function openPopUp(windowPage, windowName, windowAttributes) 
   {
	window.open(windowPage, windowName, windowAttributes);
    }

function pollSubPop(url, name, widgets)
    {
      popupWin= window.open(url, name, widgets);
      popupWin.focus();
	    return true;
    }


	
//////////////////////////////////////////////RealOne lib///////////////////////////////////////////////////
var vidurl = location.search.substring(1,location.search.length);
var MacPPC = (navigator.platform=='MacPPC') ? true : false;
var netscapeDOM = (document.layers) ? true : false;

//Loads Splash screen when user does not have RealOne installed
function noReal() {
RaceCastNo = window.open('','RaceCastNo','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=700,height=420');
RaceCastNo.location.href = '/multimedia/realone/detectcodes/getReal.vid.html';
window.close('RaceCastTest');
}

//Launches RealChannel 2-pan ram after detection
function RealChannel(vid) {
//top.opener.location.href = vid;
top.opener.location.href = vid;
window.close();
}

//Loads Splash screen when we cannot determine if the user has RealOne or not
function und() {
RaceCastNo = window.open('','RaceCastNo','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=700,height=420');
RaceCastNo.location.href = '/multimedia/realone/detectcodes/undetect.html';
window.close('RaceCastTest');
}

//RealOne channel 2pan Detection Launcher.  Takes the URL of the video location
//url == vidurl passed from the script
function LaunchRealChannel(url) {

fullurl = '/multimedia/realone/detect/sniff.exclude.html?' + url;
fullurlmac = '/multimedia/realone/detect/sniff.mac.ns4.exclude.html?' + url;
//fullurlmac = '/multimedia/realone/detectcodes/detect.mac.html';

//if (MacPPC && netscapeDOM) {
if (MacPPC) {
window.open(fullurlmac,'RaceCastMac','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=700,height=420'); }
else {
window.open(fullurl,'RaceCastTest','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=790,height=400');
}
}

//Launches RaceCast popup upon RealOne Player detection
function Real() {
var url = "http://www.nascar.com/pr/racecast/wc/qual/qualcast_frameset_exclude.html";
location.href = url;
}

//Launches RaceCast detection script
//function launchRacecast() {
//if (MacPPC && netscapeDOM) {
//if (MacPPC) {
//window.open('/multimedia/realone/detectcodes/detect.mac.html','RaceCastMac','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=700,height=420'); }
//else {
//window.open('/multimedia/racecast/sniff.exclude.html','RaceCastTest','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=790,height=400');
//}
//}

//Launches RaceCast detection script
function launchRacecast(url) {
fullurl = '/races/racecast/sniff/sniff.exclude.html?' + url;
fullurlmac = '/multimedia/realone/detectcodes/detect.mac.html';
//if (MacPPC && netscapeDOM) {
if (MacPPC) {
window.open('/multimedia/realone/detectcodes/detect.mac.html','RaceCastMac','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=700,height=420'); }
else {
window.open(fullurl,'RaceCastTest','toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=1,height=1');
}
}
//////////////////////////////////////////////RealOne lib///////////////////////////////////////////////////

// this is for opening pop-up windows
function openWindow (earl,name,widgets) 
{
	host = location.hostname;
	if (host.indexOf('customnews') != -1) 
	{
		var url = 'http://customnews.cnn.com' + earl;
	}
	else
	{
		var url = earl;
	}
	popupWin = window.open (url,name,widgets);
	
	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
     var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
     var is_ie3    = (is_ie && (is_major < 4));
     var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
     var is_aol   = (agt.indexOf("aol") != -1);
     var is_aol3  = (is_aol && is_ie3);
     var is_aol4  = (is_aol && is_ie4);
     var is_aol5  = (agt.indexOf("aol 5") != -1);
     var is_aol6  = (agt.indexOf("aol 6") != -1);
     if(!is_aol6 && !is_aol3 && !is_aol4 && !is_aol5) { popupWin.opener.top.name = "opener"; }
     
	popupWin.focus();
}

// sk
// This allows you to redirect the main browser window to a new URL when launching a popup
function jumpLink( earl, name, widgets, specialsURL ) 
{
	host = location.hostname;
	if ( host.indexOf( 'customnews' ) != -1 ) 
	{
		var url = 'http://customnews.cnn.com' + earl;
	}
	else
	{
		var url = earl;
	}
	popupWin = window.open( url, name, widgets );
	if (specialsURL)
	{
		popupWin.opener.location = specialsURL;
	}
	
	
	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
     var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
     var is_ie3    = (is_ie && (is_major < 4));
     var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
     var is_aol   = (agt.indexOf("aol") != -1);
     var is_aol3  = (is_aol && is_ie3);
     var is_aol4  = (is_aol && is_ie4);
     var is_aol5  = (agt.indexOf("aol 5") != -1);
     var is_aol6  = (agt.indexOf("aol 6") != -1);
     if(!is_aol6 && !is_aol3 && !is_aol4 && !is_aol5) { popupWin.opener.top.name = "opener"; }
	popupWin.focus();
}

function closeWindow () 
{
	parent.close ();
}
function med_vod(vidlocation){

	openWindow(vidlocation,'720x460','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=720,height=460');
}
