$(document).ready(function() {
    $('#slideshow').cycle({
		fx: 'fade',
                speed: 2500
	});

    $(function() {
        var zIndexNumber=1000;
        $('div').each(function(){
            $(this).css('zIndex', zIndexNumber);
            zIndexNumber-=10;
        });
    });

    $(".contact-form input:text, #contact-form textarea").each(function(){
        this.defaultText = this.value;
        $(this).focus(function(){
            if (this.value == this.defaultText) this.value = "";
            $(this).removeClass("default");
        })
        $(this).blur(function(){
            if (this.value == "" && this.defaultText) this.value = this.defaultText;
            $(this).addClass("default");
        });
    });
    $(function(){
        $(".validated-form").validate();
    });

    var name = "#side-tab-container";
    var menuYloc = null;

    menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
    $(window).scroll(function () {
        var offset = menuYloc+$(document).scrollTop()+"px";
        $(name).animate({top:offset},{duration:500,queue:false});
    });
});
