function show_services()
{
	var id=document.getElementById('pickup_locations').value;
	//alert(country_id);
	/*var index_of_ = country_id.lastIndexOf('_');
	var sub_location_id = country_id.substr(index_of_+1);
	country_id = country_id.substr(0,index_of_);*/
	
	
	var index_of_ = id.indexOf('_');
	var last_index_of = id.lastIndexOf('_');
	var country_id = id.substr(0,index_of_);
	//alert(country_id);
	var sub_str = id.substr(index_of_+1);
	//alert(sub_str);
	var last_index_of = sub_str.lastIndexOf('_');
	var sub_location_id = sub_str.substr(0,last_index_of);
	//alert(sub_location_id);
	var sub_location = sub_str.substr(last_index_of+1);
	//alert(sub_location);
	if(country_id =='')
	{
		document.getElementById('services').innerHTML='<option value="">Choose one service from the list</option>';
		document.getElementById('services').disabled=true;
		document.getElementById('destinations').innerHTML='<option value="">Choose one destination from the list</option>';
		document.getElementById('destinations').disabled=true;
		document.getElementById('passengers').innerHTML='<option value="">Choose number of passengers from the list</option>';
		document.getElementById('passengers').disabled=true;
		document.getElementById('2').src = 'images/2.gif';
		document.getElementById('3').src = 'images/3.gif';
		document.getElementById('4').src = 'images/4.gif';
		document.getElementById('price_div').innerHTML = '';
		document.getElementById('price_div').style.display='none';
		document.getElementById('quote_button_div').style.display='block';
		/*document.getElementById('show_trip_type').style.display='none';*/
		document.getElementById('center_form_right2').style.color='#CACBC4';
		document.getElementById('center_form_right3').style.color='#CACBC4';
		document.getElementById('center_form_right4').style.color='#CACBC4';
		document.getElementById('center_form_right2').style.visibility='hidden';
		document.getElementById('center_form_right3').style.visibility='hidden';
		document.getElementById('center_form_right4').style.visibility='hidden';
		//document.getElementById('2_form_display').style.display = 'none';
		return false;
	}
	
	document.getElementById('services').disabled=false;
	//alert(location_id);
	//alert('hi');
	document.getElementById('center_form_right2').style.visibility='visible';
	document.getElementById('drop_02').innerHTML = '<img src="images/loding.gif"  border="0" />';
	$.ajax({
				type: "POST",
				url: "includes/booking/show_services.php",
				data: "country_id="+country_id+"&sub_location_id="+sub_location_id+"&sub_location="+sub_location,
				success: function(msg){
					//alert(msg);
						document.getElementById('passengers').innerHTML='<option value="">Choose number of passengers from the list</option>';
						document.getElementById('passengers').disabled=true;
						document.getElementById('destinations').innerHTML='<option value="">Choose one destination from the list</option>';
						document.getElementById('destinations').disabled=true;
						/*document.getElementById('show_trip_type').style.display='none';*/
						
						document.getElementById('drop_02').innerHTML = msg;
						document.getElementById('services').disabled=false;
						document.getElementById('1').src = 'images/1_up.gif';
						//alert(document.getElementById('services').innerHTML);
						document.getElementById('2').src = 'images/2_up.gif';
						document.getElementById('price_div').innerHTML = '';
						document.getElementById('price_div').style.display='none';
						document.getElementById('quote_button_div').style.display='block';
						document.getElementById('3').src = 'images/3.gif';
						document.getElementById('4').src = 'images/4.gif';
						//alert(document.getElementById('center_form_right2').style.color);
						document.getElementById('center_form_right2').style.color='black';
						document.getElementById('center_form_right3').style.color='#CACBC4';
						document.getElementById('center_form_right4').style.color='#CACBC4';
						//document.getElementById('2_form_display').style.display = 'none';
						
				}
				});
}


