//
function len(field,l,nm)
{
	if(field.value.length>l)
	{
		alert(nm)
		field.focus()
		return false;
	}
	return true;
 }

function required(field,nm)
{
if(field.value == ""){
		alert(nm)
		field.focus()
		return false;
	}
	return true;
}

function alpha(field,nm)
{
var valid = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z, "
if(field.value!="")
{
		var len=field.value.length;
		var chk=field.value;
		for(i=0;i<len;i++)
		{
			x = chk.charAt(i)
			if(valid.indexOf(x) == -1)
			{
				field.focus()
				field.select()
				alert("Invalid value. "+nm+" must have a Alphabets.")
				return false;
			}
		}
}
return true;
}

function numeric(field,nm)
{
var valid = "1234567890.+ -"
if(field.value!="")
{
		var len=field.value.length;
		var chk=field.value;
		for(i=0;i<len;i++)
		{
			x = chk.charAt(i)
			if(valid.indexOf(x) == -1)
			{
				field.focus()
				field.select()
				alert("Invalid value. "+nm+" must have a Numeric entry. Please re-enter")
				return false;
			}
		}
}
return true;
}


function blank(field,nm)
{
if(field.value!=""){

	var crlf="\r\n"
	text=false
	
	var arr=new Array()
	arr=field.value.split(crlf)
	for(j=0;j<arr.length&&!text;j++){
		a=arr[j]
		if ((a!=crlf)){
			for(i=0;i<a.length&&!text;i++){
				str=a.substring(i,i+1)
				if((str!=" ")&&(str!=""))
					text=true
			}
		}
	}

	if (!text){
		alert(nm)
		field.focus()
		return false;
	}
	return true;
}
return true;
}

function lenword(field,nm){
	if (field.value!=""){
		var arr=new Array()
		arr=field.value.split(" ")
		for(i=0;i<arr.length;i++){
			if(arr[i].length>80){
				//alert("Sorry, the word '"+arr[i]+"' is too long.  Please enter another word. [max 70 char]")
				alert("Sorry, the word is too long.  Please enter another word. [one word max 70 char]")
				field.focus()
				return false;
			}
		}
	}

	return true;
 }
 
 
function dateval(sdate){

var val=sdate.value;
if(val != "")
{

if((val.length>10) ||(val.length<8))
{
	alert(" Please enter the date in (mm/dd/yyyy) format. ")
	sdate.focus();
	return false;
}
else {
	slash1=val.indexOf("/")
	if(slash1==-1)
	{
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
	}	
	slash2=val.lastIndexOf("/")
	if((slash2==-1)||(slash2==slash1))
	{
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
	}	
	
	var two=(val.substring(0,slash1));
	if ((two>=0)&&(two<=12))
	{

		mm=two;
	}
	else
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		
		sdate.focus();
		return false;
	}
	two=(val.substring(slash1+1,slash2));

	if ((two>=0)&&(two<=31))
	{
		dd=two;
	}
	else
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		
		sdate.focus();
		return false;
	}
	two=(val.substring(slash2+1,slash2+5));
	if ((two>=1900)&&(two<=2075))
	{
		yy=two;
	}
	else
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")

		sdate.focus();
		return false;
	}

	if(((dd==29)&&(mm==02))||((dd==29)&&(mm==2)))
	{
	
		if(((yy%4)==0)||((yy%400)==0))
		{
		//valid
		}
		else
		{
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
		}
	}
	if (((dd>29)&&(mm==2))||((dd==31)&&((mm==2)||(mm==4)||(mm==6)||(mm==9)||(mm==11))))
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
	}
}	
return true;
}	
return true;
}


