jQuery(document).ready(function () {
    //Dina: I commented out this line because it gives an error. I am not sure what this supposed to do. 
    //tfuse_form(); //controls the contact form locatet in frameork/functons/sendmail.js


    initScoopTooltips();
});

function dropdown_menu()
{
	jQuery("#nav a, .subnav a");
	jQuery(" #nav ul ").css({display: "none", opacity:"0.90"}); // fix for opera browser
	
	jQuery("#nav li").each(function()
	{	
		
		var $sublist = jQuery(this).find('ul:first');
		
		jQuery(this).hover(function()
		{	
			$sublist.stop().css({overflow:"hidden", height:"auto", display:"none"}).slideDown(200, function()
			{
				jQuery(this).css({overflow:"visible", height:"auto"});
			});	
		},
		function()
		{	
			$sublist.stop().slideUp(250, function()
			{	
				jQuery(this).css({overflow:"hidden", display:"none"});
			});
		});	
	});
}

function initScoopTooltips() {
    jQuery(".tooltip-anchor").each(function (i) {

        var tt = jQuery("#tt_" + $(this).attr("id"));
        var name = "scooptooltip";
        jQuery("body").append("<div class='" + name + "' id='" + name + i + "'></div>");
        
        var my_tooltip = jQuery("#" + name + i);
        my_tooltip.html(tt.html());

        my_tooltip.css({ display:"none"});

        jQuery(this).mouseover(function () {
            my_tooltip.css({ opacity: 0.9, display: "none" }).show();
        });

        jQuery(this).mousemove(function (kmouse) {
            my_tooltip.css({ left: kmouse.pageX + 15, top: kmouse.pageY + 15 });

        });

        jQuery(this).mouseout(function () {
            my_tooltip.hide();
        });
    });
}


