function fncCheckContactCSS(){
	if(document.owner1.same_contact.checked){
		fncSetStyle('input','selectGrey','background','#DDDDDD')
	}else{
		fncSetStyle('input','selectGrey','background','#FFFFFF')
	}
}

function fncSetStyle(obj,classname /* [attribute/value pairs] */)
{

	if (typeof document.styleSheets == 'undefined')
	return;


	var oRegExp = new RegExp('('+obj.toUpperCase()+'|'+obj.toLowerCase()+')' + ((classname) ? '.' + classname : ''));

	var rules, whichRule, num_rules, SS, whichSS = 0, num_sheets = document.styleSheets.length;
	for (whichSS; whichSS < num_sheets; ++whichSS)
	{
		SS = document.styleSheets.item(whichSS);
		var ruletype = (typeof SS.rules != 'undefined') ? 'rules' : 'cssRules';
		if (typeof SS[ruletype] == 'undefined')
		return;

		rules = SS[ruletype];
		num_rules = rules.length;
		for (whichRule = 0; whichRule < num_rules; ++whichRule)
		{
		rule = SS[ruletype].item(whichRule);

			if (oRegExp.test(rule.selectorText))
			{

				for (var a = 2; a < arguments.length; a+=2)
					rule.style[arguments[a]] = arguments[a + 1];
					return;
				}
			}
		}
}

function validateForm(form) {
	var obj = eval('document.'+form);
	if(	obj.category.selectedIndex == 0 ){
		alert("Please select the type of accommodation");
		obj.category.focus();
		return false;
	}
	if(	obj.aod_address.value.length < 3 ){
		alert("Please enter your address");
		obj.aod_address.focus();
		return false;
	}
	if(	obj.aod_name.value.length < 3 ){
		alert("Please enter your name");
		obj.aod_name.focus();
		return false;
	}
	if(	obj.aod_lastname.value.length < 3 ){
		alert("Please enter your surname");
		obj.aod_lastname.focus();
		return false;
	}
	if(	obj.aod_email.value.length < 3 ){
		alert("Please enter your email address");
		obj.aod_email.focus();
		return false;
	}
	 if (obj.aod_email.value.indexOf('@') == -1){
	   alert("Please email a vaild email");
	   obj.aod_email.focus();
	   return false;
	 }
	 if (obj.aod_email.value.indexOf('.') == -1){
	   alert("Please enter a vaild email");
	   obj.aod_email.focus();
	   return false;
	 }
	/* CONTACT DETAILS */
	if(obj.same_contact.checked == false){
		if(	obj.contact_address.value.length < 3 ){
		alert("Please enter your address");
		obj.contact_address.focus();
		return false;
		}
		if(	obj.contact_name.value.length < 3 ){
			alert("Please enter your name");
			obj.contact_name.focus();
			return false;
		}
		if(	obj.contact_lastname.value.length < 3 ){
			alert("Please enter your surname");
			obj.contact_lastname.focus();
			return false;
		}


	}
	return true;

}
