function openWin(url, name, w, h, perc, scroll, resize) {
	var winX = (screen.availWidth - w)*perc*.01;
	var winY = (screen.availHeight - h)*perc*.01;
	popupWin = window.open(url, name,'width=' + w + ',height=' + h + ',left=' + winX + ',top=' + winY + ',scrollbars=' + scroll + ',resizable=' + resize);
}

function openWinCentered(mypage, myname, w, h, scroll, resize) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize;
	win = window.open(mypage, myname, winprops)
}

function isValidEmail(p_strEmail) {
	var regexp = /^\S+\@[a-zA-Z0-9\.-]+\.[a-zA-Z0-9]{2,4}$/;
	return regexp.test(p_strEmail);
}

function isValidURL(p_URL) {
	var regexp = /^http\:\/\//;
	return regexp.test(p_URL);
}

function isCheckedRadio(obj) {
	var radio_choice = false;
	for (counter = 0; counter < obj.length; counter++) {
		if (obj[counter].checked) radio_choice = true; 
		
	}
	return radio_choice;
}

function openRadio() {
	openWinCentered('/radio.php', 'nitro_radio', 245, 234, 0, 0);
}

function getAlbum(tr) {
	frames['album_iframe'].location.href = '/radio_album.php?track='+tr;
	//alert(document.getElementById('album_iframe').location);
	//document.getElementById('album_iframe').location='/radio_album.php?track='+tr;
	//alert(document.getElementById('album_iframe').location);
}

function openVideo(v) {
	document.location = 'video.php?video_id='+v;
}
