// JavaScript Document
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0 -9]{2,4}$/;
var currency = /^[0-9]$/;
var email_mul=/(([a-zA-Z0-9\-?\.?]+)@(([a-zA-Z0-9\-_]+\.)+)([a-z]{2,3})(\W?[,;]\W?(?!$))?)+$/i;

function valid_pay(theform)
{      
       //alert("good morning");
		if(document.getElementById('name').value=="")
		{
			document.getElementById('name1').innerHTML="<span>enter your full name</span>";
			return false;
		}
		else if(document.getElementById('company').value=="")
		{
		document.getElementById('cname1').innerHTML="<span>enter company name</span>";
	return false;
		}
		else if(document.getElementById('telephone').value=="")
		{
		document.getElementById('telephone1').innerHTML="<span>enter telephone number</span";
	return false;
		}
		
		else if(document.getElementById('email').value=="")
		{
		document.getElementById('email1').innerHTML="<span>enter  email address</span>";
	return false;
		}
		else if(!document.getElementById('email').value.match(emailExp))
		{
		document.getElementById('email1').innerHTML="<span>invalid email address</spn>";
	return false;
		}
		else if(document.getElementById('payfor').value=="")
		{
		document.getElementById('payfor1').innerHTML="<span>enter payment for whom</span>";
	return false;
		}else if(document.getElementById('payfor').value.match(currency))
		{
		document.getElementById('payfor1').innerHTML="<span>enter correct currency</span>";
	return false;
		}
		else if(document.getElementById('amount').value=="")
		{
		document.getElementById('amount1').innerHTML="<span>enter payment amount</span>";
	return false;
		}
else if(document.getElementById('1').checked!=true &&document.getElementById('2').checked!=true)
{
		document.getElementById('method').innerHTML="<span style='width:120px;'>select payment method</span>";
	return false;
}
	else
	return true;
}

function valid_pay_(ctrlName)
{      
      
	   switch(ctrlName)
	   {
		    
			case 'name':
			
				if(document.getElementById('name').value=="")
				{
					document.getElementById('name1').innerHTML="<span>enter your full name</span>";
					return false;
				}
				else
				{
					document.getElementById('name1').innerHTML="";
					return true;
				}				
				break;
			
			case 'company':
			
				if(document.getElementById('company').value=="")
				{
					document.getElementById('cname1').innerHTML="<span>enter  email address</span>";
					return false;
				}
				else
				{
					document.getElementById('cname1').innerHTML="";
					return true;
				}				
				break;
				
			case 'telephone':
			
				if(document.getElementById('telephone').value=="")
				{
					document.getElementById('telephone1').innerHTML="<span>enter telephone number</span>";
					return false;
				}
				else
				{
					document.getElementById('telephone1').innerHTML="";
					return true;
				}				
				break;
				
			case 'email':
			
				if(document.getElementById('email').value=="")
				{
					document.getElementById('email1').innerHTML="<span>enter telephone number</span>";
					return false;
				}
				else if(!document.getElementById('email').value.match(emailExp))
				{
					document.getElementById('email1').innerHTML="<span>invalid email address</spn>";
					return false;
				}
				else
				{
					document.getElementById('email1').innerHTML="";
					return true;
				}				
				break;
				
			
			case 'payfor':
			
				if(document.getElementById('payfor').value=="")
				{
					document.getElementById('payfor1').innerHTML="<span>enter payment for whom</span>";
					return false;
				}
				else if(document.getElementById('payfor').value.match(currency))
				{
					document.getElementById('payfor1').innerHTML="<span>enter correct currency</span>";
					return false;
				}
				else
				{
					document.getElementById('payfor1').innerHTML="";
					return true;
				}				
				break;
				
			case 'amount':
			
				if(document.getElementById('amount').value=="")
				{
					document.getElementById('amount1').innerHTML="<span>enter payment amount</span>";
					return false;
				}
				else
				{
					document.getElementById('amount1').innerHTML="";
					return true;
				}				
				break;
			
			
			
			default:
	   		return true;   
		}
	   
	  
}

