/******************************************** 
` Menu Dropdown
*********************************************/
$(document).ready(function() {
    	function megaHoverOver(){
    		$(this).find(".sub").stop().fadeTo('fast', 1).show();

    	}

    	function megaHoverOut(){ 
    	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
    		  $(this).hide(); 
    	  });
    	}

    	var config = {    
    		 sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)    
    		 interval: 50, // number = milliseconds for onMouseOver polling interval    
    		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
    		 timeout: 50, // number = milliseconds delay before onMouseOut    
    		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
    	};

    	$(".menu-primary ul li .sub").css({'opacity':'100'});
    	$(".menu-primary ul li").hoverIntent(config);
});
/******************************************** 
` Hide Input Fields
*********************************************/
$(document).ready(function() {
        $(":input").focus(function() {
                if(this.value == this.defaultValue) {
                        this.value = "";
                }
        }).blur(function() {
                if(!this.value.length) {
                        this.value = this.defaultValue;
                }
        });     
                
});
/******************************************** 
` Tabs
*********************************************/
$(document).ready(function(){
    $('#tabs > div').hide();
    $('#tabs > div:first').show();
    $('#tabs ul li:first').addClass('active');

    $('#tabs ul li a').live('click', function(){
        $('#tabs ul li').removeClass('active');
        $(this).parent().addClass('active');
        var currentTab = $(this).attr('href');
        $('#tabs > div').hide();
        $(currentTab).show();
        return false;
    });
});

