function openatoz() 
{
  var station = "KETA";
  var url = "http://www.pbs.org/cgi-registry/stationfinder/setallcookies.cgir?s=" + station + "&address=/inav/sitesa2z/local.html";
  floater=window.open(url,"sitesa2z",'toolbar=0,location=0,directories=0,scrollbars=1,status=0,menubar=0,resizable=1,width=420,height=300') 
  return false;
} 

function popup(newUrl,windowWidth,windowHeight) {
  var features = "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=" + windowWidth + ",height=" + windowHeight;
  SmallWin = window.open(newUrl,"popup",features);
  if (window.focus) {
    SmallWin.focus();
  }
  if (SmallWin.opener == null) SmallWin.opener = window;
  SmallWin.opener.name = "MainWindow";
}

function VideoPopUp(vid_id){	
        var url = "http://www.pbs.org/thewar/video_popup.htm";
		var a="toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=525";
        if (navigator.appName.indexOf("Microsoft")>=0) a+=",left=50,top=50";
        else a+=",screenX=50,screenY=50";
        if( floater != null )
                if( floater.closed == false )
                        floater.close();
                        var floater = null;
        floater=window.open(url,"videopreview",a);
        floater.focus();
}

function Today(){
				var months=new Array(13);
				months[1]="January";
				months[2]="February";
				months[3]="March";
				months[4]="April";
				months[5]="May";
				months[6]="June";
				months[7]="July";
				months[8]="August";
				months[9]="September";
				months[10]="October";
				months[11]="November";
				months[12]="December";
				var time=new Date();
				var lmonth=months[time.getMonth() + 1];
				var date=time.getDate();
				var year=time.getYear();
				if (year < 2000)    // Y2K Fix, Isaac Powell
				year = year + 1900; // http://onyx.idbsu.edu/~ipowell
				document.write("" + lmonth + " ");
				document.write(date + ", " + year + "");
}
				
function PBSEpisodeWindowPopUp(params){
        this.name="pbsparentwindow";
        var url = "http://www.pbs.org/modules/tvschedules/multichannel.programinfopopup.stations.html?channelsuppress=t&display_format=ep_description&";
        url = url + params;
        var a="toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=450";
        if (navigator.appName.indexOf("Microsoft")>=0) a+=",left=50,top=50";
        else a+=",screenX=50,screenY=50";
        if( floater != null )
                if( floater.closed == false )
                        floater.close();
                        var floater = null;
        floater=window.open(url,"ProgramInformation",a);
        floater.focus();
}

function PBSMultichannelStationEpisodeWindowPopUp(params){
        this.name="pbsparentwindow";
        var url = "http://www.oeta.onenet.net/modules/program.php?display_format=ep_description&";
        url = url + params;
        var a="toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=450";
        if (navigator.appName.indexOf("Microsoft")>=0) a+=",left=50,top=50";
        else a+=",screenX=50,screenY=50";
        if( floater != null )
                if( floater.closed == false )
                        floater.close();
                        var floater = null;
        floater=window.open(url,"ProgramInformation",a);
        floater.focus();
}

function PBSMultichannelEpisodeWindowPopUp(params){
        this.name="pbsparentwindow";
        var url = "http://www.oeta.onenet.net/modules/program.php?display_format=ep_description&";
        url = url + params;
        var a="toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=605,height=450";
        if (navigator.appName.indexOf("Microsoft")>=0) a+=",left=50,top=50";
        else a+=",screenX=50,screenY=50";
        if( floater != null )
                if( floater.closed == false )
                        floater.close();
                        var floater = null;
        floater=window.open(url,"ProgramInformation",a);
        floater.focus();
}

function getObj(name) // DHTML Micro API borrowed from www.quirksmode.org
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function toggleBox(divID, dSwitch) // 1 visible, 0 hidden
{
   var x = new getObj(divID); //reference DHTML MicroAPI
   /* var obj = document.layers ? document.layers[divID] : document.getElementById ?  document.getElementById(divID).style : document.all[divID].style; */
   x.style.display = document.layers ? (dSwitch ? "block" : "none") : (dSwitch ? "block" : "none");
}

function announce(){
	var alltext = document.getElementsByTagName("body")[0].innerHTML;
	var announcement = "<div id=\"new\" style=\"\">" + 
		"<span class=\"larger\">!</span><h1>OETA has a new website!!!</h1><p>OETA's website has undergone a dramatic transformation, and this version of our web site is no longer being maintained. Please visit our <a href=\"http://www.oeta.tv/\">new website.</a></p><br class='clr' /></div>";
	document.getElementsByTagName("body")[0].innerHTML=announcement + alltext;
	return true;
}
window.onload=announce;