function printquote(theform)
{      
       //alert("good morning");
		if(document.getElementById('brief').value=="")
		{
		document.getElementById('brief1').innerHTML="**Please enter your Quote Request Brief**";
	return false;
		}
		else if(document.getElementById('printing').value=="")
		{
		document.getElementById('printing1').innerHTML="**Please Enter Printing Requirement Name**";
	return false;
		}
		else if(document.getElementById('styledesgin').value=="")
		{
		document.getElementById('style').innerHTML="**Please Select the style of design**";
	return false;
		}
		else if(document.getElementById('c1').value=="" || document.getElementById('c2').value=="" || document.getElementById('c3').value=="" || document.getElementById('c4').value=="")
{
		document.getElementById('start').innerHTML="**Please Select any request date**";
	return false;
}
		
	else
	return true;
}
function payment(theform)
{      
       //alert("good morning");
		if(document.getElementById('creditCardNumber').value=="")
		{
		document.getElementById('creditCardNumber1').innerHTML="**Please enter your Credit Card number**";
	return false;
		}
		else if(document.getElementById('firstname').value=="")
		{
		document.getElementById('firstname1').innerHTML="**Please Enter Your first Name**";
	return false;
		}
		else if(document.getElementById('lastname').value=="")
		{
		document.getElementById('lastname1').innerHTML="**Please Enter Your Last Name**";
	return false;
		}
			else if(document.getElementById('lastname').value=="") 
		{
		document.getElementById('lastname1').innerHTML="**Please Enter Your Last Name**";
	return false;
		}
		else if(document.getElementById('straight').value!=true&& document.getElementById('budget').value!=true)
{
		document.getElementById('budget1').innerHTML="**Please Select any budget type**";
	return true;
}
		else if(document.getElementById('cvv2Number').value=="")
		{
		document.getElementById('cvv2Number1').innerHTML="**Please Enter Card Verification Number**";
	return false;
		}
		else if(document.getElementById('cemail').value=="")
		{
		document.getElementById('cemail1').innerHTML="**Please Enter Confirmation E-mail**";
	return false;
		}	
	else if(!document.getElementById('cemail').value.match(emailExp))
	{
		document.getElementById('cemail1').innerHTML="**Please Enter Valid Confirmation E-mail**";
	return false;
		}	
	
	
	else
	return true;
}


function check()
{
var count=document.getElementById('counter').value;
//alert(count);
var check_counter=0;
for(var i=1;i <= count; i++)
{


if(document.getElementById('checkbox2_'+i).checked) //Checks the checked
{
check_counter++;
}
}
//alert(check_counter);
if(check_counter=='0')
{
alert("Please select at least one");
return false;
}
else 
return true;
}




function ordervalid(theform)
{
	//alert("sdfdsfds");
	if(document.getElementById('1').checked!=true &&document.getElementById('2').checked!=true&&document.getElementById('3').checked!=true && document.getElementById('4').checked!=true &&document.getElementById('5').checked!=true && document.getElementById('6').checked!=true &&document.getElementById('7').checked!=true && document.getElementById('8').checked!=true)
		{
			alert("Please Choose the method vehicle first ");
			return false;
		}
if(document.getElementById('11').checked!=true &&document.getElementById('12').checked!=true)
		{
			alert("Please Choose to greet or not");
			return false;
		}		
		
		else
		return true;
}



function postcodess()
{     
	
		if(document.getElementById('second').value=="")
		{
			alert("Please Enter the code of airport");
			document.getElementById('second').focus=true;
			return false;
		}
else

	return true;

}



function suscribe()
{      
       
		if(document.getElementById('suscribe_email').value=="")
		{
		
		alert("Please Enter Email Address for Subscribe");
	return false;
        }
		if(!document.getElementById('suscribe_email').value.match(emailExp))
	{
							   
alert("Please Enter the Valid Email Address");
return false;
	}
	else
	return confirm('Are your Sure You Want To Subscribe?'); 
	return true;
}

function validEmail(theform)
{
	
	if(theform.email.value=="")
		{
			alert("Enter the email address");
			do_blink(theform.email);
			return false;
		}
	else if(!theform.email.value.match(emailExp))
			{alert("Enter the valid email address");
			do_blink(theform.email);
			return false;
		}
		else
		return true;
}


