//*-------------------------------------------------------------------------
//* Handle setting up of the preloading button images
//* This file includes the login form validation and some other misc functions.
//* 2008-03-27 index-e.asp and index-f.asp moved to content/en 
//* 2008-03-27 index-e.asp and index-f.asp moved to content/en 
//*-------------------------------------------------------------------------
    form_domain = "www.citc.ca"   //used in form .js files. 
	pagelang = "e";
//	var testdir = "test/";  // Used in the form scripts. set to blank for production
	var testdir = "";  
   
    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.citc.ca";  //* 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;	
//* index-e.asp and index-f.asp moved to content/en so don't need this 		
// 	   imagedir = "content/images";
// 	   htmldir = "content/en/";
 	   imagedir = "../images";
 	   htmldir = "";	   
 	   homedir = "";
 	}   
 	else {   
 	   homepg = 0;	
	   imagedir = "../images";
	   htmldir = "";
//	   htmldir = "../content/";   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); 
}

//*-------------------------------------------------------------------------
//* Boilerplate Text variables for various forms.
//*-------------------------------------------------------------------------

//*** COMMON

var clearmessage = "Are you sure that you want to clear all the data you have entered on this form?"
var firstmessage="Please provide the following valid information:\n\n ";
var m_fname = "First Name";
var m_lname = "Last Name";
var m_name = "Name";
var m_title = "Title";
var m_company = "Company";
var m_addr = "Address";
var m_city = "City";
var m_country = "Country";
var m_prov = "Province";
var m_postcode = "Postal Code";
var m_tel = "Telephone";
var m_fax = "Fax";
var m_email = "Email address";
var m_comments = "Comments";
var m_price = "Total Price";
var m_paymethod = "Payment Method";
var m_cardname = "Cardholder Name";
var m_cardtype = "Card Type";
var m_cardno = "Card Number";
var m_cardmm = "Card Expiry Month (mm)";
var m_cardyy = "Card Expiry Year (yy)";
var m_carddate = "Card Expiry Date";

//*** Contact Us
var m_i_am = "I am... Check at least one";
var m_i_am_other = "I am... Specify Other";
var m_i_am_member = "I am... Specify Membership No.";
var m_help = "How can we help? Check at least one";
var m_help_other = "How can we help? Specify Other";
//var m_help_phone = "Telephone";
var m_ContactSubject = "CITC: Contact Us";
var m_OrderSubject = "CITC: Order Form";

//*** PROCTOR FORM
var m_ProctorSubject = "CITC - TICO PROCTOR";
var m_cell = "Cell phone";
var m_position = "Position";
var m_Terms_and_Conditions = "Terms and Conditions";
 