
function nsearch() {
	//alert('inside search function')
	if (!document.seekdark.rq['0'].checked || document.seekdark.rq['1'].checked) {
	//	alert('keyword')
		document.seekdark.action = "http://abc.go.com/keyword/lookup";
	} else {
	//	alert('search')
		document.seekdark.action = "http://search.abc.go.com/abctv/query.html";
	}
}

function nsearch2() {
	var sURL,sName;
	var eTerm = escape(document.seekdark.qt.value);
	if(eTerm != "" && eTerm != "%20%20type%20keyword%20here") {

		if (!document.seekdark.rq['0'].checked || document.seekdark.rq['1'].checked) {
			sURL  = "http://abc.go.com/keyword/lookup";
			sName = "KEYWORD";
		} else {
			alert('search2')
			sURL  = "http://search.abc.go.com/abctv/query.html";
			sName = "SEARCH";
		}

		sURLComplete = "http://transfer.go.com/re?srvc=abc&name=GNAV_" + sName + "&goto=" + sURL + "%3Fqt=" + eTerm;
		document.location.href = "http://transfer.go.com/re?srvc=abc&name=GNAV_" + sName + "&goto=" + sURL + "%3Fqt=" + eTerm;

	} else {
		return false;
	}

}

function ABCVideoPlayer(path,bw,host) {
if(host){host= "host="+ host + "&"} else {host = ""}
	window.open("/video/_player.html?" + host + "path=" + path + "&bw=" + bw, "ABCVideoPlayer", "height=395,width=728,resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no");
}

function openDaytimeVideoWindow(clip,bw,type) {

	window.open("/video/daytime_player.html?clip=" + clip + "&bw=" + bw, "Video", "height=395,width=728,resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no");
}

function popWindow(url, w, h, windowName) {
	win = window.open(url, windowName, "height=" + h + ",width=" + w + ",resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no");
}

function popWindowScroll(url, w, h, windowName) {
	win = window.open(url, windowName, "height=" + h + ",width=" + w + ",resizable=no,status=no,scrollbars=yes,location=no,menubar=no,toolbar=no");
}

function popWindowStatus(url, w, h, windowName) {
	win = window.open(url, windowName, "height=" + h + ",width=" + w + ",resizable=no,status=yes,scrollbars=no,location=no,menubar=no,toolbar=no");
}

function popScroll(url, w, h, windowName) {
	win = window.open(url, windowName, "height=" + h + ",width=" + w + ",resizable=no,status=no,scrollbars=yes,location=no,menubar=no,toolbar=no");
}

var radioclass,	textsize, textclass;

function checkBrowser() {
	var BROWSER_NAME = navigator.appName;
	if (BROWSER_NAME == "Netscape") {
		radioclass = ' class="nsnavradio"';
		textsize = '10';
		textclass = ' class="nsnavsearch"';
	} else {
		radioclass = '';
		textsize = '21';
		textclass = ' style="font-family: Microsoft Sans Serif, MS Sans Serif, sans-serif, Geneva; font-size: 9px;"';
	}
}

function navRadio1(){
	document.write('<input type="radio" name="rq" value="0"' + radioclass + '>');
}

function navRadio2(){
	document.write('<input type="radio" name="rq" value="1"' + radioclass + '>');
}

function navSearch(){
	document.write('<input type="text" name="qt" size=' + textsize  + textclass + '>');
}

checkBrowser();

function submitPoll(w,h){
	if (w == null && h == null) {
	w = 468;
	h = 380;
	}

	popWindow('/poll/blank.html', w, h, 'voteWindow')

}



function loadShow() {
	var index = document.shows_form.shows_list.selectedIndex;
	newpage = document.shows_form.shows_list.options[index].value;
	window.location = newpage;
}

function resetMenu() {

    document.shows_form.reset();

    }

//ns4 resize handler
NS4 = document.layers;
if (NS4) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	}
function reDo() {
    if (innerWidth != origWidth || innerHeight != origHeight)
       location.reload(); }
if (NS4) onresize = reDo;



// USED FOR ETV POP-UP OFF OF THE HOMEPAGE
function isNS(){ return  navigator.appName.indexOf("Netscape") != -1; }
function isAOL(){ return  navigator.userAgent.indexOf("AOL") != -1; }
function launchETV() {
    if (isAOL() || isNS()) {
		return;
    } else {
	var MyWindow;
	MyWindow=window.open("http://etv.go.com/abccomlaunch","etvAll","width=734,height=417,status=no,menubar=no");
	}
    return;
}





/*
WM_setCookie(), WM_readCookie(), WM_killCookie()
A set of functions that eases the pain of using cookies.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com
*/


// This next little bit of code tests whether the user accepts cookies.
var WM_acceptsCookies = false;
if(document.cookie == '') {
    document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
    if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
	WM_acceptsCookies = true;
    }// If it succeeds, set variable
} else { // there was already a cookie
  WM_acceptsCookies = true;
}


