
/////////////////////////////////////////

function nullFunc() {
}

function mydocwriter(aStr) {
	document.write(aStr);
}


var impl = new Array();
impl[0] = new Image(); impl[0].src = "/images/blue/main/arrow_red_down_bg.gif";


function ReplImgSrcById(myId, myDir, mySrc) {
	if ((myId)&&(mySrc)&&(document.getElementById(myId))) {
		document.getElementById(myId).src=myDir+'/'+mySrc;
	}
}


function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}






var CurrTSImg = 1;
var LastTSImg = 4;

function displayTopStory(aNum,aSrc) {
	if ((aNum>LastTSImg)||(aNum<1)) { return; }
	for (var c=1; c<=LastTSImg; c++) {
		if (document.getElementById('topstory'+c)) {
			if (c==aNum) {
				document.getElementById('topstory'+c).className='';
				document.getElementById('tsbtn'+c).src='/images/blue/main/fp_topstories_'+c+'_on.gif';
			}
			else {
				document.getElementById('topstory'+c).className='printonly';
document.getElementById('tsbtn'+c).src='/images/blue/main/fp_topstories_'+c+'_off.gif';
			}
		}	
	}

	document.getElementById('topstoryimg').src = '/images/news_articles/492x260/'+aSrc;

	CurrTSImg=aNum;
	//if (rotateTSInt) {
		//clearInterval(rotateTSInt);
		//rotateTSInt = setInterval("rotateTopStory()",10000);
	//}
}

function rotateTopStory() {
	if (!document.getElementById('topstory2')) {
		clearInterval(rotateTSInt); return;
	}
	CurrTSImg++;
	if (CurrTSImg>LastTSImg) { CurrTSImg=1; }
	displayTopStory(CurrTSImg);
}

//var rotateTSInt = setInterval("rotateTopStory()",6000);


var fpTopicArr = new Array(4);
fpTopicArr[0] = "local";
fpTopicArr[1] = "national";
fpTopicArr[2] = "world";
fpTopicArr[3] = "mostpop";


for (var i=1; i<fpTopicArr.length; i++) {
	var ImgId = "fpct" + fpTopicArr[i];
	var anImgTPre = new Image();
	anImgTPre.src = '/images/blue/main/fp_topics_'+fpTopicArr[i]+'_on.jpg';
}

function replaceFPTopic(tStr) {

	for (var i=0; i<fpTopicArr.length; i++) {

		var ImgId = "fpct" + fpTopicArr[i];
		var TxtId = "fpts" + fpTopicArr[i];

		if (fpTopicArr[i]==tStr) {
			if (document.getElementById(TxtId)) {
				document.getElementById(TxtId).className = '';
			}
				 
		}
		else {
			if (document.getElementById(TxtId)) {
				document.getElementById(TxtId).className = 'printonly';
			}
		}
	}

}



var DDint;
var DDmin=0.5;
var DDmax=5;

function setminDD() {
	if (DDint) { clearInterval(DDint); }
	DDint=setInterval('closeallDD()',DDmin*1000);
}
function setmaxDD() {
	if (DDint) { clearInterval(DDint); }
	DDint=setInterval('closeallDD()',DDmax*1000);
}
function openDD(anObj,anId) {
	closeallDD(anId);
	if (DDint) { clearInterval(DDint); }
	if (!document.getElementById(anId)) { return; }
	anObj.className='ddarrowdn';
	if (document.getElementById(anId).className=='hide') {
		document.getElementById(anId).className='ddlink';
		setmaxDD();
	}
}
function closeallDD(exceptId) {
	if (DDint) { clearInterval(DDint); }
	var x = document.getElementsByTagName('ul');
	for (var i=0; i<x.length; i++) {
		if (x[i].id.substring(0,2)=='dd') {
			if ((!exceptId)||(exceptId!=x[i].id)) {
				document.getElementById(x[i].id).className='hide';
			}
		}
	}
	var x2 = document.getElementsByTagName('li');
	for (var i=0; i<x2.length; i++) {
		if ((x2[i].className=='ddarrowdn')&&(x2[i].id)) {
			document.getElementById(x2[i].id).className='';
		}
	}
}


function load_breakingnews_banner_swf() {
	document.write('<'+'object width="492" height="25"   classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/  shockwave/cabs/flash/swflash.cab#version=8,0,0,0"><'+'param name="movie" value="/images/blue/main/breakingnews_banner.swf"" /><'+'param name="menu" value="false" /><'+'param name="bgcolor" value="#eeeeee" /><'+'param name="flashvars"   value="" /><'+'embed src="/images/blue/main/breakingnews_banner.swf" width="492" height="25"   menu="false" bgcolor="#eeeeee"   flashvars=""  type="application/x-shockwave-flash" pluginspage=  "http://www.macromedia.com/go/getflashplayer" /><'+'/object>');
}


