/* Menu Suckerfish IE fix */

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

$j(document).ready(
	function() {
	// animate show and hide sub ul items //
		$j(" .menu ul ").css( { display : "none"}); // Opera Fix
		$j(" .menu li").hover(
            function() {
            	$j(this).find('ul:first:hidden').css( {
            		visibility : "visible",
            		display : "none"
            		}
            	).animate({
	           		 height: 'show',
	        		 opacity: 'show' 
            	}, 'fast');
            	var pos1 = $j(this).width();
            	var pos2 = $j(this).find('ul:first').width();
            	var pos = pos2 - pos1;
            	$j(this).find('ul:first').css('marginLeft', (pos / 2) * -1)
            }, 
            function() {
//            	$j(this).find('ul:first').fadeOut('slow').slideUp(200);
            	$j(this).find('ul:first').animate({
            		 height: 'hide',
            		 opacity: 'hide' 
            	}, 'fast')
            }
        );
		
		// fade text color on mouseover //
		/*
		$j(".menu a").hover(
			function() {
				if ($j(this).hasClass("current")) {
					$j(this).stop().animate({color : "#FF0000"}, 1500);
				} else {
					$j(this).stop().animate({color : "#FF0000"}, 1500);
				}
			}, 
			function() {
				$j(this).stop().animate({color : "#00FF000"}, 1500);
			}
		);
		*/
	}
);


/* Fancy menu 
var Tsign = {		
	start: function() {
		new YOOFancyMenu($E('ul', 'menu'), { mode: 'move', transition: Fx.Transitions.Expo.easeOut, duration: 700 });
	}	
};

window.addEvent('domready', Tsign.start);
*/
