if (window != top) top.location.href = location.href;

function yearFix(raw) {
 return(raw<1000)?raw+1900: raw;
}

function initArray() {
 this.length=initArray.arguments.length
 for (i=0;i<this.length;i++)
 this[i+1]=initArray.arguments[i]
}

DOWArray=new initArray("Sun","Mon","Tues","Wednes","Thurs","Fri","Satur");
MOYArray=new initArray("January","February","March","April","May","June","July","August","September","October","November","December");
YESTERArray=new initArray("Satur","Sun","Mon","Tues","Wednes","Thurs","Fri");

today=new Date();
DOW=DOWArray[(today.getDay()+1)];
MOY=MOYArray[(today.getMonth()+1)];
YR=yearFix(today.getYear());
YESTER=YESTERArray[(today.getDay()+1)];

function tprpopup(tprPage,howHi,howWide,scrol,Xpos,Ypos) {
 window.open("http://tpr.org/"+tprPage+".html","","height="+howHi+",width="+howWide+",status=yes,resizable=no,scrollbars="+scrol+",toolbar=no,menubar=no,location=no,left="+Xpos+",top="+Ypos);
}

function securepopup(tprPage,howHi,howWide,scrol,Xpos,Ypos) {
 window.open("https://secure.nameservers.com/~texaspub/"+tprPage+".html","","height="+howHi+",width="+howWide+",status=yes,resizable=yes,scrollbars="+scrol+",toolbar=no,menubar=yes,location=no,left="+Xpos+",top="+Ypos);
}

function musicpopup(tprPage,howHi,howWide,scrol,Xpos,Ypos) {
 window.open("http://tpr.org/"+tprPage,"","height="+howHi+",width="+howWide+",status=yes,resizable=no,scrollbars="+scrol+",toolbar=no,menubar=no,location=no,left="+Xpos+",top="+Ypos);
}

window.station="KSTX_FM";
window.localize=true;
window.image=false;
window.title=false;

function tprlink(pulldown){
 var URL = document.pulldown.links.options[document.pulldown.links.selectedIndex].value;
 parent.location = URL; }

function sneakymail(edress) {
document.write('<a href='+'mail'+'to:'+edress+'@'+'tpr'+'.org>'+edress+'@tpr.org</a>');}

function setBgImage(element,imageFile) {
  element.style.backgroundImage="url("+imageFile+")";
  element.style.color="#000000"; }

function setBgImageOver(element,imageFile) {
  element.style.backgroundImage="url("+imageFile+")";
  element.style.color="#000000"; }

function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('^');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
   }
}
return params;
}
params = getParams();
