// JavaScript Document

	
	function check_available()
	{
	
	//var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
//	email=document.getElementById("txtEmail").value;
//	
//	if(!filter.test(email)){
//	alert("Please enter valid email");
//	document.getElementById("txtEmail").value='';
//	document.getElementById("txtEmail").focus();
//	return false;
//	}
	email=document.getElementById("txtEmail").value;
	var action =  "available";
		 
		 str="action="+action+"&email="+email;
		 var url = "email_available.php?"+str;  
		 
		 
		 
		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(){
				if(xmlHttp.readyState!=4){
					document.getElementById("showResult").innerHTML='';
					return false;
				}
				if(xmlHttp.readyState==4){
					
						dd=xmlHttp.responseText;
						if(dd > 0)
						document.getElementById("showResult").innerHTML='Username already exists.Please try another.';
												
					//alert(xmlHttp.responseText);
				}
			 }
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);  
	
	}
	
	function select_price(value) {
	
	//alert(value);return;
		 
		 
	
	}
	
	function select_pagetype(val)
	{
				
		var action =  "pagetype";
		 
		 str="action="+action+"&pro_type="+val;
		 var url = "prog_type.php?"+str;  
		 
		 
		 
		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(){
				if(xmlHttp.readyState!=4){
					document.getElementById("showResult").innerHTML='';
					return false;
				}
				if(xmlHttp.readyState==4){
					
						/*if(val!='other'){
						document.getElementById("pg_type").style.display='';
						}
						else{
						document.getElementById("pg_type").style.display='none';	
						}*/
						
						if(val=='other'){
						document.getElementById("pg_type").style.display='none';
						}
						
						if(val==''){
						document.getElementById("pg_type").style.display='none';
						}
						
						if(val=='PR'){
							document.getElementById("pg_type").style.display='';
							document.getElementById("pg_name").innerHTML='Program';
						}
						if(val=='EV'){
							document.getElementById("pg_type").style.display='';
							document.getElementById("pg_name").innerHTML='Trip';
						}
						document.getElementById("showResult").innerHTML=xmlHttp.responseText;
												
					//alert(xmlHttp.responseText);
				}
			 }
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);  
	}
	
	
	
	




