function flip(obj) {obj.style.backgroundPositionY="-28px";}
function fl35(obj) {obj.style.backgroundPositionY="-34px";}
function low(obj) {obj.style.backgroundPositionY="0";}
function clr(obj) {if(obj.value=="email"||obj.value=="name")obj.value="";}
function clr2(obj,txt) {if(obj.value==txt)obj.value="";}
function chk(obn) {if(document.getElementById(obn).value.length==0){document.getElementById(obn).value=obn;}}
function chk2(obn,txt) {if(document.getElementById(obn).value.length==0){document.getElementById(obn).value=txt;}}
function go(url){document.location=url+".html"}
function sub(typ){
	df=document.form;
	nm=df.name.value;
	if(nm.length<3||nm=="name"){alert("Please enter a name");return;}
	em=df.email.value;
	atpos=em.indexOf('@');
	dotpos=em.lastIndexOf('.');
	if(em.length<5||atpos<1||dotpos<atpos+2){alert("Email doesn''t look right");return;}
	if(typ=="b"){
			dt=df.date.value;
			if(dt.length<6||dt=="date of booking"){alert("Please enter date of booking as dd/mm/yy");return;}
			pt=df.party.value;
			if(pt.length<1||pt=="party size"){alert("Please enter the size of your party");return;}
			tm=df.time.value;
			if(tm.length<2||tm=="time"){alert("Please enter the time of your booking");return;}
			ph=df.phone.value;
			if(ph.length<10){alert("Please enter a contact phone number");return;}
	}
	df.method="post";
	df.action="thanks.php";
	df.chkval.value="12ee15as9gw!";
	df.submit();
}
