//Form checking script for consultation request

function chkFrmConsult(frm) {

	if (frm.name.value == "") {
		alert("Please enter your name");
		frm.name.focus();
		return false;
	}

	if (frm.email.value == "") {
		alert("Please enter an email address");
		frm.email.focus();
		return false;
	}

	if (frm.address.value == "") {
		alert("Please enter your mailing address");
		frm.address.focus();
		return false;
	}
	
	if (frm.city.value == "") {
		alert("Please enter your city or town");
		frm.city.focus();
		return false;
	}

	if (frm.state.value == "") {
		alert("Please enter your state");
		frm.state.focus();
		return false;
	}

	if (frm.zip.value == "") {
		alert("Please enter your zip code");
		frm.zip.focus();
		return false;
	}

	if (frm.contact_method.options[0].selected) {
		alert("Please tell me the best method to contact you.");
		frm.contact_method.focus();
		return false;
	}

	if (frm.contact_method.options[3].selected && frm.day_phone.value == "") {
		alert("Please tell me your daytime phone number if you prefer that contact method.");
		frm.day_phone.focus();
		return false;
	}

	if (frm.contact_method.options[4].selected && frm.ev_phone.value == "") {
		alert("Please tell me your evening phone number if you prefer that contact method.");
		frm.ev_phone.focus();
		return false;
	}

	if (frm.contact_method.options[5].selected && frm.mob_phone.value == "") {
		alert("Please tell me your mobile phone number if you prefer that contact method.");
		frm.mob_phone.focus();
		return false;
	}

	if (frm.contact_time.options[0].selected) {
		alert("Please tell me the best time to contact you.");
		frm.contact_time.focus();
		return false;
	}

	if (frm.event_type.options[0].selected) {
		alert("Please tell me what type of event you are planning.");
		frm.event_type.focus();
		return false;
	}
	
	if (frm.event_date.value == "") {
		alert("Please tell me the day for your event");
		frm.event_date.focus();
		return false;
	}

	if (!(frm.date_confirm[0].checked || frm.date_confirm[1].checked || frm.date_confirm[2].checked)) {
		alert("Please tell me if your planned event day is confirmed or not");
		return false;
	}

	if (frm.hear_about.options[0].selected) {
		alert("Please tell me how you heard about our services.");
		frm.hear_about.focus();
		return false;
	}

	var othr = frm.hear_about.options.length - 1;

	if (frm.hear_about.options[othr].selected && frm.other_src.value == "") {
		alert("Please tell me what other source referred you to our services.");
		frm.other_src.focus();
		return false;
	}

	return true;
}


//Form checking script for contact request

function chkFrmContact(frm) {
	if (frm.name.value == "") {
		alert("Please tell me your name");
		frm.name.focus();
		return false;
	}
	
	if (frm.email.value == "") {
		alert("Please enter an email address");
		frm.email.focus();
		return false;
	}
	
	return true;
}

// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
   
window.attachEvent("onload", correctPNG);