/* Drop down Selector Script */
function quickLinks(){
var slct = document.quickLinksForm.qLinks.options[document.quickLinksForm.qLinks.selectedIndex].value;

if (slct == ""){
	}
else {
	location.href=slct;
	}
}

/*===============================================
bswPopUp
pass in target URL, window name, width, height,
and scrolling.
================================================*/

function bswPopUp(url, name, width, height, scroll) {
	var properties = "scrollbars=" + scroll + ",width=" + width + ",height=" + height; 
	bswPopUpWin = window.open(url, name, properties);
	bswPopUpWin.focus();
}

function bswExternalWindow(url, name) {
	bswExt = window.open(url, name);
	bswExt.focus();
}



function popUpWin(url, name, width, height) {
  var properties = "toolbar=no,scrollbars=yes,resizable=no,menubar=no,status=no,directories=no,location=no,width=" + width + ",height=" + height; 
	popUp = window.open(url, name, properties);
  if (popUp.focus) popUp.focus();
}






function checkEMAIL(s){
	var re;
	if (null==s) {return null;}
	s = s.replace(/^\s*/g, "");
	s = s.replace(/\s+$/g, "");
	if ("undefined" == s || s.length < 6) {return null;}
	if (s.indexOf("..") > 0) {return null;}
	if (s.indexOf("@.") > 0) {return null;}
	if (s.indexOf(".@") > 0) {return null;}
	if (s.indexOf("@@") > 0) {return null;}
	re = /\s+/g
	if (re.test(s)) {return null;}
	re = /^(\w|[^_]\.|[\-])+((\@){1}([^_]))(([a-z]|[\d]|[\-]|\.)+)[a-z]{2,4}$/i
	if (!re.test(s)) {return null;}
	else {return s;}
}

function gethooked(s){
	if(s.value == "your email"){
		s.value = "";
	}
	return true; 
}

function tellafriend(){
	
	/*
	var friend = document.forms.tellafried.email.value;
	
	if(friend.length == 0){
		alert("Please enter your email.");
		return false;		
	} else {
		var destEmail = checkEMAIL(friend);
		if(destEmail == null){
			alert("Please enter valid email.");			
		} else {
			tellurl = "/tellafriend.aspx?email=" + friend + "&url=" + location.href;
			bswPopUp(tellurl,'tellafriend',636,468,'no');
		}
	
	}*/
	var friend = document.forms.tellafried.email.value;
	
	if(friend == "your friend's email"){
		friend = "";
	}
	
	tellurl = "/tellafriend.aspx?email=" + friend + "&url=" + location.href;
	bswPopUp(tellurl,'tellafriend',636,468,'no');
	

}


function validateEmail(s){
	
	var email = s.value;
	//alert(email);

	if(email.length == 0){
		alert("Please enter valid email.");	
		return false;
	}	else {
		email = checkEMAIL(email);
		if(email == null){
			alert("Please enter valid email.");	
			return false;	
		} else {
			
			return email;
		}
	}
	



}

/*===============================================
Launch radio functions
================================================*/


windowName = self.name;
 
function launchRadio(clientStationID)
{
	
	if(clientStationID != null){
		// pass request through redirect.aspx to record traffic to the player.
		var loc = "/redirect.aspx?URL=http://launchcast.launch.yahoo.com/radio/player/default.asp?clientID=524&clientStationID=" + clientStationID + "&linkTarget=" + windowName;
		//var radioWin = window.open(loc, 'playerWindow', 'HEIGHT=320,WIDTH=468');
		// replaced launch pop funtions with standard bswPopUp 
		bswPopUp(loc, 'playerWindow', 468, 320, 'no');
	}
}

/*===============================================
Launch video functions
================================================*/


function pv_isBlank(thisVal) {
	return (thisVal == null || thisVal == 'undefined' || thisVal == '');
}
/*
function playLAUNCHVideo( videoID ) {

	var windowName = ( pv_isBlank(self.name) ) ? 'LaunchVideoTarget': self.name;
	self.name = windowName;

	var videoWin = window.open("http://today.launch.yahoo.com/player/player.asp?cid=523&vid=" + videoID + "&sx=sg2.xml", 'videoPlayerWindow', 'WIDTH=690,HEIGHT=425');
}
*/

// this is the newest js. again, complete w/ typo that should be fixed. 10/15/2003
function playLAUNCHVideo( videoID ) {
		
		var winName = String( self.name );
		var windowName = ( typeof winName == "undefined" || winName == "" || winName == null || winName == "undefined") ? 'LaunchVideoTarget' : winName;
		self.name = windowName;
		var params = "?cid=523&vid=" + videoID + "&sx=ondemand.xml&referer=" + escape( new String( window.location ) );
		//var videoWin = window.open("http://today.launch.yahoo.com/player/player.asp" + params, 'videoPlayerWindow', 'width=685,height=390');
		// replaced window opener with default bsw window opener
		bswPopUp("http://today.launch.yahoo.com/player/player.asp" + params, 'videoWindow', 685, 390, 'no');
		
	}