function tempvalid(theform)
{
	//alert("sdfdsfds");
	if(document.getElementById('title').value=="")
		{
			theform.title.focus();
			return false;
		}
		if(theform.content.value=="")
		{
			theform.content.focus();
			return false;
		}
		else
		return true;
}
function subsvalid(theform)
{
		if(document.getElementById('email').value=="")
		{
			theform.email.focus();
			//do_blink(theform.email);
			return false;
		}
		else if(!theform.email.value.match(emailExp))
			{alert("Enter the valid email address");
			//do_blink(theform.email);
			return false;
		}
}
function addairport(theform)
{
		if(document.getElementById('name').value=="")
		{
			theform.name.focus();
			//do_blink(theform.email);
			return false;
		}
		if(document.getElementById('postcode').value=="")
		{
			theform.postcode.focus();
			//do_blink(theform.email);
			return false;
		}
		else
		return true;
		
}

function addcartype(theform)
{
		if(document.getElementById('name').value=="")
		{
			theform.name.focus();
			//do_blink(theform.email);
			return false;
		}
		if(theform.description.value=="")
		{
			theform.description.focus();
			//do_blink(theform.email);
			return false;
		}
		else
		return true;
		
}


function refervalidity(theform)
{
//	alert("sdfdsfds");

if(document.getElementById('sname').value=="")
		{
			theform.sname.focus();
			//do_blink(theform.email);
			return false;
		}
		if(document.getElementById('email').value=="")
		{
			theform.email.focus();
			//do_blink(theform.email);
			return false;
		}
		 if(!theform.email.value.match(emailExp))
			{alert("Enter the valid email address");
			//do_blink(theform.email);
			return false;
		}
		
	if(document.getElementById('remail').value=="")
		{
			theform.remail.focus();
			//do_blink(theform.email);
			return false;
		}
		if(!theform.remail.value.match(email_mul))
			{alert("Enter the valid email address");
			theform.remail.focus();
			//do_blink(theform.email);
			return false;
		}
		if(theform.desc.value=="")
		{
			document.getElementById('desc').focus();
			theform.desc.focus();
			//do_blink(theform.desc);
			return false;
		}
	
		else
		return true;
}
function checkvalidity(theform)
	{
	if(theform.fname.value=="")
		{
			theform.fname.focus();
			//do_blink(theform.uname);
			return false;
		}
		if(theform.lname.value=="")
		{
			theform.lname.focus();
			//do_blink(theform.uname);
			return false;
		}
		else if(theform.email.value=="")
		{
			theform.email.focus();
			return false;
		}
		else if(!theform.email.value.match(emailExp))
			{theform.email.focus();
			return false;
		}
		else if(theform.cemail.value=="")
		{
			theform.cemail.focus();
			return false;
		}
		else if(!theform.cemail.value.match(emailExp))
			{theform.cemail.focus();
			return false;
		}
			else if(theform.email.value!=theform.cemail.value)
		{
			alert("Entered email and confirm email doesnot match");
			return false;
		}
		
	else if(theform.password.value=="")
		{
			theform.password.focus();
			//do_blink(theform.upass);
			return false;
		}
	else if(theform.cpassword.value=="")
		{
		theform.cpassword.focus();
			//do_blink(theform.repass);
			return false;
		}
		else if(theform.password.value!=theform.cpassword.value)
		{
			alert("Entered password and re-password doesnot match");
			return false;
		}
		
		else
			return true;
	}
	function checkfeedvalidity(theform)
{
	//alert("sdfdsfds");
	if(document.getElementById('name').value=="")
		{
		theform.name.focus();
			
			return false;
		}if(document.getElementById('email').value=="")
		{
		theform.email.focus();
			//do_blink(theform.title);
			return false;
		}
		else if(!theform.email.value.match(emailExp))
			{alert("Enter the valid email address");
			//do_blink(theform.email);
			return false;
		}
		if(document.getElementById('subject').value=="")
		{
		theform.subject.focus();
			//do_blink(theform.title);
			return false;
		}
		if(document.getElementById('message').value=="")
		{
	theform.message.focus();
			//do_blink(theform.title);
			return false;
		}
		//alert("sdfdsfds");
	if(document.getElementById('security_code').value=="")
		{
			
			document.getElementById('security_code').focus();
			return false;
		}
	
		else
		return true;
		
		
}
	
	function checkvotevalidity(theform)
	{
	if(theform.fname.value=="")
		{
			theform.fname.focus();
			//do_blink(theform.uname);
			return false;
		}
		if(theform.lname.value=="")
		{
		theform.lname.focus();
			//do_blink(theform.uname);
			return false;
		}
		else if(theform.email.value=="")
		{
			theform.email.focus();
			//do_blink(theform.email);
			return false;
		}
		else if(!theform.email.value.match(emailExp))
			{alert("Enter the valid email address");
			//do_blink(theform.email);
			return false;
		}
	
	else if(theform.phone.value=="")
		{
			theform.lname.focus();
			//do_blink(theform.repass);
			return false;
		}
		
		else if(theform.cmnts.value=="")
		{
			theform.cmnts.focus();
			//do_blink(theform.repass);
			return false;
		}
		
			else
			return true;
	}
	
		function donate(theform)
	{
	if(theform.fname.value=="")
		{
			theform.fname.focus();
			//do_blink(theform.uname);
			return false;
		}
		if(theform.lname.value=="")
		{
		theform.lname.focus();
			//do_blink(theform.uname);
			return false;
		}
		else if(theform.email.value=="")
		{
			theform.email.focus();
			//do_blink(theform.email);
			return false;
		}
		else if(!theform.email.value.match(emailExp))
			{alert("Enter the valid email address");
			//do_blink(theform.email);
			return false;
		}
	
	else if(theform.phone.value=="")
		{
			theform.lname.focus();
			//do_blink(theform.repass);
			return false;
		}
		
		else if(theform.cmnts.value=="")
		{
			theform.cmnts.focus();
			//do_blink(theform.repass);
			return false;
		}
		else if(theform.donation.value=="")
		{
			theform.donation.focus();
			//do_blink(theform.repass);
			return false;
		}
			else
			return true;
	}
	
	
