/***************************************************************************** * GLOBAL INITIALIZATION *****************************************************************************/ var yg = new Object(); // Set debugging on/off. yg.debugging = false; // Array of init functions. yg.initializers = new Array(); yg.initializerDelays = new Array(); /** * Add initializer function. */ yg.addInitializer = function(initializer, delay) { yg.initializers.push(initializer); yg.initializerDelays.push(delay); } /** * Initialize services. */ yg.init = function() { yg.debug("JavaScript init..."); // Loop trhough initialization functions. for (var i = 0; i < yg.initializers.length; i++) { yg.debug("Initializer " + i); setTimeout(yg.initializers[i], yg.initializerDelays[i]); } } /** * This is just for debugging. */ yg.debug = function(message) { if (yg.debugging) { try { console.log(message); } catch(e) { document.title = message + " " + document.title; } } } /***************************************************************************** * TOOLTIP *****************************************************************************/ var tip = new Object(); tip.toolTipDiv = document.createElement("div"); tip.mouseX = 0; tip.mouseY = 0; tip.AJAX = 1; tip.TEXT = 2; tip.s = function (type, value) { if (type == tip.AJAX) { // Ajax... } else { tip.toolTipDiv.innerHTML = value; } tip.toolTipDiv.style.visibility = "visible"; tip.toolTipDiv.style.display = "block"; } tip.h = function () { tip.toolTipDiv.innerHTML = ""; tip.toolTipDiv.style.visibility = "hidden"; tip.toolTipDiv.style.display = "none"; //document.onmousemove = null; } tip.move = function (e) { // IE. if (navigator.appName == "Microsoft Internet Explorer") { //document.all tip.mouseX = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; tip.mouseY = event.clientY + document.body.scrollTop + document.documentElement.scrollTop; } else if (navigator.appName == "Opera") { tip.mouseX = event.clientX + document.body.scrollLeft; tip.mouseY = event.clientY + document.body.scrollTop; } // Muut. else { tip.mouseX = e.pageX; tip.mouseY = e.pageY; } tip.toolTipDiv.style.left = (tip.mouseX + 10) + "px"; tip.toolTipDiv.style.top = (tip.mouseY + 10) + "px"; if (false) { document.title = navigator.appName + " Mouse position: " + tip.mouseX + "x" + tip.mouseY + ", tip position " + tip.toolTipDiv.style.left + "x" + tip.toolTipDiv.style.top + "."; } } tip.create = function() { yg.debug("Creating tooltip."); var element = document.getElementById("toolTip"); tip.toolTipDiv.style.visibility = "hidden"; tip.toolTipDiv.style.display = "none"; tip.toolTipDiv.className = "toolTip"; tip.toolTipDiv.innerHTML = ""; element.appendChild(tip.toolTipDiv); document.onmousemove = tip.move; } // Add initializer. yg.addInitializer(tip.create); /***************************************************************************** * LEAD FLASH *****************************************************************************/ // Browser plugin support check. var MM_contentVersion = 8; var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0; if ( plugin ) { var words = navigator.plugins["Shockwave Flash"].description.split(" "); for (var i = 0; i < words.length; ++i ) { if (isNaN(parseInt(words[i]))) continue; MM_PluginVersion = words[i]; } var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion; } else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) { document.write('