function info(strURL) {
	WinCom = window.open(strURL,"winCom","alwaysRaised,width=550,height=450,scrollbars");
	WinCom.location = strURL;
	window.WinCom.focus();
	return;
}

function coupon(url) {
	newwindow=window.open(url,'name','height=350,width=550');
	if (window.focus) {newwindow.focus()}
	return false;
}

function photogallery(url) {
	newwindow=window.open(url,'name','height=400,width=550');
	if (window.focus) {newwindow.focus()}
	return false;
}

function displaySWF(moviefile) { 
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="320" height="266" allowFullScreen=true>');
	document.write('<param name="movie" value="' + moviefile + '"><param name=quality value=high>');
	document.write('<embed src="' + moviefile + '" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="320" height="266" allowFullScreen=true>');
	document.write('</embed></object>');
}

function displaySWFfull(moviefile) { 
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100%" height="100%" id="player" align="middle" allowFullScreen="true">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="player_full.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<embed src="player_full.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowFullScreen="true" />');
	document.write('</object>');
}

function fullwin(targeturl){
	window.open(targeturl,"","fullscreen,scrollbars")
}


function validateinfokit() {
	var message = "";
	if (document.infokit.strFirstName.value == "") { message += "\n  >  First Name"; }
	if (document.infokit.strLastName.value == "") { message += "\n  >  Last Name"; }
	if (document.infokit.strAddress.value == "") { message += "\n  >  Address"; }
	if (document.infokit.strCity.value == "") { message += "\n  >  City"; }
	if (document.infokit.strState.value == "") { message += "\n  >  State"; }
	if (document.infokit.strZIP.value == "") { message += "\n  >  ZIP"; }
	if (document.infokit.strHomePhone.value == "") { message += "\n  >  Home Phone"; }
	if (document.infokit.strEmail.value == "") { message += "\n  >  E-Mail"; }
	if (document.infokit.strReference.value == "") { message += "\n  >  Reference Source"; }
	if (document.infokit.strReference.value == "Other" && document.infokit.strReferenceOther.value == "") { message += "\n  >  Reference Source"; }
	if (message != "") {
		message = "Please enter your information for the following fields:" + message;
		alert(message);
		return false;
	}
	if (!validateemail(document.infokit.strEmail.value)) {
		alert("Please enter a valid E-Mail Address");
		return false;
	}
	return true;
}

function validatecontactus() {
	var message = "";
	if (document.contactus.strAuthor.value == "") { message += "\n  >  Name"; }
	if (document.contactus.strEmail.value == "") { message += "\n  >  Email"; }
	if (document.contactus.strZIP.value == "") { message += "\n  >  ZIP Code"; }
	if (document.contactus.strComment.value == "") { message += "\n  >  Comments"; }
	if (message != "") {
		message = "Please enter your information for the following fields:" + message;
		alert(message);
		return false;
	}
	if (!validateemail(document.contactus.strEmail.value)) {
		alert("Please enter a valid E-Mail Address");
		return false;
	}
	return true;
}

function validateestimate(hdepot) {
	var message = "";
	if (document.estimate.strName.value == "") { message += "\n  >  Contact Name"; }
	if (document.estimate.strEmail.value == "") { message += "\n  >  Email Address"; }
	if (document.estimate.strPhone.value == "") { message += "\n  >  Phone Number"; }
	//if (document.estimate.strCounty.value == "") { message += "\n  >  County"; }
	if (document.estimate.strZIP.value == "") { message += "\n  >  ZIP Code"; }
	if (document.estimate.strService.value == "") { message += "\n  >  Service Required"; }
	if(hdepot) {
		if (document.estimate.strReference.value == "" && document.estimate.hdepot[1].checked) { message += "\n  >  How did you hear about us"; }
	}
	if (message != "") {
		message = "Please enter your information for the following fields:" + message;
		alert(message);
		return false;
	}
	if (!validateemail(document.estimate.strEmail.value)) {
		alert("Please enter a valid E-Mail Address");
		return false;
	}
	return true;
}

function validatetellfriend() {
	var message = "";
	if (document.tellfriend.strSenderName.value =="") { message += "\n  >  Your Name"; }
	if (document.tellfriend.strSenderEmail.value =="") { message += "\n  >  Your Email"; }
	if (document.tellfriend.strRecipientEmail.value =="") { message += "\n  >  Friend's Email"; }
	if (message != "") {
		message = "Please enter your information for the following fields:" + message;
		alert(message);
		return false;
	}
	if (!validateemail(document.tellfriend.strSenderEmail.value)) {
		alert("Please enter a valid E-Mail Address for Your Email");
		return false;
	}
	if (!validateemail(document.tellfriend.strRecipientEmail.value)) {
		alert("Please enter a valid E-Mail Address for Friend's Email");
		return false;
	}
	return true;
}


function validateemail(str) {
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1){ return false; }
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false; }
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false; }
	if (str.indexOf(at,(lat+1))!=-1){ return false; }
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false; }
	if (str.indexOf(dot,(lat+2))==-1){ return false; }
	if (str.indexOf(" ")!=-1){ return false; }
	return true;			
}


//mb added to show the 'other' box if the item is selected
function showOther(val) {
	if (val == 'Other') {
		document.getElementById('otherBox').style.display = 'block';	
	}
}

//mb added to show more options for reference
//using visibility so that the browser draws the table dimensions correctly
function showHearList() {
	document.getElementById('hearList').style.visibility = 'visible';	
}