function loadScript(url, callback) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = url; // Attach handlers for all browsers var done = false; script.onload = script.onreadystatechange = function() { if( !done && ( !this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; // Continue your code callback(); // Handle memory leak in IE script.onload = script.onreadystatechange = null; head.removeChild( script ); } }; head.appendChild(script); } function z_init_menu() { jQuery("body").append('
 
'); jQuery("head").append(''); jQuery("div#company_menu").html(''); jQuery("div#company_menu").css("top", "-200px"); jQuery("div#company_menu").animate({top: "0"}, 2000); jQuery("li.parent").not(":eq(0)").each(function() { jQuery("ul", this).hide(); jQuery(this).hover( function() { jQuery("div", this).stop(true, true).show(); jQuery("div#company-menu-description").hide(); }, function() { jQuery("div", this).fadeOut("fast"); jQuery("div#company-menu-description").hide(); } ); }); jQuery("div#company_menu li:eq(0) a:eq(0)").hover( function() { jQuery("div#company-menu-description").stop(true, true).fadeIn("fast", function() { jQuery(this).show(); }); }, function() { jQuery("div#company-menu-description").fadeOut("fast", function() { jQuery(this).hide(); }); } ); jQuery("div#company_menu").hover( function() { jQuery("img#first").toggle(); jQuery("img#second").toggle(); jQuery("div#company_menu ul.company_menu li ul").stop(true, true).slideDown("fast", function() { jQuery(this).show(); }); }, function() { jQuery("img#first").toggle(); jQuery("img#second").toggle(); jQuery("div#company_menu ul.company_menu li ul").slideUp("slow", function() { jQuery(this).hide(); }); } ); } if (typeof jQuery == 'undefined') { loadScript("http://zeeland.fi/misc/jquery.js", function(){ jQuery.noConflict(); z_init_menu(); }); } (function($){ $(function(){ z_init_menu(); }); // end of document ready })(jQuery); // end of jQuery name space