
var ptf = "/";

$(document).ready(function(){
	if($.browser.msie && $.browser.version < 9)
		return false;
	else
		tooltip();
});
/*****************************************************
*					Aside Menu Img
*****************************************************/
$(document).ready(function(){
	$(".lisbon_regions").hover(function(){
		$("h2",this).stop(true,true);
		$(".lisbon_regions div",this).show();
		$("h2",this).animate({
			'margin-top': '30px'
		}, 300, 'linear', function() {
			// something, something
		});
	});
	$(".lisbon_regions").mouseleave(function(){
		$("h2",this).stop(true,true);
		$(".lisbon_regions div",this).hide();
		$("h2",this).animate({
			'margin-top': '60px'
		}, 300, 'linear', function() {
			// something, something
		});
	});
});

/*****************************************************
*					Menu Active Item
*****************************************************/
$(document).ready(function(){
	var page = $("body").attr("id");
	$("#menu li a."+page).addClass("active");
});

/*****************************************************
*				Golf Packages Filter
*****************************************************/
function show_rounds(what) {
	$(document).ready(function(){
		var child;
		if(what == "all") child = 2;
		else if( what == "5+") child = 6;
		else child = what+1;
		var this_li = $("#zones li:nth-child("+child+")");
		if($(this_li).hasClass("active")){
			// something something
		}
		else{
			$("#zones li").removeClass("active");
			$(this_li).addClass("active");
			if(what == "all"){
				$(".pack").fadeIn();
			}
			else if(what == "5+"){
				$(".pack").show();
				$(".rounds_2").hide();
				$(".rounds_3").hide();
				$(".rounds_4").hide();
			}
			else{
				$(".pack").hide();
				$(".rounds_"+what).show();
				$(".golfcourses_slider").fadeIn();
			}
		}
	});
}
		

/*****************************************************
*					Green Fees Filter
*****************************************************/
function green_fees_zone(zone){
	$(document).ready(function(){
		$('#filter_select_course').html('Loading').load(ptf+'ajax/filter_green_fees_zone.php', { 'stack': zone });
		$('#filter_search_ok').html("<a href='"+ptf+"Lisbon-Green-Fees/"+zone+"'>OK</a>");
	});
}
function set_filter_search_ok(zone, course){
	$(document).ready(function(){
		$('#filter_search_ok').html('Loading').load(ptf+'ajax/filter_green_fees_course.php', { 'stack[]': [zone,course] });
	});
}

/*****************************************************
*				Hotel Filter & Categories
*****************************************************/
function clear_filter(){
	$(document).ready(function(){
		$("#hotel_filter_opt .hotel_catg").removeClass("active");
		$(".hotel").fadeIn("slow");
		$("#error_print").html("");
	});
}

$(document).ready(function(){
	
	$("#hotel_filter_opt .hotel_catg").click(function(){
		if( $(this).hasClass("active") ){
			$(this).removeClass("active");
			var clss = $(this).attr("class");
			if( $(".hotel div").hasClass(clss) ){
				var clss_cln = clss.replace(/ /g, ".");
				$(".hotel").not($(".hotel div."+clss_cln).parent().parent()).fadeIn("slow");
			}
			else{
				$(".hotel").fadeIn("slow");
				$("#error_print").html("");
			}
		}
		else{
			var clss = $(this).attr("class");
			$(this).addClass("active");
			if( $(".hotel div").hasClass(clss) ){
				var clss_cln = clss.replace(/ /g, ".");
				$(".hotel").not($(".hotel div."+clss_cln).parent().parent()).fadeOut("slow");
			}
			else{
				$(".hotel").fadeOut("slow");
				$("#error_print").html("<p style='text-align:center'>No results for your search.</p>");
			}
		}
		$("#filter_opts").addClass("active");
	});
	
	$(".hotel").hover(function(){
		$(".hotel_categories").stop(true,true);
		$(".hotel_categories",this).animate({
			'height': '200px',
			'z-index': '1000'
		}, 300, 'linear', function() {
			// something, something
		});
	});
	
	$(".hotel").mouseleave(function(){
		$(".hotel_categories").stop(true,true);
		$(".hotel_categories",this).animate({
			'height': '35px',
			'z-index': '0'
		}, 300, 'linear', function() {
			// something, something
		});
	});
});


/*****************************************************
*					Hotel Features
*****************************************************/
function div_toggle(menu, clss, div){
	$(document).ready(function(){
		$("#"+menu+" li").removeClass("active");
		$(".it_"+div).addClass("active");
		$("."+clss).hide();
		$('#'+div).fadeIn('slow');
	});
}
function hotel_div_toggle(div){
	div_toggle("hotel_features", "hotel_details", div);
}
function description_toggle(){
	$(document).ready(function(){
		$('.btn_more_info').fadeOut('slow');
		$(".description").animate({
			'height': '100%'
		}, 'slow', 'linear');
	});
}

$(document).ready(function(){
	hotel_div_toggle('activities');
});




