// Suckerfish

$(document).ready(function() {
    $("#nav-one li").hover(
		        function() { $("ul", this).fadeIn("fast"); },
		        function() { }
	        );
    if (document.all) {
        $("#nav-one li").hoverClass("sfHover");
        $(".button").hoverClass("hover");
    }
	$(".nav > li:first").addClass('frst');
    
});

$.fn.hoverClass = function(c) {
    return this.each(function() {
        $(this).hover(
			        function() { $(this).addClass(c); },
			        function() { $(this).removeClass(c); }
		        );
    });
};





// Tooltips
function Tooltips() { 
    this.showtip = function(e, message) {
    var x = 0; var y = 0; var m; var h; 
    if (!e) var e = window.event; 
    if (e.pageX || e.pageY) { x = e.pageX; y = e.pageY; }
    else if (e.clientX || e.clientY) { x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; }
    m = document.getElementById('tooltipmap'); m.style.top = y + "px";
    var xp = document.getElementById('viewport').offsetWidth;
    if ((x + 200) < xp) { m.style.left = x + 15 + "px"; }
    else if ((x - 200) < 0) { m.style.left = 0 + "px"; } 
    else { m.style.left = x - 200 + "px"; }
    m.innerHTML = message; m.style.display = "block";
    }
    this.hidetip = function() { var m; m = document.getElementById('tooltipmap'); m.style.display = "none"; }
}
