$(document).ready(function(){

	// Remove focus outline on all links when clicked
	$("a").focus(function(){
	  $(this).blur();
	});
  
	
	// Search box hide/display default text on focus/blur
	$("#s").focus(function() {
		if(this.value == this.defaultValue) {
			this.value = "";
		}
	}).blur(function() {
		if(!this.value.length) {
			this.value = this.defaultValue;
		}
	});
	
	
	// Animated homepage feature
	$("#feature-list h2").hover(function(){
		var $curr = $(this).parent();
		$("#feature-image").html('<img src="/images/feature/' + $(this).attr('title') + '.jpg" />');
		$("#feature-list li").removeClass('on');
		$("#feature-list li").removeClass('noborder');
		$curr.addClass('on');
		$curr.prev().addClass('noborder');
	});
	
	
	// Booking form delegate fields
	$("#frm_booking #fld_places").change(function(){
		$(".target").css('display','none');
		for( i=1; i <= $("#fld_places").val(); i++){
			$("#delegate"+i).css('display','block');
		}
	});
	
	$(".prod-links").toggle(function(){
		var rel = "#" + $(this).attr("rel");
		//$(".submenu:visible").hide();
		$(rel).show("fast");
		return false;
	},function(){
		var rel = "#" + $(this).attr("rel");
		$(rel).hide("fast");
		return false;
	});
	
	var zIndexNum = 20000; /* fix for IE7 (6?) Z-index bug. we set the zindex for all li and divs */
    $('li').each(function(){
        $(this).css('zIndex',zIndexNum);
        zIndexNum -= 5;
    });

    var zIndexNum = 10000;
    $('div').each(function(){
        $(this).css('zIndex',zIndexNum);
        zIndexNum -= 5;
    }); 
	 


});
