function mOver(id1,id2,image,nav,navStyle,navValue){
	if(document.getElementById(id1)){
		if(image.indexOf("#") == 0) {
			document.getElementById(id1).style.backgroundColor = image;
		} else {
			document.getElementById(id1).style.backgroundImage = "url("+image+")";
		}
	}
	if(document.getElementById(id2)){
		if(image.indexOf("#") == 0) {
			document.getElementById(id2).style.backgroundColor = image;
		} else {
			document.getElementById(id2).style.backgroundImage = "url("+image+")";
		}
	}
	if(document.getElementById(nav)){
		strNav = 'document.getElementById("'+nav+'").style.'+navStyle+' = "'+navValue+'"';
		eval(strNav);
	}
}

function show_popup(gifurl,gifname,wd,ht,rs,mb,tb,lo,st,sb,x){
	
	var lf=(screen.width) ? (screen.width-wd)/2 : 0;
	var tp=(screen.height) ? (screen.height-ht)/2 : 0;
	
		if(!wd||!ht){
			var ha=((mb=='yes')?30:0)+((tb=='yes')?60:0)+((lo=='yes')?20:0)+((st=='yes')?20:0);wd=600;ht=400-ha;if(ver4){
				if(screen.availWidth){
					wd=screen.availWidth-20;ht=screen.availHeight-65-ha;lf=screen.availLeft;tp=screen.availTop+10;
				}
			}
		} 
	window.open(gifurl,gifname,'width='+wd+',height='+ht+',left='+lf+',top='+tp+',resizable='+rs+',menubar='+mb+',toolbar='+tb+',location='+lo+',status='+st+',scrollbars='+sb+x);
} 


function ContactForm(){
		if (document.contactus.First_Name.value == ""){
			alert("Your firstname is required");
			return false;
	}	
		if (document.contactus.Email.value == "" || (document.contactus.Email.value.indexOf("@",0) == -1||document.contactus.Email.value.indexOf(".",0) == -1)) { 
			alert("Please enter a valid E-mail address");
			return false;
	}
	   if (document.contactus.PhoneNumber.value == "" ) { 
			alert("Please enter your phone number.");
			return false;
	}
		if (document.contactus.comments.value == ""){
			alert("Your Comments are required");
			return false;
	}	
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		//button_background_over = newImage("/images/button-background-over.gif");
		preloadFlag = true;
	}
}

// functions to make png graphics with transparent show up properly in IE 5.5 to 6.*
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(){
	for(i=0; i<document.images.length; i++){
		type = document.images[i].src;
		type = type.substring(type.length-3, type.length);
		if(type == "png"){
			if ((version >= 5.5) && (version < 7) && (document.body.filters)){
				document.images[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + document.images[i].src + "', sizingMethod='scale')"
				document.images[i].src = "/images/dotblank.gif"
			}
		}
	}
	
}
function changePNG(img, replace){
	if ((version >= 5.5) && (version < 7) && (document.body.filters)){
		document[img].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + replace + "', sizingMethod='scale')";
	} else {
		document[img].src = replace;
	}
}

function fixFlash(){
theObjects = document.getElementsByTagName("object"); 
for (var i = 0; i < theObjects.length; i++) { 
theObjects[i].outerHTML = theObjects[i].outerHTML; 
}
}




//LIFE INSURANCE QUOTE FORM VALIDATION ******* FROM OLD SITE ************
// JavaScript Document
<!-- Begin
function ValidateAll()
{
	if(CheckEmail(document.dForm.email.value) == false) return false;
	return true;
}

function StripSpacesFromEnds(s)
{
	// developed by willmaster.com
	while((s.indexOf(' ',0) == 0) && (s.length > 1))
	{
		s = s.substring(1,s.length);
	}
	while((s.lastIndexOf(' ') == (s.length - 1) && (s.length > 1)))
	{
		s = s.substring(0,(s.length - 1));
	}
	if((s.indexOf(' ',0) == 0) && (s.length == 1)) s = '';
	return s;
}

function IsItPresent(s,explanation)
{
	// developed by willmaster.com
	s = StripSpacesFromEnds(s);
	if(s.length) return s;
	alert('Please enter ' + explanation + '.');
	return '';
}

function CheckEmail(s_email)
{
	// developed by willmaster.com
	s_email = IsItPresent(s_email,'your email address');
	if(! s_email) return false;
	var i = s_email.indexOf(' ',0);
	while(i > -1)
	{
		s_email = s_email.substring(0,i) + 
			s_email.substring((i + 1),s_email.length);
		i = s_email.indexOf(' ',0);
	}
	document.dForm.email.value = s_email;
	if((s_email.length < 6) ||
	   (s_email.indexOf('@',0) < 1) ||
	   (s_email.lastIndexOf('@') != s_email.indexOf('@',0)) ||
	   (s_email.lastIndexOf('@') > (s_email.length - 5)) ||
	   (s_email.lastIndexOf('.') > (s_email.length - 3)) ||
	   (s_email.lastIndexOf('.') < (s_email.length - 4)) ||
	   (s_email.indexOf('..',0) > -1) ||
	   (s_email.indexOf('@.',0) > -1) ||
	   (s_email.indexOf('.@',0) > -1) ||
	   (s_email.indexOf(',',0) > -1))
	{
		alert('The email address is not valid.');
		return false;
	}
	return true;
}
//  End -->


function openWin(theURL,winName,features) {
	window.open(theURL,winName,features);
}

//Function to add page to favorites menu
function addToFavorites(title, url) { 
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,"");
	} else if (window.external) { 
		window.external.AddFavorite(url,title);
	} else {
		alert("Sorry! Your browser doesn't support this function."); 
	}
} 