 var  from ='';
 var  to ='';
 var  image ='';
  
 var  fid=0;
 var  tid=0;
 var  car=0;
 
 var  gobook=0;
 
/*
function SelPortChange(vAr) {
		$.ajax({
		  url: "ajax.port.php",
		  type:'GET', 
		  data: "para="+vAr,
		  cache: false,
		  beforeSend: function(html) {
			$("#portname").html('<img src="images/ajax.gif"> ');
		  },
		  success: function(html) {
			$("#portname").html(html);
		  }		  
		});					
}
*/

function GetPrice() {

}

function SelCarChange(cAr) {	
		car = cAr;
		cached = false;
		var carimg="<img src='images/"+cAr+".jpg' border=0>";
		$("#carselect").html(carimg);		
		
		if(cAr==0){
			document.getElementById("specs").innerHTML ="";
		}
		
		if(cAr==1){
			document.getElementById("specs").innerHTML ='<div style="margin-left: -10px;"><div id="form_top"><img src="images/blue_top.gif" alt="top" /></div><div id="form_mid"><div style="padding: 10px;">Passenger : 4<br />Total Luggage. : 4<br />Small : 2<br />Medium : 2</div></div><div id="form_bot"><img src="images/blue_bot.gif" alt="bot" /></div></div>';
		}
		
		if(cAr==2){
			document.getElementById("specs").innerHTML ='<div style="margin-left: -10px;"><div id="form_top"><img src="images/blue_top.gif" alt="top" /></div><div id="form_mid"><div style="padding: 10px;"><div>Passenger : 4<br />Total Luggage. : 6<br />Small : 2<br />Medium : 4</div></div><div id="form_bot"><img src="images/blue_bot.gif" alt="bot" /></div></div>';
		}
		
		if(cAr==3){
			document.getElementById("specs").innerHTML ='<div style="margin-left: -10px;"><div id="form_top"><img src="images/blue_top.gif" alt="top" /></div><div id="form_mid"><div style="padding: 10px;"><div>Passenger : 5<br />Total Luggage. : 7<br />Small : 2<br />Medium : 5</div></div><div id="form_bot"><img src="images/blue_bot.gif" alt="bot" /></div></div>';
		}
		
		if(cAr==4){
			document.getElementById("specs").innerHTML ='<div style="margin-left: -10px;"><div id="form_top"><img src="images/blue_top.gif" alt="top" /></div><div id="form_mid"><div style="padding: 10px;"><div>Passenger : 6<br />Total Luggage. : 9<br />Small : 3<br />Medium : 6</div></div><div id="form_bot"><img src="images/blue_bot.gif" alt="bot" /></div></div>';
		}
		
		if(cAr==5){
			document.getElementById("specs").innerHTML ='<div style="margin-left: -10px;"><div id="form_top"><img src="images/blue_top.gif" alt="top" /></div><div id="form_mid"><div style="padding: 10px;"><div>Passenger : 8<br />Total Luggage. : 14<br />Small : 6<br />Medium : 8</div></div><div id="form_bot"><img src="images/blue_bot.gif" alt="bot" /></div></div>';
		}		
		FinalPara();
}

function CarSelect(Car) {
		car = Car;
		document.imahe.src = "images/"+Car+".jpg";			
		FinalPara();
}


function Evaluate(eval) {
			
			
		if (  eval == "frm1" ) { 
		
			from = "postcode";
			fid = $("#fpostcode").attr("value");
			
			document.getElementById("fstation").value="";
			document.getElementById("fairport").value="";			
			
		}	
			
		if ( eval == "frm2") { 
		
			from = "airport";
			fid = $("#fairport").attr("value");
			
			document.getElementById("fstation").value="";
			document.getElementById("fpostcode").value="";
			
		}
		
		if (  eval == "frm3" ) { 
		
			from = "station";
			fid = $("#fstation").attr("value");
			
			document.getElementById("fairport").value="";
			document.getElementById("fpostcode").value="";			
			
		}		
		

		if (  eval == "to1") { 
		
			to = "postcode";
			tid = $("#tpostcode").attr("value");
			document.getElementById("tstation").value="";
			document.getElementById("tairport").value="";				
			
		}	
				
		if (  eval == "to2") { 
		
			to = "airport";
			tid = $("#tairport").attr("value");
			
			document.getElementById("tstation").value="";
			document.getElementById("tpostcode").value="";			
			
		}
		
		if (  eval == "to3") { 
		
			to = "station";
			tid = $("#tstation").attr("value");
			document.getElementById("tairport").value="";
			document.getElementById("tpostcode").value="";			
			
		}
		
		if (  eval == "carsel") { 		
			car = $("#sasakyan").attr("value");			
		}
		
		FinalPara();												
}


function FinalPara() {
	
	fpara = 'from='+from+'&fromid='+fid+'&to='+to+'&toid='+tid+'&car='+car;

		
	//$("#debug").html(fpara);
	
	if ( from !='' || to !='' ) {
	
		$.ajax({
		  url: "prices.php",
		  type:'GET', 
		  data: fpara,
		  cache: false,
		  beforeSend: function(html) {
			$("#price").html('<img src="images/ajaxloading.gif" />');
		  },
		  success: function(html) {
		  
		    if (html[0]!="<") { gobook=1; $("#price").html(''+html); }	else { gobook=0; $("#price").html(html);	}								 
			
			
		  }		  
		});			
	
	
	}
	
	
}

function getURLs() {

	if ( from =='' || to =='' || car=='') {
		alert('Error : Please complete your travel Information!');
		return false;
	}
	
	if (gobook==0)  {
		alert('Preferred travel info is not yet available!');
		return false;
	}
	
	var fpara = 'from='+from+'&fromid='+fid+'&to='+to+'&toid='+tid+'&car='+car;		
	window.location='book.php?'+fpara;
	
}


function opengallery() 
{ 
window.open('gallery.php','jav','width=600,height=530,resizable=no,scrollbars=no'); 
}


function meta(){	
		var meta = document.getElementById('meta')
		if (meta.style.display == 'none') {
		meta.style.display='block';
		meta.style.marginTop='23px';
		} else {
		meta.style.display = 'none';
		}
	}


function ManagePrices(ref) {

	if ( from =='' || to =='') {
		alert('Error : Please Complete Your Selection!');
		return false;
	}
	
	var fpara = 'from='+from+'&fromid='+fid+'&to='+to+'&toid='+tid;		
	window.location='catch_price.php?'+fpara+'&ref='+ref;
	
}

/*function ManagePrices() {
	//origanl na manageprices
	if ( from =='' || to =='' || car=='') {
		alert('Error : Please Complete Your Selection!');
		return false;
	}
	
	var fpara = 'from='+from+'&fromid='+fid+'&to='+to+'&toid='+tid+'&car='+car;		
	window.location='catch_price.php?'+fpara;
	
	
}*/

