﻿$(document).ready(function() {
    $("ul.sf-menu").supersubs({
        minWidth: 12,   // minimum width of sub-menus in em units 
        maxWidth: 27,   // maximum width of sub-menus in em units 
        extraWidth: 1     // extra width can ensure lines don't sometimes turn over 
        // due to slight rounding differences and font-family 
    }).superfish();  // call supersubs first, then superfish, so that subs are 
    // not display:none when measuring. Call before initialising 
    // containing tabs for same reason. 
});
$.browser.msie6 = $.browser.msie && /MSIE 6\.0/i.test(window.navigator.userAgent) && !/MSIE 7\.0/i.test(window.navigator.userAgent) && !/MSIE 8\.0/i.test(window.navigator.userAgent) && !/MSIE 9\.0/i.test(window.navigator.userAgent);
$("#descriptions").hide();
$("#rollover").show();
var t;
$("#graphic a").hover(
        function() {
            var position = $(this).offset();
            var left = position.left + 30;
            var cssclass = 'right';
            var id = this.href.split("#");
            if ((left + 367) > $(window).width()) {
                left = position.left - 365;
                cssclass = 'left';
            }
            if ($.browser.msie6) {
                cssclass += '-ie';
            }

            var container = $('<div/>').hide().attr('id', 'description').addClass(cssclass).css("top", (position.top - 20) + "px").css("left", (left) + "px").appendTo('body');
            $("<div/>").addClass("top").appendTo(container);
            var content = $("<div/>").addClass("dcontent").appendTo(container);
            $("<div/>").addClass("bottom").appendTo(container);
            content.html('<p>' + $("#" + id[1]).html() + '</p>');
            t = setTimeout(function() { $(container).show(); }, 350);
        },
        function() {
            clearTimeout(t);
            $('#description').hide();
            $('#description').remove();
        }
    ).click(function() {
        return false;
    });

