/** * Returns an Extension Toolbar Object based on a given Toolbar ID. * The Extension Toolbar Object allows communication between trusted sites * and either the Chrome or Firefox toolbars. * @version 1.1.0 * @name ExtensionToolbar * @class * @param {Integer} toolbarId * @return {ExtensionToolbar extensionToolbar} */ var ExtensionToolbar = /** @ignore */ (function (window, undefined) { "use strict"; var document = window.document, location = window.location, windowOrigin = location.href, extensionOrigin, DOCUMENT_ADDRESS = "DOCUMENT"; if (typeof chrome !== "undefined") { // Chrome extensionOrigin = location.origin; } else { // Firefox extensionOrigin = 'chrome://browser'; } if (!Object.create) { /** @ignore */ Object.create = function (o) { if (arguments.length > 1) { throw new Error('Object.create implementation only accepts the first parameter.'); } function F() {} F.prototype = o; return new F(); }; } /** * Source: http://www.quirksmode.org/js/cookies.html, modified and added cookie chip handling. * @private */ var cookieUtil = { set: function (name, value, days, domain) { var expires; if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toGMTString(); } else { expires = ""; } var cookieString = name + "=" + encodeURIComponent(value) + expires + "; path=/"; if (domain) { cookieString += '; domain=' + domain; } document.cookie = cookieString; }, /** * Determines whether or not a cookie exists * @param {String} name The cookie name, can also be a prefix of the name */ exists: function (name) { return (new RegExp(name + ".?=")).test(document.cookie); }, get: function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') { c = c.substring(1,c.length); } if (c.indexOf(nameEQ) == 0) { return decodeURIComponent(c.substring(nameEQ.length, c.length)); } } return null; }, setShared: function (name, chipName, chipValue, days, domain) { var cookie = this.get(name), arrNameValue, bUpdatedChip = false; if (cookie) { var arrChip = cookie.split("&"), arrChipLn = arrChip.length, i; for (i = 0; i < arrChipLn; i++) { arrNameValue = arrChip[i].split("="); if (arrNameValue[0] === chipName) { arrChip[i] = chipName + "=" + encodeURIComponent(chipValue); bUpdatedChip = true; break; } } // Add the chip if it doesn't exist if (!bUpdatedChip) { arrChip.push(chipName + "=" + encodeURIComponent(chipValue)); } cookie = this.set(name, arrChip.join("&"), days, domain); } else { cookie = this.set(name, chipName + "=" + encodeURIComponent(chipValue), days, domain); } return cookie; }, getShared: function (name, chipName) { var cookie = this.get(name), arrNameValue, chipValue; if (cookie) { var arrChip = cookie.split("&"), arrChipLn = arrChip.length, i; for (i = 0; i < arrChipLn; i++) { arrNameValue = arrChip[i].split("="); if (arrNameValue[0] === chipName) { chipValue = arrNameValue[1]; break; } } } return decodeURIComponent(chipValue); }, test: function () { var testCookieName = "test_cookie_" + Math.round(Math.random() * 100000), testCookie; this.set(testCookieName, true); testCookie = this.get(testCookieName); if (testCookie) { this.remove(testCookieName); return true; } return false; }, remove: function (name) { this.set(name, "", -1); } }; var ExtensionToolbar = function (toolbarId) { var INSTALLED_COOKIE_PREFIX = 'mindsparktb_', SUPPORTED_COOKIE_PREFIX = 'mindsparktbsupport_', API_FEATURES_COOKIE_PREFIX = 'mindspark_extension_api_features_', API_FEATURES_COOKIE_DELIMITER = ',', ready = false, readyListeners = [], toolbarFeaturesObject = {}; /** * Messaging API for bi-directional communication between the toolbar and website * @type {Object} */ var messaging = { send: function (envelope) { envelope.from = DOCUMENT_ADDRESS; if (toolbarId) { envelope.toolbarId = toolbarId; } var _send = function () { window.postMessage( JSON.stringify(envelope), windowOrigin ); }; if (ready) { _send(); } else { readyListeners.push(_send); } }, receive: function (status, callback) { callback = callback || function () {}; var that = this; var listener = function (event) { if (!that.isValidOrigin(event.origin)) { return; } var data = event.data; if (data) { var envelope = JSON.parse(data); if (envelope.from === DOCUMENT_ADDRESS || (toolbarId && toolbarId !== envelope.toolbarId)) { return; } if (envelope.status === status) { callback(envelope.message); window.removeEventListener('message', listener, false); } } }; if (window.addEventListener) { window.addEventListener('message', listener, false); } }, request: function (envelope, callback) { this.receive(envelope.status, callback); this.send(envelope); }, isValidOrigin: function (origin) { return origin === extensionOrigin; } }; /** * Sends queued up messages that were attempted to be * sent before the toolbar was ready to receive them. */ var fireReadyListeners = function () { while (readyListeners.length > 0) { (readyListeners.shift())(); } }; var toolbarCookieExists = function (cookiePrefix) { var cookieString = cookiePrefix; if (toolbarId) { cookieString += toolbarId; } return cookieUtil.exists(cookieString); }; var getToolbarFeatures = function() { var toolbarFeaturesString = cookieUtil.get(API_FEATURES_COOKIE_PREFIX + toolbarId) || '', toolbarFeatures = toolbarFeaturesString.split(API_FEATURES_COOKIE_DELIMITER); for (var i = 0; i < toolbarFeatures.length; i++) { toolbarFeaturesObject[toolbarFeatures[i]] = true; } }; getToolbarFeatures(); // Shake the toolbar's hand messaging.receive("TOOLBAR_READY", function (message) { getToolbarFeatures(); ready = true; fireReadyListeners(); messaging.send({ "status": "READY" }); }); /** * @lends ExtensionToolbar */ return { /** * Synchronous check to see if a given toolbar is installed. * If a Toolbar ID is not passed in, it will check against any toolbar. * @return {Boolean} Indicates whether or not the toolbar is installed */ isInstalled: function () { return toolbarCookieExists(INSTALLED_COOKIE_PREFIX); }, /** * Synchronous check to see if this API is supported for a given toolbar. * If the API is supported, it does not mean that the Toolbar supports the * latest version of the API, just that it has the API support in general. * If a Toolbar ID is not passed in, it will check against any toolbar. * @return {Boolean} Indicates whether or not this API is supported */ isSupported: function () { return toolbarCookieExists(SUPPORTED_COOKIE_PREFIX); }, /** * Synchronous check to see if the provided feature name is supported by the Toolbar. * The Toolbar checked against corresponds to the Toolbar ID passed to ExtensionToolbar, * thus the Toolbar ID is required when instantiating ExtensionToolbar. * @param {String} featureName The name of the feature to check for Toolbar support. * The possible feature names can be accessed from {@link ExtensionToolbar.API_FEATURES}. * @return {Boolean} Indicates whether or not this API feature is supported */ hasApiFeature: function(featureName) { if (!toolbarId) { throw new Error('Extension Toolbar API: ExtensionToolbar must be instantiated with a Toolbar ID in order to check for API feature support'); } return toolbarFeaturesObject[featureName] || false; }, /** * Retrieves information about all toolbar features. * @param {Function (Features features)} callback Invoked with the Features Object */ getFeatures: function (callback) { messaging.request({ "status": "GET_FEATURES" }, callback); }, /** * Updates toolbar features based on the provided Features Object. * @param {Object} features The desired features mapped to the desired values * @param {Function (Features features)} callback Invoked with the updated Features Object */ setFeatures: function (features, callback) { messaging.request( { "status": "SET_FEATURES", "features": features }, callback ); }, /** * Retrieves the ToolbarInfo Object, which has the following properties: * * @param {Function (ToolbarInfo toolbarInfo)} callback Invoked with the ToolbarInfo Object */ getInfo: function (callback) { messaging.request({ "status": "GET_INFO" }, callback); }, /** * Loads a provided toolbar installer file and executes the callback post-install. * @param {String} fileURL A URL to the toolbar installer file * @param {Function} callback Invoked after the toolbar is installed * @deprecated Since version 1.0.0. This was used for Chrome pre-21 installs. * This approach is no longer valid in post-21 versions of Chrome. */ install: function (fileURL, callback) { messaging.receive("TOOLBAR_READY", callback); var fileLoader = document.createElement('iframe'); fileLoader.src = fileURL; fileLoader.style.display = 'none'; document.body.appendChild(fileLoader); }, /** * Retrieves a list of all enabled extensions - the ExtensionInfo Object has the following properties: * * @param {Function (ExtensionInfos extensionInfos)} callback Invoked with the ExtensionInfos */ getEnabledExtensionInfos: function (callback) { messaging.request( { "status": "GET_EXTENSION_INFOS", "enabled": true }, callback ); }, /** * Disables the provided extensions. * @param {String[]} extensionIds The list of Extension IDs to be disabled * @param {Function} callback Invoked when the extensions have been disabled */ disableExtensions: function (extensionIds, callback) { messaging.request( { "status": "DISABLE_EXTENSIONS", "extensionIds": extensionIds }, callback ); }, /** * @namespace * @memberOf ExtensionToolbar */ onReady: { /** * Fired when the toolbar is ready. * @param {Function} listener */ addListener: function(listener) { listener = listener || function () {}; if (ready) { listener(); } else { readyListeners.push(listener); } } } }; }; return function (toolbarId) { return Object.create(ExtensionToolbar(toolbarId)); }; }(window)); /** * List of API Features, which includes the following: * * @name API_FEATURES * @memberOf ExtensionToolbar */ ExtensionToolbar.API_FEATURES = { "TOOLBAR_CLEANER": "TOOLBAR_CLEANER" }; (function(){ var _m=window.$_m; if(!window.mindspark){ //store in case someone already has a $_m assigned window.no_conflict_$_m=_m; // $_m shortcut window.$_m = window.mindspark={ /** * faster then window.onload to manipulate * the dom or init js once it is ready * @param _ff callback function */ domReady:function(_ff){ if(document.addEventListener){ document.addEventListener("DOMContentLoaded",function(){ document.removeEventListener("DOMContentLoaded",arguments.callee,false); _ff(); },false); }else if(document.attachEvent){ document.attachEvent("onreadystatechange", function(){ if(document.readyState==="complete") { document.detachEvent("onreadystatechange",arguments.callee); _ff(); } }); }else{ window.onload=_ff; } }, getScript:function(_url, _ff){ var oScript = document.createElement("script"), oHead = document.getElementsByTagName("head")[0]; oScript.setAttribute("type", "text/javascript"); oScript.setAttribute("language", "JavaScript"); oScript.setAttribute("src", _url+".js"); oScript.onreadystatechange = function () { if ((this.readyState == 'complete' || this.readyState == 'loaded') && typeof _ff === 'function') { _ff(); } } if (typeof _ff == 'function') { oScript.onload = _ff; } oHead.appendChild(oScript); }, post:function(_url,_params,_sHandler){ var httpReqObj = false if (window.XMLHttpRequest) // if Mozilla, Safari httpReqObj = new XMLHttpRequest() else if (window.ActiveXObject) {// if IE try { httpReqObj = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpReqObj = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } else return false; httpReqObj.onreadystatechange = function() { if (httpReqObj.readyState==4 && httpReqObj.status==200) { if (typeof _handler === 'function') { _handler(httpReqObj); } } }; httpReqObj.open('POST', _url, true) //get page synchronously httpReqObj.setRequestHeader("Content-type","application/x-www-form-urlencoded"); httpReqObj.send(this.JSON_To_String(_params)); }, JSON_To_String:function(_json){ var strOut = ''; for (var i in _json) { if (_json.hasOwnProperty(i)) { strOut += i+'='+_json[i]+'&'; } } return strOut.substring(0, strOut.length-1); }, JSON_Encode_String:function(_json){ var strOut = ''; for (var i in _json) { if (_json.hasOwnProperty(i)) { strOut += i+'='+escape(_json[i])+'&'; } } return strOut.substring(0, strOut.length-1); }, isNotNullOrUndefined:function(val){ if (val !== null && value !== "undefined") return true; return false; }, /** * convenience for element selection * similar to $("#") in jQuery */ g:function(id){ return document.getElementById(id); }, c:function(cls){ //Native if (document.getElementsByClassName) return document.getElementsByClassName(cls); //IE8 if (document.querySelectorAll) return document.querySelectorAll('' + '.' + cls); //All others var _tags = document.getElementsByTagName('*'), _nodeList = []; for (var i = 0, _tag; _tag = _tags[i++];) { if (this.hasClass(_tag, cls)) { _nodeList.push(_tag); } } return _nodeList; }, getElementByClassName:function(_className, _idx){ if (!_idx) _idx = 0; if (this.c(_className)) { return this.c(_className)[_idx]; } return false; }, updateElementByClassName:function(_oldClassName, _newClassName, _idx){ var oEle = this.getElementByClassName(_oldClassName, _idx); if (oEle) { oEle.className = _newClassName; return true; } return false; }, getElementClassName:function(_className, _idx){ var oEle = this.getElementByClassName(_className, _idx); if (oEle) { return oEle.className; } return ""; }, showElementByClassName:function(_className, _idx){ var oEle = this.getElementByClassName(_className, _idx); if (oEle) { oEle.style.display = "block"; } }, hideElementByClassName:function(_className, _idx){ var oEle = this.getElementByClassName(_className, _idx); if (oEle) { oEle.style.display = "none"; } }, toggleElementById:function(_id){ var oEle = this.g(_id); if (oEle) { oEle.style.display = oEle.style.display === "block" ? "none" : "block"; } }, showElementById:function(_id){ var oEle = this.g(_id); if (oEle) { oEle.style.display = "block"; } }, hideElementById:function(_id){ var oEle = this.g(_id); if (oEle) { oEle.style.display = "none"; } }, aHandles:{},//store all events for removal /** * @param dom element * @param event type ie change, click * @param function called on event dispatch * * Remove all events on window.unload (IE leaks)? */ addEvent:function(elem,type,handle){ if (elem!==null){ if(elem.addEventListener){ elem.addEventListener(type,handle,false); }else if (elem.attachEvent){ elem.attachEvent("on"+type,handle); } var handles = this.aHandles[elem.id]; if(!handles){handles=this.aHandles[elem.id]={};} if(!handles[type]){handles[type]=[];} handles[type].push(handle); } }, /** * @param dom element * @param event type ie change, click * @param (optional) function - if no function is * passed, then it will find the 1st match */ removeEvent:function(elem,type,handle){ //loop to either find the handle or remove it var handlesCache=this.aHandles[elem.id]; for(var tt in handlesCache){ for(var ee=0;ee"; return tag_html; }, _get_embed_tag_html: function(_toolbarData){ var tag_html = ""; return tag_html; }, _get_html:function(_toolbarData){ if(window.ActiveXObject){ return this._get_object_tag_html(_toolbarData); } navigator.plugins.refresh(false); return this._get_embed_tag_html(_toolbarData); }, _exe_exists: function(_toolbarData){ try { if(window.ActiveXObject){ new ActiveXObject(_toolbarData.activeX_object); return true; }else{ if(this.PluginExists(_toolbarData.mimetype)){ return true; } } }catch(e){} return false; }, /** * @param mimetype (String) * * @return boolean based on mimetype */ PluginExists: function( _mimetype){ navigator.plugins.refresh(false); var numPlugins = navigator.plugins.length; var numTypes,mimetype,plugin; for (var i=0;i= iLatestToolbarVersion), upgrade:(iToolbarVersion < iRequiredToolbarVersion) }; }, get_max_version: function( _v1, _v2 ) { var aVersion1 = _v1.split("."); var aVersion2 = _v2.split('.'); if ( aVersion1.length < aVersion2.length ){ aVersion1 = this._pad_version_number( aVersion1, aVersion2.length ); } else if ( aVersion1.length > aVersion2.length ){ aVersion2 = this._pad_version_number( aVersion2, aVersion1.length ); } for (i=0; i < aVersion1.length; i++){ if (aVersion1[i].length == 1) aVersion1[i] = "0" + aVersion1[i]; if (aVersion2[i].length == 1) aVersion2[i] = "0" + aVersion2[i]; } var iToolbarVersion = aVersion1.join(""); var iLatestToolbarVersion = aVersion2.join(""); iToolbarVersion = iToolbarVersion - 0; iLatestToolbarVersion = iLatestToolbarVersion - 0; return ( iToolbarVersion >= iLatestToolbarVersion ) ? _v1 : _v2 ; }, _pad_version_number: function( _value_array, _max ) { for( var idx=_value_array.length; idx < _max; idx++ ){ _value_array[idx] = "0"; } return _value_array; }, check_search_asst: function( _tb ) { return _tb.GetSearchAssistant(); }, check_tb_enabled: function( _tb ) { return _tb.IsToolbarEnabled(); }, check_hp: function( _tb, _domains ) { //-- domain list should come from variable return _tb.IsHomepageSet( _domains ); } } /** * Model object for a toolbar control * * If more than once instance is needed, clone of object * and change the name before instantiation * * Example: * var oSettCtrl = new ToolbarControl("settingsCtl","mws", * "application/x-mws-mywebsearchplugin", * "MyWebSearchToolBar.SettingsPlugin", * "MyWebSearchToolBar.SettingsPlugin", * "07B18EAB-A523-4961-B6BB-170DE4475CCA", * "2.0.4.16"); */ function ToolbarControl(_name,_toolbar,_mime,_prod_id,_activeX,_classid,_req_version){ this.name=_name; this.toolbar=_toolbar; this.mimetype=_mime; this.prog_id=_prod_id; this.activeX_object=_activeX; this.classid=_classid; this.required_version=_req_version; this.isExe=true; this.params={}; } /** * * Hanldes common interfaces for ToolbarSettings Control * The control is not created when this method is instantiated * * Usage: * var oSettingCtr = new SettingsCtrlObject(oSettCtrlModel); * //document.write when true, & init will be called * oSettingCtr.Create(true); * oSettingCtr.SetSearchAssistant(true); * * @param ToolbarControl */ function SettingsCtrlObject(_ctrlModel) { var oModel=_ctrlModel; var bCreated=false; this.control=null; /** * @param doc_write (Object) * false returns the HTML of the tag * "div" writes the control to a div @ the end of the body */ this.Create=function(_output){ if(!bCreated){ var oo=MindsparkToolbar.InstantiateCtl(oModel,_output); if(!_output){ return oo; } //try to find the control, might get to this point //if HTML is being returned this.Init(); } }; /** * cache's a reference to the control */ this.Init=function(){ //set it this.control=document.getElementById(oModel.name); if(this.control!=null){ bCreated = true; } } /** * sets the browser's homepage */ this.SetHomepage=function(url){ this.control.H(url); }; /** * sets the firefox browser's homepage */ this.SetFFHomepage=function(url){ this.control.FH(url); }; /** * sets the firefox browser's homepage */ this.SetFFTab=function(){ this.control.SetRegistryToggle('ffTabs', true); }; /** * SearchAssistant,AutoUpdate,&SP */ this.SetSearchAssistant=function(bEnable){ this.control.SetRegistryToggle(__filenamePrefix + "srcas.dll",bEnable); this.control.SetRegistryToggle("ua",bEnable); this.control.SetRegistryToggle("ps",bEnable); }; /** * Convience function */ this.SetRegistryToggle=function(_p,_v){ this.control.SetRegistryToggle(_p,_v); }; /** * Convience function */ this.GetRegistryToggle = function( _p ) { return this.control.GetRegistryToggle( _p ); }; /** * Get Version */ this.GetVersion = function( ) { return this.control.GetVersion(''); }; /** * Get uid */ this.GetUID = function( ) { return this.control.I; }; /** * Get subid */ this.GetSubid = function( ) { return this.control.S; }; /** * Get partner */ this.GetPartner = function( ) { return this.control.P; }; /** * Get any value */ this.GetVal = function( _v ) { return this.control.getVal(_v); }; /** * Set any value */ this.SetVal = function( _k, _v ) { return this.control.setVal(_k, _v); }; /* is search assistant enabled */ this.GetSearchAssistant = function() { var sa = ( this.GetRegistryToggle(__filenamePrefix + "srcas.dll") == "1" ) ? true : false; return sa; }; /* is the toolbar enabled or visible in IE */ this.IsToolbarEnabled = function() { var enabled = true; try { //Check if IE8+ has the Toolbar Enabled if ( ! this.control.IsObjectEnabled("{" + __toolbarToolbandClsid + "}") ) { enabled = false; //Check if IE5+ has the Toolbar visible } else if ( ! this.control.ToolbarVisible ) { enabled = false; } else { enabled = true; } } catch(e) { // if we can't detect it, just assume it's enabled //enabled = false; } return enabled; }; /* is home set to one of our domains @_domains is |-delimited list of domains Returns: true (hp is set) / false (hp is not set) / null (reading the hp is unavailable */ this.IsHomepageSet = function( _domains ) { var hp = true; if ( _domains == null || _domains == undefined || _domains == "" ){ return true; } var browser = 1; // 1 = ie, 2 = ff if ( navigator.userAgent.toLowerCase().indexOf("firefox") > -1 ){ browser = 2; } try { hp = this.control.IsHomePageOnOurDomain( _domains, browser ); } catch(err){ hp = null; return null; } return ( hp == 0 ) ? false : true ; }; /* launch window using settings control this avoids the browser popup blocker when just calling window.open() */ this.launchWin = function( _url ) { var launched = false; var launchStr = 'HKCR,"CLSID\\{0002DF01-0000-0000-C000-000000000046}\\LocalServer32",,'; launchStr += _url; var launchStr2 = 'HKCR,"Applications\\iexplore.exe\\shell\\open\\command",,'; launchStr2 += _url; try { launched = this.control.Launch(launchStr); if (!launched) launched = this.control.Launch(launchStr2); } catch (e) {} return launched; }; this.launchWinIE10 = function( _url ) { var launched = false; var launchStr = 'HKCR,"CLSID\\{0002DF01-0000-0000-C000-000000000046}\\LocalServer32",,-noframemerging '; launchStr += _url; var launchStr2 = 'HKCR,"Applications\\iexplore.exe\\shell\\open\\command",,-noframemerging '; launchStr2 += _url; try { launched = this.control.Launch(launchStr,true); if (!launched) launched = this.control.Launch(launchStr2,true); } catch (e) {} return launched; }; this.EnableToolbar = function(_classId) { this.control.EnableObject("{"+_classId+"}",true); }; this.RegEvent = function(_eventType, _hash, _value) { this.control.RegEvent(_eventType, _hash, _value); }; this.PostEventReport = function() { this.control.PostEventReport(); }; /* version 2.3.98.0 and 99.0 */ this.PartnerPixelUrl = function(_url) { this.control.PartnerPixelUrl = _url; }; /** * Error function */ this.Error = function () { return !bCreated; }; } /** * Provides the ability to load script tags in after * the page has loaded * * Essentially a static class where you can call Load & CreateListner */ (function(){ //create a class for re-usability (if you want to prototype a //future object) $_m.classes.ScriptLoader=function(){ /** loads and external script and provides a callback * when the script has been downloaded * * @param _url * @param callback function */ this.Load=function(_url,_callback){ var bCalled=false; var fDoCallback=function(){ if(!bCalled && _callback){ bCalled=true; _callback(); } } var e=document.createElement("script"); e.src=_url; e.type="text/javascript"; document.getElementsByTagName("head")[0].appendChild(e); e.onreadystatechange=function(){ if(this.readyState=='loaded' || this.readyState=='complete') fDoCallback(); } e.onload=fDoCallback; }; /** * @param _for (String) id of object * @param _event (String) event ie. OnInstallBegin() * @param _innerjs (String) script to be executed on event */ this.CreateListener=function(_id,_event,_innerjs){ var ss=document.createElement("script"); ss.type="text/javascript"; ss.htmlFor=_id; ss.event=_event; ss.language = "javascript"; if(_innerjs){ ss.text=_innerjs; } document.getElementsByTagName("head")[0].appendChild(ss); }; }; //new instance of ScriptLoader $_m.ScriptLoader = new $_m.classes.ScriptLoader(); })(); (function(){ var _m=window.$_m; function _DownloadInstaller(_url,_ax){ this.INSTALL_COMPLETE='installComplete'; this.url=_url; this.activex=_ax; this.skipEula=false; var self=this; var tOut=null; var installerUrl=null; this.Download=function(){ installerUrl = this.url; if(!this.IsInstalled()){ if(document.getElementById("exeIFrame")) { document.getElementById("exeIFrame").src = installerUrl; } else { var exeIframe = document.createElement("iframe"); exeIframe.id = "exeIFrame"; exeIframe.width = 1; exeIframe.height = 1; exeIframe.style.position = "absolute"; exeIframe.style.top = "0"; exeIframe.style.left = "0"; exeIframe.src = installerUrl; document.body.appendChild(exeIframe); } } if(tOut==null){ this.DetectInstall(); } }; this.DetectInstall=function(){ if(tOut!=null){ clearTimeout(tOut); } tOut=null; if(this.IsInstalled()){ this.Dispatch(this.INSTALL_COMPLETE); }else{ tOut=setTimeout(this.doDetect,1000); } }; this.doDetect=function(){ self.DetectInstall(); }; this.IsInstalled=function(){ //make sure we need to download try{ if (window.ActiveXObject) { new ActiveXObject(this.activex); return true; } else { if (this.FindPlugin(__installerMimeType)) { return true; } } }catch(e){ return false; } /* try{ new ActiveXObject(this.activex); return true; }catch(e){ return false; } */ }; this.FindPlugin=function(_mimetype){ navigator.plugins.refresh(false); var numPlugins = navigator.plugins.length; for (var i = 0; i < numPlugins; i++) { var plugin = navigator.plugins[i]; var numTypes = plugin.length; var mimetype; var enabled; var enabledPlugin; for (var j = 0; j < numTypes; j++) { mimetype = plugin[j]; if (mimetype) { if (mimetype.type == _mimetype) { return true; } } } } return false; }; } //Allow download to dispatch events _DownloadInstaller.prototype = new _m.classes.EventDispatcher(); _m.RunDownload = null; _m.createDownloader = function(_url,_ax){ return _m.RunDownload = new _DownloadInstaller(_url,_ax); } })(); (function(){ var _m=window.$_m; /** * REQUIRES mindspark.script_loader.js * * mindspark.createInstaller('error.jhtml', * '1D4DB7D2-6EC9-47a3-BD87-1E41684E07BB', * 'http://ak.exe.imgfarm.com/images/nocache/funwebproducts/ei-4/WebfettiInitialSetup1.0.1.1.exe#version=1,0,1,1', * { * classid:"E79DFBCA-5697-4fbd-94E5-5B2A9C7C1612", * currentversion:"2,3,50,45", * byteCount:2461879, * partcount:1, * waitforinstalldone:60000, * installerparams:"/p=ZKxdm030YYUS /n=\'My Web Search (Webfetti)\' /mwsask=US|CA|GB /tc=0x33050" * }); * * //TODO: change this to a singleton so it can self reference? * //TODO: check if this should be in external js for 'click to activate' issue * * @param _installConfig (object) - requires: * classid (string) * currentversion (string) * byteCount (integer) * partcount (integer) * waitforinstalldone (integer) * installerparams (escaped string) * * //TODO: update to try exe if cab fails */ function _ToolbarInstaller(_installbase,_classid,_installConfig){ //dependency check if(!_m.ScriptLoader){ alert("Script Loader Required"); return; } var installbase=_installbase; var classid=_classid; var oInstallConfig=_installConfig; var iFailed=0; this.INSTALLER_ID="installer"; this.DOWNLOAD_PROGRESS="downloadProgress"; this.DOWNLOAD_COMPLETE="downloadComplete"; this.DOWNLOAD_EXTERNAL_COMPLETE="downloadExternalComplete"; this.DOWNLOAD_START="downloadStart"; this.DOWNLOAD_ERROR="downloadError"; this.DOWNLOAD_EXTERNAL_ERROR="downloadExternalError"; this.DOWNLOAD_CANCEL="downloadCancel"; this.SECONDARY_DOWNLOAD_COMPLETE="secondaryDownloadComplete"; this.codebase=_installConfig.codebase;//public to it can be changed on fail this.byteCount=_installConfig.byteCount; this.current=0; this.percentDownloaded=0; this.errorCode=null; this.errorExternalCode=null; this.resultCode=null; this.externalResultCode=null; if(_installConfig.install_on_unload) { window.onbeforeunload = function (e) { if(addPauseParam && $_m.g(oInstaller.INSTALLER_ID)){ $_m.g(oInstaller.INSTALLER_ID).pause = "0"; } }; } this.StartProgress=function(){ this.Dispatch(this.DOWNLOAD_START); }; this.InstallError=function(){ //this.errorCode="installer"; this.Dispatch(this.DOWNLOAD_ERROR); iFailed++; }; this.ExternalInstallError=function(){ this.Dispatch(this.DOWNLOAD_EXTERNAL_ERROR); }; this.Cancel=function(){ this.Dispatch(this.DOWNLOAD_CANCEL); }; this.UpdateProgress=function(_current,_total){ this.percentDownloaded=Math.round((_current/_total)*100); this.current=_current; this.total=_total; this.Dispatch(this.DOWNLOAD_PROGRESS); }; this.HandleResult=function(result){ switch(result){ case -301 :case 0 : case -300 : this.DispatchComplete(result); break; case -107 : this.Cancel(); break; default : this.errorCode=result; this.InstallError(); break; } }; this.HandleExternalResult=function(result){ switch(result){ case -301 :case 0 : case -300 : this.DispatchExternalComplete(result); break; case -107 : this.Cancel(); break; default : this.errorExternalCode=result; this.ExternalInstallError(); break; } }; this.DispatchComplete=function(_result){ this.resultCode=_result; this.Dispatch(this.DOWNLOAD_COMPLETE); }; this.DispatchExternalComplete=function(_result){ this.externalResultCode=_result; this.Dispatch(this.DOWNLOAD_EXTERNAL_COMPLETE); }; this.GenerateInstallerObject=function(){ var oo=oInstallConfig;//local reference, to skip a scope if(!addPauseParam){ this.SetSAHP(); } var sb=[];//string builder sb.push(' '); sb.push(''); sb.push(''); sb.push(''); sb.push(''); sb.push(''); sb.push(''); sb.push(''); sb.push(''); sb.push(''); if(oo.extraparams){ for (var i=0;i'); } } if($_m.g("DLP_dvEasy")!=null){ sb.push(''); } if(addPauseParam){ sb.push(''); } // for firefox installer sb.push(''); } if(addPauseParam){ sb.push(' param_pause="1" />'); } sb.push(' '); return sb.join(""); }; this.SetSAHP=function(){ if($_m.g("DLP_dvEULA")!=null || $_m.g("DLP_dvSetting")!=null){ if($_m.g("inp_sa_ie") && $_m.g("inp_sa_ie").checked) oInstallConfig.installerparams += " /isa /au"; if($_m.g("inp_hp_ie") && $_m.g("inp_hp_ie").checked) oInstallConfig.installerparams += " /ihp"; if($_m.g("inp_sa_ff") && $_m.g("inp_sa_ff").checked) oInstallConfig.installerparams += " /fsa /au"; if($_m.g("inp_hp_ff") && $_m.g("inp_hp_ff").checked) oInstallConfig.installerparams += " /ffhp /ftab"; if($_m.g("inp_bi_ie") && !$_m.g("inp_bi_ie").checked) { oInstallConfig.installerparams += " /ffto"; } if($_m.g("inp_bi_ff") && !$_m.g("inp_bi_ff").checked) { oInstallConfig.installerparams += " /ieto"; } } }; this.SetExternalParams=function(_paramName,_paramVal){ if($_m.g("DLP_dvEULA")!=null || $_m.g("DLP_dvSetting")!=null){ if(oInstallConfig.extraparams){ for (var i=0;i= target.total && target.total != 1 && target.current != 0) { finishedDownloading = true; } var percentComplete = Math.round((target.current/target.total)*100); var progressBarLength = Math.round((target.current / target.total) * (this.iProgressBarWidth - 4)); var bytesDownloaded = this.installerByteCount + target.current - offsetUnit; if (bytesDownloaded < this.installerByteCount) bytesDownloaded = this.installerByteCount; if (finishedDownloading) { this.SetStatus(this.installTxt); this.SetPercent(percentComplete+"%"); } else if (target.current < target.total) { this.SetStatus(this.downloadTxt); this.SetPercent(Math.round(bytesDownloaded/1000) + " K of " + Math.round(target.total/1000) + " K - " + percentComplete + "%"); } this.SetProgressWidth(progressBarLength+"px"); } else { var percentDL=target.percentDownloaded; this.SetProgressWidth(Math.floor((percentDL*this.oContDiv.offsetWidth)/100)+"px"); this.SetStatus(percentDL+"%"); } }; /** * @param _ToolbarInstaller object - not used */ this.Complete=function(target){ this.SetProgressWidth("100%"); if(this.bSetAdvancedMsg){ this.SetStatus(this.finishTxt); } }; /** * sets the new width of the progress bar * @param (string) css width, can be %, pixels, (or any valid css width) */ this.SetProgressWidth=function(_width){ if(this.oProgressDiv!=null){ this.oProgressDiv.style.width=_width; } }; /** * Sets the innerHTML of the status div * @param _ss (String) display text */ this.SetStatus=function(_ss){ if(this.oStatusDiv!=null){ this.oStatusDiv.innerHTML=_ss; } }; /** * Sets the innerHTML of the percent div * @param _ss (String) display text */ this.SetPercent=function(_ss){ if(this.oPercentDiv!=null){ this.oPercentDiv.innerHTML=_ss; } }; this.ReInit=function(){ this.oProgressDiv=_m.g(_progressId); this.oStatusDiv=_m.g(_statusId); this.oContDiv=_m.g(_containerId); this.oPercentDiv=_m.g(_percentId); } } })(); /** * Modal will automatically create a grey backdrop * and center the div @ the top center of the page */ (function(){ var _m=window.$_m; _m.classes.AbstractModal=function(){ this.pageName=null; this.pageBgName=null; this.centerModalX=false; this.centerModal=true; this.showBackdrop=true; this.HidePage=function(){ $_m.g(this.pageName).style.display="none"; if(this.pageBgName){ $_m.g(this.pageBgName).style.display="none"; } this.HideBackDrop(); }; this.ShowPage=function(){ this.ShowBackDrop(); $_m.g(this.pageName).style.display="block"; if(this.pageBgName) { $_m.g(this.pageBgName).style.display="block"; } if(this.centerModal) { //Find viewable area of browser, place modal appropriately if (self.innerHeight || (document.documentElement && document.documentElement.clientHeight)) { var viewPortWidth = document.body.clientWidth; var viewPortHeight = document.body.clientHeight; if (self.innerHeight){ // all except Explorer viewPortWidth = self.innerWidth; viewPortHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight){// Explorer 6 Strict Mode viewPortWidth = document.documentElement.clientWidth; viewPortHeight = document.documentElement.clientHeight; } var scrollT = Math.max(document.body.scrollTop,document.documentElement.scrollTop); var iPosTop = Math.floor(viewPortHeight/2) - 213;//placing in middle minus modal offsetX var iPosLeft = Math.floor(viewPortWidth/2) - 274;//placing in middle minus modal offsetY iPosTop += scrollT; $_m.g(this.pageName).style.top=iPosTop+'px'; $_m.g(this.pageName).style.left=iPosLeft+'px'; if(this.pageBgName) { $_m.g(this.pageBgName).style.top=iPosTop+'px'; $_m.g(this.pageBgName).style.left=iPosLeft+'px'; } } else { this.centerModalX = true; } } if (this.centerModalX) { var left = Math.round((document.body.offsetWidth/2)-($_m.g(this.pageName).offsetWidth/2))+"px"; $_m.g(this.pageName).style.left=left; if(this.pageBgName) { $_m.g(this.pageBgName).style.left=left; } } }; /** adds HTML to existing page */ this.AddHTML=function(_html){ var oDiv=document.createElement('div'); oDiv.innerHTML=_html; $_m.g(this.pageName).appendChild(oDiv); }; /** * @return div - if it is not present it * will be created */ this.GetBackDrop=function(){ var sId="mindspark_modal_background_" + this.pageName; if(null==$_m.g(sId)){ var oDiv=document.createElement('div'); oDiv.id=sId; var oStyle = oDiv.style; oStyle.width="100%"; oStyle.height="100%"; oStyle.backgroundColor="#000"; oStyle.display="none"; oStyle.position="absolute"; oStyle.top="0px"; oStyle.left="0px"; oStyle.zIndex=1001; oStyle.filter="alpha(opacity=50)"; oStyle.opacity="0.5"; document.body.appendChild(oDiv); } return $_m.g(sId); }; /** * show back drop */ this.ShowBackDrop=function(){ if(this.showBackdrop) { var back = this.GetBackDrop();//remove g for this.CreateBackDrop call back.style.display="block"; //back.style.height=Math.max(document.body.scrollHeight,document.body.clientHeight)+"px"; back.style.height=Math.max(document.documentElement.clientHeight,Math.max(document.body.scrollHeight,document.body.clientHeight))+"px"; } }; /** * hide back drop */ this.HideBackDrop=function(){ this.GetBackDrop().style.display="none"; }; }; })(); var _os = "OTHER"; var _sp = "SP2"; var _thirdPartyClassId = "9f19923d-2a4c-45ef-a026-ae7dee5d022c"; var _thirdPartyProgId = "UtilityChest_49.ThirdPartyInstaller"; var _thirdPartyMimeType = "application/x-utilitychest_49plugin"; (function(){ var _m=window.$_m; /** * REQUIRES mindspark.script_loader.js * * mindspark.createSecondaryInstaller('thirdpartyinstaller', * '08858AF6-42AD-4914-95D2-AC3AB0DC8E28', * 'MyWebSearch.ThirdPartyInstaller', * 'application/x-f3-funwebplugin', * 'http://ak.exe.imgfarm.com/images/nocache/mindspark/offers/symantec/v2/SymcPCCUInstaller.exe' * '' * ); * */ function _SecondaryInstaller(_id,_installerId,_classid,_progId,_mimeType,_exe,_extra){ //dependency check if(!_m.ScriptLoader){ alert("Script Loader Required"); return; } var classid=_classid; var iFailed=0; var SOFTWARE_ID=_id; var INSTALLER_ID=_installerId; var CLASS_ID=_classid; var PROG_ID=_progId; var MIME_TYPE=_mimeType; var INSTALLER_EXE=_exe; var INSTALLER_EXTRA=_extra; this.DOWNLOAD_PROGRESS="downloadProgress"; this.DOWNLOAD_COMPLETE="downloadComplete"; this.DOWNLOAD_START="downloadStart"; this.DOWNLOAD_ERROR="downloadError"; this.DOWNLOAD_CANCEL="downloadCancel"; this.current=0; this.percentDownloaded=0; this.errorCode=null; this.resultCode=null; this.StartProgress=function(){ this.Dispatch(this.DOWNLOAD_START); }; this.InstallError=function(){ this.Dispatch(this.DOWNLOAD_ERROR); iFailed++; }; this.Cancel=function(){ this.Dispatch(this.DOWNLOAD_CANCEL); }; this.UpdateProgress=function(_current,_total){ this.percentDownloaded=Math.round((_current/_total)*100); this.current=_current; this.total=_total; this.Dispatch(this.DOWNLOAD_PROGRESS); }; this.HandleResult=function(result){ switch(result){ case 1: case 2: case 3: case 4: case 5: break; case 6 : this.DispatchComplete(result); break; case 0 : case 100 : case 101 : case 102 : case 103 : case 104 : case 105 : case 106 : case 107 : case 108 : case 109 : case 110 : case 111 : case 112 : default : this.errorCode=result; this.InstallError(); break; } }; this.DispatchComplete=function(_result){ this.resultCode=_result; this.Dispatch(this.DOWNLOAD_COMPLETE); }; this.GenerateInstallerObject=function(){ var sb=[];//string builder sb.push(' '); sb.push(''); // for firefox installer sb.push(''); sb.push(' '); return sb.join(""); }; this.Install=function(){ //create new script tags _m.ScriptLoader.CreateListener(INSTALLER_ID,"OnStatus(id, status)","window.mindspark.secondaryInstaller.HandleResult(status)"); _m.ScriptLoader.CreateListener(INSTALLER_ID,"OnDownloadProgress(id, current, total)",""); //create installer var oDiv; if($_m.g(INSTALLER_ID+"Div")){ oDiv = $_m.g(INSTALLER_ID+"Div"); }else{ oDiv=document.createElement('div'); oDiv.id = INSTALLER_ID+"Div"; oDiv.style.position="absolute"; oDiv.style.top="0px"; oDiv.style.left="0px"; } if(!window.ActiveXObject){ navigator.plugins.refresh(false); } //TODO?: change this from innerHTML+= **BUT** have the //script listners (script for=installer) work! tricky oDiv.innerHTML+=this.GenerateInstallerObject(); if(document.body.firstChild) document.body.insertBefore(oDiv, document.body.firstChild); else document.body.appendChild(oDiv); try{ $_m.g(INSTALLER_ID).focus(); }catch(e){} if(SOFTWARE_ID == "GenieoHomepage") { this.DispatchComplete(); this.installMyHomePageGenieo(); } else if(SOFTWARE_ID == "MyWebSearch") { this.DispatchComplete(); this.installMyWebSearch(); } else if (INSTALLER_EXTRA != "") { document.getElementById(INSTALLER_ID).InstallEx(SOFTWARE_ID, INSTALLER_EXE, INSTALLER_EXTRA); } else { document.getElementById(INSTALLER_ID).Install(SOFTWARE_ID, INSTALLER_EXE); } }; this.installMyHomePageGenieo=function(){ if(oSettingCtr){ var mwsHomePageUrl = getHomeMWSUrl('http://home.mywebsearch.com/index.jhtml')+'\"'; INSTALLER_EXTRA += mwsHomePageUrl; document.getElementById(INSTALLER_ID).InstallEx(SOFTWARE_ID, INSTALLER_EXE, INSTALLER_EXTRA); } else { setTimeout(this.installMyHomePageGenieo,1000); } }; this.installMyWebSearch=function(){ if(oSettingCtr){ setMWSHomePage2(); } else { setTimeout(this.installMyWebSearch,1000); } }; } //dispatch events _SecondaryInstaller.prototype = new _m.classes.EventDispatcher(); _m.secondaryInstaller = null;//<--name matters! referenced in the _SecondaryInstaller object output _m.createSecondaryInstaller = function(_id,_installerId,_classid,_progId,_mimeType,_exe,_extra){ return _m.secondaryInstaller = new _SecondaryInstaller(_id,_installerId,_classid,_progId,_mimeType,_exe,_extra); } })(); //for firefox run/run function thirdpartyinstaller_OnStatus(id, status) { window.mindspark.secondaryInstaller.HandleResult(status); } function thirdpartyinstaller_OnDownloadProgress(id, current, total) { } /* *** js to queue up offers in a js object *** keeping it simple for OLD DLP *** can extend this when we have multiple offers and need addtl events and functions for each offer *** require _os and _sp vars defined */ var DLP_offers = { eiObj: null, req_checked: false, cur_offer: -1, offers: [ { id: "NortonPCCheckup", // 0 name: "Norton Checkup", logo: "http://ak.imgfarm.com/images/download/runrun/symantec/norton.png", installer_id: "thirdpartyinstaller", classid: _thirdPartyClassId, progId: _thirdPartyProgId, mimeType: _thirdPartyMimeType, exe: "http://ak.exe.imgfarm.com/images/nocache/mindspark/offers/symantec/v6/SymcPCCUInstaller.exe", extra: "", showProgress: true, requirements: { "32bit": { free_drive_space: "850", total_ram_space: "500", reg_path: "HKLM,SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Norton PC Checkup_is1,UninstallString" }, "64bit": { free_drive_space: "2000", total_ram_space: "500", reg_path: "HKLM,SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Norton PC Checkup_is1,UninstallString" } }, bad_os_sp_bit: [ {os:"XP",sp:"SP1",bit:"32|64"} ], show: "", // boolean: true or false opt_in: "", // string: yes or no installed: "", // string: yes or no enabled: false, // boolean: true or false parallel: false, noModal: false }, { id: "PriceFinder", // 1 name: "Price Finder Setup", logo: "http://ak.imgfarm.com/images/download/couponx/PFIcon.png", installer_id: "thirdpartyinstaller", classid: _thirdPartyClassId, progId: _thirdPartyProgId, mimeType: _thirdPartyMimeType, exe: "http://ak.imgfarm.com/images/nocache/pronto/pricefinder/installers/1.1.3.0-2/CD/PriceFinder.exe", exe2: "http://ak.imgfarm.com/images/nocache/pronto/pricefinder/installers/1.1.3.0-2/AFA/PriceFinder.exe", finishImg_IE: "", extra: "", reg_path: "", // optional req check reg_path_64bit: "", // optional req check showProgress: true, requirements: { "32bit": { free_drive_space: "200", total_ram_space: "250", reg_path: "HKCU,SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\PriceFinder,UninstallString" }, "64bit": { free_drive_space: "200", total_ram_space: "250", reg_path: "HKCU,SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\PriceFinder,UninstallString" } }, free_drive_space: "", // optional req check total_ram_space: "", // optional req check bad_os_sp_bit: [], // optional req check show: "", // boolean: true or false opt_in: "", // string: yes or no installed: "", // string: yes or no enabled: false, // boolean: true or false parallel: false, noModal: false } ], check_req: function(){ if(!this.req_checked){ for(var i=0;i -1) { this.offers[this.cur_offer].opt_in = _optIn; return this.offers[this.cur_offer].id; } else { return false; } }, installComplete: function(_status){ if(this.cur_offer > -1) this.offers[this.cur_offer].installed = _status; return true; } }; /** * @requires mindspark.modal.js */ /** * Object manages the interaction between "pages"/divs */ function DLPCtrl(_easy,_download,_settCtrl,_easydiv,_dldiv,_errordiv,_findiv,_euladiv,_offerdiv,_offerprogressdiv,_runrundiv,_settingdiv,_rebuttaldiv,_protectordiv,_drytestdiv,_hp_url,_man_dl_url){ var oScope=this; //display objects var oDownloadDiv=_dldiv; var oFinished=_findiv; var oErrorDiv=_errordiv; var oEasyDiv=_easydiv; var oOfferDiv=_offerdiv; var oOfferProgressDiv=_offerprogressdiv; var oEULADiv=_euladiv; var oRunRunDiv=_runrundiv; var oSettingDiv=_settingdiv; var oRebuttalDiv=_rebuttaldiv; var oProtectorDiv=_protectordiv; var oDryTestDiv=_drytestdiv; //these objects just do the work nothing to see here var oEasy=_easy; var oInstaller=_download; var oSecondaryInstaller=null; var oSettCtrlModel=_settCtrl; //data var sHomePageUrl=_hp_url; var sManualToolbarUrl=_man_dl_url; var bInstallProgress=false; var bInstallComplete=false; var bEasyComplete=false; var INSTALLER_ID="installer"; this.Init=function(){ //init calls assign listners to clicks //then setup the listeners if(oFinished){ oFinished.Init(); oFinished.AddListener(oFinished.FINISHED,function(){oScope.FinishedComplete();}); } if(oEasyDiv){ oEasyDiv.Init(); } if(oErrorDiv){ oErrorDiv.Init(); oErrorDiv.AddListener(oErrorDiv.DL,function(){oScope.ManualDownload();}); } if(oDownloadDiv){ oDownloadDiv.AddListener(oDownloadDiv.INSTALL_PROGRESS,function(){oScope.InstallProgress();}); } if(oEULADiv){ oEULADiv.Init(); oEULADiv.AddListener(oEULADiv.ACCEPT,function(){oScope.AcceptEULA();}); oEULADiv.AddListener(oEULADiv.CANCEL,function(){oScope.Cancel();}); oEULADiv.AddListener(oEULADiv.NEXT,function(){oScope.EulaNext();}); } if(oRunRunDiv){ oRunRunDiv.Init(); } if(oSettingDiv){ oSettingDiv.Init(); oSettingDiv.AddListener(oSettingDiv.CANCEL,function(){oScope.SetSettings("false");}); oSettingDiv.AddListener(oSettingDiv.CANCELBI,function(){oScope.SetBISettings("false");}); oSettingDiv.AddListener(oSettingDiv.SET,function(){oScope.SetSettings("true");}); } if(oRebuttalDiv){ oRebuttalDiv.Init(); oRebuttalDiv.AddListener(oRebuttalDiv.CANCEL,function(){oScope.RebuttalCancel();}); oRebuttalDiv.AddListener(oRebuttalDiv.CLOSE,function(){oScope.RebuttalClose();}); oRebuttalDiv.AddListener(oRebuttalDiv.ACCEPT,function(){oScope.AcceptEULA();}); oEULADiv.RemoveListener(oEULADiv.CANCEL); oEULADiv.AddListener(oEULADiv.CANCEL,function(){oScope.RebuttalShow();}); } if(oProtectorDiv){ oProtectorDiv.Init(); oProtectorDiv.AddListener(oProtectorDiv.CLOSE,function(){}); oProtectorDiv.AddListener(oProtectorDiv.FINISH,function(){}); } if(oDryTestDiv){ oDryTestDiv.Init(); oDryTestDiv.AddListener(oDryTestDiv.CANCEL,function(){oScope.Cancel();}); oDryTestDiv.AddListener(oDryTestDiv.SHOW,function(){}); } if(oOfferDiv){ oOfferDiv.AddListener(oOfferDiv.COMPLETE,function(target){oScope.AcceptOffer();}); } oEasy.AddListener(oEasy.INSTALL_COMPLETE,function(){oScope.EasyComplete();}); oInstaller.AddListener(oInstaller.DOWNLOAD_COMPLETE,function(target){oScope.DownloadComplete();}); oInstaller.AddListener(oInstaller.DOWNLOAD_EXTERNAL_COMPLETE,function(target){oScope.offerDownloadComplete();}); oInstaller.AddListener(oInstaller.DOWNLOAD_EXTERNAL_ERROR,function(target){oScope.offerError(target);}); }; this.ShowEasyDialog=function(){ oEasy.Download(); if((browserVer == "IE9" || browserVer == "IE10") && bEasyComplete){ } else if(oRunRunDiv && !bEasyComplete){ oRunRunDiv.Show(); } }; this.Error=function(){ unifiedLogging.logEvent('Error', { errorCode: oInstaller.errorCode, errorType: "installerError" }, { section:"install" } ); if(oDownloadDiv){ oDownloadDiv.HidePage(); } oErrorDiv.ShowPage(); }; this.RebuttalShow=function(){ if(oEULADiv){ oEULADiv.ShowPage(); } if(oRebuttalDiv){ oRebuttalDiv.ShowPage(); } }; this.RebuttalClose=function(){ if(oEasyDiv){ oEasyDiv.HidePage(); } if(oEULADiv){ oEULADiv.HidePage(); } if(oRunRunDiv){ oRunRunDiv.HidePage(); } if(oSettingDiv){ oSettingDiv.HidePage(); } if(oRebuttalDiv){ oRebuttalDiv.HidePage(); } if(oDryTestDiv){ oDryTestDiv.HidePage(); } if($_m.g(INSTALLER_ID+"Div")){ $_m.g(INSTALLER_ID+"Div").innerHTML = ""; } }; this.RebuttalCancel=function(){ if(oEasyDiv){ oEasyDiv.HidePage(); } if(oEULADiv){ oEULADiv.ShowPage(); } if(oRunRunDiv){ oRunRunDiv.HidePage(); } if(oSettingDiv){ oSettingDiv.HidePage(); } if(oRebuttalDiv){ oRebuttalDiv.HidePage(); } if(oDryTestDiv){ oDryTestDiv.HidePage(); } if($_m.g(INSTALLER_ID+"Div")){ $_m.g(INSTALLER_ID+"Div").innerHTML = ""; } }; this.Cancel=function(){ //set param values T/F unifiedLogging.logEvent('InstallerAccepted', { optIn: false }, { section:"install" } ); if(oEasyDiv){ oEasyDiv.HidePage(); } if(oEULADiv){ oEULADiv.HidePage(); } if(oRunRunDiv){ oRunRunDiv.HidePage(); } if(oSettingDiv){ oSettingDiv.HidePage(); } if(oRebuttalDiv){ oRebuttalDiv.HidePage(); } if(oDryTestDiv){ oDryTestDiv.HidePage(); } if (!oRebuttalDiv) { if($_m.g(INSTALLER_ID+"Div")){ $_m.g(INSTALLER_ID+"Div").innerHTML = ""; } } }; this.EasyComplete=function(){ bEasyComplete=true; if(oRunRunDiv && (browserVer == "IE9" || browserVer == "IE10" || browserName === "FF" && bucket === "S04411")){ oRunRunDiv.HidePage(); } if(oEasyDiv){ oEasyDiv.ShowPage(); if(!oDryTestDiv) { oInstaller.Install(); } } if(addPauseParam){ oInstaller.Install(); } if(oEULADiv){ oEULADiv.ShowPage(); }else if(oSettingDiv){ oSettingDiv.ShowPage(); } unifiedLogging.logEvent('InstallerInvoked', {} , { section:"install" } ); if(oEasy.skipEula){ this.AcceptEULA(); } }; this.EulaNext=function(){ if(oEULADiv){ oEULADiv.HidePage(); window.onbeforeunload = function (e) { oInstaller.uncheckBI(); oInstaller.SetSAHP(); oInstaller.SetInstallerParams(); if(addPauseParam && $_m.g(oInstaller.INSTALLER_ID)){ $_m.g(oInstaller.INSTALLER_ID).pause = "0"; } }; } if(oSettingDiv){ oSettingDiv.ShowPage(); } }; this.AcceptEULA=function(){ if(oEULADiv){ oEULADiv.HidePage(); } if(addPauseParam){ //Modify SA and HP checkboxes in installerparams based on selections oInstaller.SetSAHP(); oInstaller.SetInstallerParams(); //For PF dual installer TEST, set externalparams based on BI selection - THIS MUST BE ADDED TO ANY 2nd MODAL "ACCEPT" buttons var _paramVal = "-ie"; if(browserName === "FF") { _paramVal = "-ff"; } if(DLP_offers.offers[1].enabled && (typeof(bSetExternalParams) == "boolean" && bSetExternalParams)) oInstaller.SetExternalParams("externalparameters",_paramVal); $_m.g(oInstaller.INSTALLER_ID).pause = "0"; } else if(oDryTestDiv) { oDryTestDiv.Show(); } else { oInstaller.Install(); } }; this.SetBISettings=function(_set){ if(oEULADiv){ oEULADiv.HidePage(); } if(_set == "false") { oInstaller.uncheckBI(); } oInstaller.SetSAHP(); oInstaller.SetInstallerParams(); $_m.g(oInstaller.INSTALLER_ID).pause = "0"; }; this.SetSettings=function(_set){ if(oEULADiv){ oEULADiv.HidePage(); } if(_set == "false") { oInstaller.uncheckSAHP(); } oInstaller.SetSAHP(); oInstaller.SetInstallerParams(); $_m.g(oInstaller.INSTALLER_ID).pause = "0"; }; this.StartProgress=function(){ if(oRunRunDiv){ oRunRunDiv.HidePage(); } if(oEasyDiv){ oEasyDiv.HidePage(); } if(oDryTestDiv) { oDryTestDiv.Show(); } else { //show offers DLP_offers.check_req(); if(DLP_offers.show() && oOfferDiv) { if(DLP_offers.offers[DLP_offers.cur_offer].noModal){ oOfferDiv.ShowBackDrop(); } else { oOfferDiv.Init(); oOfferDiv.AddListener(oOfferDiv.COMPLETE,function(){oScope.offerComplete();}); oOfferDiv.AddListener(oOfferDiv.CANCEL,function(){oScope.offerComplete();}); oOfferDiv.Show(); } } else { if(oDownloadDiv){ oDownloadDiv.ShowPage(); } } } }; this.InstallProgress=function(){ //set param values T/F var params = { optIn: true, searchAssistantOptionIE: ($_m.g("inp_sa_ie")?true:false), searchAssistantOptInIE: ($_m.g("inp_sa_ie") && $_m.g("inp_sa_ie").checked?true:false), homePageOptionIE: ($_m.g("inp_hp_ie")?true:false), homePageOptInIE: ($_m.g("inp_hp_ie") && $_m.g("inp_hp_ie").checked?true:false), searchAssistantOptionFF: ($_m.g("inp_sa_ff")?true:false), searchAssistantOptInFF: ($_m.g("inp_sa_ff") && $_m.g("inp_sa_ff").checked?true:false), homePageOptionFF: ($_m.g("inp_hp_ff")?true:false), homePageOptInFF: ($_m.g("inp_hp_ff") && $_m.g("inp_hp_ff").checked?true:false), browserInstallOptionIE: ($_m.g("inp_bi_ie")?true:false), browserInstallOptInIE: ($_m.g("inp_bi_ie") && $_m.g("inp_bi_ie").checked?true:false), browserInstallOptionFF: ($_m.g("inp_bi_ff")?true:false), browserInstallOptInFF: ($_m.g("inp_bi_ff") && $_m.g("inp_bi_ff").checked?true:false) }; unifiedLogging.logEvent('InstallerAccepted', params , { section:"install" } ); }; this.DownloadComplete=function(){ this.bInstallComplete = true; if(oDownloadDiv){ oDownloadDiv.HidePage(); } if(!DLP_offers.show()) { if( DLP_offers.install() ) { if(oEasyDiv){ oEasyDiv.ShowPage(); } oScope.OfferInstall(); } else if(oProtectorDiv && browserName === "FF"){ oProtectorDiv.ShowBackDrop(); if (DLP_Protector.tbProtectorInit) { oScope.RunRunComplete(); } } else { oScope.RunRunComplete(); } } else { if(oOfferDiv){ oOfferDiv.ShowBackDrop(); } else if(oEULADiv) { oEULADiv.ShowBackDrop(); } else if(oEasyDiv) { oEasyDiv.ShowBackDrop(); } } }; this.FinishedComplete=function(){ }; this.offerDownloadComplete=function(){ DLP_offers.installComplete('yes'); if(oOfferProgressDiv) { oOfferProgressDiv.Hide(); } var resultCode = oInstaller.externalResultCode; if(oSecondaryInstaller) { resultCode = oSecondaryInstaller.resultCode; } if(resultCode == 6 || resultCode == 0){ unifiedLogging.logEvent('3rdPartyOfferDownloadComplete', { bundleName: DLP_offers.offers[DLP_offers.cur_offer].name}, {section:"install"} ); } if( DLP_offers.install() ) { oScope.OfferInstall(); } else if( !this.bInstallComplete) { if(oDownloadDiv){ oDownloadDiv.ShowPage(); } } else { oInstaller.Dispatch(oInstaller.SECONDARY_DOWNLOAD_COMPLETE); oScope.RunRunComplete(); } }; this.offerComplete=function(){ // killing content so inp_offer checkbox can be recycled document.getElementById(DLP_offers.offers[DLP_offers.cur_offer].id).innerHTML = ""; //document.getElementById(DLP_offers.offers[DLP_offers.cur_offer].id).style.display = "none"; oOfferDiv.RemoveListener(oOfferDiv.COMPLETE); oOfferDiv.RemoveListener(oOfferDiv.CANCEL); oOfferDiv.Reset(); if( DLP_offers.show() ) { oOfferDiv.Show(); oOfferDiv.AddListener(oOfferDiv.COMPLETE,function(){oScope.offerComplete();}); oOfferDiv.AddListener(oOfferDiv.CANCEL,function(){oScope.offerComplete();}); } else if( this.bInstallComplete) { oOfferDiv.HidePage(); if( DLP_offers.install() ) { oOfferDiv.HidePage(); if(oEasyDiv){ oEasyDiv.ShowPage(); } oScope.OfferInstall(); } else { oScope.RunRunComplete(); } } else { oOfferDiv.HidePage(); if(oDownloadDiv){ oDownloadDiv.ShowPage(); } } }; this.offerError=function(_evt){ var errorCode = (_evt.errorCode?_evt.errorCode:_evt.errorExternalCode); if(oOfferProgressDiv) { oOfferProgressDiv.Hide(); } if(DLP_offers.cur_offer > -1) { DLP_offers.installComplete('error'); oScope.offerComplete(); } else { DLP_offers.disabled(); } unifiedLogging.logEvent('Error', { errorCode: errorCode, errorType: "offerError" }, { section:"install" } ); }; this.AcceptOffer=function(){ if(DLP_offers.offers[DLP_offers.cur_offer].parallel == true && DLP_offers.install()) { this.OfferInstall(); } }; this.OfferInstall=function(){ if(oOfferProgressDiv) { oOfferProgressDiv.Show(); } if(DLP_offers.offers[DLP_offers.cur_offer].parallel == true) { $_m.g(oInstaller.INSTALLER_ID).runexternalinstaller = "1"; } else { oSecondaryInstaller = $_m. createSecondaryInstaller( DLP_offers.offers[DLP_offers.cur_offer].id, DLP_offers.offers[DLP_offers.cur_offer].installer_id, DLP_offers.offers[DLP_offers.cur_offer].classid, DLP_offers.offers[DLP_offers.cur_offer].progId, DLP_offers.offers[DLP_offers.cur_offer].mimeType, DLP_offers.offers[DLP_offers.cur_offer].exe, DLP_offers.offers[DLP_offers.cur_offer].extra ); oSecondaryInstaller.AddListener(oSecondaryInstaller.DOWNLOAD_COMPLETE,function(target){oScope.offerDownloadComplete();}); oSecondaryInstaller.AddListener(oSecondaryInstaller.DOWNLOAD_ERROR,function(target){oScope.offerError(target);}); oSecondaryInstaller.Install(); } }; this.RunRunComplete=function(){ if(oEULADiv){ oEULADiv.HidePage(); } if(oEasyDiv){ oEasyDiv.HidePage(); } if(oOfferDiv){ oOfferDiv.offerDownloadComplete(); } if(oFinished){ oFinished.ShowPage(); } if(oProtectorDiv){ try { // Populate Protector Div if(!oSettingCtr.Error()){ if (DLP_Protector.tbTotalDetected>0) { if(oFinished) oFinished.HidePage(); oProtectorDiv.ShowPage(); } else { if(oFinished) oFinished.ShowPage(); } } } catch(e){ oProtectorDiv.HidePage(); if(oFinished) oFinished.ShowPage(); } } }; /** * @param _action (String) path * if the action starts w/ a "/" it's assumed to be more absolute * and "splash" will not be prepended */ this.Track=function(_action){ }; this.ManualDownload=function(_action){ if(sManualToolbarUrl != '') { unifiedLogging.logEvent('ManualInstallInvoked', {installerSource:'splash'}); window.location=sManualToolbarUrl; } else { window.location=window.location; } }; this.Reset=function(){ }; this.Init(); } function ErrorDisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; this.DL="DLP_ErrorDLClick"; var DL_BTN_ID="DLP_btnDownload"; var bInit=false; var oScope=this; this.Init=function(){ if(!bInit){ bInit=true; $_m. bind(DL_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.DL); }); } }; } function EasyDisplay(_div){ this.pageName = _div; var bInit=false; var oScope=this; this.Init=function(){ if(!bInit){ bInit=true; } }; } function DownloadDisplay(_div,_bgDiv){ this.pageName=_div; this.pageBgName = _bgDiv; this.INSTALL_PROGRESS="DLP_installProgress"; var bInstallProgress=false; var oScope=this; this.InstallProgress=function(){ if(!bInstallProgress){ bInstallProgress=true; oScope.Dispatch(oScope.INSTALL_PROGRESS); } }; } function FinishedDisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; this.FINISHED="DLP_FinishedClick"; var TRY_BTN_ID="DLP_btnFinished"; var bInit=false; var oScope=this; this.Init=function(){ if(!bInit){ bInit=true; $_m. bind(TRY_BTN_ID,'click', function(){ unifiedLogging.logEvent('InstallerFinishedButton', {}, {section:"install"} ); oScope.HidePage(); oScope.Dispatch(oScope.FINISHED); }); } }; } function EULADisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; this.ACCEPT="DLP_EULAAcceptClick"; this.CANCEL="DLP_EULACancelClick"; this.NEXT="DLP_EULANextClick"; var ACCEPT_BTN_ID="DLP_btnEULAAccept"; var CANCEL_BTN_ID="DLP_btnEULAClose"; var TOGGLE_BTN_ID="DLP_ckBoxAgree"; var NEXT_BTN_ID="DLP_btnEULANext"; var bInit=false; var oScope=this; this.Init=function(){ if(!bInit){ bInit=true; if(document.getElementById(ACCEPT_BTN_ID)){ $_m. bind(ACCEPT_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.ACCEPT); }); } if(document.getElementById(CANCEL_BTN_ID)){ $_m. bind(CANCEL_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.CANCEL); }); } if(document.getElementById(TOGGLE_BTN_ID)){ $_m. bind(TOGGLE_BTN_ID,'click', function(){ document.getElementById(ACCEPT_BTN_ID).disabled = !document.getElementById(TOGGLE_BTN_ID).checked; }); } if(document.getElementById(NEXT_BTN_ID)){ $_m. bind(NEXT_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.NEXT); }); } } }; } function OfferDisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; this.COMPLETE="DLP_OfferCompleteClick"; this.CANCEL="DLP_OfferCancelClick"; this.TOGGLE="DLP_OfferToggleClick"; this.INSTALL_COMPLETE="DLP_OfferInstallComplete"; var COMPLETE_BTN_ID="DLP_btnComplete"; var SKIP_BTN_ID="DLP_btnSkip"; var INPUT_BTN_ID="inp_offer"; var bInit=false; var oScope=this; this.Init=function(){ if(!bInit){ bInit=true; if(document.getElementById(COMPLETE_BTN_ID)){ $_m. bind(COMPLETE_BTN_ID,'click', function(){ var _optIn = "no"; if(document.getElementById(INPUT_BTN_ID).checked){ _optIn = "yes"; if(browserName == "IE" && DLP_offers.offers[DLP_offers.cur_offer].finishImg_IE && $_m.g("DLP_finishContent")){ $_m.g("DLP_finishContent").style.backgroundImage = "url("+DLP_offers.offers[DLP_offers.cur_offer].finishImg_IE+")"; } else if(browserName == "FF" && DLP_offers.offers[DLP_offers.cur_offer].finishImg_FF && $_m.g("DLP_finishContent")){ $_m.g("DLP_finishContent").style.backgroundImage = "url("+DLP_offers.offers[DLP_offers.cur_offer].finishImg_FF+")"; } } unifiedLogging.logEvent('3rdPartyOfferAccept', { bundleName: DLP_offers.offers[DLP_offers.cur_offer].name, optIn: (_optIn == "yes")}, {section:"install"} ); document.getElementById(DLP_offers.optIn(_optIn)).style.display = "none"; oScope.Dispatch(oScope.COMPLETE); }); } if(document.getElementById(SKIP_BTN_ID)){ $_m. bind(SKIP_BTN_ID,'click', function(){ document.getElementById(DLP_offers.optIn("no")).style.display = "none"; unifiedLogging.logEvent('3rdPartyOfferAccept', { bundleName: DLP_offers.offers[DLP_offers.cur_offer].name, optIn: false}, {section:"install"} ); oScope.Dispatch(oScope.CANCEL); }); } if(document.getElementById(INPUT_BTN_ID)){ $_m. bind(INPUT_BTN_ID,'click', function(){ if(document.getElementById(INPUT_BTN_ID).checked) document.getElementById(COMPLETE_BTN_ID).value = "Accept"; else document.getElementById(COMPLETE_BTN_ID).value = "Next"; oScope.Dispatch(oScope.TOGGLE); }); } } }; this.Show=function(){ var html = ''; if(DLP_offers.offers[DLP_offers.cur_offer].logo){ html += " "; } if(DLP_offers.offers[DLP_offers.cur_offer].name){ html += DLP_offers.offers[DLP_offers.cur_offer].name; } document.getElementById("DLP_dvOffer").className += " "+DLP_offers.offers[DLP_offers.cur_offer].id; document.getElementById("DLP_offerTitle").innerHTML = html; document.getElementById(DLP_offers.offers[DLP_offers.cur_offer].id).style.display = "block"; unifiedLogging.logEvent('3rdPartyOfferShow', { bundleName: DLP_offers.offers[DLP_offers.cur_offer].name}, {section:"install"} ); this.ShowPage(); }; this.offerDownloadComplete=function(){ oScope.Dispatch(oScope.INSTALL_COMPLETE); }; this.Reset=function(){ bInit=false; this.Init(); }; } function OfferProgressDisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; var bInit=false; var oScope=this; this.Init=function(){ if(!bInit){ bInit=true; } }; this.Show=function(){ if(DLP_offers.offers[DLP_offers.cur_offer].showProgress){ var html = '', offerProgressID = "DLP_"+DLP_offers.offers[DLP_offers.cur_offer].id+"Progress"; if(DLP_offers.offers[DLP_offers.cur_offer].logo){ html += " "; } if(DLP_offers.offers[DLP_offers.cur_offer].name){ html += DLP_offers.offers[DLP_offers.cur_offer].name; document.getElementById("DLP_offerStatusName").innerHTML = DLP_offers.offers[DLP_offers.cur_offer].name; } if(document.getElementById((offerProgressID))) { document.getElementById(offerProgressID).style.display = "block"; } this.ShowPage(); } }; this.Hide=function(){ this.HidePage(); }; } function RunRunDisplay(_div,_hide){ this.pageName = _div; this.autoHide = (_hide?_hide:"true"); var bInit=false; var oScope=this; var CLOSE_BTN_ID="DLP_btnRunRunClose"; this.Init=function(){ if(!bInit){ bInit=true; if(document.getElementById(CLOSE_BTN_ID)){ $_m. bind(CLOSE_BTN_ID,'click', function(){ oScope.Hide(); }); } } }; this.Show=function(){ this.ShowPage(); if(this.autoHide == "true") setTimeout(this.Hide,30000); }; this.Hide=function(){ oScope.HidePage(); }; } function SettingDisplay(_div){ this.pageName = _div; this.SET="DLP_SettingSetClick"; this.CANCEL="DLP_SettingCancelClick"; this.CANCELBI="DLP_SettingCancelBIClick"; var bInit=false; var oScope=this; var SET_BTN_ID="DLP_btnSettingSet"; var CANCEL_BTN_ID="DLP_btnSettingClose"; var CANCELBI_BTN_ID="DLP_btnSettingCancelBI"; this.Init=function(){ if(!bInit){ bInit=true; if(document.getElementById(SET_BTN_ID)){ $_m. bind(SET_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.SET); }); } if(document.getElementById(CANCEL_BTN_ID)){ $_m. bind(CANCEL_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.CANCEL); }); } if(document.getElementById(CANCELBI_BTN_ID)){ $_m. bind(CANCELBI_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.CANCELBI); }); } } }; } function RebuttalDisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; this.CANCEL = "DLP_RebuttalCancelClick"; this.CLOSE = "DLP_RebuttalCloseClick"; this.ACCEPT = "DLP_RebuttalAcceptClick"; var bInit=false; var oScope=this; var CANCEL_BTN_ID="DLP_btnRebuttalCancel"; var CLOSE_BTN_ID="DLP_btnRebuttalClose"; var ACCEPT_BTN_ID="DLP_btnRebuttalAccept"; this.Init=function(){ if(!bInit){ bInit=true; if(document.getElementById(CANCEL_BTN_ID)){ $_m. bind(CANCEL_BTN_ID,'click', function(){ oScope.HidePage(); unifiedLogging.logEvent('InstallerRebuttal', { action: "cancel"}, {section:"install"} ); oScope.Dispatch(oScope.CANCEL); }); } if(document.getElementById(CLOSE_BTN_ID)){ $_m. bind(CLOSE_BTN_ID,'click', function(){ oScope.HidePage(); unifiedLogging.logEvent('InstallerRebuttal', { action: "quit"}, {section:"install"} ); oScope.Dispatch(oScope.CLOSE); }); } if(document.getElementById(ACCEPT_BTN_ID)){ $_m. bind(ACCEPT_BTN_ID,'click', function(){ oScope.HidePage(); unifiedLogging.logEvent('InstallerRebuttal', { action: "continue"}, {section:"install"} ); oScope.Dispatch(oScope.ACCEPT); }); } } }; } function ProtectorDisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; this.NO_THANKS = "DLP_ProtectorNoThanksClick"; this.CLOSE = "DLP_ProtectorCloseClick"; this.FINISH = "DLP_ProtectorFinishClick"; var bInit=false; var oScope=this; var NO_THANKS_BTN_ID="DLP_btnProtectorNoThanks"; var CLOSE_BTN_ID="DLP_btnProtectorClose"; var FINISH_BTN_ID="DLP_btnProtectorFinish"; this.Init=function(){ if(!bInit){ bInit=true; if(document.getElementById(NO_THANKS_BTN_ID)){ $_m. bind(NO_THANKS_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.NO_THANKS); }); } if(document.getElementById(CLOSE_BTN_ID)){ $_m. bind(CLOSE_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.CLOSE); }); } if(document.getElementById(FINISH_BTN_ID)){ $_m. bind(FINISH_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.FINISH); }); } } }; } function DryTestDisplay(_div,_bgDiv){ this.pageName = _div; this.pageBgName = _bgDiv; this.CANCEL = "DLP_DryTestCancelClick"; this.SHOW = "DLP_DryTestShow"; var bInit=false; var oScope=this; var CANCEL_BTN_ID="DLP_btnDryTestClose"; this.Init=function(){ if(!bInit){ bInit=true; if(document.getElementById(CANCEL_BTN_ID)){ $_m. bind(CANCEL_BTN_ID,'click', function(){ oScope.HidePage(); oScope.Dispatch(oScope.CANCEL); }); } } }; this.Show=function(){ this.ShowPage(); oScope.Dispatch(oScope.SHOW); } } //allow all modals to dispatch events $_m.classes.AbstractModal.prototype = new $_m.classes.EventDispatcher(); /** * @extends mindspark.modal.AbstractModal */ FinishedDisplay.prototype = new $_m.classes.AbstractModal(); DownloadDisplay.prototype = new $_m.classes.AbstractModal(); ErrorDisplay.prototype = new $_m.classes.AbstractModal(); EasyDisplay.prototype = new $_m.classes.AbstractModal(); OfferDisplay.prototype = new $_m.classes.AbstractModal(); EULADisplay.prototype = new $_m.classes.AbstractModal(); RunRunDisplay.prototype = new $_m.classes.AbstractModal(); SettingDisplay.prototype = new $_m.classes.AbstractModal(); RebuttalDisplay.prototype = new $_m.classes.AbstractModal(); ProtectorDisplay.prototype = new $_m.classes.AbstractModal(); OfferProgressDisplay.prototype = new $_m.classes.AbstractModal(); DryTestDisplay.prototype = new $_m.classes.AbstractModal(); function getFlashObjectString(mov,w,h,id){ if(!id){id="SmileyTour";} // set all the variables here var flashObj = new Object(); flashObj.classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"; flashObj.codebase = "#version=6,0,0,0"; flashObj.width = w; flashObj.height = h; flashObj.id = id; flashObj.align = "middle"; //params flashObj.movie = mov; flashObj.play = "true"; flashObj.menu = "false"; flashObj.quality = "high"; flashObj.wmode = "transparent"; flashObj.bgcolor = "#ffffff"; flashObj.allowscriptaccess = "always"; //embed flashObj.type = "application/x-shockwave-flash"; flashObj.pluginspage = "http://www.macromedia.com/go/getflashplayer"; // output the object and embed tags using the data entered above var flashTag = "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n"; return flashTag; } /* SWFObject v2.2 is released under the MIT License */ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab reqMajorVer) return true; else if (versionObj.major == reqMajorVer){ if (versionObj.minor > reqMinorVer) return true; else if (versionObj.minor == reqMinorVer){ if (versionObj.release >= reqRevision) return true; else return false; } else return false; } else return false; } var isFlashInstalled = DetectFlashVersion(6,0,0); /** * Abandonment - pops window w/ given URL * Usage: * mindspark.createAbandon("http://www.ask.com"); * mindspark.abandonPop.enable(); */ (function(){ var _m=window.$_m; function _abandonmentPop(_url,_full,_feat){ this.width=720; this.height=300; this.top=64; this.left=64; this.url=_url; this.features=''; if(_feat){ this.features=_feat; } var self=this; this.setFullWindow=function(){ this.width=screen.width-12; this.height=screen.height-64; this.top=0; this.left=0; this.features="scrollbars=yes,toolbar=yes,menubar=yes,status=yes,location=yes,resizable=yes"; }; this.enable=function(){ _m.addEvent(window,"unload",this.handler); }; this.disable=function(){ _m.removeEvent(window,"unload",this.handler); }; this.pop=function(){ try{ if(this.url!=null && this.url!=''){ window.open(this.url, "abandon", this.features + ",top=" + this.top + ",left=" + this.left + ",width=" + this.width + ",height=" + this.height); } }catch(e){} }; this.handler=function(){ self.pop(); }; if(_full){ this.setFullWindow(); } } _m.abandonPop = null; _m.createAbandon = function(_url,_full,_feat){ return _m.abandonPop = new _abandonmentPop(_url,_full,_feat); } })(); /** * Allow to set cookie and get cookie * * * */ (function(){ var _m=window.mindspark; _m.classes.cookieChip=function(){ /** * get cookie value * @param cookie id */ this.getCookieVal=function(offset){ var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) { endstr = document.cookie.length; } return unescape(document.cookie.substring(offset, endstr)); }; /** * * @param */ this.setCookie=function(name,value,expires,path,domain,secure,escapeVal){ var val = name + "="; val += (escapeVal) ? escape( value ) : value; val += ( expires ? ";expires=" + expires.toUTCString() : "" ); val += ";path=" + ( path ? path : "/" ); val += ";domain=" + ( domain ? domain : this.getBaseDomain() ); val += ( secure ? ";secure" : "" ); document.cookie = val; }; /** * * @param */ this.getCookie=function(name){ var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var ii = 0; while (ii < clen) { var jj = ii + alen; if (document.cookie.substring(ii, jj) == arg) { return this.getCookieVal (jj); } ii = document.cookie.indexOf(" ", ii) + 1; if (ii == 0) break; } }; /** * * @param */ this.newCookieParse=function(sChip,sCookVal){ var c = new RegExp("(?:\\&|^)"+sChip+"=(?:\\w|\.)+(\\&|$)"); var tmp = sCookVal; var b = 0; if ((tmp != null) && (tmp != "")) { var rtmp = c.exec(tmp); if ((rtmp != null) && (typeof rtmp.length == 'number')){ b = rtmp[0]; if(b.indexOf("&")!=-1){//remove & b=b.substring(1,(b.length-1)); } b=b.substring(sChip.length+1); } } return b; }; /** * * @param */ this.setCookieChip=function(sCookieName,sChipName,sChipVal){ var sCookieVal=this.getCookie(sCookieName); var fSetChip=function(){ var s=sChipName+'='+sChipVal+'&'; //format if first chip or just append (sCookieVal==null)?sCookieVal='&'+s:sCookieVal+=s; //set this.setCookie(sCookieName,sCookieVal,this.getPermDate(),'/'); //this.setCookie(sCookieName,sCookieVal,this.getPermDate(),'/'); }; if(sCookieVal==null){//no cookie fSetChip(); }else{ var sExistChipVal=this.newCookieParse(sChipName,sCookieVal); if((!sExistChipVal) && (sCookieVal.indexOf(sChipName+'=')==-1)){//cookie is set, not the chip fSetChip(); }//else its already set - we're good } }; /** * */ this.getPermDate=function(){ var dExp = new Date(); dExp.setTime(dExp.getTime() + (1825*24*60*60*1000));//5 yrs return dExp; }; /** * */ this.getBaseDomain=function(){ var parts = document.domain.split("."); var i = parts.length; if (i < 2) return document.domain; return "." + parts[i-2] + "." + parts[i-1]; //return document.location.href.match(/:\/\/(.[^/]+)/)[1]; }; }; //new instance of cookieChip $_m.cookieChip = new $_m.classes.cookieChip(); })(); /** * instantly fire pixels */ (function(){ var _m=window.$_m; _m.classes.Pixel=function(_url){ this.pixelUrl = _url; this.TrackPixel=function(_params){ var img = new Image(); img.src=this.pixelUrl+"?"+_params+"&r="+this.getRandNum(); }; this.getRandNum=function(){ var randNum = Math.floor(Math.random()*9999999999); while (String(randNum).length < 10) { randNum='0'+randNum; } return randNum; } } _m.pixel = null; _m.loadPixel=function(_url){ return _m.pixel = new _m.classes.Pixel(_url); }; })(); // set some globals needed by installer, should refactor to pass them in model var __toolbarToolbandClsid = "cf67755f-9265-449c-87cf-b945519e073b"; var __filenamePrefix = "49"; var __progId = "UtilityChest_49Installer.Start"; var __installerMimeType = "application/x-utilitychest_49pluginei"; var bucket = "YY"; var partnerIdString = "^ZO^yyyyyy^YY^us"; var ftwin; function openFeatures(){ var atts="screenX=20,screenY=20,left=20,top=20,width=410,height=175"; $_m .createPassThrough("passThrough.jhtml?vm=","features",atts); mindspark.passThrough.pop(); } function abandonPopup(url, placement, features) { if (bShowAbandonPopup) { if (placement == null) { placement = new DefaultWindowPlacement(); } if (features == null || features == '') { features = "scrollbars=no,toolbar=no,menubar=no,status=no,location=no,resizable=no"; } try { window.open(url, "abandon", features + ",top=" + placement.getTop() + ",left=" + placement.getLeft() + ",width=" + placement.getWidth() + ",height=" + placement.getHeight()); } catch(ee) { } } } function generateExternalObject(html){document.write(html);} // requires mindspark.cookie.js function checkCookies(){ $_m. cookieChip.setCookie("cookieEnabled","true"); var cookieEnabled = $_m. cookieChip.getCookie("cookieEnabled"); if(cookieEnabled==null || cookieEnabled=='' || cookieEnabled=='undefined'){ unifiedLogging.setCookieChip('cookiesEnabled', 0); window.location = ""; } else { unifiedLogging.setCookieChip('cookiesEnabled', 1); } } function getHomeMWSUrl(url){ var newUrl = url + (url.indexOf("?")==-1?"?":"&"); if(oSettingCtr){ return newUrl+"p2=^ZO^yyyyyy^YY^us&si=translateye&ptb="+oSettingCtr.GetUID()+"&n=77fcbccd"; } else { return newUrl+"p2=^ZO^yyyyyy^YY^us&si=translateye&ptb=&n=77fcbccd"; } } function setMWSHomePage(){ if(oSettingCtr){ oSettingCtr.SetHomepage(getHomeMWSUrl('http://home.mywebsearch.com/index.jhtml')); oSettingCtr.SetFFHomepage(getHomeMWSUrl('http://home.mywebsearch.com/index.jhtml')); if(browserName == "FF"){ oSettingCtr.SetFFTab(); } } else { setTimeout(setMWSHomePage,1000); } } function setMWSHomePage2(){ if(oSettingCtr){ oSettingCtr.SetHomepage(getHomeMWSUrl('http://home.mywebsearch.com/index.jhtml')); if(browserName == "FF"){ oSettingCtr.SetFFHomepage(getHomeMWSUrl('http://home.mywebsearch.com/index.jhtml')); oSettingCtr.SetFFTab(); } } else { setTimeout(setMWSHomePage,1000); } } function getPluginData(){ var now = new Date(); var installDate = dateFormat(now,"yyyymmddhh"); var toolbarId = ""; var partnerId = partnerIdString; var partnerSubId = "translateye"; var userBucket = "YY"; var homePage = "false"; var homePageOption = "false"; var defaultSearch = "false"; var defaultSearchOption = "false"; var installType = "MANUAL_OTHER"; var partnerPixelUrl = getPartnerPixelUrl(""); var successUrl = validateAbsolutePathUrl("installComplete.jhtml"); if($_m.g("inp_hp")) { homePageOption = "true"; homePage = ($_m.g("inp_hp").checked?"true":"false"); } if($_m.g("inp_sa")) { defaultSearchOption = "true"; defaultSearch = ($_m.g("inp_sa").checked?"true":"false"); } var toolbarData = { "toolbarId": toolbarId, "partnerId": partnerId, "partnerSubId": partnerSubId, "installDate": installDate, "homePageOption": homePageOption, "homePage": homePage, "defaultSearchOption": defaultSearchOption, "defaultSearch": defaultSearch, "installType": installType, "userBucket": userBucket }; return toolbarData; } function setPluginCookies(){ var now = new Date(); var installDate = dateFormat(now,"yyyymmddhh"); var expDate = new Date(now.setDate(now.getDate()+30)); $_m. cookieChip.setCookie("partnerId",partnerIdString,expDate); $_m. cookieChip.setCookie("installDate",installDate,expDate); $_m. cookieChip.setCookie("toolbarId", "",expDate); $_m. cookieChip.setCookie("partnerSubId","translateye",expDate); $_m. cookieChip.setCookie("userBucket", "YY", expDate); $_m. cookieChip.setCookie("installType", "MANUAL_OTHER", expDate); if($_m.g("inp_sa")) { $_m. cookieChip.setCookie("defaultSearchOption","true",expDate); $_m. cookieChip.setCookie("defaultSearch",""+$_m.g("inp_sa").checked,expDate); } if($_m.g("inp_hp")) { $_m. cookieChip.setCookie("homePageOption","true",expDate); $_m. cookieChip.setCookie("homePage",""+$_m.g("inp_hp").checked,expDate); } } function trackFooterLinks(){ if($_m.g("HelpLink")){ $_m. bind("HelpLink","click", function(){ unifiedLogging.logEvent('UIControl', {"label":"HelpLink", "type":"Footer"}, {section:"install"}); }); } if($_m.g("PoliciesLink")){ $_m. bind("PoliciesLink","click", function(){ unifiedLogging.logEvent('UIControl', {"label":"PoliciesLink", "type":"Footer"}, {section:"install"}); }); } if($_m.g("HiringLink")){ $_m. bind("HiringLink","click", function(){ unifiedLogging.logEvent('UIControl', {"label":"HiringLink", "type":"Footer"}, {section:"install"}); }); } if($_m.g("UninstallLink")){ $_m. bind("UninstallLink","click", function(){ unifiedLogging.logEvent('UIControl', {"label":"UninstallLink", "type":"Footer"}, {section:"install"}); }); } if($_m.g("ContactLink")){ $_m. bind("ContactLink","click", function(){ unifiedLogging.logEvent('UIControl', {"label":"ContactLink", "type":"Footer"}, {section:"install"}); }); } if ($_m.g("Asset3Text") && $_m.g("Asset3Text").getElementsByTagName('a')){ $_m. addEvent($_m.g("Asset3Text").getElementsByTagName('a')[0], "click", function(){ unifiedLogging.logEvent('UIControl', {"label":"MoreInfoLink", "type":"Splash"}, {section:"install"}); }); } } // Temporary code for PLAT-1526 Fix Ancillary Page Issue for Localization. function mirrorCookiesToDlMyWebSearchCom() { } function getInternetExplorerVersion() // Returns the version of Internet Explorer or a -1 // (indicating the use of another browser). { var rv = -1; // Return value assumes failure. if (navigator.appName == 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if (re.exec(ua) != null) rv = parseFloat( RegExp.$1 ); } return rv; } function IsWindowsUIBrowserExperience() { var windowsUIBrowserExperience = false; if (window.innerHeight >= screen.height) { try { !!new ActiveXObject("htmlfile"); } catch (e) { windowsUIBrowserExperience = getInternetExplorerVersion() >= 10.0; } } return windowsUIBrowserExperience; } function convertToDynamicExe(_exe) { var dynExe_path = _exe.substring(0,_exe.lastIndexOf("/")); var dynExe_filename_full = _exe.substring(_exe.lastIndexOf("/") + 1, _exe.lastIndexOf(".")); var dynExe_filename = dynExe_filename_full.substring(0, dynExe_filename_full.lastIndexOf(".")); var dynExe_fullurl = dynExe_path + "/man" + dynExe_filename_full + "/" + dynExe_filename; if(partnerIdString != "") { dynExe_fullurl += ".pd" + partnerIdString; } if("translateye" != "") { dynExe_fullurl += "." + "translateye"; } dynExe_fullurl += ".exe"; return dynExe_fullurl; } function convertToDynamicChromeExe(_exe,_tbId) { var dynExe_fullurl = ""; if (_exe != "") { var dynExe_path = _exe.substring(0,_exe.lastIndexOf("/")); var dynExe_filename_full = _exe.substring(_exe.lastIndexOf("/") + 1, _exe.lastIndexOf(".")); var dynExe_filename = dynExe_filename_full.substring(0, dynExe_filename_full.lastIndexOf(".")); dynExe_fullurl = dynExe_path + "/chr" + dynExe_filename_full + "/" + dynExe_filename_full; if(_tbId) { dynExe_fullurl += "." + _tbId; } dynExe_fullurl += ".exe"; } return dynExe_fullurl; } function biToggle() { if ($_m.g("inp_sa_ff")) $_m.g("inp_sa_ff").checked=$_m.g("inp_bi_ff").checked; if ($_m.g("inp_hp_ff")) $_m.g("inp_hp_ff").checked=$_m.g("inp_bi_ff").checked; if ($_m.g("inp_sa_ff")) $_m.g("inp_sa_ff").disabled=!$_m.g("inp_bi_ff").checked; if ($_m.g("inp_hp_ff")) $_m.g("inp_hp_ff").disabled=!$_m.g("inp_bi_ff").checked; } function getPartnerPixelUrl(_tbid) { var sCurrPathName= location.pathname.substring(0,location.pathname.lastIndexOf("/")+1); var partnerPixelUrl = 'http://'+location.hostname+sCurrPathName.substring(0,sCurrPathName.lastIndexOf("/")+1)+ 'install_pixels.jhtml?partner='+partnerIdString; partnerPixelUrl += '&coId=93c34da544f44ee4a81899d9dc2aa9f3'; return partnerPixelUrl; } function validateAbsolutePathUrl(_url) { var sCurrPathName= location.pathname.substring(0,location.pathname.lastIndexOf("/")+1); var url = _url; if(url.indexOf("http:") == -1) { url = 'http://'+location.hostname+sCurrPathName.substring(0,sCurrPathName.lastIndexOf("/")+1) + url; } return url; } window.toolbarDetectData = [ ]; // Returns "firefox", "msie" or "unknown". function currentBrowserName() { if (navigator.userAgent.search(/Firefox/i) > -1) { return 'firefox'; } if (navigator.appName.search(/Internet Explorer/i) > -1) { if (navigator.userAgent.search(/Opera\s/i) < 0) { return 'msie'; } } return 'unknown'; } // Returns the ToolbarControl instance resulting from the successful // instantiation of any of the given toolbar detect data objects, or null if // none of the given objects can be instantiated. function firstInstalled(toolbarDetectDataArray) { // Get the current browser name. var currentBrowser = currentBrowserName(); for (var k = 0; k < toolbarDetectDataArray.length; k++) { var toolbar = toolbarDetectDataArray[k]; if (toolbar && (toolbar.browser == currentBrowser || toolbar.browser == 'dual' || !toolbar.browser)) { var control = new ToolbarControl( 'settingsCtl', toolbar.internalProductName, toolbar.mimeType, toolbar.toolbarSettingsProgId, toolbar.toolbarSettingsProgId, toolbar.toolbarSettingsClsid, toolbar.requiredVersion ); if (MindsparkToolbar.IsInstalled(control)) { // Hold your horses. Let's check the browser too. var settingsControl = new SettingsCtrlObject(control); settingsControl.Create("div"); var bsf = settingsControl.control && settingsControl.control.BrowsersSupported; // --- // TB-1340: refuse dual browser install even if we're in the // case where a FF only browser is installed (this is that case). // The resolution is to ignore BSF. bsf = null; // --- if (bsf) { var expectedBsf = toolbar.browser == 'msie' ? 0x01 : toolbar.browser == 'firefox' ? 0x02 : 0x03; if (bsf == expectedBsf) { // Browser match. return control; } } else { // BrowsersSupported is unsupported. return control; } } } } return null; } // Given a hash of objects in a format understood by the toolbar-v2.2-*.js // family of scripts, returns a hash of entries useable by the detect logic // present on this page. The data is returned keyed by class id. function convertToolbarDataToDetectData(rawItems) { var items = []; items.byClassId = {}; for (var p in rawItems) { var rawItem = rawItems[p]; var item = { browser: rawItem.settingsCtl.browser, internalProductName: rawItem.settingsCtl.toolbar, mimeType: rawItem.settingsCtl.mimetype, toolbarSettingsProgId: rawItem.settingsCtl.prog_id, toolbarSettingsClsid: rawItem.settingsCtl.classid, requiredVersion: rawItem.settingsCtl.required_version, fileNamePrefix: rawItem.settingsCtl.fileNamePrefix }; items.push(item); items.byClassId[item.toolbarSettingsClsid] = item; } return items; } function isAnyToolbarInGroup(toolbars, group) { if (!group.byClassId) { throw 'Internal error: given group must contain byClassId map, as returned by convertToolbarDataToDetectData.'; } for (var k = 0; k < toolbars.length; k++) { var toolbar = toolbars[k]; if (toolbar && isToolbarInGroup(toolbar, group)) { return true; } } return false; } function isToolbarInGroup(toolbar, group) { if (!group.byClassId) { throw 'Internal error: given group must contain byClassId map, as returned by convertToolbarDataToDetectData.'; } return !!group.byClassId[toolbar.toolbarSettingsClsid]; } var debug = function(msg){ //console.log(msg); } var unifiedLogging = { src: 'http://ak.imgfarm.com/images/anx/anemone-1.2.7', chipParams: {}, appSpecificMap: { section : 'xx', platform : 'xp', installerType : 'xi', refPartner : 'xrp', refCobrand : 'xrco', refSub : 'xrs', refCampaign : 'xrca', refTrack : 'xrt', refCountry : 'xrcc' }, cookiesEnabled: -1, campaignVal: '', enabled: false, appSpecificParams: { spid: null, // splash page id //theme: null, // Splash/Landing Page Theme (optional) platform: "vicinio", // DLP Platform: old or vicinio refPartner: null, // Full FUTURE Partner ID as determined by the DLP process to be written into windows registry upon successful conversion of the lead into a toolbar installation refSub: null, // Full FUTURE Sub ID as determined by the DLP process to be written into windows registry upon successful conversion of the lead into a toolbar installation. installerType: null // Type of the installer: ActiveX Web Installer, RunRun, XPI, EXT }, //Stores expected events and perspective parameters events: { "SuccessPopDisplayButton" : [], "SuccessPopCloseButton" : [], "ManualInstallLanding" : [], "ManualInstallInvoked" : ["installerSource"], "ToolbarDetect": [], "FeatureDetect": ['searchAssistantOptIn','homePageOptIn'], "FeatureDetectLanding": [], "FeatureDetectLandingClicked": [], //'action' Type of click on the splash landing page. Button vs Middle vs Top. "GoogleAnalytics": ['varName','varValue'], "SplashLanding": ['cookiesEnabled'], "SplashLandingClicked": [], //'action' Type of click on the splash landing page. Button vs Middle vs Top. "InstallerInvoked": [], "InstallerAccepted": [], "3rdPartyOfferCriteriaCheck" : ['bundleName','criteriaPass','failType'], "3rdPartyOfferShow" : ['bundleName'], "3rdPartyOfferAccept" : ['bundleName','optIn'], "3rdPartyOfferDownloadComplete" : ['bundleName'], "InstallerFinished": ['searchAssistantOptIn','homePageOptIn','tbUID','tbVer'],//,'withIE','withFF','withSF','withCH' "InstallerFinishedButton": [], "Error": ['errorCode','errorType'], "VendorPixelFrame": [], "PixelFrameTB": ['tbUID','tbVer'], "PostInstallPop": ['popStyle','url'], "UIControl": ['label','type'], "InstallerRebuttal": [], //'action' quit, cancel or continue "TBCleanupInitialize":['TBcleanupDetect','TBcleanupDetectList','TBcleanupDisplayed','TBcleanupDisplayedList'], // "TBCleanupProcess":['TBcleanupSelected','TBcleanupSelectedList','TBcleanupDisabled','TBcleanupDisabledList'], // "PageRedirect": [] }, load: function( appParams, callback ){ this.enabled = ( typeof(_Anemone) != 'undefined' ); // if _Anemone is missing load it dynamically if (!this.enabled) { var oScope = this; $_m .getScript(this.src, function() { oScope.load(appParams, callback); }); return; } // load appSpecificParams, set in the back-end if (this.isNotNullOrUndefined(appParams)) { for (prop in this.appSpecificParams) { if (appParams[prop] !== null) { this.appSpecificParams[prop] = appParams[prop]; } } } if (typeof callback === "function") { callback(); } }, /* Param aggregate & trigger * @param name - event name * @param params - anemone params * @params opt - optional app params such as section, cookies enabled, campaignVal, etc... */ logEvent: function(name, params, cookieOpt){ if (this.enabled) { if (this.events[ name ] !== null) { var anemone_params = params, hasParams = false; try { // set anemone event params if (this.isNotNullOrUndefined(anemone_params)) { hasParams = true; } // set optional environment params if (this.isNotNullOrUndefined(cookieOpt)) { this.chipParams = cookieOpt; } //trigger event if (hasParams) { _Anemone.logEvent(name, anemone_params); } else { _Anemone.logEvent(name); } } catch(e) { //console.log("message: "+e.message); } } else { //alert('Undefined event was triggered!') } } else { //alert('Unified Logging is disabled = ' + name) } }, isNotNullOrUndefined: function( _var ) { if (_var !== undefined && _var !== null) { return true; } return false; }, setCookieChip: function(name,val){ if (this.isNotNullOrUndefined(this[name])){ this[name] = val; } }, getCookieChips: function() { var chips = {}, prop = null; for (p_name in this.chipParams) { prop = this.appSpecificMap[p_name]; if (this.isNotNullOrUndefined(prop)) { chips[prop] = this.chipParams[p_name]; } } return chips; } } var _anxGetAppCookieChips = function () { return unifiedLogging.getCookieChips(); }; _AnemoneParams = {}; _AnemoneParams.backFillRequired = false; var redirectDLP = null; var IEOverlayRedirect = null; var bSuccessPopped = false; var sToolbarId = 204540489; var _extension_toolbar = ExtensionToolbar(sToolbarId); // spid (xs) // theme (xt) // refMarketing (xrm) unifiedLogging.logEvent = function(name, params, extras) { if (typeof params === 'undefined' || typeof params === null) { params = {}; } params['eventType'] = name; params['section'] = 'external'; params['platform'] = 'vicinio'; params['installerType'] = "MANUAL_OTHER"; params['refPartner'] = '^ZO^yyyyyy^YY^us'; params['refCobrand'] = 'ZO'; params['refCampaign']= 'yyyyyy'; params['refSub'] = 'translateye'; params['refTrack'] = 'YY'; params['refCountry'] = 'US'; var oParams = $_m .JSON_Encode_String(params), src = "http://www.utilitychest.com/anemone_js.jhtml?partner=^ZO^yyyyyy^YY^us&"+oParams, conversionId = "93c34da544f44ee4a81899d9dc2aa9f3"; if (conversionId !== "") { src += "&coId=" + conversionId; } document.body.appendChild(new anemoneFrame(src, name)); }; var anemoneFrame = function(_src, _name){ this.oFrm = ""; this._id = 'anemoneFrame_'+_name this._src = _src; this._name = _name; this.trigger = function() { this.oFrm = document.createElement("iframe"); this.oFrm.setAttribute("style", 'display:none;'); this.oFrm.setAttribute("id", this._id); this.oFrm.setAttribute("src", this._src); var oScope = this; this.oFrm.onload = function () { oScope.SetTimeoutObj(oScope, 10, oScope.remove, null); }; this.oFrm.onreadystatechange = function () { if (this.readyState == 'complete' || this.readyState == 'loaded') { oScope.SetTimeoutObj(oScope, 10, oScope.remove, null); } }; return this.oFrm; }; //maintain scope after setTimeout is triggered this.SetTimeoutObj = function(o, t, f, a) { return setTimeout(function() { f.call(o,a); }, t); }; this._bRemovedIFrame = false; this.remove = function() { if (!this._bRemovedIFrame) { try { document.body.removeChild(this.oFrm); this._bRemovedIFrame = true; } catch (e) {} } }; return this.trigger(); }; var oDLPCtrl = null; var oEasyCtrl = null; var oEULADiv = null; var oRebuttalDiv = null; var oInstaller = null; var oEasyDiv = null; var oSettingCtr = null; var oSettCtrl = null; var sRedirectUrl = ""; var browserVer = "OTHER"; var browserName = "OTHER"; var installerTotalBytes = ("3631488"!=""?3631488:0); var successUrl = "http://www.utilitychest.com/installComplete.jhtml"; var successPopUrl = "http://www.utilitychest.com/installComplete.jhtml"; var suppressRedirect = false; var suppressAbandonPop = true; // logic to determine where to go next var latestVersionRedirect = "http://www.utilitychest.com/alreadyInstalled.jhtml"; var sInstalledVersion = ""; var bSupportFeatureDetect = (""=="true"?true:false); var bInitRunRun = false; var addPauseParam = false; addPauseParam = false; function initRunRun (){ if(!suppressAbandonPop) { $_m .createAbandon("tryagain.jhtml",true); $_m .abandonPop.enable(); } // set if cookie enabled checkCookies(); unifiedLogging.load(); oSettCtrl = new ToolbarControl("settingsCtl", "UtilityChest", "application/x-utilitychest_49plugin", "UtilityChest_49.SettingsPlugin", "UtilityChest_49.SettingsPlugin", "268ca04c-106c-4636-b707-95e8cd5859e0", "2.5.12.0"); var oDownloadDiv = new DownloadDisplay("DLP_dvDownload"); var oFinishedDiv = new FinishedDisplay("DLP_dvFinished"); var oErrorDiv = new ErrorDisplay("DLP_dvError"); var oRunRunDiv = null; oEasyCtrl = $_m. createDownloader("http://ak.imgfarm.com/images/nocache/vicinio/204540489/63027-121205190710-YY.2/UtilityChest.exe", "UtilityChest_49Installer.Start"); oInstaller = $_m. createInstaller('', '1db3bc24-5735-44d9-96dc-2e1d5eada08d', { codebase:'http://ak.imgfarm.com/images/nocache/vicinio/installers/204540489.YY.2/90246-130430134823-YY.2/UtilityChestSetup.exe', classid:"cf67755f-9265-449c-87cf-b945519e073b", currentversion:"2,5,12,0", byteCount:3631488, partcount:1, waitforinstalldone:60000, installerparams:"/p=^ZO^yyyyyy^YY^us /psid=translateye" }); drawRunRunModals(); oEasyDiv = new EasyDisplay("DLP_dvEasy"); oDLPCtrl = new DLPCtrl(oEasyCtrl,oInstaller,oSettCtrl,oEasyDiv,oDownloadDiv,oErrorDiv,oFinishedDiv,oEULADiv,null,null,oRunRunDiv,null,oRebuttalDiv,null,null,"success.jhtml","http://ak.imgfarm.com/images/nocache/vicinio/installers/204540489.YY.2/90246-130430134823-YY.2/UtilityChestSetup2.5.12.0.^ZO^man000^YY^.exe"); //show download progress var oProgressObj = new $_m.classes.ProgressIndicator("DLP_progressBarDIV", "DLP_statusDIV", "DLP_progressBarContainer","DLP_percentDIV",installerTotalBytes,true); oProgressObj.downloadTxt = "Downloading Utility Chest..."; oProgressObj.installTxt = "Installing Utility Chest..."; oProgressObj.finishTxt = "Congratulations, Utility Chest has been successfully installed!"; //wrap in anon functions to keep the scope of oProgressObj oInstaller.AddListener(oInstaller.DOWNLOAD_START,function(target){ if(typeof(downloadstartFuncOverride) == "function"){ downloadstartFuncOverride(); } else { if(mindspark.abandonPop){ $_m .abandonPop.disable(); } oDLPCtrl.StartProgress();} } ); oInstaller.AddListener(oInstaller.DOWNLOAD_PROGRESS,function(target){ if(typeof(downloadprogressFuncOverride) == "function"){ downloadprogressFuncOverride(); } else { oDownloadDiv.InstallProgress(); oProgressObj.Progress(target);} } ); oInstaller.AddListener(oInstaller.DOWNLOAD_ERROR,function(target){ if(typeof(downloaderrorFuncOverride) == "function"){ downloaderrorFuncOverride(); } else { oDLPCtrl.Error(); } }); oInstaller.AddListener(oInstaller.DOWNLOAD_CANCEL,function(target){ if(typeof(downloadcancelFuncOverride) == "function"){ downloadcancelFuncOverride(); } else { oDLPCtrl.Cancel(); } }); oInstaller.AddListener(oInstaller.DOWNLOAD_COMPLETE,function(target){ if(typeof(downloadcompleteFuncOverride) == "function"){ downloadcompleteFuncOverride(); } else { oProgressObj.Complete(target); createSettingCtrl(); onSuccessHandler(); onSuccessPixel(); } }); oEasyCtrl.AddListener(oEasyCtrl.INSTALL_COMPLETE,function(){ if(typeof(installcompleteFuncOverride) == "function"){ installcompleteFuncOverride(); } else { oProgressObj.ReInit(); } }); oFinishedDiv.AddListener(oFinishedDiv.FINISHED,function(){ if(typeof(redirectDLP) == "function"){ redirectDLP(); } }); if(typeof(afterDOMReady) == "function"){ afterDOMReady(); } /* not sure if its being used function installComplete(target){ oProgressObj.Complete(target); //3rd party pixel $_m. pixelManger.FirePixel("success"); } */ function onSuccessHandler() { var sa_enabled = false; var hp_enabled = false; if(!oSettingCtr.Error()){ sa_enabled = MindsparkToolbar.check_search_asst( oSettingCtr ); hp_enabled = MindsparkToolbar.check_hp( oSettingCtr, "|.mywebsearch.com|" ); } var tb_uid = oSettingCtr.GetUID(); var tb_partner = oSettingCtr.GetPartner(); var tb_version = oSettingCtr.GetVersion(); var tb_subid = oSettingCtr.GetSubid(); unifiedLogging.logEvent('InstallerFinished', { searchAssistantOptIn: (sa_enabled ? true : false), homePageOptIn: (hp_enabled ? true : false), tbUID: tb_uid, tbVer: tb_version }); } function onSuccessPixel() { if(!oSettingCtr.Error()){ var pixelIframe = document.createElement("iframe"); pixelIframe.width = 1; pixelIframe.height = 1; pixelIframe.src = "http://www.utilitychest.com/install_pixels.jhtml?product=utilitychest&p2=^ZO^yyyyyy^YY^us&si=translateye&coId=93c34da544f44ee4a81899d9dc2aa9f3"; document.body.appendChild(pixelIframe); unifiedLogging.logEvent('VendorPixelFrame'); } } function createSettingCtrl() { //create the control oSettingCtr = new SettingsCtrlObject(oSettCtrl); //create ctrl oSettingCtr.Create("div"); } IEOverlayRedirect = function () { }; redirectDLP = function (){ if(typeof(finishedFuncOverride) == "function"){ finishedFuncOverride(); } else { if (successPopUrl != "" && !bSuccessPopped) { //FF and anything else that uses R/R var isSameUrl = (successUrl == successPopUrl); if (!isSameUrl) { unifiedLogging.logEvent('PostInstallPop', { popStyle: 'tab', url: successPopUrl }, { section:"external" } ); window.open(successPopUrl); } } //disable unified after toolbar is installed unifiedLogging.enabled = false; if(successUrl.indexOf("home.mywebsearch.com") != -1 || successUrl.indexOf("www.mytotalsearch.com") != -1){ window.location = getHomeMWSUrl(successUrl); } else if(successUrl.indexOf("www.bing.com") != -1){ window.location = successUrl + "?form=MNDE01&pc=MDSP"; } else if(successUrl != '') { window.location=successUrl; } } } if($_m.g("inp_bi_ie")){ $_m. bind("inp_bi_ie","click",biToggle); } if($_m.g("inp_bi_ff")){ $_m. bind("inp_bi_ff","click",biToggle); } bInitRunRun = true; }; function installToolbar(){ if(!bInitRunRun) { initRunRun(); } if(sRedirectUrl!="") { window.location=sRedirectUrl; return true; } var installed = MindsparkToolbar.IsInstalled(oSettCtrl); if (_extension_toolbar.isInstalled()) { installed = true; } if( installed && !suppressRedirect) { window.location=latestVersionRedirect; }else{ unifiedLogging.logEvent('ManualInstallInvoked', {installerSource:'splash'}); setTimeout(function(){window.location.href ='http://ak.imgfarm.com/images/nocache/vicinio/installers/204540489.YY.2/90246-130430134823-YY.2/UtilityChestSetup2.5.12.0.^ZO^man000^YY^.exe';}, 500); } } function callAnx() { var timeMillis = new Date().getTime(); var anxUrl = "http://anx.mywebsearch.com/tr.gif?anxa=IE9%20Messages&anxe=Run%20Overlay%20-%20View&anxt=&anxtv=&anxp=^ZO^yyyyyy^YY^us&anxsi=translateye&anxr=" + timeMillis + "&anxv=1.0&anxd=2011-04-01"; var anxImage = new Image(); anxImage.src = anxUrl; } function drawRunRunModals(){ var html = []; html.push('
'); html.push('
Initializing...
'); html.push('
'); html.push('
'); html.push('
'); var oModalDiv = document.createElement('div'); oModalDiv.id = 'DLP_dvModals'; oModalDiv.innerHTML = html.join(''); document.body.appendChild(oModalDiv); } function drawRunRunEULAModals(){ var html = []; html.push('
By choosing to install the UtilityChest Toolbar, I agree to the
End User License Agreement and the Privacy Policy.
Make MyWebSearch my homepage & new tab for these browsers
Make MyWebSearch my default search engine for these browsers
Cancel
'); html.push('
Installation has Stopped
Utility Chest Toolbar Installation
Utility Chest installation is incomplete.
Are you sure you want to quit?
'); html.push('
Initializing...
'); html.push('
'); html.push('
'); html.push('
'); var oModalDiv = document.createElement('div'); oModalDiv.id = 'DLP_dvModals'; oModalDiv.innerHTML = html.join(''); document.body.appendChild(oModalDiv); }