﻿/*
Watermarks

This does the watermarking for input boxes, use the watermark class on
labels, watermarkJS is added so you can position the label over the input
*/

$(function(){

	$('label.watermark').addClass("watermarkJS");
	$('label.watermark').each(function(index,label){
	    eleInput = $('#'+$(label).attr("for"))[0];
	    
	    if(eleInput.value != "")
	    {
	        $(label).hide();
	    }
	    
	    $(eleInput).blur(function(){
	        eleInput = $('#'+$(label).attr("for"))[0];
	        if(eleInput.value == "")
	        {
	            $(label).show();
	        }
	    });
	    $(eleInput).focus(function(){
	        eleInput = $('#'+$(label).attr("for"))[0];
	        $(label).hide();
	    });
	    
	});
	
});     
/*
End Watermarks
*/


//$(".currentpage-home_the-park #rightColumn #parkAreas a.parkOverlay").




$(function() {
    
    //All - nav menu open hovers
    $("#nav ul > li").hover(function() {
        $(this).children("div.yuimenu").children("div.bd").children("ul").addClass("menuOpen");
    },
    function() {
        $(this).children("div.yuimenu").children("div.bd").children("ul").removeClass("menuOpen");
    });
    
    //All - menu module, hide empty divs
    $(".navTree").children().each(function(i, ele) {
        if ($(ele).text() == "")
            $(ele).hide();
    });

    //All - countdown page header
    $("#header #countdown").countdown({until: new Date(2012, 4 - 1, 30), format: 'W', 
		layout: '<span class="countdown_row"><span class="countdown_section"><span class="countdown_amount">{w100}</span></span><span class="countdown_section"><span class="countdown_amount">{w10}</span></span><span class="countdown_section"><span class="countdown_amount">{w1}</span></span></span>'});

	//Homepage - columns hover
    $(".currentpage-home a.overlay").hover(function() { $(this).parent(".col").css("background","#C50077"); }, function() { $(this).parent(".col").css("background","#003529"); });

    //About - gallery image hovers
    $("#galleryThumbs .galleryImage").each(function(i) {
        $(this).bind("click",i,function(event) {
            $("#galleryMainImages div").hide();
            $("#galleryMainImages div .ai"+(event.data+1)).parent("div").show();
            return false;
        });
    });
    
    //About - gallery, show controls if more than 12
    if ($("#galleryThumbs .page .gi13").length != 0)
        $("#galleryControls").show();
        

    //About - gallery image paging
    $("#galleryThumbs").cycle({ fx: 'none', timeout: 0, next: "#rightArrow", prev: "#leftArrow", pager: "#pager" });
    
    
    //Attractions - gallery image hovers
    $("#articlesPics img").eq(0).show();

    $("#galleryThumbs .galleryImage").each(function(i) {
        $(this).bind("click",i,function(event) {
            $("#articlesPics img").hide();
            $("#articlesPics #pap"+(event.data+1)).show();
        });
    });
	
	//Events - if no items, default message
	//if ($("#sectionId_22 div.EventNewsRow").length < 1)
		//$("#sectionId_22 div.moduleInnerContent").prepend("<h4 class='noEvents'>No upcoming events</h4>");

	$('#sectionId_139').each(function(index,ele){
	    swfobject.embedSWF("/Templates/Default/map.swf?id=jsddffj7", "sectionId_139", "940", "298", "8.0.0", "/Templates/Default/Images/expressInstall.swf");
	});    

});



