$(function() {

	$('ul.sf-menu').superfish(); 

	$('#footer .credit').hover(function() {
		$(this).attr("src", $(this).attr("src").replace(".png", "_hover.png"));									
	}, function() {
		$(this).attr("src", $(this).attr("src").replace("_hover.png", ".png"));									
	});
	
	$('#footer_right img').hover(function() {
		$(this).attr("src", $(this).attr("src").replace(".png", "_hover.png"));									
	}, function() {
		$(this).attr("src", $(this).attr("src").replace("_hover.png", ".png"));									
	});
	
	$(".latestNews .newsPreview").slice(1).hide();
	$(".latestNews .links a:eq(0)").mouseover(function() {
		$(".latestNews .newsPreview").hide();
		$(".latestNews .newsPreview:eq(0)").show();
	});
	$(".latestNews .links a:eq(1)").mouseover(function() {
		$(".latestNews .newsPreview").hide();
		$(".latestNews .newsPreview:eq(1)").show();
	});
	$(".latestNews .links a:eq(2)").mouseover(function() {
		$(".latestNews .newsPreview").hide();
		$(".latestNews .newsPreview:eq(2)").show();
	});
	
	if ($(".jobsWidget .comment").size() > 0) {
		setInterval( "jobsWidget()", 5000 );
	}

	// ie6
	if ($.browser.msie && $.browser.version.substr(0,1)==6) {
		$("body").addClass("ie6");
		$("body").addClass("ie7");
		//DD_belatedPNG.fix('.logo,.facebook,.twitter,.youtube,.textclub,.loveit,#leftMenu,#rightLogos,#footer span,.fred,.streamline,.box,.submit,.nivo-directionNav a');
	} else if ($.browser.msie && $.browser.version.substr(0,1)==7) {
		$("body").addClass("ie7");
	}
});

jQuery.fn.outerHTML = function() {
    return $('<div>').append( this.eq(0).clone() ).html();
};


function jobsWidget() {
	$(".jobsWidget").prepend($(".jobsWidget .comment:last-child").outerHTML());
	$(".jobsWidget .comment:first-child").hide().slideDown("slow");
	$(".jobsWidget .comment:last-child").remove();
}
