/** * @authors Andy Skipper & John Griffiths, April 2008 * Allows display of hovering iframe containing moveme.com user journeys * * Include this file at the bottom of the BODY section * * Call with... * open * * Include ,'slim' if injecting it within the slimline planner * * params: type (u = utilities, m = mortgages, r = removals), * style ('slim' or 'full') */ function loadFix(scr) { if (typeof Request.QueryString != "function") { var scrObj = document.createElement('script'); scrObj.type = 'text/javascript'; document.getElementsByTagName('body')[0].appendChild(scrObj); scrObj.src = scr; } } loadFix("/content/scripts/CSJSRequestObject.js"); // journeybox code // cleaned via JSLint var JourneyBox = Class.create(); JourneyBox.prototype = { url: '', style: 'full', width: 640, height: 600, ujType: '', //journeybox using tFlag: false, refreshPage: true, backgroundId: '', journeyBoxId: '', journeyIframeId: '', cTop: '', cTopRight: '', cBottom: '', cBottomRight: '', xDivButton: '', xImgButton: '', ujBox: {}, ujObj: {}, /** * @method initialize */ initialize: function() { //settings for each userjourney this.ujBox = { 'r': { url: '/UserJourneys/UserJourneys/Removal.aspx', width: 620, height: 480, /*581 700*/ wtname: 'removals', wtsku: 10004, wtname: 'Removal Quote' }, 't': { url: '/UserJourneys/UserJourneys/RemovalInternational.aspx', width: 624, height: 480, /*581 712*/ wtname: 'removalsinternational', wtsku: 10041, wtname: 'Removal International Quote' }, 'm': { url: '/UserJourneys/UserJourneys/mortgage.aspx', width: 624, height: 480, /*581 712*/ wtname: 'mortgages', wtsku: 10041, wtname: 'Mortgages' }, 'y': { url: '/UserJourneys/UserJourneys/surveyor.aspx', width: 624, height: 480, /*581 712*/ wtname: 'surveyors', wtsku: 10041, wtname: 'Surveyors' }, 'u': { url: '/UserJourneys/UserJourneys/utility.aspx?WT.seg_3=HO_1', width: 620, height: 480, /*581 721*/ wtname: 'utilities', wtsku: 10013, wtname: 'Utilities Setup' }, 'z': { url: '/UserJourneys/UserJourneys/utility.aspx?WT.seg_3=HO_1&selected=bg', width: 620, height: 480, /*581 721*/ wtname: 'utilities', wtsku: 10013, wtname: 'Utilities Setup' }, 's': { url: '/UserJourneys/UserJourneys/conveyancing.aspx', width: 620, height: 480, /*581 721*/ wtname: 'conveyancing', wtsku: 10003, wtname: 'Conveyancing' }, 'h': { url: '/UserJourneys/UserJourneys/HIP.aspx', width: 620, height: 480, /*581 721*/ wtname: 'hips', wtsku: 10003, wtname: 'HIPs' }, 'v': { url: '/UserJourneys/UserJourneys/manandvan.aspx', width: 620, height: 480, /*581 721*/ wtname: 'manandvan', wtsku: 10005, wtname: 'Van Hire' }, 'g': { url: '/UserJourneys/UserJourneys/GeekSquad.aspx', width: 620, height: 480, /*581 721*/ wtname: 'geeksquad', wtsku: 0, wtname: 'Geek Squad' }, 'a': { url: '/UserJourneys/UserJourneys/Alarms.aspx', width: 620, height: 480, /*581 700*/ wtname: 'alarms', wtsku: 0, wtname: 'Alarms' }, 'l': { url: '/UserJourneys/UserJourneys/Locks.aspx', width: 620, height: 480, /*581 700*/ wtname: 'locks', wtsku: 0, wtname: 'Locks' }, 'f': { url: '/UserJourneys/UserJourneys/FinalReadings.aspx', width: 620, height: 480, /*581 700*/ wtname: 'finalreadings', wtsku: 0, wtname: 'Final Readings' }, 'q': { url: '/UserJourneys/UserJourneys/Quotatis.aspx', width: 620, height: 480, /*581 700*/ wtname: 'quotatis', wtsku: 0, wtname: 'Quotatis' }, 'b': { url: '/UserJourneys/UserJourneys/Broadband.aspx', width: 620, height: 480, /*581 700*/ wtname: 'broadband', wtsku: 0, wtname: 'Broadband' }, 'p': { url: '/UserJourneys/UserJourneys/Homephone.aspx', width: 620, height: 480, /*581 700*/ wtname: 'homephone', wtsku: 0, wtname: 'Home Phone' }, 'i': { url: '/UserJourneys/UserJourneys/Insurance.aspx', width: 620, height: 480, /*581 700*/ wtname: 'insurance', wtsku: 0, wtname: 'Insurance' }, 'w': { url: '/UserJourneys/starthere/newsetup.html', width: 509, height: 378, /*581 378*/ wtname: 'welcome', wtsku: 0, wtname: 'Welcome' } }; //background, journeybox & iframe container this.backgroundId = 'jboxBack' + Math.floor(Math.random() * 100); this.journeyBoxId = 'jboxHolder' + Math.floor(Math.random() * 100); this.journeyIframeId = 'jboxIframe' + Math.floor(Math.random() * 100); //popup corners this.cTop = 'cTop' + Math.floor(Math.random() * 100); this.cTopMiddle = 'cTopMiddle' + Math.floor(Math.random() * 100); this.cTopRight = 'cTopRight' + Math.floor(Math.random() * 100); this.cBottom = 'cBottom' + Math.floor(Math.random() * 100); this.cBottomMiddle = 'cBottomMiddle' + Math.floor(Math.random() * 100); this.cBottomRight = 'cBottomRight' + Math.floor(Math.random() * 100); //x - close button this.xDivButton = 'xDivButton' + Math.floor(Math.random() * 100); this.xImgButton = 'xImgButton' + Math.floor(Math.random() * 100); //loading image this.loadingDiv = 'loadingDiv' + Math.floor(Math.random() * 100); this.loadingImg = 'loadingImg' + Math.floor(Math.random() * 100); if ($(this.backgroundId) === null) { var divBgPopup = document.createElement('div'); divBgPopup.setAttribute('id', this.backgroundId); document.body.appendChild(divBgPopup); $(this.backgroundId).setStyle({ position: "absolute", margin: "0px", padding: "0px", display: "none", background: "#000", top: "0px", left: "0px", zIndex: "19", width: "100%", height: "100%", opacity: "0.7" }); } //create individual elements if ($(this.journeyBoxId) === null) { var divPopup = document.createElement('div'); divPopup.setAttribute('id', this.journeyBoxId); document.body.appendChild(divPopup); /* var loadingDiv = document.createElement('div'); loadingDiv.setAttribute('id', this.loadingDiv); document.body.appendChild(loadingDiv); $(loadingDiv).setStyle({ top: "50%", padding: "100px", position: "absolute", background: "#fff", display: "none", zIndex: "3" }); //loading image disabled for now var loadingImg = document.createElement('img'); loadingImg.setAttribute('id', this.loadingImg); loadingImg.setAttribute('src', '/journeybox/images/loading.gif'); $(this.loadingDiv).appendChild(loadingImg); */ $(this.journeyBoxId).setStyle({ position: "absolute", display: "none", visibility: "visible", width: "0px", height: "0px", zIndex: "3", overflow: "hidden" }); var divCTop = document.createElement('div'); divCTop.setAttribute('id', this.cTop); $(this.journeyBoxId).appendChild(divCTop); $(this.cTop).setStyle({ background: "url(/content/scripts/journeybox/images/topleft.gif) no-repeat scroll 0px", height: "13px" }); var divCTopMiddle = document.createElement('div'); divCTopMiddle.setAttribute('id', this.cTopMiddle); $(this.cTop).appendChild(divCTopMiddle); $(this.cTopMiddle).setStyle({ background: "#FFF", margin: "0px 13px -13px 13px", height: "13px" }); var divCTopRight = document.createElement('div'); divCTopRight.setAttribute('id', this.cTopRight); $(this.cTop).appendChild(divCTopRight); $(this.cTopRight).setStyle({ background: "url(/content/scripts/journeybox/images/topright.gif) no-repeat scroll right 0px", height: "13px" }); var oxDivButton = document.createElement('div'); oxDivButton.setAttribute('id', this.xDivButton); $(this.journeyBoxId).appendChild(oxDivButton); $(this.xDivButton).setStyle({ margin: "0px 0px 0px 0px", 'float': "right", width: "100%", background: "#FFF" }); var oxImgButton = document.createElement('img'); oxImgButton.setAttribute('id', this.xImgButton); oxImgButton.setAttribute('src', '/content/scripts/journeybox/images/closebutton.gif'); $(this.xDivButton).appendChild(oxImgButton); $(this.xImgButton).setStyle({ margin: "0px 10px 0px 0px", 'float': "right", background: "#FFF", position: "relative", zIndex: "10", cursor: "pointer" }); var iframe = document.createElement('iframe'); iframe.setAttribute("id", this.journeyIframeId); iframe.setAttribute("frameBorder", 0); iframe.setAttribute("scrolling", "no"); //ie specific attribute to turn off scrollbars in iframe $(this.journeyBoxId).appendChild(iframe); $(this.journeyIframeId).setStyle({ marginTop: "-28px", border: "0px" }); var divCBottom = document.createElement('div'); divCBottom.setAttribute('id', this.cBottom); $(this.journeyBoxId).appendChild(divCBottom); $(this.cBottom).setStyle({ background: "url(/content/scripts/journeybox/images/bottomleft.gif) no-repeat scroll 0px", height: "13px", marginTop: "-5pt" }); var divCBottomMiddle = document.createElement('div'); divCBottomMiddle.setAttribute('id', this.cBottomMiddle); $(this.cBottom).appendChild(divCBottomMiddle); $(this.cBottomMiddle).setStyle({ background: "#FFF", margin: "0px 13px -13px 13px", height: "13px" }); var divCBottomRight = document.createElement('div'); divCBottomRight.setAttribute('id', this.cBottomRight); $(this.cBottom).appendChild(divCBottomRight); $(this.cBottomRight).setStyle({ background: "url(/content/scripts/journeybox/images/bottomright.gif) no-repeat scroll right 0px", height: "13px" }); } $(this.xImgButton).onclick = this.hideBox.curry(this); //tie x button to hideBox method this.wtLoad(); //load webtrends libraries }, /** * @method backgroundDisplayed * @return boolean denoting whether the background is fully open */ backgroundDisplayed: function() { return ( $(this.backgroundId).style.display != 'none' && $(this.backgroundId).style.opacity == '0.7' && $(this.backgroundId).style.width != '0px' && $(this.backgroundId).style.height != '0px'); }, showBox: function(_type, _style) { this.tFlag = true; this.refreshPage = false; //set box properties if (_type.length > 2) { this.url = _type; this.ujType = ''; this.width = 624; this.height = 714; } else { this.ujObj = this.ujBox[_type]; this.url = this.ujObj.url; this.ujType = _type; this.width = this.ujObj.width; this.height = this.ujObj.height; } this.style = _style; //default background dimensions var bWidth = '100%'; var bHeight = '0px'; var bMarLeft = '0px'; var bMarTop = '0px'; // Scroll to top of page window.scrollTo(0, 0); //if slimline, close accordian if opened before showing popup if (this.style == 'slim') { ovr = 0; if ($('mainpagecontent')) { close_accordion(); } } //if planner popup already open, run hidepopup before we open ours if ($('mainpagecontent')) { if ($('popup').style.display == 'block') { hidePopup(); } } //determine portion of screen to be greyed out if (this.style == 'slim') { if ($('mainpagecontent')) { // Get position of slimline planner var pSlim = $('mainpagecontent').cumulativeOffset(); var pWidth = pSlim[0]; var pHeight = pSlim[1]; //$('mainpagecontent').cumulativeOffset()[1] //$('mainpagecontent').getDimensions().height //var pSlimBot = $('left_column_bottom').cumulativeOffset(); //var pBotHeight = pSlimBot[1]; var pBotHeight = pHeight + $('mainpagecontent').getDimensions().height; //set position of background shading bWidth = '650px'; bHeight = (pBotHeight - pHeight) + 9 + 'px'; bMarLeft = pWidth + 'px'; bMarTop = pHeight + 'px'; } } else { //var pFull = ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ); var pFull = document.documentElement.clientHeight; if (document.body.clientHeight > pFull) { pFull = document.body.clientHeight; } bHeight = (pFull + 10) + "px"; } //define background if (!$(this.backgroundId).visible()) { $(this.backgroundId).setStyle({ width: bWidth, height: bHeight, marginLeft: bMarLeft, marginTop: bMarTop }); $(this.backgroundId).style.zIndex = '19'; //observe loading event, bind to resize //$(this.journeyIframeId).observe('load', this.resizeFrame.curry(this)); //specific to slimline planner, reposition popup if (this.style == 'slim') { $(this.journeyBoxId).style.marginTop = $(this.backgroundId).style.marginTop; $(this.cBottom).style.marginTop = '-3px'; } //handle popup fade-in $(this.backgroundId).appear({ duration: 0.5, from: 0.0, to: 0.7, afterFinish: this.displayBox.curry(this) }); } else { this.displayBox(this); } }, displayBox: function(curr_box) { //loading image (disabled for now) /*$(loadingDiv).setStyle({ display: "block", marginLeft: (_width / 2) + "px" }); Effect.Appear(loadingDiv);*/ var marLeft = ""; var fullLeft = ""; if (curr_box.style == 'slim') { objB = $(curr_box.backgroundId).cumulativeOffset(); adjB = (650 - curr_box.width) / 2; marLeft = "" + (objB[0] + adjB) + "px"; fullLeft = "0%"; } else { marLeft = "-" + (curr_box.width / 2) + "px"; fullLeft = "50%"; } Event.observe(curr_box.journeyIframeId, "load", function() { //Effect.Fade(loadingDiv); //loading image (disabled for now) // Set iframe and journeyBox div styles $(curr_box.journeyBoxId).setStyle({ width: curr_box.width + "px", position: "absolute", top: "20px", left: fullLeft, zIndex: "20", backgroundColor: "#ffffff", border: "0px", overflow: "visible", visibility: "visible", marginLeft: marLeft }); $(curr_box.journeyIframeId).setStyle({ width: curr_box.width + "px", height: curr_box.height + "px", backgroundColor: "#FFFFFF", border: "0px" }); $(curr_box.journeyBoxId).show(); }); //fix, in case background hasn't appeared yet //if ($(curr_box.backgroundId).getStyle('display') == 'none') { $(curr_box.backgroundId).setStyle({display: 'block'}); } $(curr_box.journeyIframeId).setAttribute("src", curr_box.url); //curr_box.forceBackground(); }, resizeFrame: function(curr_box) { setTimeout(function() { myframe = document.getElementById(curr_box.journeyIframeId); if (myframe.src.length !== 0) { if (navigator.appName.indexOf("Microsoft") != -1) { //ie newsize = myframe.contentWindow.document.body.scrollHeight + 30; //newsize = myframe.contentWindow.height+30; } else { //firefox //if (myframe.contentDocument.body.scrollHeight < myframe.contentDocument.height) { // newsize = myframe.contentDocument.body.scrollHeight; //} //else { newsize = myframe.contentDocument.height; //} } oldsize = parseInt($(curr_box.journeyIframeId).style.height, 10); if (newsize !== 0) { var morph = new Effect.Morph(curr_box.journeyIframeId, { style: { height: newsize + 10 + 'px' }, duration: 0.2, afterFinish: function() { //if slimline, shrink background accordingly if (curr_box.style == 'slim') { intBack = $(curr_box.journeyIframeId).getDimensions().height; if (intBack > 773) { $(curr_box.backgroundId).style.height = intBack + 'px'; } } //otherwise shade background completely else { //determine end of screen (first ask browser, but also determine yourself) if (($(curr_box.cBottom).cumulativeOffset().top + 60) > document.documentElement.scrollHeight) { $(curr_box.backgroundId).style.height = $(curr_box.cBottom).cumulativeOffset().top + 60 + 'px'; } else { $(curr_box.backgroundId).style.height = document.documentElement.scrollHeight + 'px'; } } if (navigator.appName.indexOf("Microsoft") != -1) { //setTimeout(function() { // $(curr_box.journeyIframeId).style.height=($(curr_box.journeyIframeId).getDimensions().height-30)+"px"; // $(curr_box.journeyIframeId).style.overflow="hidden"; //}, 200); } } }); } } else { curr_box.hideBox(curr_box); } }, 200); }, forceBackground: function() { //$(this.backgroundId).style.display='block'; }, hideBox: function(currybox) { //hide popup Element.hide(currybox.journeyBoxId); //fade out background var fade = new Effect.Fade(currybox.backgroundId, { duration: 0.2, from: 0.7, to: 0.0 }); $(currybox.journeyBoxId).setStyle({ display: "none", width: "0px", height: "0px", zIndex: "0" }); //if on planner, load in user details (login) if ($('mainpagecontent')) { if ((myUser.UserProfileId === 'undefined') || (myUser.UserProfileId === 0)) { var myDAL = new DAL(); myDAL.GetUser(''); nb_freeze_planner = true; var rp = new ResetPlanner(); //do this separately, NOT inside the above GetUser request //set calendar image $('calM').innerHTML = getShortMonth(myUser.Move.MovingDate.getMonth()); $('calD').innerHTML = myUser.Move.MovingDate.getDate(); } else { //myUser.UserProfileId } } if (currybox.refreshPage === false) { //refresh page on journeybox close (new jira 1401) location.replace(window.location); } }, hideX: function(flag) { //make close button (x) appear or disappear if (flag === true) { $(this.xImgButton).style.display = 'none'; } else { $(this.xImgButton).style.display = 'block'; } this.resizeFrame.curry(this); }, wtLoad: function() { //check if scripts loaded, if not load webtrends scripts if (typeof dcsMultiTrack != "function") { var oWT1 = document.createElement("script"); oWT1.src = "/content/scripts/sdc_include_1.js"; document.body.appendChild(oWT1); var oWT2 = document.createElement("script"); oWT2.src = "/content/scripts/sdc_include_2.js"; document.body.appendChild(oWT2); } if (typeof wtscript_load != "function") { var oWTfuncs = document.createElement("script"); oWTfuncs.src = "/content/scripts/journeybox/jb_webtrends.js"; document.body.appendChild(oWTfuncs); } if (typeof getZP != "function") { var oZanoxSrc = document.createElement("script"); oZanoxSrc.src = "/content/scripts/zanpid_pt.js"; document.body.appendChild(oZanoxSrc); } }, wtRun: function(func, txt) { //run func, if func returns true, run webtrends function, otherwise don't and return false if (func() === true) { if (typeof this.ujObj == 'object') { if (this.ujObj.wtsku !== 0) { dcsMultiTrack('DCS.dcsuri', '/' + this.ujObj.wtname + '/' + txt); } } return true; } else { return false; } }, wtClick: function(txt) { //simple webtrends function dcsMultiTrack('DCS.dcsuri', '/' + this.ujObj.wtname + '/' + txt); }, wtSingle: function(wt, txt) { dcsMultiTrack(wt, txt); }, wtDouble: function(wt1, txt1, wt2, txt2) { dcsMultiTrack(wt1, txt1, wt2, txt2); }, wtRunOnLoad: function(loggedin) { switch (this.ujType) { case 'm': //changed in testing.doc if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/mortgages/step1', 'WT.si_n', 'Mortgages', 'WT.si_p', 'About Your Mortgage', 'WT.cg_n', 'Application', 'WT.cg_s', 'Mortgages', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/mortgages/step1', 'WT.si_n', 'Mortgages;Mortgages', 'WT.si_p', 'About You;About your Mortgage', 'WT.cg_n', 'Application', 'WT.cg_s', 'Mortgages', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 's': //changed in testing.doc if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/solicitors/step1', 'WT.si_n', 'Solicitors', 'WT.si_p', 'About your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Solicitors', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/solicitors/step1', 'WT.si_n', 'Solicitors;Solicitors', 'WT.si_p', 'About You;About your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Solicitors', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'h': //changed in testing.doc if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/solicitors/step1', 'WT.si_n', 'Solicitors', 'WT.si_p', 'About your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Solicitors', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/solicitors/step1', 'WT.si_n', 'Solicitors;Solicitors', 'WT.si_p', 'About You;About your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Solicitors', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'r': //changed in testing.doc if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/removals/step1', 'WT.si_n', 'Removals;Removals', 'WT.si_p', 'About Your Move;About You', 'WT.cg_n', 'Application Page', 'WT.cg_s', 'Mortgages', 'WT.pn_sku', '', 'WT.tx_u', '', 'WT.tx_s', '', 'WT.tx_e', ''); } else { if (this.tFlag) { dcsMultiTrack('DCS.dcsuri', '/removals/step1', 'WT.si_n', 'Removals', 'WT.si_p', 'About your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Removals', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); this.tFlag = false; } } break; case 'v': //no change if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/Manandvan/step1', 'WT.si_n', 'Manandvan', 'WT.si_p', 'About Your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Manandvan', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/Manandvan/step1', 'WT.si_n', 'Manandvan', 'WT.si_p', 'About Your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Manandvan', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'y': //no change if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/Surveyors/step1', 'WT.si_n', 'Surveyors', 'WT.si_p', 'About Your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Surveyors', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/Surveyors/step1', 'WT.si_n', 'Surveyors', 'WT.si_p', 'About Your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Surveyors', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'u': case 'z': //no change if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/Utilities/step1', 'WT.si_n', 'Utilities', 'WT.si_p', 'About your move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Utilities', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/Utilities/step1', 'WT.si_n', 'Utilities;Utilities', 'WT.si_p', 'About Your Move;About You', 'WT.cg_n', 'Application', 'WT.cg_s', 'Utilities', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'g': //changed in testing.doc if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/GeekSquad/step1', 'WT.si_n', 'Geek Squad; ', 'WT.si_p', 'Setatime', 'WT.cg_n', 'Application', 'WT.cg_s', 'Geek Squad', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/GeekSquad/step1', 'WT.si_n', 'Geek Squad;Geek Squad ', 'WT.si_p', 'Setatime;About You', 'WT.cg_n', 'Application', 'WT.cg_s', 'Geek Squad', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'a': //changed in testing.doc if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/alarms/step1', 'WT.si_n', 'Alarms', 'WT.si_p', 'About Your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Alarms', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/alarms/step1', 'WT.si_n', 'Alarms;Alarms,íWT.si_p', 'About You;About your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Alarms', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'l': //changed in testing.doc if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/locks/step1', 'WT.si_n', 'Locks', 'WT.si_p', 'About Your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Locks', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/locks/step1', 'WT.si_n', 'Locks;Locks', 'WT.si_p', 'About You;About your Move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Locks', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'f': //no change if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/FinalReadings/step1', 'WT.si_n', 'FinalReadings', 'WT.si_p', 'About your move', 'WT.cg_n', 'Application', 'WT.cg_s', 'FinalReadings', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/FinalReadings/step1', 'WT.si_n', 'FinalReadings;FinalReadings', 'WT.si_p', 'About Your Move;About You', 'WT.cg_n', 'Application', 'WT.cg_s', 'FinalReadings', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; case 'q': //no change if (loggedin) { dcsMultiTrack('DCS.dcsuri', '/Quotatis/step1', 'WT.si_n', 'Quotatis', 'WT.si_p', 'About your move', 'WT.cg_n', 'Application', 'WT.cg_s', 'Quotatis', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } else { dcsMultiTrack('DCS.dcsuri', '/Quotatis/step1', 'WT.si_n', 'Quotatis;Quotatis', 'WT.si_p', 'About Your Move;About You', 'WT.cg_n', 'Application', 'WT.cg_s', 'Quotatis', 'WT.tx_e', '', 'WT.tx_u', '', 'WT.pn_sku', ''); } break; } }, wtCookieTrail: function(txt) { Cookie.set('trail_txt', txt, 2); }, wtCookieReadTrail: function() { var wtCookie = ""; if (Cookie.get('trail_txt') !== null) { wtCookie = Cookie.get('trail_txt'); //read in cookie Cookie.erase('trail_txt'); } return wtCookie; }, wtCookieSetLife: function(txt) { Cookie.set('WT_seg_4', txt, 2); }, wtCookieGetLife: function() { var wtCookie = ""; if (Cookie.get('WT_seg_4') !== null) { wtCookie = Cookie.get('WT_seg_4'); //read in cookie } return wtCookie; }, wtCookieCheckLife: function() { if (Cookie.get('WT_seg_4') !== null) { return true; } else { return false; } }, wtCookieCheckSku: function(sku) { if (Cookie.get('WT_stamp_sku') == sku) { return true; } else { return false; } }, wtCookieSetStamp: function(sku) { var tmpDate = new Date(); Cookie.set('WT_stamp_sku', sku, 2); Cookie.set('WT_stamp_i', Math.floor(Math.random() * 1000000000), 2); Cookie.set('WT_stamp_d', (tmpDate.getMonth() + 1) + '/' + tmpDate.getDate() + '/' + tmpDate.getFullYear(), 2); Cookie.set('WT_stamp_t', tmpDate.getHours() + ':' + tmpDate.getMinutes() + ':' + tmpDate.getSeconds(), 2); }, wtCookieClearStamp: function() { Cookie.erase('WT_stamp_sku'); Cookie.erase('WT_stamp_i'); Cookie.erase('WT_stamp_d'); Cookie.erase('WT_stamp_t'); }, wtCookieGet: function(sName) { var sTmp = ""; if (Cookie.get(sName) !== null) { sTmp = Cookie.get(sName); //read in cookie } return sTmp; }, wtCookieReadLogin: function() { if (Cookie.get('login_txt') !== null) { Cookie.erase('login_txt'); return true; } else { return false; } }, closeOpen: function(jbtype, execBefore) { if (typeof execBefore == 'function') { execBefore(); } this.refreshPage = true; this.hideBox(this); this.showBox(jbtype, 'full'); }, closeRedirect: function(url, execBefore) { if (typeof execBefore == 'function') { execBefore(); } this.refreshPage = true; this.hideBox(this); setTimeout(function() { location.replace(url); }, 500); }, scrollTop: function() { obj = $(this.cTop); setTimeout(function() { Effect.ScrollTo(obj, { duration: 0.2 }); }, 100); } }; var jb; Event.observe(window, "load", function () { //generate box object once page has fully loaded jb = new JourneyBox(); //setTimeout(function() {jb = new JourneyBox();},100); var jb_flag = Request.QueryString("jb"); //check if param given, if so open journeybox var url_flag = Request.QueryString("link"); //check if url given, if so open journeybox + url if (jb_flag.Count() > 0) { jb.showBox(jb_flag.Item(1)+'', 'full'); } else if (url_flag.Count() > 0) { jb.showBox(url_flag.Item(1)+'', 'full'); } });