function load_logo_swf(myPg) {
	if (myPg=='wx') { document.write('<'+'object width="272" height="90"   classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/  shockwave/cabs/flash/swflash.cab#version=8,0,0,0"><'+'param name="movie" value="/images/blue/main/logo_wsvn_wx.swf"" /><'+'param name="menu" value="false" /><'+'param name="bgcolor" value="#006" /><'+'param name="flashvars"   value="" /><'+'embed src="/images/blue/main/logo_wsvn_wx.swf" width="272" height="90"   menu="false" bgcolor="#006"   flashvars=""  type="application/x-shockwave-flash" pluginspage=  "http://www.macromedia.com/go/getflashplayer" /><'+'/object>'); }
	else { document.write('<'+'object width="272" height="90"   classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/  shockwave/cabs/flash/swflash.cab#version=8,0,0,0"><'+'param name="movie" value="/images/blue/main/logo_wsvn.swf"" /><'+'param name="menu" value="false" /><'+'param name="bgcolor" value="#006" /><'+'param name="flashvars"   value="" /><'+'embed src="/images/blue/main/logo_wsvn.swf" width="272" height="90"   menu="false" bgcolor="#006"   flashvars=""  type="application/x-shockwave-flash" pluginspage=  "http://www.macromedia.com/go/getflashplayer" /><'+'/object>'); }
}


function openInfo(aUrl, WinName, wid, hei) {
	if (wid == null) { wid=620; }	 
	if (hei == null) { hei=473; }
	var popupWin = window.open(aUrl, WinName,
			'width='+wid+',height='+hei+',screenx=5,screeny=5,left=5,top=5');
	popupWin.focus();
}

function EmailToStation(name, email) {
	var aUrl='/contact/emailtostation.html?r_name='+name+'&r_email='+email;
	var popupWin = window.open(aUrl, 'ContactWin',
		'width=420,height=515,screenx=5,screeny=5,left=5,top=5');
	popupWin.focus();
}

function EmailToFriend(myVars) {
	var aUrl = 'http://www1.whdh.com/contact/emailtofriend.php?'+myVars;
	var popupWin = window.open(aUrl, 'EmailFriendWin',
		'width=420,height=515,screenx=5,screeny=5,left=5,top=5');
	popupWin.focus();
}



var QuigoStatus = "on";

function GenQuigo(atype,apid,aps,azw,azh) {

	if ((!QuigoStatus)||(QuigoStatus!="on")) { return; }

	var refurl = escape(window.location.href);
	
	var aurl = "http://ads.adsonar.com/adserving/getAds.jsp?pid="+apid
				+"&amp;ps="+aps
				+"&amp;zw="+azw
				+"&amp;zh="+azh
				+"&amp;url="+refurl
				+"&amp;v=5";

	var ifr = '<'+'iframe src="'+aurl+'" name="quigframe" id="quigframe" scrolling="no" '
				+ 'marginwidth="0" marginheight="0" vspace="0" hspace="0" '
				+ 'width="'+azw+'" height="'+azh+'" frameborder="0"'+'><'+'/iframe>';

	if (atype=="default") {
		document.write('<'+'div class="cblock quigo">');
		document.write('<'+'h2 class="cheader">Advertising Links<'+'/h2>');
		document.write('<'+'div class="content">');
		document.write(ifr);
		document.write('<'+'/div>');
		document.write('<'+'div class="footer">');
		document.write('<'+'a href="/sales/adlink.php">&gt; Buy a Link<'+'/a>')
		document.write('<'+'/div><'+'/div>');
	}
	else if (atype=="RightSide") {
		document.write('<'+'div class="cblock quigors">');
		document.write('<'+'h2 class="cheader">Advertising Links<'+'/h2>');
		document.write('<'+'div class="content">');
		document.write(ifr);
		document.write('<'+'/div>');
		document.write('<'+'div class="footer">');
		document.write('<'+'a href="/sales/adlink.php">&gt; Buy a Link<'+'/a>')
		document.write('<'+'/div><'+'/div>');
	}
	else if ((atype=="FrontPage")||(atype=="MainContent")) {
		document.write('<'+'div class="cblock quigofp">');
		document.write('<'+'h2 class="cheader">Advertising Links<'+'/h2>');
		document.write('<'+'div class="content">');
		document.write(ifr);
		document.write('<'+'/div>');
		document.write('<'+'div class="footer">');
		document.write('<'+'a href="/sales/adlink.php">&gt; Buy a Link<'+'/a>')
		document.write('<'+'/div><'+'/div>');
	}

}