var reWhiteSpace = /[A-Za-z]+/;
var ValidPhone = /^[0-9\+\-]+[0-9]$/;
var ValidEmail = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
var ValidZip =/^\d{5}([\-]\d{4})?$/;


function validateadmin()
{
	if(window.document.getElementById('editMovietitle').value == "")
	{
		alert("Please enter Movie Title.");
		window.document.getElementById('editMovietitle').value =  "";
		window.document.getElementById("editMovietitle").focus();
		return false;
	}
	if(window.document.getElementById('editMovieeditSlugName').value == "")
	{
		
		alert("Please enter Slug name.");
		window.document.getElementById('editMovieeditSlugName').value =  "";
		window.document.getElementById("editMovieeditSlugName").focus();
		return false;
	}
	
	return true;
}





function checkoption1()
{
		document.getElementById('hdn_a').value =1;
		document.getElementById('hdn_c').value =0;
		document.getElementById('hdn_e').value =0;		
}
function checkoption2()
{
		document.getElementById('hdn_a').value =0;
		document.getElementById('hdn_c').value =1;
		document.getElementById('hdn_e').value =0;
}
function checkoption3()
{
		document.getElementById('hdn_a').value =0;
		document.getElementById('hdn_c').value =0;
		document.getElementById('hdn_e').value =1;
}





function validateContact()
{
	/**
		form validation for support form
	*/
	if(window.document.getElementById('ContactsFirstName').value == "")
	{
		alert("Please enter your first name.");
		window.document.getElementById('ContactsFirstName').value =  "";
		window.document.getElementById("ContactsFirstName").focus();
		return false;
	}
	else if(!reWhiteSpace.test(window.document.getElementById('ContactsFirstName').value))
	{
		alert("Please enter valid first name.");
		window.document.getElementById('ContactsFirstName').value="";
		window.document.getElementById("ContactsFirstName").focus();
		return false;
	}
	
	if(window.document.getElementById('ContactsLastName').value == "")
	{
		alert("Please enter your last name.");
		window.document.getElementById('ContactsLastName').value =  "";
		window.document.getElementById("ContactsLastName").focus();
		return false;
	}
	else if(!reWhiteSpace.test(window.document.getElementById('ContactsLastName').value))
	{
		alert("Please enter valid last name.");
		window.document.getElementById('ContactsLastName').value="";
		window.document.getElementById("ContactsLastName").focus();
		return false;
	}
	if(window.document.getElementById('ContactsEmail').value == "")
	{
		alert("Please enter your email id.");
		window.document.getElementById('ContactsEmail').value="";
		window.document.getElementById("ContactsEmail").focus();
		return false;
	}else if(!ValidEmail.test(window.document.getElementById('ContactsEmail').value))
	{
		alert("Please enter valid email. ");
		window.document.getElementById('ContactsEmail').value="";
		window.document.getElementById("ContactsEmail").focus();
		return false;
	}
	if(window.document.getElementById('ContactsComment').value == "")
	{
		alert("Please enter your comments.");
		window.document.getElementById('ContactsComment').value =  "";
		window.document.getElementById("ContactsComment").focus();
		return false;
	}
	return true;
}

