$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { 
				if ($.browser.msie && parseInt($.browser.version)==7) {  // workaround pro IE7
					$(this).siblings().removeClass(c); 
				}
				$(this).addClass(c); 
			},
			function() {
				if (!$.browser.msie || parseInt($.browser.version)!=7) {  // ostatni prohlizece
					$(this).removeClass(c); 
				}
			}
		)
		if ($.browser.msie && parseInt($.browser.version)==7) { // workaround pro IE7
			$(this).click(function() { $(this).removeClass(c); });
		}
	});
	
};


$(document).ready(function(){
													 
	if ($.browser.msie && parseInt($.browser.version)==7) {  // workaround pro IE7
		$("#left").mouseover(function() { $('li').removeClass('sys_active'); });
		$("#middle").mouseenter(function() { $('li').removeClass('sys_active'); });
	}
	
	$("body").addClass("js"); // add class to body to show we have javascript

	// first/last item fixes (for IE)
	$("#header .sys_left ul li:last-child, #homepage #spotlights .sys_spotlight ul li:last-child, #internal #internalNav ul li:last-child, #internal #main #pageTools ul li:last-child, #footer ul li:last-child").addClass("sys_last");
	$("#internal #internalNav ul li:first-child, #internal #content .sys_relatedRight h2:first-child, #internal #content .sys_relatedRight ul li:first-child").addClass("sys_first");


	// rollover fix (for IE6)
	if ($.browser.msie && parseInt($.browser.version)==6) $("#menu ul li:not(li li)").hoverClass("sys_active"); //, #peopleLookUp tr

	// add 'rollover' class to links when a rollover box is open
	$("#menu ul li div.sys_rollover").each(function (i) {
		$(this).parent().mouseover(function (i) {
			$(this).attr("id","rollover");
			// check if next or prev LIs have 'on' state
			// remove left/right bar if so
		//	if($(this).prev().attr("id") == "mmOn") {
		//		$(this).addClass("sys_leftFix");
		//	};
		//	if($(this).next().attr("id") == "mmOn") {
		//		$(this).addClass("sys_rightFix");
		//	};
		}).mouseout(function (i) {
			$(this).removeAttr("id","rollover");//.removeClass("sys_leftFix").removeClass("sys_rightFix")
		});
	});

})
