	//SET DEFAULT VALUES
	var child = 0;
	var NS4 = 0;
	var IE4 = 0;
	var MacIE = 0;
	var Gen4 = 0;
	var WindowEnabled = 1;
	var IBS_Sitekey = 'ral';
	var IS_IA = true;
	
var IBS_Sitekey = 'ral';

if (typeof IBSSite == 'undefined')  IBSSite = new Object();
	IBSSite.siteKey = 'ral';
	IBSSite.city = 'Raliegh';
	IBSSite.state = 'North Carolina';
	IBSSite.stateAbv = 'NC';
	IBSSite.siteDomain = 'www.wral.com';
	IBSSite.domain = 'wral.com';
	IBSSite.siteName = 'www.wral.com';

	//SET GLOBAL VARIABLES FOR BROWSER
	bName = navigator.appName;
	bVer = parseInt(navigator.appVersion);
	NS4 = (document.layers)? 1 : 0;
	MacIE = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) )? 1 : 0;
	IE4 = (document.all && !MacIE)? 1 : 0;
	Gen4 = (document.all || document.layers)? 1 : 0;
	//WindowEnabled = ((navigator.userAgent.indexOf("MSIE 4.0") >= 1))? 0 : 1;

	//APPENDS LOCAL SITEKEY TO A URL
	function localizeURL(object) {object.href += '&sitekey=' + IBSsite.siteKey; return true;}


	//OPEN WINDOW JS
	// takes all attributes in direct format
	/*function popUp(URL, ATTRIBUTES)  {
		DEF_ATTRIB = 'width=200,height=200,top=100,left=100,resizable=yes,scrollbars';
		if (ATTRIBUTES == null) {
			ATTRIBUTES = DEF_ATTRIB;
		}
		child = window.open(URL, "spawn", ATTRIBUTES);
		child.opener = self;
		if	(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '2') {
			// Do Nothing
		} else {
			child.focus();
		}
	} */

	
	function emailafriend(URL, ATTRIBUTES)
	//OPEN WINDOW JS
	// takes all attributes in direct format
{
	ATTRIBUTES = 'width=450,height=225,top=100,left=100,resizable=yes,scrollbars';
	MYURL = "http://weather.channel4000.com/services/toafriend/index.cfm?page=" + window.location;
	
	if (WindowEnabled){
		child = window.open(MYURL, "spawn", ATTRIBUTES);
		child.opener = self;
		if	(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '2') {
			// Do Nothing
		} else {
			child.focus();
		}
	} else {
		document.location = MYURL;
	}
}

	
	//This function is specific for the Cream Their Team pages-- written by :pT:
	function creamThe(teamname)
	{
		var popuptop = 100, popupleft = 100, team_arguments, total_href, wideness=590;
		if(top.screen)
		{
			if(screen.width == 800) wideness=660;
			else if(screen.width >= 1024) wideness=740;
			popuptop = screen.height/2-225;
			popupleft = screen.width/2-(wideness/2);
		}
		team_arguments = "resizable=yes,width=" + wideness + ",height=440,top=" + popuptop + ",left=" + popupleft;
		total_href = "http://weather.channel4000.com/services/creamteam/ct-framer.cfm?site=channel4000&team=" + teamname;
		popUp(total_href,team_arguments);
	}
	
	//Function closes Health Daily tips window and redirects user to archive
	function health_archive(day){
			window.opener.location=("/sh/health/dailytips/"+day+"-archive.html");
			window.close();
	}

// Function to open videoblast windows //
function openVideo(sUrl, sName, sOptions) {
	window.open(sUrl,sName,sOptions+',scrollbars=no,resizable=1,top=50,left=50,width=780,height=504');
}

// Function to open Olympic PopUp //

function popUpOlympic(fileName) {
		// open new window
		newOlympicWin = window.open(fileName, 'newOlympicWin', 'status=1,toolbar=no,top=50,left=50,width=600,height=400');
		
}
// Magic Box Elements //

function highlight(trgt) {
	if (document.all) document.all[trgt].style.backgroundColor = '#ff9900';
	else if (document.getElementById()) document.getElementById(trgt).style.backgroundColor = '#ff9900';
	}