function validateNews()
{
	if(window.document.getElementById('NewsEmail').value == "")
	{
		alert("Please enter your email id.");
		window.document.getElementById('NewsEmail').value="";
		window.document.getElementById("NewsEmail").focus();
		return false;
	}else if(!ValidEmail.test(window.document.getElementById('NewsEmail').value))
	{
		alert("Please enter valid email. ");
		window.document.getElementById('NewsEmail').value="";
		window.document.getElementById("NewsEmail").focus();
		return false;
	}
	if(window.document.getElementById('NewsFirstName').value == "")
	{
		alert("Please enter your first name.");
		window.document.getElementById('NewsFirstName').value =  "";
		window.document.getElementById("NewsFirstName").focus();
		return false;
	}
	else if(!reWhiteSpace.test(window.document.getElementById('NewsFirstName').value))
	{
		alert("Please enter valid first name.");
		window.document.getElementById('NewsFirstName').value="";
		window.document.getElementById("NewsFirstName").focus();
		return false;
	}
	
	if(window.document.getElementById('NewsLastName').value == "")
	{
		alert("Please enter your last name.");
		window.document.getElementById('NewsLastName').value =  "";
		window.document.getElementById("NewsLastName").focus();
		return false;
	}
	else if(!reWhiteSpace.test(window.document.getElementById('NewsLastName').value))
	{
		alert("Please enter valid last name.");
		window.document.getElementById('NewsLastName').value="";
		window.document.getElementById("NewsLastName").focus();
		return false;
	}
}
function validateTheaterAdmin()
{
	if(window.document.getElementById('editTheaterChain').value == "")
	{
		alert("Please enter theater chain.");
		window.document.getElementById('editTheaterChain').value="";
		window.document.getElementById("editTheaterChain").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterSlug').value == "")
	{
		alert("Please enter theater slug.");
		window.document.getElementById('editTheaterSlug').value="";
		window.document.getElementById("editTheaterSlug").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterName').value == "")
	{
		alert("Please enter theater name.");
		window.document.getElementById('editTheaterName').value="";
		window.document.getElementById("editTheaterName").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterPhone').value == "")
	{
		alert("Please enter theater phone number.");
		window.document.getElementById('editTheaterPhone').value="";
		window.document.getElementById("editTheaterPhone").focus();
		return false;
	} else if(!ValidPhone.test(window.document.getElementById('editTheaterPhone').value))
	{
		alert("Please enter valid theater phone number.");
		window.document.getElementById('editTheaterPhone').value = "";
		window.document.getElementById("editTheaterPhone").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterAttributes').value == "")
	{
		alert("Please enter theater attributes.");
		window.document.getElementById('editTheaterAttributes').value="";
		window.document.getElementById("editTheaterAttributes").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterTicketing').value == "")
	{
		alert("Please select theater ticketing.");
		window.document.getElementById('editTheaterTicketing').value="";
		window.document.getElementById("editTheaterTicketing").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterClosed').value == "")
	{
		alert("Please enter theater closed reason.");
		window.document.getElementById('editTheaterClosed').value="";
		window.document.getElementById("editTheaterClosed").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterMarket').value == "")
	{
		alert("Please enter theater market.");
		window.document.getElementById('editTheaterMarket').value="";
		window.document.getElementById("editTheaterMarket").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterScreens').value == "")
	{
		alert("Please enter theater screens.");
		window.document.getElementById('editTheaterScreens').value="";
		window.document.getElementById("editTheaterScreens").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterSeatings').value == "")
	{
		alert("Please enter theater seating capacity.");
		window.document.getElementById('editTheaterSeatings').value="";
		window.document.getElementById("editTheaterSeatings").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterSound').value == "")
	{
		alert("Please enter theater sound.");
		window.document.getElementById('editTheaterSound').value="";
		window.document.getElementById("editTheaterSound").focus();
		return false;
	}
	if(window.document.getElementById('theAddress').value == "")
	{
		alert("Please enter theater street address.");
		window.document.getElementById('theAddress').value="";
		window.document.getElementById("theAddress").focus();
		return false;
	}
	if(window.document.getElementById('theLocation').value == "")
	{
		alert("Please enter theater location.");
		window.document.getElementById('theLocation').value="";
		window.document.getElementById("theLocation").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterCity').value == "")
	{
		alert("Please enter theater city.");
		window.document.getElementById('editTheaterCity').value="";
		window.document.getElementById("editTheaterCity").focus();
		return false;
	}else if(!reWhiteSpace.test(window.document.getElementById('editTheaterCity').value))
	{
		alert("Please enter valid theater city.");
		window.document.getElementById('editTheaterCity').value = "";
		window.document.getElementById("editTheaterCity").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterState').value == "")
	{
		alert("Please enter theater state.");
		window.document.getElementById('editTheaterState').value="";
		window.document.getElementById("editTheaterState").focus();
		return false;
	}else if(!reWhiteSpace.test(window.document.getElementById('editTheaterState').value))
	{
		alert("Please enter theater valid state.");
		window.document.getElementById('editTheaterState').value = "";
		window.document.getElementById("editTheaterState").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterZip').value == "")
	{
		alert("Please enter theater zip.");
		window.document.getElementById('editTheaterZip').value="";
		window.document.getElementById("editTheaterZip").focus();
		return false;
	}else if(!ValidZip.test(window.document.getElementById('editTheaterZip').value))
	{
		alert("Please enter valid theater zip code.");
		window.document.getElementById('editTheaterZip').value = "";
		window.document.getElementById("editTheaterZip").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterCountry').value == "")
	{
		alert("Please enter theater country.");
		window.document.getElementById('editTheaterCountry').value="";
		window.document.getElementById("editTheaterCountry").focus();
		return false;
	}else if(!reWhiteSpace.test(window.document.getElementById('editTheaterCountry').value))
	{
		alert("Please enter theater valid country.");
		window.document.getElementById('editTheaterCountry').value = "";
		window.document.getElementById("editTheaterCountry").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterLatitude').value == "")
	{
		alert("Please enter theater latitude.");
		window.document.getElementById('editTheaterLatitude').value="";
		window.document.getElementById("editTheaterLatitude").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterLongitude').value == "")
	{
		alert("Please enter theater longitude.");
		window.document.getElementById('editTheaterLongitude').value="";
		window.document.getElementById("editTheaterLongitude").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterAdult').value == "")
	{
		alert("Please enter adult ticket cost.");
		window.document.getElementById('editTheaterAdult').value="";
		window.document.getElementById("editTheaterAdult").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterChildPrice').value == "")
	{
		alert("Please enter child ticket cost.");
		window.document.getElementById('editTheaterChildPrice').value="";
		window.document.getElementById("editTheaterChildPrice").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterSenior').value == "")
	{
		alert("Please enter senior ticket cost.");
		window.document.getElementById('editTheaterSenior').value="";
		window.document.getElementById("editTheaterSenior").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterHmmProcessing').value == "")
	{
		alert("Please enter processing login.");
		window.document.getElementById('editTheaterHmmProcessing').value="";
		window.document.getElementById("editTheaterHmmProcessing").focus();
		return false;
	}
	if(window.document.getElementById('editTheaterHmmProcessingPass').value == "")
	{
		alert("Please enter processing password.");
		window.document.getElementById('editTheaterHmmProcessingPass').value="";
		window.document.getElementById("editTheaterHmmProcessingPass").focus();
		return false;
	}
	if(!ValidZip.test(window.document.getElementById('editTheaterCorporateZip').value))
	{
		alert("Please enter valid corporate zip code.");
		window.document.getElementById('editTheaterCorporateZip').value = "";
		window.document.getElementById("editTheaterCorporateZip").focus();
		return false;
	}
	if(!ValidPhone.test(window.document.getElementById('editTheaterCorporatePhone').value))
	{
		alert("Please enter valid corporate phone number.");
		window.document.getElementById('editTheaterCorporatePhone').value = "";
		window.document.getElementById("editTheaterCorporatePhone").focus();
		return false;
	}
}

function checkNews()
{
	if(window.document.getElementById('subscribeInput').value == "" || window.document.getElementById('subscribeInput').value == "Enter Email Address")
	{
		alert("Please enter your email id.");
		window.document.getElementById('subscribeInput').value="Enter Email Address";
		window.document.getElementById("subscribeInput").focus();
		return false;
	}else if(!ValidEmail.test(window.document.getElementById('subscribeInput').value))
	{
		alert("Please enter valid email. ");
		window.document.getElementById('subscribeInput').value="Enter Email Address";
		window.document.getElementById("subscribeInput").focus();
		return false;
	}
}