function ValidateEMail(objName)
{
	var sobjValue;
	var iobjLength;
	
	sobjValue=objName.value;
	
	iobjLength=sobjValue.length;
	
	iFposition=sobjValue.indexOf("@");
	iSposition=sobjValue.indexOf(".");
	iTmp=sobjValue.lastIndexOf(".");	
	
	if (iobjLength!=0)
	{
		if ((iFposition == -1)||(iSposition == -1))
		{
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;
		}
		else if(sobjValue.charAt(0) == "@" || sobjValue.charAt(0)==".")
		{
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;				
		}
		else if(sobjValue.charAt(iobjLength) == "@" || sobjValue.charAt(iobjLength)==".")
		{
			alert("Please enter the E-Mail address in the proper format");
			objName.focus();
			return false;				
		}	
		else if((sobjValue.indexOf("@",(iFposition+1)))!=-1)
		{	
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;
		}
		else if ((iobjLength-(iTmp+1)<2)||(iobjLength-(iTmp+1)>3))
		{
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;
		}
		else
		{
			return true;
		}		
	}		
}    


function year_validation(field)
{
var valid = "1234567890."
if(field.value!="")
	{
		var len=field.value.length;
		var chk=field.value;
		for(i=0;i<len;i++)
		{
			x = chk.charAt(i)
			if(valid.indexOf(x) == -1)
			{
				field.focus()
				field.select()
				alert("Please enter only numeric values in year field.")
				return false;
			}
		}
		if((chk<1900)||(chk>2075)){
			field.focus()
			field.select()
			alert("Please enter the Year between 1900 to 2075.")
			return false;
		}
		
	}
return true;
}

function notSelected(field,fieldnm)
{
	if (field.selectedIndex == 0)
	{
		alert("Please select the " + fieldnm)
		filed.focus();
		return false;
	}
return true;	
}


<!--
/* Limit form input to a certain number of characters */
function formFldTrunc(fldID,fldLen) {
	if (fldID.value.length > fldLen) fldID.value = fldID.value.substr(0,fldLen);
}
/* Show Product Image Popup */
function showPopup(popURL,popName,popWidth,popHeight) {
	var popWin;
	var popAttr = "width="+popWidth+",height="+popHeight+",resizable=1,scrollbars=1";
	popWin = window.open(popURL,popName,popAttr);
	if (popWin.opener == null) popWin.opener = self;
	popWin.focus();
}
//-->
	function confirmSubmit()
	{
		var agree=confirm("This action can not be undone. Are you sure you want to continue?");
		if (agree)
			return true ;
		else
			return false ;
	}
	
	function CheckAll(formObject) 
	{
		var chk = formObject.checkAll.checked;
		var len = formObject.elements.length;
		for(var i=0; len >i; i++) 
		{
			var elm = formObject.elements[i];
			if (elm.type == "checkbox")
			{
				elm.checked = chk;
			}
		}
	}

//
function len(field,l,nm)
{
	if(field.value.length>l)
	{
		alert(nm)
		field.focus()
		return false;
	}
	return true;
 }

function required(field,nm)
{
if(field.value == ""){
		alert(nm)
		field.focus()
		return false;
	}
	return true;
}

function alpha(field,nm)
{
var valid = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z, "
if(field.value!="")
{
		var len=field.value.length;
		var chk=field.value;
		for(i=0;i<len;i++)
		{
			x = chk.charAt(i)
			if(valid.indexOf(x) == -1)
			{
				field.focus()
				field.select()
				alert("Invalid value. "+nm+" must have a Alphabets.")
				return false;
			}
		}
}
return true;
}

function numeric(field,nm)
{
var valid = "1234567890.+ -"
if(field.value!="")
{
		var len=field.value.length;
		var chk=field.value;
		for(i=0;i<len;i++)
		{
			x = chk.charAt(i)
			if(valid.indexOf(x) == -1)
			{
				field.focus()
				field.select()
				alert("Invalid value. "+nm+" must have a Numeric entry. Please re-enter")
				return false;
			}
		}
}
return true;
}


