
function initMaps() {
	if (document.getElementById) {
		var mapIds = initMaps.arguments;			// pass string IDs of containing map elements
		var i, j, area, areas;
		for (i = 0; i < mapIds.length; i++) {
			areas = document.getElementById(mapIds[i]).getElementsByTagName("area");
	
			for (j = 0; j < areas.length; j++) {	// loop thru img elements
				area = areas[j];
							// set event handlers
				area.onmouseout = imgSwap;
				area.onmouseover = imgSwap;
				
			}
		}
	}
}


// image swapping event handling
function imgSwap(evt) {
	evt = (evt) ? evt : event;
	var elem = (evt.target) ? evt.target : evt.srcElement;
	var imgClass = elem.parentNode.name;
	var coords = elem.coords.split(",");
	var clipVal = "rect(" + coords[1] + "px " +
							coords[2] + "px " +
							coords[3] + "px " +
							coords[0] + "px)";
	var imgStyle;
	
	switch (evt.type) {
		case "mousedown" :
			imgStyle = document.getElementById(imgClass + "Down").style;
			imgStyle.clip = clipVal;
			imgStyle.visibility = "visible";
			break;
		case "mouseout" :
			document.getElementById(imgClass + "Over").style.visibility = "hidden";
			break;
		case "mouseover" :
			imgStyle = document.getElementById(imgClass + "Over").style;
			imgStyle.clip = clipVal;
			imgStyle.visibility = "visible";
			break
		case "mouseup" :
			// guarantee click in IE
			if (elem.click) {
				elem.click();
			}
			break;
	}
	evt.cancelBubble = true;
	return false;
}


function popup()
{
	window.open('contact_form.html','how','status=no,location=no,scrollbars=yes,width=690,height=900,left=20,top=0');
}

function popup_service()
{
	window.open('services_pop.html','how','status=no,location=no,scrollbars=yes,width=500,height=500,left=20,top=0');
}


		  
		  
		  
		  
function validateForm(form)
  {
  // validate First Name field
  // begin by stripping leading/trailing blanks
  form.name.value = stripLeadingTrailingBlanks(form.name.value);
  if (isBlank(form.name.value))
    {
    alert("Please enter your First Name.");
    form.name.focus();
    return false;
    }

  // validate Phone field
  // begin by stripping leading/trailing blanks
  form.daytime_phone.value = stripLeadingTrailingBlanks(form.daytime_phone.value);
  if (!isUSPhoneNumber(form.daytime_phone.value))
    {
    alert("Please enter a valid US phone number WITH area code (10 digits).");
    form.daytime_phone.focus();
    return false;
    }

	
  // validate Email field
  // begin by stripping leading/trailing blanks
  form.email.value = stripLeadingTrailingBlanks(form.email.value);
  if (!isEmail(form.email.value))
    {
    alert("Please enter a valid email address: ?????@?????.???");
    form.email.focus();
    return false;
    }
  
	
  // validate Guests field
  if ((getCheckedSelectOptions(form.number_invited_guests) == -1) || 
      (getCheckedSelectOptions(form.number_invited_guests) == 0))
    {
    alert("Please choose how many invited guests.");
    return false;
    }
	
	
  // validate Budget field
  if ((getCheckedSelectOptions(form.budget) == -1) || 
      (getCheckedSelectOptions(form.budget) == 0))
    {
    alert("Please choose your Budget.");
    return false;
    }
	
  // validate Information field
  if ((getCheckedCheckboxes(form.would_like_information) == -1) || 
      (getCheckedCheckboxes(form.would_like_information) == 0))
    {
    alert("Please choose which subject you would like information.");
    return false;
    }
	

  // validate Budget field
  if ((getCheckedSelectOptions(form.how_find_us) == -1) || 
      (getCheckedSelectOptions(form.how_find_us) == 0))
    {
    alert("Please choose how you found us.");
    return false;
    }
	


	return true; 

  }

		  