function VideoWindow(url)
{
	window.open(url,'Video_Player','scrolling=no,scrollbars=no,resizable=no,toolbar=no,width=728,height=494');
}

function dtvcount()
{
	window.open('/template/shared_content/dtv/dtv.shtml','DTV','scrolling=yes,scrollbars=yes,resizable=yes,toolbar=no,width=700,height=500');
}

function rulespopup1()
{
	window.open('/promotions/fiesta/coloring-rules.html','coloringrules','scrolling=yes,scrollbars=yes,resizable=yes,toolbar=no,width=650,height=700');
}


/* NEWS BOX */
function getnewsdata(dataname) {

		scroll(0,0);
		var divnewsDisplay = document.getElementById("newsdatadisplay");
		divnewsDisplay.innerHTML = '<br><br><img src="/images/loading_wheel1.gif"> Loading....<br><br><br>';
		top.hiddenFrame.location = dataname + '.html';
		
		var subSection = dataname.substring(24,0);

		if (subSection ==  '/news/data/newsheadlines')
		{
			divnewsDisplay.style.height = '400px';
		}

		else
		{
			divnewsDisplay.style.height = '540px';
		}
}

function displaynewsInfoReturn(infoText,photo,phototitle) {
    var divnewsDisplay = document.getElementById("newsdatadisplay");
    var divphotoDisplay = document.getElementById("photodisplay");
    var divphototitleDisplay = document.getElementById("phototitledisplay");


    divnewsDisplay.innerHTML = infoText;
    divnewsDisplay.style.display = "block";

	if (photo)
		{
		    divphotoDisplay.innerHTML = photo;
		    divphotoDisplay.style.display = "block";
		}
	else
		{
		    divphotoDisplay.style.display = "none";
		}


	if (phototitle)
		{
		    divphototitleDisplay.innerHTML = phototitle;
		    divphototitleDisplay.style.display = "block";
		}
	else
		{
		    divphototitleDisplay.style.display = "none";
		}
}



/* Weather BOX */
function getwxdata(dataname) {

//		scroll(0,0);
		var divwxDisplay = document.getElementById("wxvidPane");
		divwxDisplay.innerHTML = '<br><br><center><img src="/images/loading_wheel1.gif"> Loading....</center><br><br><br>';
		top.hiddenFrame.location = dataname + '.shtml';
}

function displaywxInfoReturn(infoText) {
    var divwxDisplay = document.getElementById("wxvidPane");
    if (divwxDisplay.innerHTML == infoText) {
	    divwxDisplay.style.display = "none";
	}
    divwxDisplay.innerHTML = infoText;
    divwxDisplay.style.display = "block";
}


/* HEADLINES DISPLAY */
var oldtag = '';

function visoggle(index,pic,pictitle) {
 var tag = document.getElementById(index);
 var picture = document.getElementById('photodisplay');
 var picturetitle = document.getElementById('phototitledisplay');
 
   if (tag.className=='hideMe')
	{
		tag.className='showMe';
		if (pic)
			{
				picture.innerHTML = '<a href="javascript:void(0)" onClick="visoggle(\'' +index + '\')"><img src="/news/photos/' + pic + '" border=0></a>';
				picturetitle.innerHTML = pictitle;
			}
		else
			{
				picture.innerHTML = '<img src="/news/photos/FoxNewsPhoto.jpg">';
				picturetitle.innerHTML = '';
			}
	}
   else {
		tag.className='hideMe';
		tag = '';
				picture.innerHTML = '<img src="/news/photos/FoxNewsPhoto.jpg">';
				picturetitle.innerHTML = '';
	}

		oldtag.className='hideMe';
		oldtag = tag;

/*
 classoggle(d, 'hideMe', 'showMe');
   if (me!=undefined) {
      if (me.src == closePicture){
         me.src = openPicture; }
      else {
         me.src = closePicture;
      }
    }
*/
}

  function playheadlineFlashVideo(vidId) {
	vidPaneID = document.getElementById('photodisplay');
	phototitleID = document.getElementById('phototitledisplay');
        phototitleID.innerHTML='';

 //        vidPaneID.style.display='block';
        vidPaneID.innerHTML='';
	var vidstring ='<object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" data="/template/flashplayers/xmlstreamplayer.swf?xmlfile=/vod/flashheadlines/'+vidId+'.xml&autostart=true" width="190" height="160">';
	vidstring +='<param name="movie" value="/template/flashplayers/xmlstreamplayer.swf?xmlfile=/vod/flashheadlines/'+vidId+'.xml&autostart=true" />';
	vidstring +='<embed src="/template/flashplayers/xmlstreamplayer.swf?xmlfile=/vod/flashheadlines/'+vidId+'.xml&autostart=true" width="320" height="260" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	vidstring +='</object>';
	vidPaneID.innerHTML+=vidstring;
}


function switchAd(zone) {
  var adwin = document.getElementById('vidad');
  while (adwin.hasChildNodes()) {
    adwin.removeChild(adwin.firstChild);
  }
	top.frames["hiddenadFrame"].location = "/vod/ad/vod_adzone" + zone + ".html";
}
function addisplaynewsInfoReturn(infoText)
{
    var addivDisplay = document.getElementById("vidad");
    if (addivDisplay.innerHTML == infoText) {
	    addivDisplay.style.display = "none";
	}
    addivDisplay.innerHTML = infoText;
    addivDisplay.style.display = "block";
}

olddtag='';
function toggle(index) {
 var taga = document.getElementById(index);
 
   if (taga.className=='hideMe')
	{
		taga.className='showMe';
	}
   else {
		taga.className='hideMe';
		taga = '';
	}

		olddtag.className='hideMe';
		olddtag = taga;
}

function SA411()
{
	window.open('http://sa411.myfoxsa.com','SA411','scrolling=yes,scrollbars=yes,resizable=yes,toolbar=no,width=650,height=700');
}
function WebLinks(url)
{
	window.open(url,'KABBWebLinks');
}

function wximage(imagefile)
{
	window.open('/weather/graphics/'+imagefile,'WXRadar','scrolling=no,scrollbars=no,resizable=yes,toolbar=no,width=660,height=498');
}


	var win=null;
	function NewWindow(mypage,myname,w,h,pos,infocus){
		if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
		if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
		else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
		settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
		win.focus();
		}