function blank(field,nm)
{
if(field.value!=""){

	var crlf="\r\n"
	text=false
	
	var arr=new Array()
	arr=field.value.split(crlf)
	for(j=0;j<arr.length&&!text;j++){
		a=arr[j]
		if ((a!=crlf)){
			for(i=0;i<a.length&&!text;i++){
				str=a.substring(i,i+1)
				if((str!=" ")&&(str!=""))
					text=true
			}
		}
	}

	if (!text){
		alert(nm)
		field.focus()
		return false;
	}
	return true;
}
return true;
}

function lenword(field,nm){
	if (field.value!=""){
		var arr=new Array()
		arr=field.value.split(" ")
		for(i=0;i<arr.length;i++){
			if(arr[i].length>80){
				//alert("Sorry, the word '"+arr[i]+"' is too long.  Please enter another word. [max 70 char]")
				alert("Sorry, the word is too long.  Please enter another word. [one word max 70 char]")
				field.focus()
				return false;
			}
		}
	}

	return true;
 }
 
 
function dateval(sdate){

var val=sdate.value;
if(val != "")
{

if((val.length>10) ||(val.length<8))
{
	alert(" Please enter the date in (mm/dd/yyyy) format. ")
	sdate.focus();
	return false;
}
else {
	slash1=val.indexOf("/")
	if(slash1==-1)
	{
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
	}	
	slash2=val.lastIndexOf("/")
	if((slash2==-1)||(slash2==slash1))
	{
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
	}	
	
	var two=(val.substring(0,slash1));
	if ((two>=0)&&(two<=12))
	{

		mm=two;
	}
	else
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		
		sdate.focus();
		return false;
	}
	two=(val.substring(slash1+1,slash2));

	if ((two>=0)&&(two<=31))
	{
		dd=two;
	}
	else
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		
		sdate.focus();
		return false;
	}
	two=(val.substring(slash2+1,slash2+5));
	if ((two>=1900)&&(two<=2075))
	{
		yy=two;
	}
	else
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")

		sdate.focus();
		return false;
	}

	if(((dd==29)&&(mm==02))||((dd==29)&&(mm==2)))
	{
	
		if(((yy%4)==0)||((yy%400)==0))
		{
		//valid
		}
		else
		{
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
		}
	}
	if (((dd>29)&&(mm==2))||((dd==31)&&((mm==2)||(mm==4)||(mm==6)||(mm==9)||(mm==11))))
	{	
		alert(" Please enter the date in (mm/dd/yyyy) format.")
		sdate.focus();
		return false;
	}
}	
return true;
}	
return true;
}


function ValidateEMail(objName)
{
	var sobjValue;
	var iobjLength;
	
	sobjValue=objName.value;
	
	iobjLength=sobjValue.length;
	
	iFposition=sobjValue.indexOf("@");
	iSposition=sobjValue.indexOf(".");
	iTmp=sobjValue.lastIndexOf(".");	
	
	if (iobjLength!=0)
	{
		if ((iFposition == -1)||(iSposition == -1))
		{
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;
		}
		else if(sobjValue.charAt(0) == "@" || sobjValue.charAt(0)==".")
		{
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;				
		}
		else if(sobjValue.charAt(iobjLength) == "@" || sobjValue.charAt(iobjLength)==".")
		{
			alert("Please enter the E-Mail address in the proper format");
			objName.focus();
			return false;				
		}	
		else if((sobjValue.indexOf("@",(iFposition+1)))!=-1)
		{	
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;
		}
		else if ((iobjLength-(iTmp+1)<2)||(iobjLength-(iTmp+1)>3))
		{
			alert("Please enter the E-Mail address in the proper format")
			objName.focus();
			return false;
		}
		else
		{
			return true;
		}		
	}		
}    


function year_validation(field)
{
var valid = "1234567890."
if(field.value!="")
	{
		var len=field.value.length;
		var chk=field.value;
		for(i=0;i<len;i++)
		{
			x = chk.charAt(i)
			if(valid.indexOf(x) == -1)
			{
				field.focus()
				field.select()
				alert("Please enter only numeric values in year field.")
				return false;
			}
		}
		if((chk<1900)||(chk>2075)){
			field.focus()
			field.select()
			alert("Please enter the Year between 1900 to 2075.")
			return false;
		}
		
	}
return true;
}

