//*-------------------------------------------------------------------------
//* Handle setting up of the preloading button images
//* This file includes the login form validation and some other misc functions.
//*
//* 2007-07-02 - Add enlarge button.
//*-------------------------------------------------------------------------

// 	var testdir = "test/";  // Used in the form scripts. set to blank for production
// 	var testdir = "";  
    var bcc = "pc@twistedpixel.com"; 
   
//	sTest = "{Test}";   // Activates Test mode on internet secure
	sTest = "";			// Uncomment to place into production   
   
    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 DHTML = (document.getElementById || document.all || document.layers);
    urlname = "www.ec-edi.biz";
    
// 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 == urlname) homepage = 0;
 	if (homepage) {
 		homepg = 1;	
 	   imagedir = "images";
 	   htmldir = "content/";
 	   homedir = "";
 	}   
 	else {   
 	   homepg = 0;	
	   imagedir = "../images";
	   htmldir = "";
//	   htmldir = "../content/";   This breaks pagecolor option in milonic
	   homedir = "../";
	} 
//  alert(imagedir);
if(document.images){
	enlargeon 	= new Image(); enlargeon.src= imagedir + "/b-enlarge-on.gif";
	enlargeoff 	= new Image(); enlargeoff.src= imagedir + "/b-enlarge-off.gif";	
	viewadon 	= new Image(); viewadon.src= imagedir + "/b-viewad-on.gif";
	viewadoff 	= new Image(); viewadoff.src= imagedir + "/b-viewad-off.gif";	
	viewliston 	= new Image(); viewliston.src= imagedir + "/b-viewlist-on.gif";
	viewlistoff = new Image(); viewlistoff.src= imagedir + "/b-viewlist-off.gif";	
	websiteon 	= new Image(); websiteon.src= imagedir + "/b-website-on.gif";
	websiteoff 	= new Image(); websiteoff.src= imagedir + "/b-website-off.gif";	
	contacton 	= new Image(); contacton.src= imagedir + "/b-contact-on.gif";
	contactoff 	= new Image(); contactoff.src= imagedir + "/b-contact-off.gif";	
	searchon 	= new Image(); searchon.src= imagedir + "/b-search-on.gif";
	searchoff 	= new Image(); searchoff.src= imagedir + "/b-search-off.gif";	
			
  	clickon 	= new Image(); clickon.src= imagedir + "/b-clickon.gif";
 	clickoff	= new Image(); clickoff.src= imagedir + "/b-clickoff.gif"; 	 
  	loginon 	= new Image(); loginon.src= imagedir + "/b-loginon.gif";
 	loginoff	= new Image(); loginoff.src= imagedir + "/b-loginoff.gif";  	
  	logouton 	= new Image(); logouton.src= imagedir + "/b-logouton.gif";
 	logoutoff	= new Image(); logoutoff.src= imagedir + "/b-logoutoff.gif"; 	  	
 			 	 	 	 		 	
  	coachon 	= new Image(); coachon.src= imagedir + "/b-buyerscoach-on.gif";
 	coachoff	= new Image(); coachoff.src= imagedir + "/b-buyerscoach-off.gif"; 	  	
 }


function flipImg(imgNam,imgTyp,onoff){
//*******************************************************************************
//	Do the mouse over image flipping.
//******************************************************************************* 		
  	if(document.images){ 	
 		document.images[imgNam].src=eval(imgTyp+onoff+'.src');
  	}
}
