// JavaScript Document

//Ajax Main Function
function GetXmlHttpObject() {
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
} 

function PrintEmail() {
	var name = 'info';
	var at = '&#64;';
	var domain = 'tonyart';
	var ext = '.co.uk';
	document.write('<a href=\"mailto:'+name+at+domain+ext+'\">'+name+at+domain+ext+'</a>');
}

function VerifyCnt() {
	
	var txt = "";
	
	if (document.frmcnt.name.value=="") {
	 txt = txt + "\n * Name";
	}
	
	var str=document.frmcnt.email.value
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i 
	if (!filter.test(str)) {
	 txt = txt + "\n * Email is not Valid";
	}
	
	if (document.frmcnt.telephone.value=="") {
	 txt = txt + "\n * Telephone";
	}
	
	if (document.frmcnt.message.value=="") {
	 txt = txt + "\n * Message";
	}

	
	if (txt) {
		alert ("The folowing fields are required:\n" + txt);
		return false;
	}
	
}

function VerifyBooking() {
	
	var txt = "";
	
	if (document.frmcnt.subject.value=="") {
	 txt = txt + "\n * Subject";
	}
	
	if (document.frmcnt.name.value=="") {
	 txt = txt + "\n * Name";
	}
	
	var str=document.frmcnt.email.value
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i 
	if (!filter.test(str)) {
	 txt = txt + "\n * Email is not Valid";
	}
	
	if (document.frmcnt.telephone.value=="") {
	 txt = txt + "\n * Telephone";
	}
	
	if (document.frmcnt.date.value=="") {
	 txt = txt + "\n * Date";
	}
	
	if (document.frmcnt.time.value=="") {
	 txt = txt + "\n * Time";
	}
	
	if (document.frmcnt.message.value=="") {
	 txt = txt + "\n * Message";
	}

	
	if (txt) {
		alert ("The folowing fields are required:\n" + txt);
		return false;
	}
	
}