function email(theform)
{
	alert("good");
	
}


	
	function emailtofren(theform)
	{
		if(theform.name.value=="")
		{
			alert("Enter Sender's Name");
			do_blink(theform.name);
			return false;
		}
			
		else if(theform.semail.value=="")
		{
			alert("Enter the sender's email address");
			do_blink(theform.semail);
			return false;
		}
				
	else if(theform.rname.value=="")
		{
			alert("Enter Reciever's Name");
			do_blink(theform.rname);
			return false;
		}
		else if(theform.remail.value=="")
		{
			alert("Enter reciever's email address");
			do_blink(theform.remail);
			return false;
		}
			else if(theform.cmnts.value=="")
		{
			alert("Enter Comments");
			do_blink(theform.cmnts);
			return false;
		}
			
				
		else if(!theform.semail.value.match(emailExp))
			{alert("Enter the valid email address");
			do_blink(theform.semail);
			return false;
		}
		
		else if(!theform.remail.value.match(emailExp))
			{alert("Enter the valid email address");
			do_blink(theform.remail);
			return false;
			}
		else
			return true;
	}

	function checkvalid(theform)
	{
	if(theform.username.value=="")
		{
			alert("Enter Username");
			do_blink(theform.username);
			return false;
		}
		else if(theform.password.value=="")
		{
			alert("Enter the password");
			do_blink(theform.password);
			return false;
		}
			else
			return true;
	}
	
	function checkvalidity_profile(theform)
		{
			if(theform.uname.value=="")
		{
			alert("Enter Username");
			do_blink(theform.uname);
			return false;
		}
		else if(theform.upass.value=="")
		{
			alert("Enter the password");
			do_blink(theform.upass);
			return false;
		}
	else if(theform.repass.value=="")
		{
			alert("Enter the re-password");
			do_blink(theform.repass);
			return false;
		}
		
		else if(theform.repass.value!=theform.upass.value)
		{
			alert("Enter password and re-password doesnot match");
			return false;
		}
		else if(theform.email.value=="")
		{
			alert("Enter the email address");
			do_blink(theform.email);
			return false;
		}
		
		else if(!theform.email.value.match(emailExp))
			{alert("Enter the valid email address");
			do_blink(theform.email);
			return false;
		}
		
			else if(theform.my_story.value=="")
		{
			alert("Enter the description");
			do_blink(theform.my_story);
			return false;
		}
		
		else if(theform.city_name.value=="")
		{
			alert("Enter the city name");
			do_blink(theform.city_name);
			return false;
		}
		
		else 
		return true;
	}
	
	
	function do_blink(field)
{
	var errorcolor="Red";
	field.focus();
	field.select();
	field.style.background=errorcolor;
    field_main=field;
	setInterval("temp()",500);
}