function loading_f (){
	Element.show('loading_div');
	$('result').innerHTML = '';
}

function showHide(id) {
	obj = document.getElementById(id);
	obj.style.display = (obj.style.display == "block" ? "none" : "block");
}


function s_getcities(id, lang){
	loading_f();
	new Ajax.Updater('cities_div',
	'/get.php5?do=select_cities&lang=' +lang + '&id=' + id,
	{
	    asynchronous:true,
		onComplete: fun_co = function() {
    	Form.enable('search');
	   	Element.hide('loading_div');}
	})
}

function find_hotels(lang){
	loading_f();
	new Ajax.Updater('result',
	'/get.php5?do=find_hotels&' + Form.serialize( 'search' ),
	{
	    asynchronous:true,
	    onCreate: function(){
	        Form.disable('search');
	    },
        onComplete: fun_co = function() {
    	Form.enable('search');
	   	Element.hide('loading_div');
    }
  })
    return false;
}

function reserve(param, width, same, start)
{
	if (start != undefined)
		$('searchs').startWaiting('waiting');

	if (!width)
		width = 410;

	if (same != undefined)
	    window.location = '/reserve.php5' + param;
	else
		window.open('/reserve.php5' + param, 'whr' + width, 'width=' + width + ',height=700,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=yes,resizable=0,left=20,top=20');
}

function reserve_div(param)
{
	$('searchs').startWaiting('waiting');

	new Ajax.Updater('reserve_div',	'/reserve.php5' + param + '&ajax=1',
	{
		asynchronous:true,
		onComplete: function(t)
		{
			$('searchs').stopWaiting('waiting');
			$('searchs').scrollTo();
			$('reserve_div').innerHTML = t.responseText
			$('searchs').style.height = 'auto';

		}
	})
}

function opens(param, width) {
	if (!width) width = 840;
	window.open(param, 'opener' + width, 'width=' + width + ',height=700,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=yes,resizable=0,left=20,top=20');
	return false
}

function check_b() {
	$('details').show();
	$('reviews').hide();
	$('review_form').hide();
}
function review_b() {
	$('details').hide();
	$('reviews').show();
	$('review_form').hide();
}
function add_review_b() {
	$('review_form').show();
	$('details').hide();
	$('reviews').hide();
}

