function myFunction(){
	
	if(document.getElementById("book_checkbox").checked == true){
		
		document.getElementById("book_ticket").style.display = "block";
		
		
	}else{
		
		document.getElementById("book_ticket").style.display = "none";

		 
	}
	
	
	
}


function resetAll(){
	
	document.getElementById("ans_hotel").innerHTML = " ";
	document.getElementById("image_hotel").innerHTML = " ";
	 document.getElementById("book").disabled = true;	
	 document.getElementById("book_ticket").style.display = "none";
}

function selectCountry( countryId, value, menuId )
{
	var country = document.getElementById( countryId );
	var obj = document.getElementById( menuId );
	obj.style.display='none';	
	country.value = value;
	
	return false;
}

function hiddelistCountry( menuId, action )
{

	document.getElementById( menuId ).className = 'display_'+action;	
//	alert( document.getElementById( menuId ).display + "|"+ action);

}

function actionhiddelistCountry( menuId, inputId )
{
/*
	if( inputId )document.getElementById( inputId ).onclick=hiddelistCountry(menuId,'block');	
	var onclick = document.onclick;
	if (typeof window.onclick != 'function')
	{
		document.onclick =  function(){
		hiddelistCountry( menuId, 'none' );	
		}
	} 
		else 
	{
		document.onclick = function(){
		hiddelistCountry( menuId, 'none' );	
		onclick();
		}
	}
*/	
}

function handler_country_ajax( countryId, sityId, menuId ) {
	
	/*
if(document.getElementById('city').value	== 0)
{
document.getElementById('sub_pod').style.display = "none";	
}
*/
	if( document.getElementById( countryId ).value )
	{
		        JsHttpRequest.query(
            '/hand/', // backend
            {
            'lns': document.getElementById('wer1').value,	
			'country_id' : countryId,
			'sity_id' : sityId,			
			'menu_id' : menuId,						
            'country_list': document.getElementById( countryId ).value	
            },


        function(result) {
               // Write errors to the debug div.
                           // Write the answer.
                 if (result) {
                	var html = ''; 
                	for(var i in result){
                		html += result[i]+"<br>";
                		
                	}
					
					if( !sityId )sityId = "city";
					var  obj = document.getElementById( menuId );
                	obj.innerHTML = "";
                    obj.innerHTML = html;
					obj.style.display='block';

                   
                }
            },
            false // do not disable caching
        );
    }
}

function handler_country( countryId, sityId ) {
	
	/*
if(document.getElementById('city').value	== 0)
{
document.getElementById('sub_pod').style.display = "none";	
}
*/
if( !document.getElementById( sityId ) )return;	
	
		        JsHttpRequest.query(
            '/hand/', // backend
            {
             'lns': document.getElementById('wer1').value,	
            'country': document.getElementById( countryId ).value	
                 
            },


        function(result) {
               // Write errors to the debug div.
                           // Write the answer.
                 if (result) {
                	var html = ''; 
                	for(var i in result){
                		html += result[i]+"<br>";
                		
                	}
					
					if( !sityId )sityId = "city";
					
                	document.getElementById( sityId ).innerHTML = "";
                    document.getElementById( sityId ).innerHTML = html;
                   
                }
            },
            false // do not disable caching
        );
    }