function WM_setCookie (name, value, hours, path, domain, secure) {
    if (WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
	var not_NN2 = (navigator && navigator.appName
		       && (navigator.appName == 'Netscape')
		       && navigator.appVersion
		       && (parseInt(navigator.appVersion) == 2))?false:true;

	if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
	    if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
		var numHours = hours;
	    } else if (typeof(hours) == 'number') { // calculate Date from number of hours
		var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
	    }
	}
	document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':''); // Set the cookie, adding any parameters that were specified.
    }
} // WM_setCookie


function WM_readCookie(name) {
    if(document.cookie == '') { // there's no cookie, so go no further
	return false;
    } else { // there is a cookie
	var firstChar, lastChar;
	var theBigCookie = document.cookie;
	firstChar = theBigCookie.indexOf(name);	// find the start of 'name'
	var NN2Hack = firstChar + name.length;
	if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
	    firstChar += name.length + 1; // skip 'name' and '='
	    lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
	    if(lastChar == -1) lastChar = theBigCookie.length;
	    return unescape(theBigCookie.substring(firstChar, lastChar));
	} else { // If there was no cookie of that name, return false.
	    return false;
	}
    }
} // WM_readCookie

function WM_killCookie(name, path, domain) {
  var theValue = WM_readCookie(name); // We need the value to kill the cookie
  if(theValue) {
      document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie
  }
} // WM_killCookie


function motionPopUp(){

	pathName = location.pathname;
	pathArray = new Array('/alias/','/bachelor/','/extrememakeover/','/daytime/','/cgi/abc/');
	c = WM_readCookie('motion_popup');

	if(c == false){


	 	for(var i=0; i < pathArray.length; i++){

	 		if(pathName.indexOf(pathArray[i]) != -1 && pathName.indexOf('/theview/') == -1 ) {


				setTimeout('window.open("http://abc.abcnews.go.com/motion/promo_popup.html", "motion_popup", "height=279,width=372,resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no")',5000);

				WM_setCookie('motion_popup','true',12,'/','go.com');
				break;
	 		}
	 	}
	 }
}


function motionSurveyWithCookie(){

	c = WM_readCookie('motion_survey');

	if(c == false){

		window.open("http://abc.abcnews.go.com/motion/survey.html", "motion_survey", "height=570,width=483,resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no");
		WM_setCookie('motion_survey','true',3600,'/','go.com');

	}

}

/* Added 20040322 */
function dtSurveyWithCookie(){

	c = WM_readCookie('daytime_survey');

	if(c == false){

		window.open("http://abc.go.com/daytime/survey/20040317/popup.html", "daytime_survey", "height=596,width=661,resizable=no,status=no,scrollbars=yes,location=no,menubar=no,toolbar=no");
		WM_setCookie('daytime_survey','true',3600,'/','go.com');

	}

}





/* REQUIRED FOR IN-CONTENT ADS */
function spotlight() { 
	if (document.getElementById) {
		if(document.getElementById("ad_spacer")) {
			document.getElementById("ad_spacer").style.display = "block";
		}
	}
	else if (document.all) {
		if(document.all["ad_spacer"]) {
			document.all["ad_spacer"].style.display = "block";
		}		
	}
}


/* DISCLAIMER THAT STORE IS HOSTED ON DIFFERENT SITE */
function shopPop(url,width,height,scrollbars,name)
{
	if (name != null) { url = url + '\",\"'+name+'\"'; } else { url = url + '\",\"_blank\"'; }
	if (width != null) { url = url + ',\"width='+width+',height='+height; if (scrollbars != null) { url = url + ',scrollbars\"' } else { url = url + '\"'; } }
	var popDisclaimer=window.open("","disclaimer","width=390,height=140,top=1,left=1,screenX=1,screenY=1");
	if ((navigator.appName == "Netscape") && (navigator.appVersion.substring(0,1) == "4"))
	{
		var writeStyle = "font-family:arial,helvetica; font-size:12px; font-weight:bold; color: black;";
	}
	else { var writeStyle = "font-family:arial,helvetica; font-size:11px; font-weight:bold; color: black;"; }

	popDisclaimer.document.write ('<html>');
	popDisclaimer.document.write ('<head>');
	popDisclaimer.document.write ('<title>ABC.com - Shop Disclaimer</title>');
	popDisclaimer.document.write ('<SCR'+'IPT TYPE="text/javascript" LANGUAGE="JavaScript">');
	popDisclaimer.document.write ('sendTimer = setTimeout("sendToClientSide()",1500);closeTimer = setTimeout("window.close()",15000);');
	popDisclaimer.document.write ('function sendToClientSide(){window.open("'+url+');}');
	popDisclaimer.document.write ('</scr'+'ipt>');
	popDisclaimer.document.write ('</head>');
	popDisclaimer.document.write ('<body link="309898" vlink="309898" alink="000099" topmargin=0 leftmargin=0 marginwidth="0" marginheight="0">');
	popDisclaimer.document.write ('<table width="390" height="100%" border="0" cellspacing="0" cellpadding="0" background="http://abc.go.com/images/ai/shop_disclaimer_bkgd.gif"><tr><td cospan="3" height="50"><img src="http://abc.go.com/images/spacer.gif" border="0" width="50"></td></tr><tr><td width="60"><img src="http://abc.go.com/images/spacer.gif" border="0" width="60"></td><td><p align="justify"><font style="'+writeStyle+'">The Web site you are about to link to is not controlled by ABC.com and different terms of use and privacy policy will apply. By proceeding you agree and understand that ABC.com is not responsible for the site you are about to access.<br><img src="http://abc.go.com/images/spacer.gif" border="0" width="1" height="5"><br><center><font style="font-size:9px; font-weight:bold;"><a href="javascript:window.close();">close this window</a></font></center></td><td width="5"><img src="http://abc.go.com/images/spacer.gif" border="0" width="5"></td></tr></table>');
	popDisclaimer.document.write ('</body>');
	popDisclaimer.document.write ('</html>');
	popDisclaimer.document.close();
}



