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('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('editTheaterTicketing').value == "")
	{
		alert("Please select theater ticketing.");
		window.document.getElementById('editTheaterTicketing').value="";
		window.document.getElementById("editTheaterTicketing").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('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('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;
	}
}

function validateTheaterLocator()
{
	if(window.document.getElementById('promoCode').value == "")
	{
		alert("Please enter the promo code printed on the bottom left hand portion of your certificate exactly as it appears.");
		window.document.getElementById('promoCode').value="";
		window.document.getElementById("promoCode").focus();
		return false;
	}

	if(window.document.getElementById('zipCode').value == "")
	{
		alert("Please enter your zip code.");
		window.document.getElementById('zipCode').value="";
		window.document.getElementById("zipCode").focus();
		return false;
	}
	else if(!ValidZip.test(window.document.getElementById('zipCode').value))
        {
                alert("Please enter valid theater zip code.");
                window.document.getElementById('zipCode').value = "";
                window.document.getElementById("zipCode").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;
	}
}

