sfHover = function() {
	if (!document.getElementsByTagName) return false;
	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);

jQuery(document).ready(function($) {
	$contactBox = $('#contactLeft');
	$navItems = $('#nav>li.page_item');
	$catItems = $('#nav>li.categories>a');
	
	$contactBox.hover(function(){
		$(this).css({'cursor' : 'pointer'});
	});
	
	$contactBox.click(function () {
		window.location = $(this).find('a').attr('href');
	});
	
	$('.resourceJump').click(function () {
		window.location = $(this).find('a').attr('href');
	});
	
	$('.resourceJump').hover(function(){
		$(this).css({'cursor' : 'pointer'});
	});

	
	//$navItems.find('a').each(smallTextify);
	//$catItems.each(smallTextify);
	
		
	function smallTextify() {
		$navText = $(this).attr('text').split(' ');
		
		if($navText.length>1){
			$newNavText = new String();
			if ($navText[1] == 'of'){
				$newNavText = '<span class="smallNavText">' + $navText[0] + ' ' + $navText[1] + '</span><br /><span class="navText">';
				for (var i = 2; i < $navText.length; i++) {
					$newNavText += $navText[i] + ' ';
				}
			} else {
				$newNavText = '<span class="smallNavText">' + $navText[0] + '</span><br /><span class="navText">';
				for (var i = 1; i < $navText.length; i++) {
					$newNavText += $navText[i] + ' ';
				}
			}
			
			$newNavText += '</span>';
			
			$(this).contents().replaceWith($newNavText);
		}
	}
	
	
	//$navItems.css({'height' : '40px'});
	//$catItems.parent().css({'height' : '40px'});
	//$catItems.css({'padding-bottom' : '0px', 'padding-top' : '0px', 'margin-top' : '11px'});
});