function notSelected(field,fieldnm)
{
	if (field.selectedIndex == 0)
	{
		alert("Please select the " + fieldnm)
		filed.focus();
		return false;
	}
return true;	
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

	var win = null;
	function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
	}

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

function timeTillDate(whenDay,whenMonth,whenYear) {
    var now = new Date();
    var thisDay = now.getDate(), thisMonth = now.getMonth() + 2, thisYear = y2k(now.getYear());
    var yearsDifference = whenYear - thisYear, monthsDifference = 0, daysDifference = 0, string = '';
	
    if (whenMonth >= thisMonth) monthsDifference = whenMonth - thisMonth;
    else { yearsDifference--; monthsDifference = whenMonth + 12 - thisMonth; }

    if (whenDay >= thisDay)daysDifference = whenDay - thisDay;
    else {
        if (monthsDifference > 0) monthsDifference--;
        else { yearsDifference--; monthsDifference+=11; }
        daysDifference = whenDay + 31 - thisDay;
    }

    if (yearsDifference < 0) return '';

    if ((yearsDifference == 0) && (monthsDifference == 0) && (daysDifference == 0))
        return '';

    if (yearsDifference > 0) {
//        string = yearsDifference;
		yeardifference= yearsDifference*12;
        if (yearsDifference > 1) string;
        string += '';
    }
    
    if (yearsDifference == 0) {
	    yeardifference = 0;
    }
    
    if (monthsDifference > 0) {
    	totalmonth = monthsDifference+yeardifference+2;
        string += totalmonth;
        if (monthsDifference > 1) string;
        string += '';

    }

    if (monthsDifference <= 0) {
    	totalmonth = monthsDifference+yeardifference+2;
        string += totalmonth;
        if (monthsDifference > 1) string;
        string += '';

    }

//    if (daysDifference > 0) {
//        string += daysDifference + ' day';
//        if (daysDifference > 1) string += 's';
//        string += ' ';
//    }

    var difference = Date.UTC(y2k(now.getYear()),now.getMonth(),now.getDate(),now.getHours(),now.getMinutes(),now.getSeconds()) -
                     Date.UTC(y2k(now.getYear()),now.getMonth(),now.getDate(),0,0,0);
                     
    difference = 1000*60*60*24 - difference;

    var hoursDifference = Math.floor(difference/1000/60/60);
    difference = difference - hoursDifference*1000*60*60
    var minutesDifference = Math.floor(difference/1000/60);
    difference = difference - minutesDifference*1000*60
    var secondsDifference = Math.floor(difference/1000);

//    if (hoursDifference > 0) {
//        string += hoursDifference + ' hour';
//        if (hoursDifference > 1) string +='s';
//        string += ' ';
//    }

//    if (minutesDifference > 0) {
//        string += minutesDifference + ' minute';
//        if (minutesDifference > 1) string +='s';
//        string += ' ';
//    }

//    if (secondsDifference > 0) {
//        string += secondsDifference + ' second';
//        if (secondsDifference > 1) string +='s';
//        string += ' ';
//    }

    return string;
}

	function wait()
	{
		document.frmBooking.Submit.disabled=true;
		document.frmBooking.Submit.value='Please Wait....';
	}

	function seats(str)
	{
	document.write("<link rel=stylesheet href=images/styles.css type=text/css><br /><br /><br /><br /><table width=0 border=0 cellpadding=0 cellspacing=0 class=waitBlock><tr><td align=center><div class=div777><div class=wcontents><p><h3><strong>Please wait while we process your request.....</strong></h3></p><br><img src=images/load.gif><br><br><p>This may take a few minutes... please wait.<br /><br /><br /><span class=footer>Powered by: Key2London.com</span></p></div></div></td></tr></table>");
	document.location.href=str;
	}