function handler() {
	
if(document.getElementById('city').value	== 0)
{
document.getElementById('sub_pod').style.display = "none";	
}
	
	
		        JsHttpRequest.query(
            '/hand/', // backend
            {
             'lns': document.getElementById('wer1').value,	
            'city': document.getElementById('city').value	
                 
            },


        function(result) {
               // Write errors to the debug div.
                           // Write the answer.
                 if (result) {
                	var html = ''; 
                	for(var i in result){
                		html += result[i]+"<br>";
                		
                	}
                	document.getElementById("ans_hotel").innerHTML = "";
                    document.getElementById("ans").innerHTML = html;
                   
                }
            },
            false // do not disable caching
        );
    }
 function hotel_handler() {
 	
if(document.getElementById('hotel').value	== 0)
{
document.getElementById('sub_pod').style.display = "none";	
} 	
 	
	
		        JsHttpRequest.query(
            '/hand/', // backend
            {
            'lns': document.getElementById('wer1').value,	
            'hotel': document.getElementById('hotel').value	
                 
            },


        function(result) {
               // Write errors to the debug div.
                           // Write the answer.
                 if (result) {
                	var html = ''; 
                	for(var i in result){
                		html += result[i];
                	
                	}
                	 document.getElementById("book").style.display = "block";	
                    document.getElementById("ans_hotel").innerHTML = html;
                    document.getElementById('sub_pod').style.display = "block";
                }
            },
            false // do not disable caching
        );
        hotel_image();
    }   

 function hotel_image() {
var html = "Loading..."; 
 document.getElementById("image_hotel").innerHTML = html;
		        JsHttpRequest.query(
            '/hand/', // backend
            {
             'lns': document.getElementById('wer1').value,	
            'hotel_img': document.getElementById('hotel').value	
                 
            },


        function(result) {
               // Write errors to the debug div.

               // Write the answer.
                 if (result) {
             
                		html = result;
                	
                	
                    document.getElementById("image_hotel").innerHTML = html;
                }
            },
            false // do not disable caching
        );
    }
    
    
   function fullimage(img_id) {

ls = document.getElementById("wer1").value;	
	
myopen = window.open("/"+ls+"/imagehack/"+img_id+"/", "im", "toolbar=no,menubar=no,personalbar=no,width=500,height=350,scrollbars=yes,resizable=yes");	
	
	
} 

   function other(img_id) {

ls = document.getElementById("wer1").value;	
	
myopen = window.open("/"+ls+"/other/"+img_id+"/", "other", "toolbar=no,menubar=no,personalbar=no,width=500,height=350,scrollbars=yes,resizable=yes");	
	
	
} 


   function sub(img_id) {

ls = document.getElementById("wer1").value;	
	
myopen = window.open("/"+ls+"/sub/"+img_id+"/", "sub", "toolbar=no,menubar=no,personalbar=no,width=500,height=350,scrollbars=yes,resizable=yes");	
	
	
} 

function check_services(){
	
	ar = {};
	ar['visa_support'] = ' visa_support';
	ar['transfers'] = 'transfers';
	ar['excursions'] = 'excursions';
	ar['local_escort_guide'] = 'local_escort_guide';
	ar['international_air_tickets'] = 'international_air_tickets';
	ar['local_air_tickets'] = 'local_air_tickets';
	
	if(document.getElementById("wer1").value == "en") 
	{
	r = "Uncheck";	
	l = "Check all the services";	
	}else{
			
	r = "Сбросить все";	
	l = "Выбрать все услуги";	
	}
	
	
	for(k in ar){
  		
	if(document.getElementById(''+k+'').checked == true)
	{
	document.getElementById(''+k+'').checked = false;	
	document.getElementById('services').innerHTML = l;
	}else{
	document.getElementById(''+k+'').checked = true;	
	document.getElementById('services').innerHTML = r;
	}
	}
		
   
	
}

function check_cities(){
	
 city = {};
 
 city['tashkent'] = 'tashkent' ;
 city['samarkand'] =	'samarkand' ;
 city['shakhrisabz'] = 'shakhrisabz' ;
 city['bukhara'] =	'bukhara' ;
 city['khiva'] =	'khiva' ;
 city['urgench'] ='urgench' ;
 city['nukus'] =	'nukus' ;
 city['fergana'] =	'fergana' ;
 city['termez'] =	'termez' ;
 
 
 	if(document.getElementById("wer1").value == "en") 
	{
	r = "Uncheck";	
	l = "Check all the cities";	
	}else{
			
	r = "Сбросить все";	
	l = "Выбрать все города";	
	}
 
 
	for(k in city){
	if(document.getElementById(''+k+'').checked == true)
	{
	document.getElementById(''+k+'').checked = false;	
	document.getElementById('cities').innerHTML = l;
	}else{
	document.getElementById(''+k+'').checked = true;	
	document.getElementById('cities').innerHTML = r;
	}	
	}

	
}



   function support() {

//ls = document.getElementById("wer1").value;	
	
myopen = window.open("http://www.tourism.uz/support.php", "support", "toolbar=no,menubar=no,personalbar=no,width=500,height=350,scrollbars=yes,resizable=yes");	
	
	
} 

function setFieldValue( input, value, popup )
{
	var obj = document.getElementById( input );
	obj.value = value;
	var pobj = document.getElementById( popup );
	if( pobj )pobj.style.display = 'none';
	return false;
}

function displayOrNone( id )
{
	var obj = document.getElementById( id );

	if( obj.style.display == 'none' || obj.style.display == '' )obj.style.display='block';
	                            else obj.style.display='none';
								
	return false;
}




