loadcheck = 0;
function preload(basePath) {
		loadcheck = 0;
			
		menu = new Array();
    	menu[1] = "images/nav_home_off.gif"
		menu[2] = "images/nav_home_on.gif"
		menu[3] = "images/nav_products_off.gif"
		menu[4] = "images/nav_products_on.gif"
		menu[5] = "images/nav_support_off.gif"
		menu[6] = "images/nav_support_on.gif"
		menu[7] = "images/nav_company_off.gif"
		menu[8] = "images/nav_company_on.gif"

        im = new Array()
	    for (var i = 1; i < menu.length; i++){

               im[i] = new Image();
               im[i].src = menu[i];}

		loadcheck = 1;
}


//Swaps the images --->
function display(num,imgname){ 
     	if (loadcheck) {
    	imgname.src = im[num].src;
		}
}
        

function showElement(){ //usage showElement('id1','id2','id3','id4','etc')
 var element;
 for (var i=0; i<=showElement.arguments.length; i++) {  
    element = document.getElementById(showElement.arguments[i]);
      if(element == null) { continue };
    element.style.display='block'; 
 }   
}// end fn

  
  
function hideElement(){  //usage hideElement('id1','id2','id3','id4','etc')
 var element;
 for (var i=0; i<=hideElement.arguments.length; i++) {  
    element = document.getElementById(hideElement.arguments[i]);
      if(element == null) { continue };
    element.style.display='none';
 } 
}// end fn

timeout = 0;
function resetDivs(on){
window.clearTimeout(timeout);
hideElement('products_menu','support_menu','company_menu');
if(on){
showElement(on);}
timeout = window.setTimeout('resetDivs()',2500);
}

function OpenWin(url, lWidth, lHeight) {
	var ww, wh;
	if ( lWidth == "") ww = 780;
	else ww = lWidth;
	if ( lHeight == "") wh = 580;
	else wh = lHeight;
	var sw = window.screen.availWidth;
	var sh = window.screen.availHeight;
	var lt = Math.round((sw-ww)/2);
	var rt = Math.round((sh-wh)/2);
	
	var ftr = 'width='+ww+',height='+wh+',location=no,url=no,toolbar=no,left='+lt+',top='+rt+',menubar=no,scrollbars=no,status=no';
	window.open(url, "win" + url, ftr);
}

function ShowTour() {
	var ww = 780;
	var wh = 580;
	var sw = window.screen.availWidth;
	var sh = window.screen.availHeight;
	var lt = Math.round((sw-ww)/2);
	var rt = Math.round((sh-wh)/2);
	
	var ftr = 'width='+ww+',height='+wh+',location=no,url=no,toolbar=no,left='+lt+',top='+rt+',menubar=no,scrollbars=no,status=no';
	window.open("tour/tour1.htm", 'winTour', ftr);
}

function ChkSubmit() {
	var failure = false;
	if ( document.form1.fname.value == "" ) failure=true;
	if ( document.form1.lname.value == "" ) failure=true;
	if ( document.form1.sname.value == "" ) failure=true;
	if ( document.form1.phone.value == "" ) failure=true;
	if ( document.form1.email.value == "" ) failure=true;
	if ( document.form1.address.value == "" ) failure=true;
	if ( document.form1.city.value == "" ) failure=true;
	if ( document.form1.state.value == "" ) failure=true;
	if ( document.form1.zip.value == "" ) failure=true;
	if ( failure ) {
		alert("All fields are required.");
		return false;
	} else {
		return true;
	}
}
