var strChUserAgent = navigator.userAgent;
var intSplitStart = strChUserAgent.indexOf("(",0);
var intSplitEnd = strChUserAgent.indexOf(")",0);
var strChStart = strChUserAgent.substring(0,intSplitStart);
var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
var strChEnd = strChUserAgent.substring(strChEnd); 

if(strChMid.indexOf("MSIE 6") != -1)
{
	sfHover = function() {

		var sfEls;
		var i;
		
		sfEls = document.getElementById("resa-menu").getElementsByTagName("LI");
		for ( 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);
}
else
{
	(function($){
		$.fn.superfish = function(o){
			var defaults = {
				hoverClass	: "sfHover",
				delay		: 500,
				animation	: {opacity:"show",height:"show"},
				speed		: "normal"
			},
				over = function(){
					var $$ = $(this);
					clearTimeout(this.sfTimer);
					if (!$$.is("."+o.hoverClass)) {
						$$.addClass(o.hoverClass)
							.find("ul")
								.animate(o.animation,o.speed)
								.end()
							.siblings()
							.removeClass(o.hoverClass);
					}
				},
				out = function(){
					var $$ = $(this);
					this.sfTimer=setTimeout(function(){
						$$.removeClass(o.hoverClass)
						.find("iframe", this)
							.remove();
					},o.delay);
				};
			o = $.extend(defaults, o || {});
			var sfHovAr=$("li",this)
				.hover(over,out)
				.find("a").each(function() {
					var $a = $(this), $li = $a.parents("li");
					$a.focus(function(){ $li.each(over); })
					  .blur(function(){ $li.each(out); });
				}).end();
			$(window).unload(function() {
				sfHovAr.unbind("mouseover").unbind("mouseout");
			});
			return this;
		};
	})(jQuery);
	$(document).ready(function(){
		$("#resa-menu").superfish();
	});
}