//*-------------------------------------------------------------------------
//* Handle setting up of the preloading button images
//* This file includes the login form validation and some other misc functions.
//*
//* Updates: 2004-08-06 - Remove some obsolete image preloads (sendon/clearon)
//*-------------------------------------------------------------------------

// Dynamically get the file name of the displayed page.
// Hence the "file" argument is not needed.
	var pagelang = "e";  // English.
    var homepage = 0; // default to not the home page
    var homepg = 0; // This is checked in footer-e.js
	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.miramichi.org";
    testurl = "test.miramichi.org";
    
// Have to use a slightly different page when it's the homepage since the index.html file
// is not in the /html directory.
	
    if (filenm.substring(0,5) == "index" || filenm == "" || filenm == urlname) homepage = 1;
 	if (homepage) {
 		homepg = 1;	
 	   imagedir = "../assets";
 	   htmldir = "en/";
 	}   
 	else {   
 	   homepg = 0;	
	   imagedir = "../assets";
	   htmldir = "../en/";
	} 
//  alert(imagedir);
if(document.images){
  	homeon 		= new Image(); homeon.src= imagedir + "/b-homeon-e.gif";
 	homeoff		= new Image(); homeoff.src= imagedir + "/b-homeoff-e.gif";
  	searchon 	= new Image(); searchon.src= imagedir + "/b-searchon-e.gif";
 	searchoff	= new Image(); searchoff.src= imagedir + "/b-searchoff-e.gif";
  	langon 		= new Image(); langon.src= imagedir + "/b-frenchon.gif";
 	langoff		= new Image(); langoff.src= imagedir + "/b-frenchoff.gif"; 	 		 	 	 				 	
 }

//*-------------------------------------------------------------------------
//* 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_name = "Name";
var m_addr = "Address";
var m_city = "City";
var m_country = "Country";
var m_prov = "Province / State";
var m_postcode = "Postal/Zip Code";
var m_tel = "Telephone";
var m_fax = "Fax";
var m_email = "Email address";
var m_comments = "Comments";

//***  VISIT FEEDBACK (visit-feedbackform.js  visit-feedbackform-e.asp)

var m_VisitFeedbackSubject = "Miramichi: Visitor Feedback";

//*** REQUEST INFO (requestform.js  requestform-e.asp)

var m_RequestInfoSubject = "Miramichi: Request Tourist Info";

//*** CONTACT FEEDBACK (contact-feedbackform.js  contact-feedbackform-e.asp)

var m_ContactFeedbackSubject = "Miramichi: Website Feedback";

//*** BLOOM (bloomform.js  comm-bloomform-e.asp)

var m_category = "Category: Check at least one";
var m_puchaseTshirt = "Purchase T-Shirt(s)?";
var m_tshirtQty = "T-Shirt Total Quantity";
var m_tshirtS = "T-Shirt S Quantity";
var m_tshirtM = "T-Shirt M Quantity";
var m_tshirtL = "T-Shirt L Quantity";
var m_tshirtXL = "T-Shirt XL Quantity";
var m_BloomSubject = "Miramichi in Bloom - Entry";