function show_destinations()
{
	var id=document.getElementById('services').value;
	
	var index_of_ = id.lastIndexOf('_');
	var service_id = id.substr(index_of_+1);
	//alert(service_id);
	id = id.substr(0,index_of_);
	//alert(id);
	if(id =='')
	{
		document.getElementById('destinations').innerHTML='<option value="">Choose one destination from the list</option>';
		document.getElementById('destinations').disabled=true;
		document.getElementById('passengers').innerHTML='<option value="">Choose number of passengers from the list</option>';
		document.getElementById('passengers').disabled=true;
		document.getElementById('3').src = 'images/3.gif';
		document.getElementById('4').src = 'images/4.gif';
		document.getElementById('price_div').innerHTML = '';
		document.getElementById('price_div').style.display='none';
		document.getElementById('quote_button_div').style.display='block';
		/*document.getElementById('show_trip_type').style.display='none';*/
		document.getElementById('center_form_right3').style.color='#CACBC4';
		document.getElementById('center_form_right4').style.color='#CACBC4';
		//document.getElementById('2_form_display').style.display = 'none';
		document.getElementById('center_form_right3').style.visibility='hidden';
		document.getElementById('center_form_right4').style.visibility='hidden';
		return false;
	}
	
	document.getElementById('destinations').disabled=false;
	//alert(id);
	//alert('hi');
	document.getElementById('center_form_right3').style.visibility='visible';
	document.getElementById('drop_03').innerHTML = '<img src="images/loding.gif"  border="0" />';
	$.ajax({
				type: "POST",
				url: "includes/booking/show_destinations.php",
				data: "id="+id+"&service_id="+service_id,
				success: function(msg){
					//alert(msg);
						document.getElementById('passengers').innerHTML='<option value="">Choose number of passengers from the list</option>';
						document.getElementById('passengers').disabled=true;
						/*document.getElementById('show_trip_type').style.display='none';*/
						document.getElementById('drop_03').innerHTML = msg;
						document.getElementById('destinations').disabled=false;
						document.getElementById('3').src = 'images/3_up.gif';
						document.getElementById('price_div').innerHTML = '';
						document.getElementById('price_div').style.display='none';
						document.getElementById('quote_button_div').style.display='block';
						document.getElementById('4').src = 'images/4.gif';
						document.getElementById('center_form_right3').style.color='black';
						document.getElementById('center_form_right4').style.color='#CACBC4';
						//document.getElementById('2_form_display').style.display = 'block';
						
				}
				});
}




function number_of_passengers()
{
	var data=document.getElementById('destinations').value;
	var index_of_ = data.lastIndexOf('_');
	id = data.substr(0,index_of_);
	var text = data.substr(index_of_+1);
	//alert(id);
	if(id =='')
	{
		document.getElementById('passengers').innerHTML='<option value="">Choose number of passengers from the list</option>';
		document.getElementById('passengers').disabled=true;
		document.getElementById('4').src = 'images/4.gif';
		document.getElementById('price_div').innerHTML = '';
		document.getElementById('price_div').style.display='none';
		document.getElementById('quote_button_div').style.display='block';
		//alert();
		/*document.getElementById('show_trip_type').style.display='none';*/
		document.getElementById('center_form_right4').style.color='#CACBC4';
		document.getElementById('center_form_right4').style.visibility='hidden';
		return false;
	}
	document.getElementById('center_form_right4').style.visibility='visible';
	document.getElementById('drop_04').innerHTML = '<img src="images/loding.gif"  border="0" />';
	$.ajax({
				type: "POST",
				url: "includes/booking/show_passengers.php",
				data: "id="+id+"&text="+text,
				success: function(msg){
					//alert(msg);
						/*document.getElementById('show_trip_type').style.display='none';*/
						if(msg == 1)
						{
							alert('Please select different destination!');
							document.getElementById('destinations').options[0].selected = 'selected';
						}
						else
						{
						document.getElementById('drop_04').innerHTML = msg;
						document.getElementById('passengers').disabled=false;
						document.getElementById('4').src = 'images/4_up.gif';
						document.getElementById('price_div').innerHTML = '';
						document.getElementById('price_div').style.display='none';
						document.getElementById('quote_button_div').style.display='block';
						document.getElementById('center_form_right4').style.color='black';
						
						}
				}
				});
	
	
	
}


function show_vehicles()
{
	var id=document.getElementById('passengers').value;
	
	//alert(id);
	if(id =='')
	{
		//document.getElementById('show_trip_type').style.display='none';
		document.getElementById('price_div').innerHTML = '';
		document.getElementById('price_div').style.display='none';
		document.getElementById('quote_button_div').style.display='block';
		
		return false;
	}
	var index_of_ = id.indexOf('_');
	var last_index_of = id.lastIndexOf('_');
	var pri_passengers_id = id.substr(0,index_of_);
	//alert(pri_passenger_id);
	var sub_str = id.substr(index_of_+1);
	//alert(sub_str);
	var last_index_of = sub_str.lastIndexOf('_');
	var vip_passengers_id = sub_str.substr(0,last_index_of);
	var no_of_passengers = sub_str.substr(last_index_of+1);
	//alert(vip_passenger_id);
	//alert(no_of_passengers);
	document.getElementById('price_div').innerHTML = '<div style="padding-left:10px; height:50px; width:100%; padding-top:50px;" align="center"><img src="images/loding.gif" border="0" /></div>';
	$.ajax({
				type: "POST",
				url: "includes/booking/show_vehicles.php",
				data: "pri_passengers_id="+pri_passengers_id+"&vip_passengers_id="+vip_passengers_id+"&no_of_passengers="+no_of_passengers,
				success: function(msg){
					//alert(msg);
						/*document.getElementById('show_trip_type').style.display='none';*/
						
						
						
						document.getElementById('price_div').innerHTML = msg;
						//document.getElementById('4').src = 'images/4_up.gif';
				
				}
				});
	
}


