// JavaScript Document	function checkRequired(which) {
	function checkRequired(which) {
		var pass=true;
		if (document.contactsupport) {
			for (i=0;i<which.length;i++) {
				var tempobj=which.elements[i];
				if (tempobj.name.substring(0,8)=="required") {
					if (((tempobj.type=="text"||tempobj.type=="textarea")&&
						tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
						tempobj.selectedIndex==0)) {
						tempobj.focus();
						pass=false;
						break;
					}
				}
		   }
		}
		if (!pass) {
			shortFieldName=tempobj.name.substring(8,30).toUpperCase();
			alert("Please make sure the "+shortFieldName+" field was properly completed.");
			return false;
		}
		else {
			if(which.requiredemail.value!=which.email2.value) { alert("Please make sure the email fields are identical."); return false; }
			myvalue=which.requiredemail.value;
			if(myvalue.indexOf("@")<1) {
				alert("Invalid e-mail address.");
				return false;
			} else {
				fields=myvalue.split("@");
				if(fields[0].length<=0) { alert("Invalid e-mail address."); return false; }
				if(fields[1].lastIndexOf(".")<1) { alert("Invalid e-mail address."); return false; }
				edomain=fields[1].split(".");
				if(edomain[0].length<=0) { alert("Invalid e-mail address."); return false; }
				if(edomain[(edomain.length-1)].length>4) { alert("Invalid e-mail address."); return false; }
			}
			return true;
		}
	}
	function getCountry() {
		if(document.contactsupport) {
		$.get("/includes/getcountry.asp", { }, function(data) {
					var listitems=data.split("|"); 
					var itemdata;
					with(document.contactsupport.requiredcountry) {
						for(var i=0;i<listitems.length-1;i++) {
							itemdata=listitems[i].split("~");
							options[i+1]=new Option(itemdata[1],itemdata[0],false,false);
						}
					}
				  } );
		}
	}
	function getState(id) {
		if(id!="") {
			$.get("/includes/getstate.asp", { countryID:id }, function(data) {
					var listitems=data.split("|"); 
					var itemdata;
					with(document.contactsupport.requiredstate) {
						for(var i=0;i<listitems.length-1;i++) {
							itemdata=listitems[i].split("~");
							options[i+1]=new Option(itemdata[1],itemdata[0],false,false);
						}
					}
				  } );
		}
	}
	$(document).ready(function() {
		if(document.forms['contactsupport'] != 'undefined') {
			getCountry();
		}
	});
