if (typeof(prependDomain) == "undefined") { prependDomain = ""; } /** * Set, Get, and Delete Cookie utils * */ function GetCookieUtil (name) { var result = null; var myCookie = " " + document.cookie + ";"; var searchName = " " + name + "="; var startOfCookie = myCookie.indexOf(searchName); var endOfCookie; if (startOfCookie != -1) { startOfCookie += searchName.length; endOfCookie = myCookie.indexOf(";", startOfCookie); result = unescape(myCookie.substring(startOfCookie, endOfCookie)); } return result; } function SetCookieUtil (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "; path=/") + ((domain) ? "; domain=" + domain : "; domain="+document.location.hostname) + ((secure) ? "; secure" : ""); } function DeleteCookieUtil (name,path,domain) { if (GetCookieUtil(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } var today = new Date(); var oneDay = new Date(today.getTime() + 24 * 60 *60 * 1000); var oneYear = new Date(today.getTime() + 24 * 60 *60 * 1000 * 365); /***** droplet src="/sitewide/droplets/downloadPop.jhtml" *****/ /***** MEDIAPLAYER LAUNCH SCRIPTS *****/ if (typeof additionalVals == "undefined") { additionalVals=""; } function launchVideo(clipy){ prependDomain = ""; players = new Array(); player = "defaultPlayer"; players['defaultPlayer'] = new Array("mtvmediaplayer","720","540"); clipyNew = clipy clipy = clipyNew if(clipyNew.indexOf('channelID=')<0 && window.channelID) clipy = clipy + "&" + "channelID=" + channelID if(clipyNew.indexOf('orgID=')<0 && window.orgID) clipy = clipy + "&" + "orgID=" + orgID if(clipyNew.indexOf('gateway=')<0 && window.gateway) clipy = clipy + "&" + "gateway=" + gateway if(clipyNew.indexOf('portal=')<0 && window.portal) clipy = clipy + "&" + "portal=" + portal; if(clipyNew.indexOf('paid=')<0 && window.paid) clipy = clipy + "&" + "paid=" + paid if(clipyNew.indexOf('seriesID=')<0 && window.seriesID) clipy = clipy + "&" + "seriesID=" + seriesID if(clipyNew.indexOf('episodeID=')<0 && window.episodeID) clipy = clipy + "&" + "episodeID=" + episodeID if(clipyNew.indexOf('albumid=')<0 && window.albumid) clipy = clipy + "&" + "albumid=" + albumid ap = "&adPth=" + escape(""); ap = ap.substring(0,ap.length-17); ap = ap + "&adPN=" + escape(""); refURL = document.location.pathname; pieces = refURL.split("/"); if (pieces.length == 2) pieces[1] = "home"; var ss = ''; for (var i = 1; i < pieces.length; i++) { sIndex = i - 1; ss = ss + "§ion_" + sIndex + "=" + pieces[i]; } ss = ss + "&refURL=" + refURL; clipy = clipy.replace(/'/g,'\\\'') attSw = 'no'; if(document.referrer.indexOf("yahoo")>=0) additionalVals += '&partner=yahoo'; sUrl = prependDomain + "/sitewide/apps/mediaplayer/index.jhtml?" + clipy + ss + ap + additionalVals; attrs = 'width=' + players[player][1] + ','; attrs += 'height=' + players[player][2] + ','; attrs += 'left=25,top=25,'; attrs += 'scrollbars=' + attSw + ',resizable=' + attSw + ',toolbar=' + attSw + ',location=' + attSw + ',directories=' + attSw + ',status=' + attSw + ',menubar=' + attSw; var pWin = false; pWin = window.open(sUrl, players[player][0], attrs); // popCheck(pWin); // pWin.focus(); } { function launchTrailer(stuff){ launchVideo(stuff) } } /***** URGE LAUNCH SCRIPTS *****/ var urge_referrer = "[no referrer provided]"; /************************************************************************* * URGE Launch: Launch the URGE player *************************************************************************/ function launchUrge (paramString) { var hash = {}; var pairs = paramString.split("&"); for (var i=0;i= 4) && (navigator.platform == "Win32")) || (this.os.indexOf("win32") != -1) || (this.os.indexOf("32bit") != -1)); //mac os this._isMac = (this.getOs().indexOf("mac") != -1); this._isMac68K = (this.isMac() && ((this.getOs().indexOf("68k") != -1) || (this.getOs().indexOf("68000") != -1))); this._isMacPPC = (this.isMac() && ((this.getOs().indexOf("ppc") != -1) || (this.getOs().indexOf("powerpc") != -1))); this._isMacOS8 = (this.isMac() && ((this.getOs().indexOf("os 8") != -1) || (this.getOs().indexOf("os8") != -1))); this._isMacOS9 = (this.isMac() && ((this.getOs().indexOf("os 9") != -1) || (this.getOs().indexOf("os9") != -1))); this._isMacOSX = (this.isMac() && ((this.getOs().indexOf("powerpc") != -1) || (this.getOs().indexOf("osx") != -1) || (this.getOs().indexOf("os x") != -1))); if (this.isMac()) this._isWindows =! this._isMac; }//end method /** * getOs - returns the os property */ function getOs() { return this.os; }//end method /** * isWindows - is windows, any version */ function isWindows() { return this._isWindows; }//end method /** * isWindows16 - is windows 16 bit */ function isWindows16() { return this._isWindows16; }//end method /** * isWindows31 - is windows 3.1 */ function isWindows31() { return this._isWindows31; }//end method /** * isWindows95 - is windows 95 */ function isWindows95() { return this._isWindows95; }//end method /** * isWindows98 - is windows 98 */ function isWindows98() { return this._isWindows98; }//end method /** * isWindowsME - is windows me */ function isWindowsME() { return this._isWindowsME; }//end method /** * isWindowsNT - is windows NT */ function isWindowsNT() { return this._isWindowsNT; }//end method /** * isWindows2K - is windows 2000 */ function isWindows2K() { return this._isWindows2K; }//end method /** * isWindowsXP - is windows xp */ function isWindowsXP() { return this._isWindowsXP; }//end method /** * isWindows32 - is windows 32 bit */ function isWindows32() { return this._isWindows32; }//end method /** * isWindows64 - is windows 64 bit */ function isWindows64() { return this._isWindows64; }//end method /** * isWindowsDotNet - is windows dot net */ function isWindowsDotNet() { return this._isWindowsDotNet; }//end method /** * isWindowsVista - is windows vista */ function isWindowsVista() { return this._isWindowsVista; }//end method /** * isMac - is mac os any version */ function isMac() { return this._isMac; }//end method /** * isMac68K is mac 6800 series */ function isMac68K() { return this._isMac68K; }//end method /** * isMacPPC is mac power pc */ function isMacPPC() { return this._isMacPPC; }//end method /** * isMacOS8 is mac os 8 */ function isMacOS8() { return this._isMacOS8; }//end method /** * isMacOS9 is mac os 9 */ function isMacOS9() { return this._isMacOS9; }//end method /** * isMacOSX is mac os x */ function isMacOSX() { return this._isMacOSX; }//end method /** * isPlayerPossible */ function isPlayerPossible() { //all these platforms cant get wmp 9 if (this.isWindows95() || this.isWindowsNT() || this.isWindows98() || this.isWindowsME() || this.isMacOS9() || this.isMacOS9() || this.isMacOS8() || this.isMacPPC() || this.isMac68K() ) { return false; } return true; }//end method os = new OSDetector(); os.detect(); //for wmp detection /* if (os.isWindows()) { if (isPlayerPossible()) { //player possible, do player detection } else { //no player possible, download vmc } } */ /*************************************************************************/ // Requires the following script libraries. // // /global/apps/mediaplayer/scripts/os_detect.js // /shared/scripts/flash_detect.js // /sitewide/droplets/scripts/detect_overdrive.js // /*************************************************************************/ var od_win; var detectState=""; var fn=""; var ok=""; function launchOverdriveDetect(){ var resultStatus = getOverdriveState().detectState; if (resultStatus == "ok"){ return true; } else{ window.location.href = detectFailUrlWin + "?error=" + resultStatus; } } function launchOverdrive(){ if (getOverdriveState().detectState == "XXXok") { var broadband_parent = parentWindowVar; var url = detectSuccessUrl; var width; var height; var odscrollbars; var odresizable; var purlArray = null; if (getOverdriveState().dim == "lowres"){ width = 800; height = 600; odscrollbars = "yes"; odresizable = "yes"; } else { width = winWidth; height = winHeight; odscrollbars = "no"; odresizable = "no"; } // CONSTRUCT DEEP LINK ARGS var qs = ""; if(arguments.length > 0){ qs = "?"+arguments[0]; for(i=1; i 0)) { docloc = fullLoc.substr(fullLoc.indexOf('#') +1, fullLoc.length).split("?")[0]; } if(qs.length > 0){ qs += "&launchedFrom=" + docloc; } else{ qs += "?launchedFrom=" + docloc; } var path = url+qs; od_win = window.open(path, "player", "width=" + width + ", height=" + height + ", left=" + (Math.round(window.screen.width/2) - Math.round(width/2)) + ", top=" + (Math.round(window.screen.height/2) - Math.round(height/2)) + ",scrollbars=" + odscrollbars + ", resizable=" + odresizable + ", menubar=no, location=no, toolbar=no, status=no, directories=no" ); if (purlArray != null) window.location.href = purlArray[1]; broadbandWindowPopped(od_win, path); } else{ // window.location.href = detectFailUrl; var qs = ""; if(arguments.length > 0){ qs = arguments[0]; for(i=1; i 0) { args = param[0]; if (param.length > 1) { for (i=1; i= 9) { return true; } else { return false; } } catch(e) { return false; } } function hasIE55plus(){ var version=0; if (navigator.appVersion.indexOf("MSIE")!=-1){ temp=navigator.appVersion.split("MSIE"); version=parseFloat(temp[1]); } if (version >= 5.5) { return true; } else { return false; } } function broadbandWindowPopped(win, path) { try { win.focus(); showAlertsPromo(); } catch (e) { window.location.replace(path); } } function launchContentOn(){ document.getElementById('flaunchContent').style.visibility = "visible"; } function launchShell(){ var hostname = ""; var hpA = window.location.host.split("."); var hp; hp = (hpA[0].substr(0,1) == "o" && hpA[0].indexOf("-") == -1) ? hpA[2]: hpA[1].replace("x", ""); if ( (hp != "mtv") && (hp != "mtv-d") && (hp != "mtv-q")) hostname = "http://www.mtv.com"; var broadband_parent = parentWindowVar; var url = hostname + "/overdrive/"; var width = 1034; var height = 768; var odscrollbars; var odresizable; var purlArray = null; // CONSTRUCT DEEP LINK ARGS var qs = ""; if(arguments.length > 0){ qs = "?" +arguments[0]; for(i=1; i 0)) { docloc = fullLoc.substr(fullLoc.indexOf('#') +1, fullLoc.length).split("?")[0]; } if(qs.length > 0){ qs += "&launchedFrom=" + docloc; } else{ qs += "?launchedFrom=" + docloc; } var path = url+qs; shell_win = window.open(path, "shell", "width=" + width + ", height=" + height + ", left=" + (Math.round(window.screen.width/2) - Math.round(width/2)) + ", top=" + (Math.round(window.screen.height/2) - Math.round(height/2)) + ",scrollbars=yes" + ", resizable=yes" + ", menubar=yes, location=yes, toolbar=yes, status=yes, directories=yes" ); shell_win.focus(); if (purlArray != null) window.location.href = purlArray[1]; broadbandWindowPopped(od_win, path); } function broadbandWindowPopped(win, path) {} /***** RADIO LAUNCH SCRIPTS *****/ function launchRSNu(getUrl){ var tuner = false; tuner = window.open(getUrl,'TUNERLogin','width=700,height=312,toolbar=no,resizable=no,scrollbars=no'); tuner.focus(); } function launchRSN(varStationID){ var tuner = false; tuner = window.open(prependDomain + '/mtvradio/radiolaunch.jhtml?oparam=radio&serviceSubjectID='+ varStationID + '&A='+ varStationID ,'TUNERLogin','width=700,height=312,toolbar=no,resizable=no,scrollbars=no'); tuner.focus(); // popCheck(tuner); } /***** FLIPBOOK LAUNCH SCRIPTS *****/ /* * @description Opens the sitewide flipbook player. * @param fbKey Flipbook ID or URL. * @param obj, Object, used to customize the flipbook skin and values. */ function popFlip(fbKey, obj){ var fbArgs = ""; for (var p in obj){ fbArgs += "&" + p + "=" + obj[p]; } var lfArg; // for fbml urls fullLoc = window.location.toString(); if ((typeof browserManager != "undefined") && (fullLoc.indexOf('#') > 0)) { lfArg = "&launchedFrom=" + fullLoc.substr(fullLoc.indexOf('#') +1, fullLoc.length).split("?")[0]; } else { lfArg = "&launchedFrom=" + window.location.pathname; } var pWin = false; if (fbKey.indexOf("fid=")>=0) { // new flip pop, old w=556, h=486 pWin = window.open('/sitewide/flipbook/index.jhtml?'+fbKey+fbArgs+lfArg,'flipbook','width=747,height=505,scrollbars=no'); } else { var flipLoc = fbKey.split("?"); flipLocPath = flipLoc[0].split("index.jhtml"); var flipLocFull = flipLocPath[0]; if (flipLoc[1] != "" && flipLoc[1] != null) flipLocFull += "&" + flipLoc[1]; pWin = window.open('/sitewide/flipbook/index.jhtml?pf='+flipLocFull+fbArgs+lfArg+'','flipbook','width=747,height=505,scrollbars=no'); } // popCheck(pWin); } function popFlipMedia(fid, mid){ pWin = window.open('/sitewide/flipbook/index.jhtml?fid=' + fid + '&mid=' + mid,'flipbook' + fid,'width=747,height=505,scrollbars=no'); } function popFlipById(fid){ popFlip('fid=' + fid); } /***** COMMUNITY LAUNCH SCRIPTS *****/ // Library used for community services var thisHost = window.location.host; if (typeof(prependDomain) == "undefined") { prependDomain = ""; } var Prefix = prependDomain; var SIGNPAGE = Prefix + '/community/account/signin.jhtml'; var REGPAGE = Prefix + '/community/account/join.jhtml'; var BOARDPAGE = Prefix + '/community/message_boards/adredirect.jhtml'; var MYPROFILEPAGE = Prefix + '/community/profiles/myProfile.jhtml'; var BOARDTHREADPAGE = Prefix + '/community/message_boards/viewthread.jhtml'; var REDFLAGPAGE = Prefix + '/community/message_boards/redflag.jhtml'; var ARTISTBOARDPAGE = Prefix + '/community/message_boards/artistboard.jhtml'; var CHATPAGE = Prefix + '/community/chat/chat.jhtml'; var IMPAGE = Prefix + '/community/im/imlaunch.jhtml'; var IMDOWNLOAD = Prefix + '/community/im/imdownload.jhtml'; var INFOPAGE = Prefix + '/community/account/smryinfo.jhtml'; var mcPAGE = Prefix + '/community/messages/mclaunch.jhtml'; var VMPHONEPAGE = Prefix + '/secure/vmu/editvmu.jhtml?returnPage='+escape('http://'+thisHost+'/community/account/editvmusuccess.jhtml'); var VMPHONETEXT = Prefix + '/secure/vmu/editvmu.jhtml?returnPage='+escape('http://'+thisHost+'/community/account/editvmutext.jhtml?updateVMUser=true'); var winTarget= "im"; var openPARAMS = 'resizable=yes,menubar=yes,location=yes,toolbar=yes,status=yes,scrollbars,directories=no,width=805,height=500'; // This is the default for winPARAMS var winPARAMS = 'resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,directories=no,width=260,height=425'; var mcPARAMS = openPARAMS; var vmPARAMS = 'resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,directories=no,width=376,height=260'; var USER_BROWSER = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))) function popMsg(daURL){ newwin = window.open(daURL,'messages','width=556,height=486,scrollbars,resizable'); } function signin(){ signinPop(); } function signinMsg(mtvparams, service){ if(arguments.length != 2) { mtvparams=""; service=""; } editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=' + mtvparams + '&oparam=' + service + '&target=', 'SignIn', openPARAMS); } function signinPop(){ editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=&target=', 'SignIn', openPARAMS); } function popSignin(){ editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=&target=', 'SignIn', openPARAMS); } function editProfile(){ if(USER_BROWSER){ var editwindow; editwindow = window.open(SIGNPAGE + '?serv=profile&mtvparams=&target=&oparam=edit_profile&mesg=', 'SignIn', openPARAMS); }else{ editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=&oparam=edit_profile&target=', 'mtv', openPARAMS); //window.open(SIGNPAGE + '?serv=profile&mtvparams=&target=self&mesg=','EditProfile',IEPARAMS); } } function goToMyProfile(){ var editwindow; editwindow = window.open(MYPROFILEPAGE, 'mtv', openPARAMS); } function boardPop(bid,tid,mid,offset){ var mbPARAMS = 'resizable=yes,menubar=no,location=no,toolbar,status,scrollbars,directories=no,width=760,height=435'; if(arguments.length == 2){editwindow = window.open(BOARDPAGE + '?bID=' + bid + '&tID=' + tid, 'Board' + bid, mbPARAMS);} else if(arguments.length == 4){editwindow = window.open(BOARDTHREADPAGE + '?bID=' + bid + '&tID=' + tid + '&mID=' + mid + '&offset=' + offset, 'Board' + bid, mbPARAMS);} else{editwindow = window.open(BOARDPAGE + '?bID=' + bid, 'Board' + bid, mbPARAMS);} editwindow.focus; popCheck(editwindow); } function popCheck(obj){ if (!obj) { alert("Some content on MTV.com is displayed using pop-ups. \n\nIf you're using a Pop-up Blocker, you'll need to permit pop-ups \nfrom MTV.com in order to view Videos, photos and other content on our site."); } } function redFlag(bid,mid) { open(REDFLAGPAGE + '?mID=' + mid + '&bID=' + bid, 'RedFlag', 'width=400,height=200'); } function artistBoardPop(artistid){ var mbPARAMS = 'resizable=yes,menubar=no,location=no,toolbar,status,scrollbars,directories=no,width=600,height=440'; editwindow = window.open(ARTISTBOARDPAGE + '?artistid=' + artistid, 'Board' + artistid, mbPARAMS); } function popChat(room){ var chatPARAMS = 'resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars,directories=no,width=605,height=560'; editwindow = window.open(CHATPAGE + '?oparam=chat&room=' + room, 'chat' + room,chatPARAMS); } // legacy chat opener function launchPopUpApp(p,room){ l = room.length; var room = room.substring(5,l) var chatPARAMS = 'resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars,directories=no,width=605,height=560'; editwindow = window.open(CHATPAGE + '?room=' + room, 'chat' + room,chatPARAMS); } function popIm(){ randid = new String(Math.random()); var editwindow; popimwin = window.open(IMPAGE + '?rnd=' + randid,winTarget,winPARAMS); } function popImDownload(){ editwindow = window.open(IMDOWNLOAD, 'imdownload',openPARAMS); } function sendMessage(username){ randid = new String(Math.random()); editwindow = window.open(IMPAGE + '?rnd=' + randid + '&sendto=' + username,'im',openPARAMS); } function popEmailLogin(){ editwindow = window.open(SIGNPAGE + '?serv=mail&mtvparams=email&target=self&mesg=', 'EmailLogin', openPARAMS); } function popEmailRegister(){ editwindow = window.open(REGPAGE + '?serv=mail&mtvparams=email&target=self&mesg=', 'EmailLogin', openPARAMS); } function popMessageCenter(){ editwindow = window.open(mcPAGE, 'messages', mcPARAMS); } function editAccount(){ editwindow = window.open(INFOPAGE, 'EditAccount', openPARAMS); } function linkPhone(host){ window.open(host+VMPHONEPAGE, 'LinkPhone', vmPARAMS); } function linkPhoneForText(host){ window.location.href = host+VMPHONETEXT; } function popMessageCenterFromNav(page, params) { editwindow = window.open('/community/messages/inbox.jhtml', 'messages', 'width=556,height=486,scrollbars=yes,resizable'); } function logoutFromNav() { document.logoutform.submit(); } function signInFromNav() { var thisUrl = document.location; signinMsg(thisUrl,'default'); } function joinFromNav() { var thisUrl = escape(document.location); genPop('/community/account/join.jhtml?serv=url&mtvparams=' + thisUrl, 'account', 'width=605,height=535,resizable,scrollbars'); } function editProfileFromNav() { location.href = '/community/profiles/profile.jhtml?username=' + if_nt_userName; } function editProfileWrapper() { editProfileFromNav(); } function editNewsletters() { genPop('http://ebm.cheetahmail.com/r/regf2?aid=409502673&n=102&a=0', 'newsletters', 'width=690,height=550,resizable,scrollbars'); } function editProfileWrapper() { editProfile(); } /***** SHELL SCRIPTS *****/ function toggleFBML() { if(document.getElementById('flashObj').style.display == 'none') { document.getElementById('noFlash').style.display='none'; document.getElementById('flashObj').style.display='block'; } else { document.getElementById('noFlash').style.display='block'; document.getElementById('flashObj').style.display='none'; } } function setHTML() { document.getElementById('flashObj').style.display='none'; if (typeof document.getElementById('upgradeFlash') != "undefined") document.getElementById('upgradeFlash').style.display='none'; document.getElementById('noFlash').style.display='block'; report(); SetCookieUtil('cSiteVersion', 'HTML', oneDay); } function setUpgradeFlash() { document.getElementById('flashObj').style.display='none'; document.getElementById('noFlash').style.display='none'; if (typeof document.getElementById('upgradeFlash') != "undefined") { document.getElementById('upgradeFlashImage').src = "/relaunch/sitewide/images/flashupgrade/promo_02_html.jpg"; document.getElementById('upgradeFlash').style.display='block'; } } function report() { var reportingObj = new Object(); reportingObj.tVars = new Object(); var pageKeyVals = new Array(); if (typeof pageVals != "undefined") pageKeyVals = pageVals.split(";"); if (typeof additionalValues == "undefined") additionalValues = ""; if (typeof clientEnvironmentVars == "undefined") clientEnvironmentVars = ""; if (typeof personalizationVars == "undefined") personalizationVars = ""; for (var item in pageKeyVals) { var p = pageKeyVals[item].split("="); if (p[0] != null && p[0] != undefined && p[0] !="") reportingObj[p[0]] = p[1]; } otherVals = additionalValues + ";" + clientEnvironmentVars + ";" + personalizationVars; var otherKeyVals = otherVals.split(";"); for (var item in otherKeyVals) { var p = otherKeyVals[item].split("="); if (p[0] != null && p[0] != undefined && p[0] !="") reportingObj.tVars[p[0]] = p[1]; } REPORTING.makeCall('fbml_pv', reportingObj); } function reportUpgrade() { var reportingObj = new Object(); reportingObj.tVars = new Object(); reportingObj["pageName"]="upgradeFlash.jhtml" REPORTING.makeCall('fbml_pv', reportingObj); } // WMP Detection // ************************************** function getWMPVer() { var version = "undefined"; var gkoaxwma = detectMozillaActiveXObject(); if (window.ActiveXObject || gkoaxwma) { try { if (window.ActiveXObject && navigator.userAgent.indexOf('Win') != -1) { var axo = new ActiveXObject("WMPlayer.OCX.7"); } else if (gkoaxwma) { var axo = new GeckoActiveXObject("WMPlayer.OCX.7"); } if (axo) { parseFloat(axo.versionInfo); version=parseFloat(axo.versionInfo); } } catch(e) {} } return version; } function detectWMPVer(reqVer) { var version = getWMPVer(); if (parseInt(version) != NaN && parseInt(version) >= parseFloat(reqVer)) { return true; } else if (parseInt(version) != NaN && parseInt(version) < parseFloat(reqVer)) { return false; } else if (navigator.plugins && navigator.plugins.length) { for (var i=0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf('Windows Media') != -1) { // WMP installed but cannot detect version. hope for the best return true; } } } else { return false; } } function detectMozillaActiveXObject() { var hasaxo; if (navigator.plugins && navigator.plugins.length) { var hasaxo = false; for (var i=0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf('ActiveX') != -1 && window.GeckoActiveXObject) { hasaxo = true; break; } } } return hasaxo; } // Flash Detection // ************************************** function getFlashVer() { PlayerVersion = function(arrVersion){ this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0; this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0; this.revision = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0; } var version = new PlayerVersion([0,0,0]); if(navigator.plugins && navigator.mimeTypes.length){ var x = navigator.plugins["Shockwave Flash"]; if(x && x.description) { version = new PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); } }else{ try{ var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); }catch(e){ try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); version = new PlayerVersion([6,0,21]); axo.AllowScriptAccess = "always"; } catch(e) { if (PlayerVersion.major == 6) { return version; } } try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(e) {} } if (axo != null) { version = new PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); } } return version; } function detectFlashVer(reqMajorVer, reqMinorVer, reqRevision) { var versionArr = getFlashVer(); if (versionArr.major > parseFloat(reqMajorVer)) { return true; } else if (versionArr.major == parseFloat(reqMajorVer)) { if (versionArr.minor > parseFloat(reqMinorVer)) { return true; } else if (versionArr.minor == parseFloat(reqMinorVer)) { if (versionArr.revision >= parseFloat(reqRevision)) { return true; } } } return false; }