page=1; targetPage=1;
$(document).ready(function() {
	if($.browser.msie && $.browser.version<"7.0") {
		$('ul.deals li').hover(
			function mOver() { $(this).addClass("hover"); },
			function mOut() { $(this).removeClass("hover"); }
		);
		$("#loading").css("position", "absolute").css("bottom", "30%");
	}
	setClickToLI('ul.deals li');
	$(".pages a").click(loadPage);
	$("#loading").ajaxStop(function() {this.style.display='';});
	$("#loading").ajaxStart(function() {this.style.display='block';});
});
function showFastjumpmenu(controler) {
	$('#'+controler.id+'_menu').slideToggle("medium");
	selector = (controler.id == 'destination') ? '#category_menu' : '#destination_menu';
	$(selector).hide();
	return;
}
function filterLastminute(controler) {
	lastmin = $(controler).attr('checked') ? 'y' : 'n';
	$.post("/travel_deals/session.php", {lastminute:lastmin}, function() {
		document.location.reload();
	});
	return;
}
function loadPage(aObj) {
	page = parseInt(page);
	switch(this.id) {
		case "pagePrev":targetPage = page-1; break;
		case "pageNext":targetPage = page+1; break;
		default:targetPage = targetPage = this.id.replace("page", ""); break;
	}
	$("#dealCont").load("/travel_deals/pagination.php?"+params+targetPage+"&r="+Math.random(), "", function() {
		$(".pages a").click(loadPage);
		page = targetPage;
		setClickToLI('ul.deals:eq(1) li');
	});
	return false;
}
function setClickToLI(selector) {
	$(selector).bind('click',function(event) {
		if(event.target && event.target.parentNode.tagName.toUpperCase()=="A") return true;
		if(event.srcElement && event.srcElement.parentNode.tagName.toUpperCase()=="A") return true;
		lnk = $("a:eq(0)", this).attr('target');
		if(!lnk) return false;
		window.open('/global/'+lnk+'/19/');
		return false;
	});
	return;
}