//<!--

//this runs on everypage

if (document.images) {

redbar_off = new Image();
redbar_off.src = "images/redbar.gif";

bullet_on = new Image();
bullet_on.src = "images/on/bullet.gif";
bullet_off = new Image();
bullet_off.src = "images/off/bullet.gif";

redbarcar_on = new Image();
redbarcar_on.src = "images/redbar-auto.gif";
redbarhome_on = new Image();
redbarhome_on.src = "images/redbar-home.gif";
redbarcomm_on = new Image();
redbarcomm_on.src = "images/redbar-commercial.gif";
redbarlife_on = new Image();
redbarlife_on.src = "images/redbar-life.gif";
redbartrav_on = new Image();
redbartrav_on.src = "images/redbar-travel.gif";

redbar_on = new Image();
redbar_on.src = "images/redbar-auto.gif";

home_off = new Image();
home_off.src = "images/off/barimage-home.jpg";
home_on = new Image();
home_on.src = "images/on/barimage-home.jpg";

car_off = new Image();
car_off.src = "images/off/barimage-car.jpg";
car_on = new Image();
car_on.src = "images/on/barimage-car.jpg";

comm_off = new Image();
comm_off.src = "images/off/barimage-com.jpg";
comm_on = new Image();
comm_on.src = "images/on/barimage-com.jpg";

life_off = new Image();
life_off.src = "images/off/barimage-life.jpg";
life_on = new Image();
life_on.src = "images/on/barimage-life.jpg";

trav_off = new Image();
trav_off.src = "images/off/barimage-travel.jpg";
trav_on = new Image();
trav_on.src = "images/on/barimage-travel.jpg";

redbar_off = new Image();
redbar_off.src = "images/off/redbar.gif";
redbar_on = new Image();
redbar_on.src = "images/on/redbar.gif";

divider_off = new Image();
divider_off.src = "images/divider2.gif";
divider_on = new Image();
divider_on.src = "images/divider2.gif";

divReal_off = new Image();
divReal_off.src = "images/enter_real_estate.jpg";
divReal_on = new Image();
divReal_on.src = "images/enter_real_estate_HL.jpg";

divInsur_off = new Image();
divInsur_off.src = "images/enter_insurance.jpg";
divInsur_on = new Image();
divInsur_on.src = "images/enter_insurance_HL.jpg";

mm_1_off = new Image();
mm_1_off.src = "images/off/home.gif";
mm_1_on = new Image();
mm_1_on.src = "images/on/home.gif";

mm_2_off = new Image();
mm_2_off.src = "images/off/toole_peet.gif";
mm_2_on = new Image();
mm_2_on.src = "images/on/toole_peet.gif";

mm_3_off = new Image();
mm_3_off.src = "images/off/services.gif";
mm_3_on = new Image();
mm_3_on.src = "images/on/services.gif";

mm_4_off = new Image();
mm_4_off.src = "images/off/quote.gif";
mm_4_on = new Image();
mm_4_on.src = "images/on/quote.gif";

mm_5_off = new Image();
mm_5_off.src = "images/off/history.gif";
mm_5_on = new Image();
mm_5_on.src = "images/on/history.gif";

mm_6_off = new Image();
mm_6_off.src = "images/off/contacts.gif";
mm_6_on = new Image();
mm_6_on.src = "images/on/contacts.gif";

};

//end run on everypage

function turnOn(imageName) {
	if (document.images) { document[imageName].src = eval(imageName + "on.src");
		passVal = ('redbar' + imageName);
		document['redbar_'].src = eval(passVal + "on.src");
	}
};
function turnOff(imageName) {
	if (document.images) { document[imageName].src = eval(imageName + "off.src");
		document['redbar_'].src = eval('redbar_' + "off.src");
	}
};
function turnOnBar(imageName) {
	if (document.images) { document[imageName].src = eval(imageName + "on.src"); }
};
function turnOffBar(imageName) {
	if (document.images) { document[imageName].src = eval(imageName + "off.src"); }
};

function turnOnThis(imageName,target) {
	if (document.images) { document[target].src = eval(imageName + "on.src"); }
};
function turnOffThis(imageName,target) {
	if (document.images) { document[target].src = eval(imageName + "off.src"); }
};