function validate_booking()
{
	if(document.getElementById('pickup_locations').value == "")
	{
		alert("Please choose pick up point!");
		document.getElementById('pickup_locations').focus();
		return false;
	}
	else if(document.getElementById('services').value == "")
	{
		alert("Please choose one service from the list!");
		document.getElementById('services').focus();
		return false;
	}	
	else if(document.getElementById('destinations').value == "")
	{
		alert("Please choose one destinations from the list!");
		document.getElementById('destinations').focus();
		return false;
	}
	else if(document.getElementById('passengers').value == "")
	{
		alert("Please choose number of passengers from the list!");
		document.getElementById('passengers').focus();
		return false;
	}
	
	/*<!--else if(document.getElementById('private_price').value == '')
	{
		//alert(document.getElementById('vip_price').value);
		if(document.getElementById('vip_price').value == '')
		{
			alert("Please click any link to select price for required services (Private Or V.I.P)!");
			return false;
		}
	}-->*/
	
	document.getElementById('price_div').style.display='block';
	document.getElementById('quote_button_div').style.display='none';
}




function open_airport_transfer_form()
{
	document.getElementById('right_form_container').style.display = 'block';
}
function close_airport_transfer_form()
{
	document.getElementById('right_form_container').style.display = 'none';
}

function change_price_private(price)
{
	document.getElementById('private_price').value = price;	
	document.getElementById('vip_price').value = '';
}
function change_price_vip(price)
{
	document.getElementById('vip_price').value = price;	
	document.getElementById('private_price').value = '';
}

/*function show_hide_price(arg)
{
	if(arg == 'vip')
	{
		document.getElementById('private_price').value = '';	
	}
	else if(arg == 'private')
	{
		document.getElementById('vip_price').value = '';	
	}
}*/



function mouse_over1()
{
	document.getElementById('best_rates').style.color = '#e75b5d';
	document.getElementById('regarding').style.color = '#f1f1f1';
	document.getElementById('Adapted_vehicles').style.color = '#f1f1f1';
	document.getElementById('id_3').style.color = '#f1f1f1';
	document.getElementById('id_4').style.color = '#f1f1f1';
	document.getElementById('id_5').style.color = '#f1f1f1';
	document.getElementById('id_6').style.color = '#6aae23';
	document.getElementById('private').style.backgroundImage = 'url(images/private_over.jpg)';
	
}
function mouse_out1()
{
	document.getElementById('best_rates').style.color = '#903738';
	document.getElementById('regarding').style.color = '#666666';
	document.getElementById('Adapted_vehicles').style.color = '#666666';
	document.getElementById('id_3').style.color = '#666666';
	document.getElementById('id_4').style.color = '#666666';
	document.getElementById('id_5').style.color = '#666666';
	document.getElementById('id_6').style.color = '#666666';
	document.getElementById('private').style.backgroundImage = 'url(images/private.jpg)';
}


function mouse_over2()
{
	//alert(document.getElementById('vip').style.background);
	document.getElementById('id2_1').style.color = '#f1f1f1';
	document.getElementById('id2_2').style.color = '#f1f1f1';
	document.getElementById('id2_3').style.color = '#f1f1f1';
	document.getElementById('id2_4').style.color = '#f1f1f1';
	document.getElementById('id2_5').style.color = '#f1f1f1';
	document.getElementById('id2_6').style.color = '#f1f1f1';
	document.getElementById('id2_7').style.color = '#4E9402';
	document.getElementById('vip').style.backgroundImage = 'url(images/vip_over.jpg)';
	
}
function mouse_out2()
{
	document.getElementById('id2_1').style.color = '#666666';
	document.getElementById('id2_2').style.color = '#666666';
	document.getElementById('id2_3').style.color = '#666666';
	document.getElementById('id2_4').style.color = '#666666';
	document.getElementById('id2_5').style.color = '#666666';
	document.getElementById('id2_6').style.color = '#666666';
	document.getElementById('id2_7').style.color = '#666666';
	document.getElementById('vip').style.backgroundImage = 'url(images/vip.jpg)';
}
