//===============================================================================
//========== General Functions ==================================================
//===============================================================================
function on(img_name) {
  var s=document[img_name].src;
  var ss=s.substring(0,(s.length - 4))+'_a'+s.substring((s.length - 4),s.length)
  document[img_name].src=ss;
}

function off(img_name) {
  var s=document[img_name].src;
  var ss=s.substring(0,(s.length - 6))+s.substring((s.length - 4),s.length)
  document[img_name].src=ss;
}

function popUpFrame(url) {
  var win = window.open(url);
}

function popUp(url, name, features) {
  var newwin = window.open(url, name, features);
}

function helpPopUp(url) {
  var win = window.open(url,"","resizable,scrollbars,toolbar,status,WIDTH=700,HEIGHT=550");
}

function goBack(){
	window.history.go(-1);
}

function modalWindow(theURL,args,features) { 
  window.showModalDialog(theURL,args,features);
}

// for dev purposes
function modalWindowM(theURL,winName,features) { 
    window.open(theURL,"","resizable,scrollbars,menubar,WIDTH=480,HEIGHT=320");
}

function submitThisForm(f, action){
	//alert("Hit OK to submit: "+f.name)
	f.func.value=action
	f.target="_self";
	return f.submit();
}

function goTo(url) {
	location = url;
}

function printPopUp(url) { 
  var win = window.open(url,"","resizable,scrollbars,toolbar,status,WIDTH=500,HEIGHT=400");
}

//===============================================================================
//========== General Business Functions used in Event Model =====================
//===============================================================================

function setVariables() {
  if (navigator.appName == "Netscape") {
    v=".top=";
    dS="document.";
    sD="";
    y="window.pageYOffset";
  } else {
    v=".pixelTop=";
    dS="";
    sD=".style";
    y="document.body.scrollTop";
  }
}

function checkLocation() {
  object="header";
  yy=eval(y);
  eval(dS+object+sD+v+yy);
  setTimeout("checkLocation()",10);
}

//===============================================================================
// Change this to the time delay that you desire 
var what = null; 
var newbrowser = true; 
var check = false; 

function init() {  
    if (document.layers) {  
        layerRef="document.layers";  
        styleSwitch="";  
        visibleVar="show";  
        what ="ns4";  
    }  else if(document.all) {  
        layerRef="document.all";  
        styleSwitch=".style";  
        visibleVar="visible";  
        what ="ie4";  
    }  else if(document.getElementById) {  
        layerRef="document.getElementByID";  
        styleSwitch=".style";  
        visibleVar="visible";  
        what="dom1";  
    }  else {  
        what="none";  
        newbrowser = false;  
    } 
    check = true; 
} 
 
// Toggles the layer visibility on 
function showLayer(layerName) {  
    if(check) {  
        if (what =="none") {  
            return;  
        }  else if (what == "dom1") {  
            document.getElementById(layerName).style.visibility="visible";  
        }  else {  
            eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');  
        } 
    }  else {  
        return;  
    }  
} 

// Toggles the layer visibility off 
function hideLayer(layerName) {  
    if(check) {  
        if (what =="none") {  
            return;  
        }  else if (what == "dom1") {  
            document.getElementById(layerName).style.visibility="hidden";  
        }  else {  
            eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');  
        }  
    }  else {  
        return;  
    }  
} 

init();
