//reloads the window if Nav4 resized
function MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// browser variables

var ns4 = (document.layers)? true:false;
var ie4 = (document.all)? true:false;
var w3c = (document.getElementById)? true:false;
var random_number="";
var timerID

// functions that show and hide layers

function show(id){
clearTimeout(timerID);
for(var i=1; i<layerLoop; i++)
	//if (ns4) document.layers['L'+i].visibility = "hide";
	//else if (w3c) document.getElementById('L'+i).style.visibility = "hidden";
	//else if (ie4) document.all['L'+i].style.visibility = "hidden";
	
	if (ns4) document.layers[id].visibility = "show";
	else if (w3c) document.getElementById(id).style.visibility = "visible";
	else if (ie4) document.all[id].style.visibility = "visible";
}	

function hide(){
for(var i=1; i<layerLoop; i++)
	if (ns4) document.layers['L'+i].visibility = "hide";
	else if (w3c) document.getElementById('L'+i).style.visibility = "hidden";
	else if (ie4) document.all['L'+i].style.visibility = "hidden";
}
	
// functions that show and hide image rollovers

function imgAct(imgName) {
//for(var i=1; i<imageLoop; i++)
	//if (document.images) document['img'+i].src = eval('img'+i+'off.src');
	if (document.images) document[imgName].src = eval(imgName+'on.src');
}	

function imgInact() {
for(var i=1; i<imageLoop; i++)
	if (document.images) document['img'+i].src = eval('img'+i+'off.src');
}

function popopen(location){
var windowwidth = screen.width - 100
var windowheight = screen.height - 150
window.open(location,"_blank","width="+windowwidth+",height="+windowheight+",left=5,top=5,screenx=5,screeny=5,toolbar=yes,resizable=yes,status=yes,scrollbars=yes,locationbar=yes")
}
	
function popapp(location){
	var windowwidth = screen.width - 400
	var windowheight = screen.height - 100
	window.open(location,"_blank","width="+windowwidth+",height="+windowheight+",left=5,top=5,screenx=5,screeny=5,toolbar=yes,resizable=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,locationbar=yes")
}

function flexipop(location, windowheight, windowwidth){
	window.open(location,"_blank","width="+windowwidth+",height="+windowheight+",left=25,top=25,screenx=25,screeny=25,toolbar=yes,resizable=yes,status=yes,scrollbars=yes,locationbar=yes,location=yes,menubar=yes")
}

function fullpopopen(location){
	var windowwidth = screen.width - 100
	var windowheight = screen.height - 150	
	window.open(location,"_blank","width="+windowwidth+",height="+windowheight+",left=5,top=5,screenx=5,screeny=5,toolbar=yes,resizable=yes,status=yes,scrollbars=yes,locationbar=yes,location=yes,menubar=yes")
}


function validateSearch(theform) {
	re= /\w/gi;
	if (theform.search.value.match(re)== null)   {
	alert("Please enter your search request.");
	theform.search.focus();
	theform.search.select();
	return false;}
	}
	
function setFocus() {
      document.forms[0].elements[0].focus();
  }

 var newwin;
 function launchwin(winurl,winname,winfeatures)
 {
 newwin = window.open(winurl,winname,"scrollbars=1,width=700,height=500");
 if(javascript_version> 1.0)
 {
 setTimeout('newwin.focus();',250);
 }
 }
 
 
// function for .js error notification
 
function errAlert(msg, errUrl, line) {
	//alert(msg);
	//alert(errUrl);
	//alert(line); 
errImage = new Image();
errImage.src = '/error_templates/js_mailer.cfm?url=' + escape(errUrl) + '&msg=' + escape(msg) + '&line=' + line;
return true;
}
window.onerror = errAlert;
//
