//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			//ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	//ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)
//END SUCKERTREE MENU

//BEGIN FORM VALIDATION
function doCheckForm(oForm){
				if (oForm.name.value==""){
					alert("Please enter your name!");
					oForm.name.focus();
					return false;
				}

				if (oForm.company.value==""){
					alert("Please enter a company name!");
					oForm.company.focus();
					return false;
				}

				var reg1 = /^\+{0,1}\d{7,20}$/;
				if (oForm.phone.value.match(reg1) == null){
					alert("Please enter a valid phone number! Only digits and '+' symbol at the beginning allowed");
					oForm.phone.focus();
					return false;
				}
						
				
				if (!checkEmail(oForm.email.value)){
					alert("Please enter correct email address!");
					oForm.email.focus();
					return false;
				}
				
				if (oForm.address.value==""){
					alert("Please enter your address!");
					oForm.address.focus();
					return false;
				}
				
				if (oForm.city.value==""){
					alert("Please enter your city!");
					oForm.city.focus();
					return false;
				}
				
				if (oForm.state.value==""){
					alert("Please select state!");
					oForm.state.focus();
					return false;
				}
				
				if (oForm.zip.value==""){
					alert("Please enter your ZIP / Postal code!");
					oForm.zip.focus();
					return false;
				}

				oForm.action_name.value = "send";
				 document.contact.submit();
				return true;
			}

			function checkEmail(email)	{
				var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
				if (! email.match(re)) 	return (false);
				return(true);
			}