function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};


$().ready(function($) {
var $search = $('.searchBox');//Cache the element for faster DOM searching since we are using it more than once
original_val = $search.val(); //Get the original value to test against. We use .val() to grab value="Search"
$search.focus(function(){ //When the user tabs/clicks the search box.
if($(this).val()===original_val){ //If the value is still the default, in this case, "Search"
$(this).val('');//If it is, set it to blank
}
})
.blur(function(){//When the user tabs/clicks out of the input
if($(this).val()===''){//If the value is blank (such as the user clicking in it and clicking out)...
$(this).val(original_val); //... set back to the original value
}

});


var $searchWhite = $('.searchWhite');//Cache the element for faster DOM searching since we are using it more than once
original_valWhite = $searchWhite.val(); //Get the original value to test against. We use .val() to grab value="Search"
$searchWhite.focus(function(){ //When the user tabs/clicks the search box.
if($(this).val()===original_valWhite){ //If the value is still the default, in this case, "Search"
$(this).val('');//If it is, set it to blank
}
})
.blur(function(){//When the user tabs/clicks out of the input
if($(this).val()===''){//If the value is blank (such as the user clicking in it and clicking out)...
$(this).val(original_valWhite); //... set back to the original value
}

});

// Tabs
$('#tabs').tabs({
    select: function(event, ui) {
        var url = $.data(ui.tab, 'load.tabs');
        if( url ) {
            location.href = url;
            return false;
        }
        return true;
    }
});

$('#twitterFeed').innerfade({
speed: 1500,
timeout: 10000
});
    $('#resources').jcarousel({
        auto: 5,
        scroll: 1,
        wrap: 'circular',
        initCallback: mycarousel_initCallback
    });
});

 sfHover = function() {
	var sfEls = document.getElementById("main-navigation-inner").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);




