// PRE-LOAD IMAGES ------------------------------------------------------------
if (document.images) {

  btn = new Array();
  btnOver = new Array();
  
  for(i=0; i<12; i++) {
    
    btn[i] = new Image();
    btn[i].src = "/nav/img/nav"+i+".gif";
    
    btnOver[i] = new Image();
    btnOver[i].src = "/nav/img/nav"+i+"over.gif";
    
  }
}
 
function imgFlip(imageName,imageSrc) {
  if (document.images)
    document.images[imageName].src = eval(imageSrc + ".src");
}

// FORM HANDLER CODE ----------------------------------------------------------
var win = null;

function formHandle(formname, listname) {
  var l = document.forms[formname][listname];
  var i = l.selectedIndex;
  var url = l.options[i].value;
  var firstChar = url.charAt(0);
  var secondChar = url.charAt(1);
  
  var windowprops = new Array;
  windowprops[0] = "width=400,height=300,scrollbars=yes,resizable=yes";
  windowprops[1] = "width=320,height=180,screenX=30,screenY=30";
 // add new window properties here and call them by using '$' followed by the next array number and place in front of url 
 // windowprops[1] = " ";
 // windowprops[2] = " ";
  
  // do nothing if no url is selected
  if (url=='none') l.selectedIndex = 0;
  
  // open the link in a new browser window
  else if (firstChar=='+') open(url.substring(1), '_blank');
  
  // open as popup with attributes defined in the array windowprops[]
  else if (firstChar=='$') window.open(url.substring(2),"MenuPopup",windowprops[secondChar]);
  
  // just go to the URL
  else location.href = url;
}

// POP UP WINDOW CODE ---------------------------------------------------------
var win = null;
function popper(theURL,winName,features) {
  if (win!=null && !win.closed) win.close();
  win = window.open(theURL,winName,features);
  win.focus();
}

// RELOADER CODE --------------------------------------------------------------
function load(){
  if (parseFloat(navigator.appVersion) == 4.08) return;
  location.reload();
}

// OPEN UP PREFERENCES WINDOW -------------------------------------------------
function prefs() {

  var url = "/reg/util/direct.jhtml?dir=popup&linkTextID=toPrefs&messageID=loginRequired&welcome=false&postLoginURL=/reg/prefs/pop.userinfo.jhtml%3Finit%3D1";

  popper(url, "prefs", "width=600,height=460,scrollbars=0");
}

// coBrand v.2.1 - COUNTRYDOTCOM
//This launches the Sonicnet powered Country.com radio stations
function launchRSN(varStationID)
 {
  var face = 'COUNTRYDOTCOM';
  var tuner;
  tuner = window.open('http://radio.sonicnet.com/player/launchplayer.asp?A='+varStationID+'&face='+face,'TUNER','width=492,height=381,toolbar=no,resizable=no,scrollbars=no');
 }

