function toursearch_result(page_start) {
	AjaxRequest.send('toursearch_form', '/actions_site.php', 'Идёт загрузка данных...', true, {'_event':'galopom/toursearch_result', 'page_start':page_start});
}
function get_toursearch_info(price_id) {
	if(byId('layer_info_'+price_id).innerHTML == '') {
		AjaxRequest.send('', '/actions_site.php', 'Идёт загрузка данных...', true, {'_event':'galopom/toursearch_info', 'price_id':price_id});
	} else {
		byId('layer_info_'+price_id).innerHTML = '';
	}
}
function resize_description(price_id) {
	if (!byId('hotel_description_'+price_id)) {
		return;
	}
//	byId('hotel_description_'+price_id).style.width = byId('toursearch_page').clientWidth - 200;
}
function show_description(price_id, hotel_id, type) {
	byId('description_'+price_id+'_'+hotel_id).style.display='none';
	byId('photo_'+price_id+'_'+hotel_id).style.display='none';
	
	byId('folder_description_'+price_id+'_'+hotel_id).className='';
	byId('folder_photo_'+price_id+'_'+hotel_id).className='';
	
	byId('folder_'+type+'_'+price_id+'_'+hotel_id).className='selected';
	byId(type+'_'+price_id+'_'+hotel_id).style.display='block';
	byId('hotel_description_'+price_id).scrollTop=0;
}
function getBodyScrollTop() {
	return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
function show_tendency(x, y, param_1, param_2) {
	var obj = document.getElementById('price_history');
	obj.style.top = y + getBodyScrollTop() + 'px';
	obj.style.left = x - 550 + 'px';
	obj.innerHTML = 'Идёт загрузка данных, подождите...';
	AjaxRequest.send('', '/actions_site.php', 'Идёт загрузка данных', true, {'param_1':param_1,'param_2':param_2,'_event':'galopom/toursearch_price_history'});
}
function show_history() {
	document.getElementById('price_history').style.display='block';
	document.getElementById('price_history').innerHTML = document.getElementById('layer_buffer').innerHTML;
}
function hide_history() {
	document.getElementById('price_history').style.display='none';
}
function form_reload(type) {
	AjaxRequest.send('toursearch_form', '/actions_site.php', 'Идёт загрузка данных...', true, {'type':type});
	if (byId('resort_title')) {
		byId('resort_title').style.display='block';
		byId('night_title').style.display='block';
	}
}
var reload_spo_timeout = 0;
function reload_spo() {
	window.clearTimeout(reload_spo_timeout);
	if (byId('toursearch_spo').value.length == 0) {
		byId('layer_spo').innerHTML = '';
	} else {
		reload_spo_timeout = window.setTimeout('form_reload("spo")', 1000);
	}
}
function add_date(obj) {
	var d = obj.value.split('.');
	var d2 = new Date(d[2], d[1], Math.ceil(d[0]) + 2);
	var dday = d2.getDate();
	var dmonth = d2.getMonth();
	var dyear = d2.getFullYear();
	if (dday < 10) dday = '0'+dday;
	if (dmonth == 0) {
		dmonth = 12;
		dyear--;
	}
	if (dmonth < 10) dmonth = '0'+dmonth;
	byId('search_date_to').value = dday+'.'+dmonth+'.'+dyear;
}