/* PARSES ANY VARS WHICH MAY BE IN QUERY STRING */
/* Added: 20040326 */
if (location.search.length != 0) {

	var get_vars = new Object();
	get_vars.varName = new Array();
	get_vars.varValue = new Array();
	var q_str = location.search.substring(1);
	var temp_var = q_str.split("&");

	for (x=0;x<temp_var.length;x++) {
		parts = temp_var[x].split("=");
		get_vars.varName[x] = parts[0];
		get_vars.varValue[x] = '"' + parts[1] + '"';
		eval(get_vars.varName[x] + "=" + get_vars.varValue[x]);
	}
}













// GLOBAL NAV









var menuHeight=0
var growHeight=0
var growMax=300
var displayMenu=true;

function growMenu(){
	growHeight+=50
	if(growHeight<=growMax) {
		document.getElementById('growDiv').style.visibility="visible"
		document.getElementById('growDiv').style.height=growHeight
		setTimeout("growMenu()",50)
	} else {
		document.getElementById('growDiv').style.visibility="hidden"
		document.getElementById('growDiv').style.height="0"
		document.getElementById('menu').style.visibility="visible"
		displayMenu=false;
	}
}
function shrinkMenu(){
	growHeight-=50
	if(growHeight>0) {
		document.getElementById('growDiv').style.visibility="visible"
		document.getElementById('growDiv').style.height=growHeight
		setTimeout("shrinkMenu()",50)
	} else {
		document.getElementById('growDiv').style.visibility="hidden"
		document.getElementById('growDiv').style.height="0"
		displayMenu=true;
	}
}
function display(){
	if (displayMenu) {
		if(arguments.length==0)	growMenu()
	} else {
		if(arguments.length==0)	growHeight=growMax;
		else growHeight=0;
		document.getElementById('menu').style.visibility="hidden"
		document.getElementById('growDiv').style.height=growHeight
		shrinkMenu()
	}
}function onHighlightMenu(obj){
	if(obj!='ignore') document.getElementById(obj).style.backgroundColor="#E4AD47"
}
function offHighlightMenu(obj){
	document.getElementById(obj).style.backgroundColor="#DAF299"
}

function initMaps() {
	//alert('inside initMaps()')
   if (document.getElementById) {
      var mapIds = initMaps.arguments;    // pass string IDs of containing map elements
      var i, j, area, areas;
      for (i = 0; i < mapIds.length; i++) {
        areas = document.getElementById(mapIds[i]).getElementsByTagName("area");

        for (j = 0; j < areas.length; j++) {  // loop thru area elements
           area = areas[j];
           area.onmousedown = imgSwap;    // set event handlers
           area.onmouseout = imgSwap;
           area.onmouseover = imgSwap;
           area.onmouseup = imgSwap;
        }
      }
   }
}

// image swapping event handling
function imgSwap(evt) {
   evt = (evt) ? evt : event;                   // equalize event models
   var elem = (evt.target) ? evt.target : evt.srcElement;
   var imgClass = elem.parentNode.name;         // get map element name
   var coords = elem.coords.split(",");         // convert coords to clip
   var clipVal = "rect(" + coords[1] + "px " +
                           coords[2] + "px " +
                           coords[3] + "px " +
                           coords[0] + "px)";
   var imgStyle;

   switch (evt.type) {
      case "mousedown" :
         //imgStyle = document.getElementById(imgClass + "Down").style;
         //imgStyle.clip = clipVal;
         //imgStyle.visibility = "visible";
         break;
      case "mouseout" :
         document.getElementById(imgClass + "Over").style.visibility = "hidden";
         //document.getElementById(imgClass + "Down").style.visibility = "hidden";
         break;
      case "mouseover" :
         imgStyle = document.getElementById(imgClass + "Over").style;
         imgStyle.clip = clipVal;
         imgStyle.visibility = "visible";
         break
      case "mouseup" :
         //document.getElementById(imgClass + "Down").style.visibility = "hidden";
         // guarantee click in IE
         if (elem.click) {
             elem.click();
         }
         break;
   }
   evt.cancelBubble = true;
   return false;
}




document.write('<style>BODY {background-color:#FFFFFF}</st' + 'yle>')
