$(document).ready(function() {

	$('#search').focus(function () {
		if ($(this).val() == $(this).attr("title")) {
			$(this).val("");
		}
	}).blur(function () {
		if ($(this).val() == "") {
			$(this).val($(this).attr("title"));
		}
	});
	
	$('#hero-inner').after('<div id="slide-nav">').cycle({ 
			speed:    1500, 
			fx:      'fade',
    		timeout:  7000,
    		pause:	true,
			pager:  '#slide-nav',
			delay: -1000
	});
	
	// Enable no-side if the side-bar is empty
	var side_html = $('#side').html();
	if($.trim(side_html) == '') {
		$('body').addClass('no-side');
	}
});

/* hover menus */

sfHover = function() {
	var sfEls = document.getElementById("nav").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);
