//*-------------------------------------------------------------------------
//* Handle setting up of the preloading button images
//* This file includes the login form validation and some other misc functions.
//*-------------------------------------------------------------------------
   
	pagelang = "e";
 
   
    var homepage = 0; // default to not the home page
    var homepg = 0; // This is checked in footer.js
    
// Dynamically get the file name of the displayed page.
// Hence the "file" argument is not needed.
    
	var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
	var filenm = location.href.substring(dir.length,location.href.length+1);
	var thefile = filenm;
	var DHTML = (document.getElementById || document.all || document.layers);
    var urlname = "www.gaspinfo.com";  //* Just used to set homepage flag.
   
// Have to use a slightly different page when it's the homepage since the index.html file
// is not in the /html directory.
//	alert(filenm.substring(0,5) )
    if (filenm.substring(0,5) == "index" || filenm == "" || filenm == "10.html" || filenm == urlname) homepage = 1;
 	if (homepage) {
 		homepg = 1;	
 	   imagedir = "content/images";
 	   htmldir = "content/en/";
 	   homedir = "";
 	}   
 	else {   
 	   homepg = 0;	
	   imagedir = "../images";
	   htmldir = "";
//	   htmldir = "../en/";   This breaks pagecolor option in milonic
	   homedir = "../../";
	} 
//	alert(htmldir)
//  alert(imagedir);
if(document.images){
  	abouton 	= new Image(); abouton.src= imagedir + "/b-abouton.gif";
 	aboutoff	= new Image(); aboutoff.src= imagedir + "/b-aboutoff.gif"; 	
  	trainon 	= new Image(); trainon.src= imagedir + "/b-trainon.gif";
 	trainoff	= new Image(); trainoff.src= imagedir + "/b-trainoff.gif"; 	
  	memon 		= new Image(); memon.src= imagedir + "/b-memon.gif";
 	memoff		= new Image(); memoff.src= imagedir + "/b-memoff.gif"; 	
  	travon 		= new Image(); travon.src= imagedir + "/b-travon.gif";
 	travoff		= new Image(); travoff.src= imagedir + "/b-travoff.gif"; 	
 	 	 	 	
  	loginon 	= new Image(); loginon.src= imagedir + "/b-loginon.gif";
 	loginoff	= new Image(); loginoff.src= imagedir + "/b-loginoff.gif"; 
  	searchon 	= new Image(); searchon.src= imagedir + "/b-search-e-on.gif";
 	searchoff	= new Image(); searchoff.src= imagedir + "/b-search-e-off.gif";
  	   	
 }
function doSearch ( form ) {	
//*******************************************************************************
// Validate Form
//*******************************************************************************	
	var firstmessage="Please provide the following valid information:\n____________________________________\n ";
	var errormessage="";
	var len;
	
//	alert("Search Function not yet implemented");
		document.form1.action = "search-" + pagelang + ".asp";  //* Search
  		document.form1.method = "POST";
  		 document.form1.submit();
		return(0); 
}

