function isEmpty (el) {
  return el.value.match(/^\s*$/)
}

$(document).ready(function () {
	$('.change-bg').hover(function () {$(".change-bg").animate({ backgroundPosition: "100% 0"}, 300 );}, 
		function () {$(".change-bg").animate({ backgroundPosition: "0 0"}, 100 );}
	);
	//$(".answer").first().slideToggle("normal");
	$(".h").click(function()
	{
		$(this).next(".hide-enable-block").slideToggle("normal");
	});
	$(".uni-h").click(function()
	{
		$(this).next(".uni-hide-enable-block").slideToggle("normal");
	});
	$(".hotel-page .h").click(function()
	{
		$(this).prev(".hide-enable-block").slideToggle("normal");
		if($(this).prev(".hide-enable-block").length)
			if($(this).find("a").text()=="More") {$(this).find("a").text("Minimise");} else {$(this).find("a").text("More");}
	});
	$(".question").click(function()
	{
		$(this).next(".answer").slideToggle("normal");
	});
	$(".more-hotels").click(function()
	{
		$(this).next(".more-hotels-block").slideToggle("normal");
		if($(".more-hotels a").text()=="More hotels") {$(".more-hotels a").text("Minimise");} else {$(".more-hotels a").text("More hotels");}
	});
	
	/* calendar on index page */
	$(".news-interview-block .calendar .date").css("width","55px").css("height", "50px").css("paddingTop", "10px");
	$(".news-interview-block .calendar li div").css("width","280px").css("height", "60px");
	$(".news-interview-block .calendar li").hover(function() {
		$(this).find(".date").stop(true, true).animate({width: "63px", height: "54px", paddingTop: "14px"}, "fast");
		$(this).find("div").stop(true, true).animate({width: "288px", height: "68px", top: "-4px", left: "-4px"},
		"fast");
		$(this).find("p").stop(true, true).animate({"margin-left":"71px", "padding-top":"9px"}, "fast");
		return false;
	}, function() {
		$(this).find(".date").stop(true, true).animate({width: "55px", height: "50px", paddingTop: "10px"}, "fast");
		$(this).find("div").stop(true, true).animate({width: "280px", height: "60px", top: "0px", left: "0px"}, "fast");
		$(this).find("p").stop(true, true).animate({"margin-left":"67px", "padding-top":"5px"}, "fast");
		return false;
	});
	
	/* uni village on index page */
	$('.i-village-image').hover(
		function() {
			if($(this).find(".i-village-description").is(':hidden')){
				$(this).find(".i-village-description").slideDown(400);
			}
		}, 
		function() {
			if($(this).find(".i-village-description").is(':visible')){
				$(this).find(".i-village-description").slideUp(400);
			}
		}
	);
	
	var quote_height = 0;
	quote_height = $('.i-quote .quote > div').height();
	quote_height2 = $('.i-quote .quote2 > div').height();
	/* quote block on index page */
	$('.i-quote .quote').hover(
		function() {
			$(this).find("div").stop(true, true).animate({height: quote_height, paddingBottom: "7px"}, "fast");
		}, 
		function() {
			$(this).find("div").stop(true, true).animate({height: "83px", paddingBottom: "3px"}, "fast");
		}
	);
	$('.i-quote .quote').animate({height: "83px", paddingBottom: "3px"}, "fast");
	
	/* quote block on index page */
	$('.i-quote .quote2').hover(
		function() {
			$(this).find("div").stop(true, true).animate({height: quote_height2, paddingBottom: "7px"}, "fast");
		}, 
		function() {
			$(this).find("div").stop(true, true).animate({height: "83px", paddingBottom: "3px"}, "fast");
		}
	);
	$('.i-quote .quote2').animate({height: "83px", paddingBottom: "3px"}, "fast");
	
	var rel_val=1;
	$(".uf_prev").hide();
	
	function show_hide_link(rel_val_param){
		if(rel_val_param==1){$(".uf_prev").hide(); $(".uf_next").show();}
			else if(rel_val_param==6){$(".uf_next").hide(); $(".uf_prev").show();} else {$(".uf_prev").show(); $(".uf_next").show();}
	}
	
	function show_hide_block(rel_val_param){
		$(".uf_steps").removeClass("ufs_active");
		$("#uf_step"+rel_val_param).addClass("ufs_active");
		$(".uf_pager li").removeClass("ufp_active");
		$(".uf_pager"+rel_val_param).addClass("ufp_active");
	}
	
	/*$(".uf_pager li").click(function(){
		var rel_val=$(this).attr('rel');
		
		show_hide_link(rel_val);
		show_hide_block(rel_val);
	})*/
	
	$(".uf_next").click(function(){
		rel_val=rel_val+1;
		show_hide_link(rel_val);
		show_hide_block(rel_val);		
	})
	$(".uf_prev").click(function(){
		rel_val=rel_val-1;
		show_hide_link(rel_val);
		show_hide_block(rel_val);
	})
});
/*$(document).ready(function(){

	$(".games-index ul a").append("<em></em>");
	
	$(".games-index ul a").hover(function() {
		$(this).find("em").stop(true, true).animate({opacity: "show", top: "0"}, "slow");
		$(this).find("em").css({display: "block"});
		var hoverText = $(this).attr("title");
	    $(this).find("em").text(hoverText);
	}, function() {
		$(this).find("em").stop(true, true).animate({opacity: "hide", top: "-35"}, "fast");
	});


});*/
