var form = {};
form.setUpContact = function(){
	/*$(".formBox select.inputBox").bind("onchange",function(){
		var formStyle = $(".formBox select option:eq("+this.selectedIndex+")").value;
		 
	});*/
	if(!navigator.appVersion.match("AppleWebKit")){
		$("#contactForm select.inputBox").addClass("notsafariBox");	
	}
	
	$(".formBox input.submit").click(function(){
		event.preventDefault;
		var a=true;
		return a;
	});
	
	if($("#contactForm")[0]){
		if(location.href.split("?")[1]){
			if(location.href.split("?")[1].match("goto=")){
				var goto = getQueryVal(location.href.split("?")[1],"goto");
				for(var i=0;i<$("#contactForm select.inputBox option").length;i++){
					if($("#contactForm select.inputBox option")[i].value==goto){
						$("#contactForm select.inputBox")[0].selectedIndex=i;
					}
				}
				$("#contactForm select.inputBox")[0].value=goto;
				//ALTER THE FORM & Interest Box
			}
		}
	}
		
	function getRadioButtonValue(group){
		var a = "";
		if(getSelectedRadio(group)>-1){
			var b=getSelectedRadio(group);
			a = group[b].value;
		}
		return a;
	}
	
	function getSelectedRadio(buttonGroup) {// returns the array number of the selected radio button or -1 if no button is selected
	   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
		  for (var i=0; i<buttonGroup.length; i++) {
			 if (buttonGroup[i].checked) {
				return i;
			 }
		  }
	   } else {
		  if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
	   }// if we get to this point, no radio button is selected
	   return -1;
	} 
	
	//Check input field for errors, if valid, save to cookie (cvalue). types: "email".. other
	function validationHelper(loc,type,cvalue){
		var a = true;
		if($(loc)[0]){
			switch(type){
				case "email":
					if($(loc)[0].value == "" || $(loc)[0].value == null || $(loc)[0].value.indexOf("@") < 0 || $(loc)[0].value.indexOf(".") < 0){
						a = false;
						$(loc).addClass("error");
					}else{
						setCookie(cvalue,$(loc)[0].value,60);
					}
					break;
				default:
					if($(loc)[0].value == "" || $(loc)[0].value == "_" || $(loc)[0].value == null){
						a = false;	
						$(loc).addClass("error");
					}else{
						setCookie(cvalue,$(loc)[0].value,60);
					}
					break;
			}
		}else { a= false;}
		return a;
	}	
}
form.validateContact = function(){
	
}

