var activex = ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion) >= 4 )); var CantDetect = ((navigator.userAgent.indexOf('Safari') != -1) || (navigator.userAgent.indexOf('Opera') != -1)); function yahooOopsPopup() { if((navigator.language && navigator.language.indexOf("ja") != -1) || (navigator.systemLanguage && navigator.systemLanguage.indexOf("ja") != -1) || (navigator.userLanguage && navigator.userLanguage.indexOf("ja") != -1)) { var URLtoOpen = "http://messenger.yahoo.com/download/"; } else { var URLtoOpen = "http://messenger.yahoo.com/download/"; } var windowName = "yahoo_oops"; var popW = 900, popH = 700; var scrollB = 'no'; w = screen.availWidth; h = screen.availHeight; var leftPos = (w-popW)/2, topPos = (h-popH)/2; oopswindow = window.open(URLtoOpen, windowName,'width=' + popW + ',height=' + popH + ',scrollbars=' + scrollB + ',screenx=' +leftPos +',screeny=' +topPos +',top=' +topPos +',left=' +leftPos); return false; } if(typeof(detected) == "undefined" && activex) { document.write( [''].join("\n") ); } function yahooCheck() { if(CantDetect) { return true; } else if(!activex) { var yahooMime = navigator.mimeTypes["application/ymsgr"]; detected = true; if(typeof(yahooMime) == "object") { return true; } else { return yahooOopsPopup(); } } else { if(isYahooInstalled()) { detected = true; return true; } } detected = true; return yahooOopsPopup(); } function loadYahooDetection() { if(document.getElementById && document.getElementsByTagName) { if (window.addEventListener) window.addEventListener('load', addYahooDetection, false); else if (window.attachEvent) window.attachEvent('onload', addYahooDetection); } } function addYahooDetection() { var pageLinks = document.getElementsByTagName("a"); for (var i=0; i < pageLinks.length; i++) { if(pageLinks[i].id == 'yahoo_link') { pageLinks[i].onclick = function yChk() { return yahooCheck(); } } } } loadYahooDetection();