function unhighlight(trgt) {
	if (document.all) document.all[trgt].style.backgroundColor = 'transparent';
	else if (document.getElementById()) document.getElementById(trgt).style.backgroundColor = 'transparent';
	}
function showLayer(lyr) {
	if (document.all) document.all[lyr].style.visibility = 'visible';
	else if (document.getElementById()) document.getElementById(lyr).style.visibility = 'visible';
	}
function hideLayer(lyr) {
	if (document.all) document.all[lyr].style.visibility = 'hidden';
	else if (document.getElementById()) document.getElementById(lyr).style.visibility = 'hidden';
	}
	
	
// "smart" popup for xml sites
// djohnson 04 / 01
var args, urlstring;
var host = "html." + window.location.host.substring(window.location.host.indexOf(".") +1, window.location.host.length);

function getpopup() {
	args = getpopup.arguments;
	urlstring = "http://" + host + "/sh/scripts/popup_640.cfm?img=" + args[0] + "&sitekey=" + args[1];
	if(args.length == 3) urlstring += "&refresh=" + args[2];
	window.open(urlstring, "weather_640","width=655,height=615,scrollbars=0,toolbar=0,status=0");
}

function quizanswerpopup(answer)	{
	if(typeof(w) != 'undefined' && w.closed == false) w.focus();
	else w = window.open('','w','toolbar=no,status=no,location=no,menubar=no,height=200,width=200,scrollbars=yes');
	w.document.open("text/html", "replace");
	w.document.write('<HTML><HEAD><TITLE>Answer'
   	       + '</TITLE></HEAD><BODY leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px;">'
   	       + '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td background="http://www.wral.com/images/structures/titlebars/titlebar_bluesquare.gif"><font style="color:#ffffff; font-weight:bold;">WRAL.com</font></td></tr></table><div style="padding: 2px" align="center"><b>Answer:</b></br>'
   	       + answer
   	       + '<br><br>For more Tar Heel Trivia, tune in to the WRAL-TV5 Morning News<br><br><DIV ALIGN=center><a href="javascript:window.close()">Close Window</a></DIV></div></BODY></HTML>');
	w.document.close();
}

// generic trivia popup js

function triviaPopup(answer, blurb){
	if(typeof(w) != 'undefined' && w.closed == false) w.focus;
	else w = window.open('', 'w', 'toolbar=no,status=no,location=no,menubar=no,height=200,width=200,scrollbars=yes');
	
	w.document.open("text/html", "replace");
	w.document.write('<HTML><HEAD><TITLE>Answer'
          + '</TITLE></HEAD><BODY leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px;">'
          + '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td background="http://images.ibsys.com/ral-structure/images/structures/titlebars/titlebar_bluesquare.gif"><font style="color:#ffffff; font-weight:bold;">WRAL.com</font></td></tr></table><div style="padding: 2px" align="center"><b>Answer:</b></br>'
          + answer
          + '<br><br>'+ blurb + '<br><br><DIV ALIGN=center><a href="javascript:window.close()">Close Window</a></DIV></div></BODY></HTML>');	
	w.document.close();

}

// writes BUYLINES located inside the Buylines array 
function writeBuylines(){
	if (typeof Buylines != 'undefined') {
		if (Buylines.length > 0) {
			for(b=0; b != Buylines.length; b++) {
				clickThru = Buylines[b].url;
				clickThru = clickThru.replace(/Redirect=%2F/g, 'Redirect=http:%2F%2f' + IBSsite.siteDomain);
				document.write ('<div class="buyline"><a class="iconed" href="' + clickThru + '">' + Buylines[b].text + '</a></div>');
			}
		Buylines = null;
		}
	}
}
function Buyline(url,text) {
	this.text=text;
	this.url=url
}

//for radar loop
/*
var refresh= parseInt('180secondrefresh');
function countdown() {
		refresh--;
		if(document.getElementById) document.getElementById("DOMcountdown").innerText = "This image will refresh in " + refresh + " seconds.";
		if(refresh < 1) location.reload();
		else setTimeout("countdown()", 1000);
}
if(refresh) window.onload = countdown;
*/

