function validate_agent_form()
		{
			
			if (document.agnt.T1.value=="")
			{
				alert("Please enter your username")
				document.agnt.T1.focus();
				return false;
			}

			if (document.agnt.T2.value=="")
			{
				alert("Please enter password")
				document.agnt.T2.focus();
				return false;
			}

					 
			
		}



function chekform()
		{		
					
				if(document.frm.company.value=='')
					{
						alert("Name Should Not Be Blank");
						document.frm.company.focus();
						return false;
						}			

				if(document.frm.address1.value=='')
					{
						alert("Kindly Enter Address");
						document.frm.address1.focus();
						return false;
					}									


				if(document.frm.city.value=='')
					{
						alert("Kindly Enter city");
						document.frm.city.focus();
						return false;
					}														




						if(!validateEmail(document.frm.email.value))
								{
								 alert("Please enter a valid email id"); 
								 document.frm.email.focus();
								 document.frm.email.select();
								 return false;
								}
				

				if(document.frm.number.value=='')
					{
						alert("Kindly Enter the string as shown above ....!");
						document.frm.number.focus();
						return false;
					}									

															
					
					
		} 



		function validate_print_form()
		{
			
			if (document.prnt.T1.value=="")
			{
				alert("Please enter your payment confirmation number..")
				document.prnt.T1.focus();
				return false;
			}


					if(!validateEmail(document.prnt.T2.value))
								{
								 alert("Please enter a valid email id"); 
								 document.prnt.T2.focus();
								 document.prnt.T2.select();								 
								 return false;
								}			
			
		}



		
		function validate_check_out_form()
		{

			if (document.chek_out_form.T1.value=="")
			{
				alert("Please enter your full name..")
				document.chek_out_form.T1.focus();
				return false;
			}
			
			if (document.chek_out_form.T2.value=="")
			{
				alert("Please enter your mobile number.")
				document.chek_out_form.T2.focus();
				return false;
			}			

			if (isNaN(document.chek_out_form.T2.value))
			{
				alert("Please enter numeric value only.")
				document.chek_out_form.T2.focus();
				document.chek_out_form.T2.select();
				return false;
			}						
			

			if (document.chek_out_form.T2.value.length<10)
			{
				alert("Please enter minimum 10 digits for mobile number.")
				document.chek_out_form.T2.focus();
				document.chek_out_form.T2.select();
				return false;
			}	
			
			
					if(!validateEmail(document.chek_out_form.T3.value))
								{
								 alert("Please enter a valid email id"); 
								 document.chek_out_form.T3.focus();
								 document.chek_out_form.T3.select();								 
								 return false;
								}			


			if (document.chek_out_form.T4.value=="")
			{
				alert("Please enter your address")
				document.chek_out_form.T4.focus();
				return false;
			}			


			if (document.chek_out_form.T5.value=="")
			{
				alert("Please enter your city")
				document.chek_out_form.T5.focus();
				return false;
			}			


			if (document.chek_out_form.T6.value=="")
			{
				alert("Please enter your state")
				document.chek_out_form.T6.focus();
				return false;
			}			


			if (document.chek_out_form.T8.value=="")
			{
				alert("Please enter postal code.")
				document.chek_out_form.T8.focus();
				return false;
			}			

			
											
			if (document.chek_out_form.C1.checked==false)
			{
				alert("Please accept Terms & Conditions");
				return false;
			}	



		}




	var cc = 0;	
	function SwapImage1(img_id,bus_id,st_price) 
	{
	
 											var xmlHttp;
                           try
                           { 
                           // Firefox, Opera 8.0+, Safari    
                           xmlHttp=new XMLHttpRequest();    
                           }
                           catch (e)
                           {    
	                           // Internet Explorer    
	                           try
	                           {
	                           xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
	                           }
	                           catch (e)
	                           {      
		                           try
		                           {        
		                           xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
		                           }
		                           catch (e)
		                           {        
		                           alert("Your browser does not support AJAX!");        
		                           return false;        
		                           }      
	                           }    
                           }		
		
		
 				xmlHttp.onreadystatechange=function(a)
				      {   				        
					        if(xmlHttp.readyState==4)
					        {       
					                 if (xmlHttp.responseText)
					                  {																											                  	
																//alert(xmlHttp.responseText);
					                  }
					        }
				      } 		
		

		
		
		if (cc==0)
		{			
  		document.getElementById(img_id).src="images/selected_seat.png";
  		document.ss.B1.disabled=false;  		
  		cc = 1;
  		
										var URL="add_temp_seat_jx.php";  				                
				                URL=URL+"?bus_id="+bus_id; 							                
				                URL=URL+"&seat_id="+img_id; 	
				                URL=URL+"&seat_price="+st_price; 					                						                
				                
				                xmlHttp.open("GET",URL,true);
				                xmlHttp.send(null);    		
  	}
  	else
  		{  			
  			document.getElementById(img_id).src="images/empty_seat.png";
  			document.ss.B1.disabled=true;  		
  			cc = 0;

										var URL="delete_temp_seat_jx.php";  				                
				                URL=URL+"?bus_id="+bus_id; 							                
				                URL=URL+"&seat_id="+img_id; 							                
				                URL=URL+"&seat_price="+st_price; 					                						                
				                
				                xmlHttp.open("GET",URL,true);
				                xmlHttp.send(null);    		
  			
  		}  	
	}


				 
				 	function remove_seat(bus_id,seat_id)
				 	{
				 										var xmlHttp;
                           try
                           { 
                           // Firefox, Opera 8.0+, Safari    
                           xmlHttp=new XMLHttpRequest();    
                           }
                           catch (e)
                           {    
	                           // Internet Explorer    
	                           try
	                           {
	                           xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
	                           }
	                           catch (e)
	                           {      
		                           try
		                           {        
		                           xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
		                           }
		                           catch (e)
		                           {        
		                           alert("Your browser does not support AJAX!");        
		                           return false;        
		                           }      
	                           }    
                           }		
		
		
					 				xmlHttp.onreadystatechange=function(a)
									      {   				        
										        if(xmlHttp.readyState==4)
										        {       
										                 if (xmlHttp.responseText)
										                  {																											                  	
																				//	alert(xmlHttp.responseText);
																				document.getElementById(seat_id).src="a-secure/images/delete.png";
										                  }
										        }
									      } 		
		

		 

											var URL="delete_temp_seat_jx.php";  				                
				                URL=URL+"?bus_id="+bus_id; 							                
				                URL=URL+"&seat_id="+seat_id; 							                				                				                
				                
				                xmlHttp.open("GET",URL,true);
				                xmlHttp.send(null);    		
  			
  		 
			}
				 
				 
 
   

									function validateEmail(email)
                        {
                                                        if (email == "")
                                                        {                                                        
                                                                return false;
                                                        }
                                                        
                                                        
                                                        badStuff = ";:/,' \"\\";
                                                        
                                                        for (i=0; i<badStuff.length; i++)
                                                        {
                                                        badCheck = badStuff.charAt(i)
                                                        if (email.indexOf(badCheck,0) != -1){return false;}
                                                        }
                                                        
                                                        posOfAtSign = email.indexOf("@",1)
                                                        if (posOfAtSign == -1){return false;}
                                                        
                                                        
                                                        if (email.indexOf("@",posOfAtSign+1) != -1){return false;}
                                                        
                                                        posOfPeriod = email.indexOf(".", posOfAtSign)
                                                        if (posOfPeriod == -1){return false;}
                                                        
                                                        if (posOfPeriod+2 > email.length){return false;}
                                                        
                                                        return true;
                                        }       
                       
