var xmlHttp
var clientid="";
var vacationid ="";
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}



/************ This function is used to fetch content 0f level on build your own************/
function getSeries(level,action) {	
	if(level=='' || level=='0'){
		document.getElementById('div_series').innerHTML='';
	}else{
		var strURL="independentLevelSeries.php?level="+level+"&action="+action;
		var req = GetXmlHttpObject();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
						document.getElementById('div_series').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
					document.getElementById('div_series').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;height:25px;width:25px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
	}
}


/************ This function is used to fetch content 0f level on build your own************/
function getgroupSeries(level,action) {	
	if(level=='' || level=='0'){
		document.getElementById('div_series').innerHTML='';
	}else{
		var strURL="groupLevelSeries.php?level="+level+"&action="+action;
		var req = GetXmlHttpObject();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
						document.getElementById('div_series').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
					document.getElementById('div_series').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;height:25px;width:25px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
	}
}


/************ This function is used to fetch content 0f level on build your own************/
function getVacationSeries(level,action) {	
	if(level=='' || level=='0'){
		document.getElementById('div_series').innerHTML='';
	}else{
		var strURL="vacationtLevelSeries.php?level="+level+"&action="+action;
		var req = GetXmlHttpObject();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
						document.getElementById('div_series').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
					document.getElementById('div_series').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;height:25px;width:25px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
	}
}
//============ neelam 2 march 2010 search form validation ========================

function valid_search(){
	
	dep_from = document.search.from.value;
	dep_to   = document.search.to.value;
	
	 if(dep_from==''){
	 alert('Please select depart date start from.');
     document.search.from.focus();
 	 return false; 
 }	
 if(dep_to==''){ 
 	alert('Please select depart date end to.');
 	document.search.to.focus();
 	return false;
 }	
return true;
/*level 	 = document.search.level.value;
 if(level==''){
	 alert('Please select a level of luxury.');
	 document.search.level.focus();
 	 return false;
 }	
*/ 

}


//========= search for indepent tour ==============================


function valid_search_custom(){
	duration 	 = document.search.duration.value;
	
	
	 if(duration==''){
	 alert('Please select duration.');
     document.search.duration.focus();
 	 return false; 
 }	

 return true;

}


function valid_search_main(){
	
	dep_from = document.search_form.from.value;
	dep_to   = document.search_form.to.value;
	
	 if(dep_from==''){
	 alert('Please select depart date start from.');
     document.search_form.from.focus();
 	 return false; 
 }	
 if(dep_to==''){ 
 	alert('Please select depart date end to.');
 	document.search_form.to.focus();
 	return false;
 }	
return true;
/*level 	 = document.search.level.value;
 if(level==''){
	 alert('Please select a level of luxury.');
	 document.search.level.focus();
 	 return false;
 }	
*/ 

}
function valid_search_custom_main(){

duration 	 = document.search_form_main.duration.value;
	 if(duration==''){
	 alert('Please select duration.');
     document.search_form_main.duration.focus();
 	 return false; 
 }	

 return true;

}
//===================vacation search  validation==============================
function valid_search_vacation_main()
{
if(document.search_form_main_vacation.duration.selectedIndex=='') {
	 alert('Please select duration.');
     document.search_form_main_vacation.duration.focus();
 	 return false; 
 }	


}
