jQuery(document).ready(function(){

	/* Fix Nav - hover on last tab */
	jQuery("#nav li:last-child").hover(function () {
    	jQuery("#nav").addClass("hover");
  	}, function () {
    	jQuery("#nav").removeClass("hover");
  	});

	
	/* Feedback Tab */
	jQuery("#subscribe-tab-link").toggle(function(){
		jQuery("#subscribe-tab").show();
	}, function(){
		jQuery("#subscribe-tab").hide();
	});
	
	
	jQuery("#subscribe-tab-cancel").click(function(){
		jQuery("#subscribe-tab").hide();
	});

	/* Add Value on load - clear on click */
	jQuery("input#input_1_1").attr('value','Enter your email address');
	
	/* Input Value */
	jQuery('input').each(function() {
        var default_value = this.value;
        if( jQuery(this).is('.button') || jQuery(this).is('#submit') ){
        	// Do Nothing
        }else{
	        jQuery(this).focus(function() {
	            if(this.value == default_value) {
	                this.value = '';
	            }
	        });
	        jQuery(this).blur(function() {
	            if(this.value == '') {
	                this.value = default_value;
	            }
	        });
		}
    });

    /* Textarea Value */
    jQuery('textarea').each(function() {
    	var default_value = this.value;
    	jQuery(this).focus(function() {
    		if(this.value == default_value) {
                    this.value = '';
             }
    	});
    	jQuery(this).blur(function() {
    		if(this.value == '') {
    			this.value = default_value;
    		}
    	});
    });

		// Feedback Scroll
		/*var   $sidebar   	= jQuery("#subscribe-wrapper"),
	        $window    	= jQuery(window),
	        offset     	= $sidebar.offset(),
	        topPadding 	= 15;

	    $window.scroll(function() {
	        if ($window.scrollTop() > offset.top) {
	            $sidebar.stop().animate({
	                marginTop: $window.scrollTop() - offset.top + topPadding
	            });
	        } else {
	            $sidebar.stop().animate({
	                marginTop: 0
	            });
	        }
	    });*/
	
});
