// JavaScript Document

$(document).ready(function() {	
	// scrift replacement
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
	// IE 6 do nothing
	//$("#naviTwo ul li ul").before("<br clear='both' />");
		$("#prk").css({"display" : "none"});
	} else {
		Cufon.replace('h1');
		Cufon.replace('h2');
		Cufon.replace('#naviOne a');
		Cufon.replace('#sta-ma-contact li');

	// scroll
		if($('.no-scroll').length == 0){
			$(window).scroll( function() {
				var pos = $(window).scrollTop();
				var navScroll = 248;
				// alert(pos);
				if (pos >= navScroll) {
					$("#nav").css( {
						"position" :"fixed",
						"background-color" :"white",
						"top" :"94px"
					});
				} else {
					$("#nav").css( {
						"position" :"relative",
						"top" :"0"
					});
				}
			});
		}
	}
});

// Suckerfish für IE
$(document).ready(function() {
	$("#naviTwo li").hover(function() {
		$("ul", this).fadeIn("fast");
	}, function() {
		if (document.all) {
			$("#naviTwo li").hoverClass("sfHover");
		}
	});
	
});

$.fn.hoverClass = function(c) {
	return this.each(function() {
		$(this).hover(function() {
			$(this).addClass(c);
		}, function() {
			$(this).removeClass(c);
		});
	});
};

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