function isValidEmail(str) {
   var result = (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	if (result == false) {
		document.FORM.email.value = "** INVALID EMAIL **";
	}
}

function rollerCoster(id) {
	var txts = new Array(6);
	txts[0] = "";

	txts[1] = '<img src="images/subTop.gif" alt="" width="13" height="55" border="0" align="left">'
		+'<a href="automobile.html">AUTOMOBILE INSURANCE</a> <strong>&raquo; <a href="#">GET QUOTE</a> &laquo;</strong><br>'
		+'<a href="#">PROPERTY INSURANCE</a><br>'
		+'<a href="#">LIFE INSURANCE</a><br>'
		+'<a href="#">TRAVEL INSURANCE</a><br>';

	txts[2] = '<img src="images/subSec.gif" alt="" width="13" height="55" border="0" align="left">'
		+'<a href="automobile.html">BUSINESS INSURANCE</a><br>'
		+'<a href="#">BUSINESS AUTOMOBILE INSURANCE</a><br>'
		+'<a href="#">BUSINESS IN THE HOME</a><br>';
	
	txts[3] = '<img src="images/subthi.gif" alt="" width="13" height="55" border="0" align="left">'
		+'&nbsp;<br><a href="automobile.html">LIFE INSURANCE</a><br>'
		+'<a href="#">DISABILITY INSURANCE</a><br>'
		+'<a href="#">CRITICAL ILLNESS INSURANCE</a><br>';
	
	txts[4] = '<img src="images/off/bullet.gif" width="8" height="12"> <a href="automobile.html">RETIREMENT PLANNING</a><br>'
		+'<img src="images/off/bullet.gif" width="8" height="12"> <a href="#">RRSPs &amp; ANNUITY PLANS</a><br>';
	

	document.getElementById("submenu").innerHTML = txts[id];
	if (document.images) { document["1_"].src = eval('bullet_' + "off.src"); }
	if (document.images) { document["2_"].src = eval('bullet_' + "off.src"); }
	if (document.images) { document["3_"].src = eval('bullet_' + "off.src"); }
	if (document.images) { document["0_"].src = eval('bullet_' + "off.src"); }
	bulletNum = id - 1;
	if (document.images) { document[bulletNum + "_"].src = eval('bullet_' + "on.src"); }
};

<!--

function inputMainMenu(swfName,ver,FLwidth,FLheight) {
	reqMajorVer = ver;
	reqRevision = 0;
	curFlashVersion = DetectFlashVer(reqMajorVer,0,reqRevision); //ignore middle 0
	//document.write(curFlashVersion);
		if (curFlashVersion != true) {
			self.name = "noflash";
		} else {  // flash is too old or we can't detect the plugin
			 var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'width="' + FLwidth + '" height="' + FLheight + '"'
			+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
			+ '<param name="movie" value="' + swfName + '" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="wmode" value="transparent">'
			+ '<embed src="' + swfName + '" quality="high" bgcolor="#ffffff" wmode="transparent"'
			+ 'width="' + FLwidth + '" height="' + FLheight + '" name="movie1" align="middle"'
			+ 'play="true"'
			+ 'loop="false"'
			+ 'quality="high"'
			+ 'allowScriptAccess="sameDomain"'
			+ 'type="application/x-shockwave-flash"'
			+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
			+ '<\/embed>'
			+ '<\/object>';
			document.write(oeTags);   // embed the flash movie
		}
};


// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 7;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// -->


var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	//else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	//else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	//else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : versionNum );	
			}
		}
	}	
}



function newWindow(path){

smallWindow = window.open
(path,'info','status=no,resizable=yes,scrollbars=no,screenX=25,left=25,screenY=50,top=50,width=400,height=270');
smallWindow.focus();
};

function getBrowserHeight(height) {
var intMovHeight;
intMovHeight = "";


if (navigator.appName.indexOf("Microsoft") != -1) {
	//alert('ie');
	intMovHeight = document.body.scrollHeight
} else if (navigator.appName.indexOf("Netscape") != -1) {
	//alert('NS');
	intMovHeight = window.innerHeight
} else {
	//alert('non-standard browser error, this page may not display right');
	intMovHeight = screen.height;
};
if (intMovHeight == "") { //just incase
	//alert('unexpected error, this page may not display right');
	intMovHeight = height;
};

forUseScreenSize = intMovHeight+''; // convert to string
//alert(forUseScreenSize);
//alert("hello, your browser use size will be " + forUseScreenSize);
return forUseScreenSize;
};


function CheckFormMS () { 

	//Initialise variables
	var errorMsg = "";

	//Check for a name
	if (document.FORM.name.value == "") { 
 		errorMsg += "\n\tName \t\t...Enter a contact name";
	}
	
	//Check for a phone
	if (document.FORM.name.value == "") { 
 		errorMsg += "\n\tPhone \t\t...Enter a phone number";
	}
	
	//Check valid e-mail
	if ((document.FORM.email.value == "") || (document.FORM.email.value.length > 0 && (document.FORM.email.value.indexOf("@",0) == - 5 || document.FORM.email.value.indexOf(".",0) == - 5))) { 
		errorMsg += "\n\tE-mail \t\t...Enter a valid e-mail address";
	}

	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		line = "__________________________________________________________________\n\n";
		msg = line;
		msg += "There are problem(s) with the information you provided.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += line;
		msg += "The following field(s) need to be corrected: \n";
		errorMsg += alert(msg + errorMsg + "\n" + line);
		return false;
	}
	return true;
};

function CheckFormBus () { 

	//Initialise variables
	var errorMsg = "";

	///Check for a company
	if (document.FORM.company.value == "") { 
 		errorMsg += "\n\tCompany \t...Enter your company";
	}
	
	//Check for a name
	if (document.FORM.name.value == "") { 
 		errorMsg += "\n\tName \t\t...Enter a contact name";
	}
	
	//Check valid e-mail
	if ((document.FORM.email.value == "") || (document.FORM.email.value.length > 0 && (document.FORM.email.value.indexOf("@",0) == - 5 || document.FORM.email.value.indexOf(".",0) == - 5))) { 
		errorMsg += "\n\tE-mail \t\t...Enter a valid e-mail address";
	}

	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		line = "__________________________________________________________________\n\n";
		msg = line;
		msg += "There are problem(s) with the information you provided.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += line;
		msg += "The following field(s) need to be corrected: \n";
		errorMsg += alert(msg + errorMsg + "\n" + line);
		return false;
	}
	return true;
};

function eLnk (vpName,v1) {
	var v2="A3XX33KISI3DBR";
	var v7=unescape("%01G77_V%3B%2C6%3D%1D%27-%3F");
	var v5=v2.length;
	for(var v4=0;v4<v5;v4++){v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4));}
	document.write('<a href="javascript:void(0)" onclick="window.location=\'mail\u0074o\u003a'+v1+'?subject='+'\'">'+vpName+'<\/a>');
}