Advertisement
Guest User

Pretty-Fuck you FlashNetwork and Airtel

a guest
Jun 10th, 2015
2,322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. if (top == window) {
  3.     var fnNameSpace = "fntoolbar";
  4.     if (typeof window[fnNameSpace] == "undefined") {
  5.         window[fnNameSpace] = {}
  6.     }
  7.     window[fnNameSpace].Manager = function() {
  8.         var TOOLBAR_IFRAME_ID = "fn_layer8";
  9.         var RELOCATE_TOOLBAR_ON_LOAD_INTERVAL = 1000;
  10.         var ATTEMP_TO_RELOCATE_TOOLBAR_AFTER_LOAD_TIMEOUT = 5000;
  11.         var SCREEN_OVERLAY_ID = "fnscreenOverlay";
  12.         var toolbarsById = new Object();
  13.         this.toolbarsById = toolbarsById;
  14.         this.toolbarsZIndex = 2147483646;
  15.         this.toolbarData;
  16.         this.currentToolbar;
  17.         this.isRestorePreviousViewportNeeded = false;
  18.         this.initialToolbarBindingIntervalMethod = false;
  19.         this.lastNotifiedOrientation;
  20.         this.tbstatus = {
  21.             isMinimize: undefined,
  22.             suspendDragDrop: false
  23.         };
  24.         this.flashPlayerManager = undefined;
  25.         this.enableFlashPlayerManager = true;
  26.         this.updateScrollTimerId = 0;
  27.         this.isToolbarSrcReloaded = false;
  28.         this.monitorScrollDown = false;
  29.         this.l8FocusState = false;
  30.         this.lastWindowAndScreenSizes = {
  31.             windowWidth: 0,
  32.             windowHeight: 0,
  33.             screenWidth: 0,
  34.             screenHeight: 0
  35.         };
  36.         this.screenOverlayElement = undefined;
  37.         this._scriptInjectionRequestTimeouts = {};
  38.         this.initManager = function() {
  39.             try {
  40.                 this.initGlobals();
  41.                 this.calculateMaxZIndex();
  42.                 this.isMobileAwareSite = window[fnNameSpace].ViewPort.isMobileAwareSite();
  43.                 this.lastNotifiedOrientation = window[fnNameSpace].displayUtils.isPortrait();
  44.                 window[fnNameSpace].message.assignTo(this);
  45.                 this.initToolbarData();
  46.                 var loadedTB = this.loadToolbar(TOOLBAR_IFRAME_ID, "portrait");
  47.                 if (loadedTB === false) {
  48.                     throw "No toolbars found"
  49.                 }
  50.                 this.appendScreenOverlayLayout(SCREEN_OVERLAY_ID);
  51.                 if (typeof window[fnNameSpace].OverlayTextBox !== "undefined") {
  52.                     window[fnNameSpace].OverlayTextBox.appendScreenOverlayTextBoxLayout()
  53.                 }
  54.                 this.initManagerDevice();
  55.                 this.setCurrentToolbar(toolbarsById[TOOLBAR_IFRAME_ID]);
  56.                 if (!this.currentToolbar) {
  57.                     throw "No toolbar is set!"
  58.                 }
  59.                 window[fnNameSpace].EventRegister(this.eventsToRegister);
  60.                 if (this.enableFlashPlayerManager) {
  61.                     this.flashPlayerManager = new window[fnNameSpace].FlashPlayerManager();
  62.                     this.flashPlayerManager.modifyFlashPlayerWmode()
  63.                 }
  64.                 this.notifyManagerIsUp();
  65.                 this.setToolbarLocationAfterPageLoad()
  66.             } catch (ex) {
  67.                 return false
  68.             }
  69.         };
  70.         if (!this.startIos7FixResizeInterval) {
  71.             this.startIos7FixResizeInterval = function() {}
  72.         }
  73.         this.initGlobals = function() {
  74.             this.initGetComputedStyleIfNeeded()
  75.         };
  76.         this.initGetComputedStyleIfNeeded = function() {
  77.             if (!window.getComputedStyle) {
  78.                 window.getComputedStyle = function(el, pseudo) {
  79.                     this.el = el;
  80.                     this.getPropertyValue = function(prop) {
  81.                         var re = /(\-([a-z]){1})/g;
  82.                         if (prop == "float") {
  83.                             prop = "styleFloat"
  84.                         }
  85.                         if (re.test(prop)) {
  86.                             prop = prop.replace(re, function() {
  87.                                 return arguments[2].toUpperCase()
  88.                             })
  89.                         }
  90.                         return el.currentStyle[prop] ? el.currentStyle[prop] : null
  91.                     };
  92.                     return this
  93.                 }
  94.             }
  95.         };
  96.         this.scrollToDest = function(x, y) {
  97.             if (y == "bottom") {
  98.                 y = document.body.scrollHeight
  99.             } else {
  100.                 if (y == "top") {
  101.                     if (window.scrollY == 0) {
  102.                         return
  103.                     } else {
  104.                         y = 0
  105.                     }
  106.                 }
  107.             }
  108.             window.scrollTo(x, y)
  109.         };
  110.         this.setPageOpcityTrick = function() {
  111.             document.body.style.opacity = 0.999;
  112.             window.setTimeout(function() {
  113.                 document.body.style.opacity = 1;
  114.                 document.body.style.opacity = ""
  115.             }, 1)
  116.         };
  117.         this.addCssClassToHead = function(cssProp) {
  118.             var head = document.getElementsByTagName("head")[0];
  119.             var styleElement = document.createElement("style");
  120.             styleElement.setAttribute("type", "text/css");
  121.             if (styleElement.styleSheet) {
  122.                 styleElement.styleSheet.cssText = cssProp
  123.             } else {
  124.                 styleElement.appendChild(document.createTextNode(cssProp))
  125.             }
  126.             head.appendChild(styleElement)
  127.         };
  128.         this.setToolbarLocationAfterPageLoad = function() {
  129.             if (window[fnNameSpace].util.Browser.isIOS) {
  130.                 var metas = document.getElementsByTagName("meta");
  131.                 var currentZoomLevel = window[fnNameSpace].displayUtils.getIframeZoomLevel() / 100;
  132.                 var lastScreenHeight = window.innerHeight / currentZoomLevel;
  133.                 for (i = 0; i < metas.length; i++) {
  134.                     if (metas[i].getAttribute("name") == "apple-itunes-app") {
  135.                         i = metas.length;
  136.                         var metaTagInterval = window.setInterval(function() {
  137.                             currentZoomLevel = window[fnNameSpace].displayUtils.getIframeZoomLevel() / 100;
  138.                             var heightToCheck;
  139.                             if (window[fnNameSpace].util.Browser.isiPhone4 && window[fnNameSpace].util.Browser.isIOS7) {
  140.                                 heightToCheck = 371
  141.                             } else {
  142.                                 if (window[fnNameSpace].util.Browser.isiPhone4 && window[fnNameSpace].util.Browser.isIOS6) {
  143.                                     heightToCheck = 278
  144.                                 } else {
  145.                                     if (window[fnNameSpace].util.Browser.isiPhone4 || window[fnNameSpace].util.Browser.isIOS6) {
  146.                                         heightToCheck = 443
  147.                                     } else {
  148.                                         heightToCheck = 459
  149.                                     }
  150.                                 }
  151.                             }
  152.                             if (lastScreenHeight <= heightToCheck && window.innerHeight / currentZoomLevel > heightToCheck) {
  153.                                 manager.scrollToDest(0, window.scrollY - 1);
  154.                                 window.clearInterval(metaTagInterval)
  155.                             }
  156.                             lastScreenHeight = window.innerHeight
  157.                         }, 2000)
  158.                     }
  159.                 }
  160.             }
  161.             if (RELOCATE_TOOLBAR_ON_LOAD_INTERVAL <= 0) {
  162.                 return
  163.             }
  164.             this.initialToolbarBindingIntervalMethod = new window[fnNameSpace].StopWatch();
  165.             this.initialToolbarBindingIntervalMethod.create(function() {
  166.                 if (typeof manager.currentToolbar.move == "function") {
  167.                     setTimeout(function() {
  168.                         manager.currentToolbar.move()
  169.                     }, 0)
  170.                 }
  171.             }, RELOCATE_TOOLBAR_ON_LOAD_INTERVAL, "Fix toolbar location on page load");
  172.             var intervalRemover = new window[fnNameSpace].StopWatch();
  173.             intervalRemover.create(function() {
  174.                 manager.initialToolbarBindingIntervalMethod.remove()
  175.             }, ATTEMP_TO_RELOCATE_TOOLBAR_AFTER_LOAD_TIMEOUT, "Remove toolbar location fix timer", true)
  176.         };
  177.         this.calculateMaxZIndex = function() {
  178.             this.maxZIndexOnPage = window[fnNameSpace].domHelper.getMaxZIndex();
  179.             this.toolbarsZIndex = (this.maxZIndexOnPage > this.toolbarsZIndex) ? this.maxZIndexOnPage + 1 : this.toolbarsZIndex
  180.         };
  181.         this.appendScreenOverlayLayout = function(screenOverlayId) {
  182.             var screenOverlay = document.createElement("div");
  183.             screenOverlay.setAttribute("id", screenOverlayId);
  184.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "background-color", "transparent", true);
  185.             if (window[fnNameSpace].util.Browser.isAndroid23) {
  186.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "position", "absolute", true);
  187.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "top", window.scrollY + "px", true);
  188.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "left", window.scrollX + "px", true);
  189.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "right", "auto", true);
  190.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "bottom", "auto", true);
  191.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "height", "1000%", true)
  192.             } else {
  193.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "position", "fixed", true);
  194.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "bottom", "0px", true);
  195.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "left", "0px", true);
  196.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "top", "auto", true);
  197.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "right", "auto", true);
  198.                 window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "height", document.documentElement.scrollHeight + "px", true)
  199.             }
  200.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "z-index", 2147483645, true);
  201.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "width", "100%", true);
  202.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "text-align", "center", true);
  203.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "margin", "0", true);
  204.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "padding", "0", true);
  205.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "border", "0", true);
  206.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "opacity", "0", true);
  207.             window[fnNameSpace].util.setStyleWithImportant(screenOverlay, "display", "none", true);
  208.             manager.screenOverlayElement = screenOverlay;
  209.             screenOverlay.addEventListener("touchstart", function(e) {
  210.                 e.preventDefault()
  211.             }, false);
  212.             screenOverlay.addEventListener("touchmove", function(e) {
  213.                 e.preventDefault()
  214.             }, false);
  215.             document.body.appendChild(screenOverlay);
  216.             return screenOverlay
  217.         };
  218.         this.setCurrentToolbar = function(toolbar) {
  219.             if (this.currentToolbar) {
  220.                 this.currentToolbar.hide(true);
  221.                 this.currentToolbar.isCurrentToolbar = false
  222.             }
  223.             this.currentToolbar = toolbar;
  224.             this.currentToolbar.isCurrentToolbar = true;
  225.             if (toolbar.isReady) {
  226.                 toolbar.loadToolbar();
  227.                 this.currentToolbar.sendCurrentZoomLevelToToolbar()
  228.             }
  229.         };
  230.         this.loadToolbar = function(toolbarId, type) {
  231.             if (!window[fnNameSpace].domHelper.checkElementOnPageById(toolbarId)) {
  232.                 return false
  233.             }
  234.             var toolbarDOM = window[fnNameSpace].domHelper.getElement(toolbarId);
  235.             var toolbarInstance = new window[fnNameSpace].Toolbar(toolbarDOM, this.toolbarsZIndex);
  236.             toolbarsById[toolbarInstance.id] = toolbarInstance;
  237.             return true
  238.         };
  239.         this.isDebug = function() {
  240.             if (window[fnNameSpace].util.fetchGetVariableValue("fndebug") == "true") {
  241.                 return true
  242.             }
  243.             return false
  244.         };
  245.         this.messageAllToolbars = function(msg) {
  246.             window[fnNameSpace].util.console("sending message to all toolbars!", "messaging");
  247.             for (var i in toolbarsById) {
  248.                 if (toolbarsById.hasOwnProperty(i)) {
  249.                     window[fnNameSpace].util.console("sending message: " + window[fnNameSpace].util.serialize(msg) + " to toolbar: " + toolbarsById[i].id, "messaging");
  250.                     toolbarsById[i].sendMessage(msg)
  251.                 }
  252.             }
  253.         };
  254.         this.notifyManagerIsUp = function() {
  255.             var msg = this.getManagerUpMessage();
  256.             this.messageAllToolbars(msg)
  257.         };
  258.         this.notifyManagerIsUpToOneFrame = function(toolbarInstance) {
  259.             var msg = this.getManagerUpMessage();
  260.             msg.frameAlreadyUp = true;
  261.             toolbarInstance.sendMessage(msg)
  262.         };
  263.         this.getManagerUpMessage = function() {
  264.             var msg = new Object();
  265.             msg.message = "ManagerUp";
  266.             msg.toolbarData = this.toolbarData;
  267.             var visualViewportInfo = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  268.             msg.windowWidth = visualViewportInfo.width;
  269.             msg.windowHeight = visualViewportInfo.height;
  270.             var screenSize = window[fnNameSpace].displayUtils.calcScreenSize();
  271.             msg.screenWidth = screenSize.width;
  272.             msg.screenHeight = screenSize.height;
  273.             msg.isPortrait = window[fnNameSpace].displayUtils.isPortrait();
  274.             msg.zoomLevel = window[fnNameSpace].displayUtils.getIframeZoomLevel();
  275.             msg.pageInfo = {
  276.                 url: window.location.href,
  277.                 title: window.document.title,
  278.                 icon: window.location.href + "/favicon.ico"
  279.             };
  280.             msg.doNotQueue = true;
  281.             msg.isMobileAwareSite = manager.isMobileAwareSite;
  282.             msg.iframePositioning = manager.currentToolbar.getIframePositioning();
  283.             msg.isNonScrollAbleSite = window.innerHeight >= document.body.scrollHeight;
  284.             msg.isToolbarSrcReloaded = this.isToolbarSrcReloaded;
  285.             return msg
  286.         };
  287.         this.initToolbarData = function() {
  288.             var toolbarData;
  289.             if (window[fnNameSpace].domHelper.checkElementOnPageById(window[fnNameSpace].util.FN_TOOLBAR_SCRIPT) === false) {
  290.                 return false
  291.             }
  292.             toolbarData = document.getElementById(window[fnNameSpace].util.FN_TOOLBAR_SCRIPT).getAttribute(window[fnNameSpace].util.TOOLBAR_DATA_ATTRIBUTE);
  293.             this.toolbarData = toolbarData;
  294.             if (!toolbarData) {
  295.                 return false
  296.             }
  297.             return true
  298.         };
  299.         this.updateAllFramesWithWindowSize = function() {
  300.             var visualViewportInfo = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  301.             var screenSize = window[fnNameSpace].displayUtils.calcScreenSize();
  302.             var screenWidth = screenSize.width;
  303.             var screenHeight = screenSize.height;
  304.             if (typeof(this.lastWindowAndScreenSizes) !== undefined) {
  305.                 if ((this.lastWindowAndScreenSizes.windowWidth !== visualViewportInfo.width) || (this.lastWindowAndScreenSizes.windowHeight !== visualViewportInfo.height) || (this.lastWindowAndScreenSizes.screenWidth !== screenWidth) || (this.lastWindowAndScreenSizes.screenHeight !== screenHeight)) {
  306.                     this.lastWindowAndScreenSizes = {
  307.                         windowWidth: visualViewportInfo.width,
  308.                         windowHeight: visualViewportInfo.height,
  309.                         screenWidth: screenWidth,
  310.                         screenHeight: screenHeight
  311.                     };
  312.                     var msg = new Object();
  313.                     msg.message = "ScreenSizeChange";
  314.                     msg.windowWidth = visualViewportInfo.width;
  315.                     msg.windowHeight = visualViewportInfo.height;
  316.                     msg.screenWidth = screenWidth;
  317.                     msg.screenHeight = screenHeight;
  318.                     this.messageAllToolbars(msg)
  319.                 }
  320.             }
  321.         };
  322.         this.loadToolbarPosition = function() {
  323.             var msg = new Object();
  324.             msg.message = "LoadToolbarPosition";
  325.             this.currentToolbar.sendMessage(msg)
  326.         };
  327.         this.storeToolbarPosition = function(verticalPos, horizontalPos) {
  328.             var msg = new Object();
  329.             msg.message = "StoreToolbarPosition";
  330.             msg.verticalPos = verticalPos;
  331.             msg.horizontalPos = horizontalPos;
  332.             this.currentToolbar.sendMessage(msg)
  333.         };
  334.         this.attachClassToElement = function(elementId, className) {
  335.             var msg = new Object();
  336.             msg.message = "AttachClassToElement";
  337.             msg.elementId = elementId;
  338.             msg.className = className;
  339.             this.currentToolbar.sendMessage(msg)
  340.         };
  341.         this.maximizeToolbarRequest = function() {
  342.             var msg = new Object();
  343.             msg.message = "MaximizeToolbarRequest";
  344.             this.currentToolbar.sendMessage(msg)
  345.         };
  346.         this.minimizeToolbarRequest = function() {
  347.             var msg = new Object();
  348.             msg.message = "MinimizeToolbarRequest";
  349.             this.currentToolbar.sendMessage(msg)
  350.         };
  351.         this.sendOverlayTextBoxValue = function(elementId, textValue) {
  352.             var msg = new Object();
  353.             msg.message = "SendOverlayTextBoxValue";
  354.             msg.elementId = elementId;
  355.             msg.textValue = encodeURI(textValue);
  356.             this.currentToolbar.sendMessage(msg)
  357.         };
  358.         this.notifyOverlayTextBoxSubmit = function(submitString) {
  359.             var msg = new Object();
  360.             msg.message = "NotifyOverlayTextBoxSubmit";
  361.             msg.submitString = submitString;
  362.             this.currentToolbar.sendMessage(msg)
  363.         };
  364.         this.notifyOverlayTextBoxClose = function(closeString) {
  365.             var msg = new Object();
  366.             msg.message = "NotifyOverlayTextBoxClose";
  367.             msg.closeString = closeString;
  368.             this.currentToolbar.sendMessage(msg)
  369.         };
  370.         this.scrollDownAndUp = function() {
  371.             var msg = {
  372.                 message: "ScrollDownAndUp",
  373.                 scrollY: window.scrollY,
  374.                 innerHeight: window.innerHeight,
  375.                 scrollHeight: document.body.scrollHeight
  376.             };
  377.             this.currentToolbar.sendMessage(msg)
  378.         };
  379.         this.scrollDown = function() {
  380.             var msg = {
  381.                 message: "ScrollDown",
  382.                 scrollY: window.scrollY,
  383.                 innerHeight: window.innerHeight,
  384.                 scrollHeight: document.body.scrollHeight
  385.             };
  386.             this.currentToolbar.sendMessage(msg)
  387.         };
  388.         this.handleL8FocusEvent = function(state) {
  389.             manager.l8FocusState = state.disable;
  390.             if (manager.l8FocusState) {
  391.                 var innerHeight = 0;
  392.                 window.setTimeout(function() {
  393.                     var interval = setInterval(function() {
  394.                         if (innerHeight !== 0 && window.innerHeight > (innerHeight + 41)) {
  395.                             manager.currentToolbar.l8BlurEvent();
  396.                             clearInterval(interval);
  397.                             return
  398.                         }
  399.                         innerHeight = window.innerHeight
  400.                     }, 500)
  401.                 }, 300)
  402.             }
  403.         };
  404.         this.scrollUp = function() {
  405.             var msg = {
  406.                 message: "ScrollUp",
  407.                 scrollY: window.scrollY,
  408.                 innerHeight: window.innerHeight,
  409.                 scrollHeight: document.body.scrollHeight
  410.             };
  411.             this.currentToolbar.sendMessage(msg)
  412.         };
  413.         this.mouseOutEvent = function(e) {
  414.             var msg = {
  415.                 message: "MouseOutEvent"
  416.             };
  417.             this.currentToolbar.sendMessage(msg)
  418.         };
  419.         this.onInitializeDragDropManager = function(eventMessage) {
  420.             if (typeof window[fnNameSpace].DragDropManager === "undefined") {
  421.                 window[fnNameSpace].util.console("DragDropManager is undefined", "DragDrop");
  422.                 return
  423.             }
  424.             if (toolbarsById[eventMessage.sender]) {
  425.                 if (window[fnNameSpace].dragdropManager != null) {
  426.                     return
  427.                 }
  428.                 var params = eventMessage.params || {};
  429.                 window[fnNameSpace].dragdropManager = new window[fnNameSpace].DragDropManager(params);
  430.                 window[fnNameSpace].dragdropManager.registerDragSupport()
  431.             }
  432.         };
  433.         this.onSuspendDragDrop = function(eventMessage) {
  434.             manager.tbstatus.suspendDragDrop = eventMessage.bSuspend;
  435.             if (toolbarsById[eventMessage.sender]) {
  436.                 if (window[fnNameSpace].dragdropManager) {
  437.                     window[fnNameSpace].dragdropManager.suspendDragDrop()
  438.                 }
  439.             }
  440.         };
  441.         this.onToolbarSetDragPosition = function(eventMessage) {
  442.             if (toolbarsById[eventMessage.sender]) {
  443.                 if (window[fnNameSpace].dragdropManager) {
  444.                     window[fnNameSpace].dragdropManager.setPosition(eventMessage.verticalPos, eventMessage.horizontalPos)
  445.                 }
  446.             }
  447.         };
  448.         this.onSetDragIcon = function(eventMessage) {
  449.             if (toolbarsById[eventMessage.sender]) {
  450.                 if (window[fnNameSpace].dragdropManager) {
  451.                     window[fnNameSpace].dragdropManager.setDragIcon(eventMessage.iconUrl)
  452.                 }
  453.             }
  454.         };
  455.         this.onFrameUp = function(eventMessage) {
  456.             var toolbarInstance = toolbarsById[eventMessage.sender];
  457.             if (!toolbarInstance) {
  458.                 return
  459.             }
  460.             if (!eventMessage.managerUp) {
  461.                 this.notifyManagerIsUpToOneFrame(toolbarInstance);
  462.                 return
  463.             }
  464.             toolbarInstance.onFrameReady();
  465.             if (toolbarInstance.isCurrentToolbar) {
  466.                 toolbarInstance.loadToolbar(eventMessage.config);
  467.                 toolbarInstance.sendCurrentZoomLevelToToolbar()
  468.             }
  469.         };
  470.         this.onRequestPageNavigation = function(eventMessage) {
  471.             window.location.href = eventMessage.url
  472.         };
  473.         this.onUpdateToolbarStatus = function(eventMessage) {
  474.             manager.tbstatus.isMinimize = eventMessage.isMinimize;
  475.             if (toolbarsById[eventMessage.sender]) {
  476.                 if (window[fnNameSpace].dragdropManager) {
  477.                     window[fnNameSpace].dragdropManager.toolbarStateChanged()
  478.                 }
  479.             }
  480.         };
  481.         this.onFlapClick = function(eventMessage) {
  482.             document.activeElement.blur()
  483.         }, this.onToolbarResize = function(eventMessage) {
  484.             if (toolbarsById[eventMessage.sender]) {
  485.                 toolbarsById[eventMessage.sender].resize(eventMessage.width, eventMessage.height, true, eventMessage.ratio)
  486.             }
  487.         };
  488.         this.onToolbarScrollToDest = function(eventMessage) {
  489.             if (toolbarsById[eventMessage.sender]) {
  490.                 manager.scrollToDest(eventMessage.x, eventMessage.y)
  491.             }
  492.         };
  493.         this.onToolbarOpacityRenderTrick = function(eventMessage) {
  494.             if (toolbarsById[eventMessage.sender]) {
  495.                 manager.setPageOpcityTrick()
  496.             }
  497.         };
  498.         this.onToolbarMove = function(eventMessage) {
  499.             if (toolbarsById[eventMessage.sender]) {
  500.                 toolbarsById[eventMessage.sender].move(eventMessage.positioning)
  501.             }
  502.         };
  503.         this.onShowToolbar = function(eventMessage) {
  504.             if (toolbarsById[eventMessage.sender]) {
  505.                 toolbarsById[eventMessage.sender].show();
  506.                 toolbarsById[eventMessage.sender].sendCurrentZoomLevelToToolbar(true);
  507.                 manager.currentToolbar.showL8CompletedCallback()
  508.             }
  509.         };
  510.         this.onHideToolbar = function(eventMessage) {
  511.             if (toolbarsById[eventMessage.sender]) {
  512.                 toolbarsById[eventMessage.sender].hide()
  513.             }
  514.         };
  515.         this.onChangeIframePosition = function(eventMessage) {
  516.             if (toolbarsById[eventMessage.sender]) {
  517.                 manager.toolbarPositionControl(eventMessage)
  518.             }
  519.         };
  520.         this.onChangeIframeVerticalPosition = function(eventMessage) {
  521.             if (toolbarsById[eventMessage.sender]) {
  522.                 manager.toolbarPositionVerticalPosition(eventMessage)
  523.             }
  524.         };
  525.         this.onChangeIframeOpacity = function(eventMessage) {
  526.             if (toolbarsById[eventMessage.sender]) {
  527.                 manager.toolbarOpacityControl(eventMessage)
  528.             }
  529.         };
  530.         this.onSetScreenOverlay = function(eventMessage) {
  531.             if (toolbarsById[eventMessage.sender]) {
  532.                 manager.toolbarScreenOverlay(eventMessage.screenOverlayId, eventMessage)
  533.             }
  534.         };
  535.         this.onShowOverlayTextBox = function(eventMessage) {
  536.             if (toolbarsById[eventMessage.sender]) {
  537.                 if (typeof window[fnNameSpace].OverlayTextBox !== "undefined") {
  538.                     window[fnNameSpace].OverlayTextBox.showOverlayTextBox(eventMessage)
  539.                 }
  540.             }
  541.         };
  542.         this.onMonitorScrollDown = function(eventMessage) {
  543.             if (toolbarsById[eventMessage.sender]) {
  544.                 manager.monitorScrollDown = eventMessage.monitor
  545.             }
  546.         };
  547.         this.onL8FocusEvent = function(eventMessage) {
  548.             if (toolbarsById[eventMessage.sender]) {
  549.                 manager.handleL8FocusEvent(eventMessage)
  550.             }
  551.         };
  552.         this.onTollbarLocationParametersUpdate = function(eventMessage) {
  553.             if (toolbarsById[eventMessage.sender]) {
  554.                 manager.handleTollbarLocationParametersUpdate()
  555.             }
  556.         };
  557.         this.handleTollbarLocationParametersUpdate = function() {
  558.             var bodyScrollHeight = document.body.scrollHeight;
  559.             var windowInnerHeight = window.innerHeight;
  560.             var windowScrollY = window.scrollY;
  561.             var msg = {
  562.                 message: "TopBottomTollbarLocationParameters",
  563.                 bodyScrollHeight: bodyScrollHeight,
  564.                 windowInnerHeight: windowInnerHeight,
  565.                 windowScrollY: windowScrollY
  566.             };
  567.             this.currentToolbar.sendMessage(msg)
  568.         };
  569.         this.onScriptInjectionRequest = function(eventMessage) {
  570.             var toolbarInstance = toolbarsById[eventMessage.sender];
  571.             if (toolbarInstance) {
  572.                 var id = eventMessage.id;
  573.                 var sourceUrl = eventMessage.sourceUrl;
  574.                 var callbackName = eventMessage.callbackName;
  575.                 var preScriptEvalCode = eventMessage.preScriptEvalCode;
  576.                 var timeout = eventMessage.timeout;
  577.                 if (typeof preScriptEvalCode === "string" && preScriptEvalCode !== "") {
  578.                     window.eval(preScriptEvalCode)
  579.                 }
  580.                 window[callbackName] = function() {};
  581.                 var me = this;
  582.                 this._scriptInjectionRequestTimeouts[id] = window.setTimeout(function() {
  583.                     me._scriptInjectionRequestFinished.call(me, toolbarInstance, id, undefined)
  584.                 }, timeout);
  585.                 this._scriptInjectionRequestAppendScript(toolbarInstance, id, sourceUrl, callbackName)
  586.             }
  587.         };
  588.         this._scriptInjectionRequestFinished = function(toolbarInstance, id, result) {
  589.             var timeoutId = this._scriptInjectionRequestTimeouts[id];
  590.             if (typeof timeoutId !== "undefined" && timeoutId !== null) {
  591.                 window.clearTimeout(timeoutId);
  592.                 delete this._scriptInjectionRequestTimeouts[id];
  593.                 toolbarInstance.notifyScriptInjectionFinished(id, result)
  594.             }
  595.         };
  596.         this._scriptInjectionRequestAppendScript = function(toolbarInstance, id, sourceUrl, callbackName) {
  597.             var me = this;
  598.             var injectionScript = document.createElement("script");
  599.             injectionScript.src = sourceUrl;
  600.             injectionScript.onload = function() {
  601.                 if (typeof callbackName === "string" && callbackName !== "") {
  602.                     window[callbackName] = function() {
  603.                         var result = Array.prototype.concat.apply([], arguments);
  604.                         me._scriptInjectionRequestFinished.call(me, toolbarInstance, id, result);
  605.                         delete window[callbackName]
  606.                     }
  607.                 } else {
  608.                     me._scriptInjectionRequestFinished.call(me, toolbarInstance, id, undefined)
  609.                 }
  610.             };
  611.             document.body.appendChild(injectionScript)
  612.         }
  613.     };
  614.     window[fnNameSpace].Manager.prototype.handleOrientationChange = function(a) {
  615.         manager.firstOrientationChangeOccur = true;
  616.         var c = window[fnNameSpace].displayUtils.isPortrait();
  617.         if (this.lastNotifiedOrientation != c) {
  618.             if (manager.l8FocusState && c) {
  619.                 return
  620.             }
  621.             this.handleOrientationChangeDevice();
  622.             window[fnNameSpace].domHelper.hideiFrameWithOpacity(0.2);
  623.             this.lastNotifiedOrientation = c;
  624.             var b = this;
  625.             window.setTimeout(function() {
  626.                 b.currentToolbar.sendCurrentZoomLevelToToolbar();
  627.                 b.currentToolbar.resize();
  628.                 b.currentToolbar.onOrientationChange(c);
  629.                 if (window[fnNameSpace].dragdropManager) {
  630.                     window[fnNameSpace].dragdropManager.orientationChange(c)
  631.                 }
  632.                 if (!b.currentToolbar.changeIframeCSSPosition()) {
  633.                     window[fnNameSpace].domHelper.showiFrameWithOpacity(0.6)
  634.                 }
  635.             }, 500)
  636.         }
  637.     };
  638.     window[fnNameSpace].Manager.prototype.handleOrientationChangeDevice = function() {};
  639.     window[fnNameSpace].Manager.prototype.triggerUpdateScrollEventTimer = function() {
  640.         if (this.updateScrollTimerId === 0) {
  641.             this.updateScrollTimerId = window.setTimeout(function() {
  642.                 var a = new Object();
  643.                 a.message = "PageScroll";
  644.                 a.scrollTop = document.body.scrollTop;
  645.                 a.scrollHeight = document.body.scrollHeight;
  646.                 a.scrollWidth = document.body.scrollWidth;
  647.                 manager.currentToolbar.sendMessage(a);
  648.                 manager.updateScrollTimerId = 0
  649.             }, 2000)
  650.         }
  651.     };
  652.     window[fnNameSpace].Manager.prototype.handleScroll = function(a) {};
  653.     window[fnNameSpace].Manager.prototype.lastVisualViewportInfo = undefined;
  654.     window[fnNameSpace].Manager.prototype.handleResize = function(a) {
  655.         var b = this;
  656.         setTimeout(function() {
  657.             var d = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  658.             if (window[fnNameSpace].OverlayTextBox && window[fnNameSpace].OverlayTextBox.isDisplayed()) {
  659.                 if (b.lastNotifiedOrientation === window[fnNameSpace].displayUtils.isPortrait()) {
  660.                     if (b.lastVisualViewportInfo && (b.lastVisualViewportInfo.width === d.width) && ((b.lastVisualViewportInfo.height < d.height))) {
  661.                         window[fnNameSpace].OverlayTextBox._restoreLayer8()
  662.                     }
  663.                 }
  664.             }
  665.             b.lastVisualViewportInfo = d;
  666.             if (typeof window[fnNameSpace].Manager.prototype.toolbarScreenOverlayVisible === "object") {
  667.                 var e = (window[fnNameSpace].displayUtils.getIframeZoomLevel()) / 100;
  668.                 for (var c in window[fnNameSpace].Manager.prototype.toolbarScreenOverlayVisible) {
  669.                     overlayLayout = document.getElementById(c);
  670.                     if (overlayLayout) {
  671.                         if (window[fnNameSpace].util.Browser.isAndroid23) {
  672.                             window[fnNameSpace].util.setStyleWithImportant(overlayLayout, "height", "1000%", true)
  673.                         } else {
  674.                             window[fnNameSpace].util.setStyleWithImportant(overlayLayout, "height", window.screen.height * e + "px", true)
  675.                         }
  676.                     }
  677.                 }
  678.             }
  679.         }, 0);
  680.         this.handleOrientationChange();
  681.         this.handleTollbarLocationParametersUpdate();
  682.         var b = this;
  683.         setTimeout(function() {
  684.             b.currentToolbar.sendCurrentZoomLevelToToolbar();
  685.             b.currentToolbar.resize();
  686.             b.updateAllFramesWithWindowSize();
  687.             b.currentToolbar.changeIframeCSSPosition()
  688.         }, 500)
  689.     };
  690.     window[fnNameSpace].Manager.prototype.initManagerDevice = function() {};
  691.     window[fnNameSpace].Manager.prototype.eventsToRegister = [{
  692.         event: "pagehide",
  693.         func: function(a) {
  694.             window[fnNameSpace].uiEventHandler.beforeunloadEvent(a)
  695.         },
  696.         element: window,
  697.         capture: false
  698.     }, {
  699.         event: "click",
  700.         func: function(a) {
  701.             window[fnNameSpace].touchEventsHandler.clickEvent(a)
  702.         },
  703.         element: document,
  704.         capture: false
  705.     }, {
  706.         event: "touchmove",
  707.         func: function(a) {
  708.             window[fnNameSpace].touchEventsHandler.touchmoveEvent(a)
  709.         },
  710.         element: top.document,
  711.         capture: false
  712.     }, {
  713.         event: "touchend",
  714.         func: function(a) {
  715.             window[fnNameSpace].touchEventsHandler.touchendEvent(a)
  716.         },
  717.         element: top.document,
  718.         capture: false
  719.     }, {
  720.         event: "touchcancel",
  721.         func: function(a) {
  722.             window[fnNameSpace].touchEventsHandler.touchcancelEvent(a)
  723.         },
  724.         element: top.document,
  725.         capture: false
  726.     }, {
  727.         event: "scroll",
  728.         func: function(a) {
  729.             window[fnNameSpace].uiEventHandler.scrollEvent(a)
  730.         },
  731.         element: window,
  732.         capture: true
  733.     }, {
  734.         event: "resize",
  735.         func: function(a) {
  736.             window[fnNameSpace].uiEventHandler.resizeEvent(a)
  737.         },
  738.         element: window,
  739.         capture: false
  740.     }, {
  741.         event: "orientationchange",
  742.         func: function(a) {
  743.             window[fnNameSpace].uiEventHandler.orientationChangeEvent(a)
  744.         },
  745.         element: window,
  746.         capture: false
  747.     }];
  748.     window[fnNameSpace].Manager.prototype.handleScroll = function(a) {
  749.         if (!this.currentToolbar) {
  750.             return
  751.         }
  752.         if (!this.currentToolbar.isVisible) {
  753.             return
  754.         }
  755.         var b = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  756.         manager.lastVisualViewportInfo = b;
  757.         this.currentToolbar.move();
  758.         this.triggerUpdateScrollEventTimer();
  759.         var c = this;
  760.         window.setTimeout(function() {
  761.             c.currentToolbar.sendCurrentZoomLevelToToolbar();
  762.             c.currentToolbar.resize();
  763.             c.updateAllFramesWithWindowSize();
  764.             c.currentToolbar.changeIframeCSSPosition()
  765.         }, 500)
  766.     };
  767.     window[fnNameSpace].Manager.prototype.initManagerDevice = function() {
  768.         if (window[fnNameSpace].util.Browser.isIOS6) {
  769.             window.addEventListener("pageshow", function(a) {
  770.                 if (a.persisted) {
  771.                     manager.isToolbarSrcReloaded = true;
  772.                     manager.currentToolbar.hide();
  773.                     var c = window.scrollX;
  774.                     var b = window.scrollY;
  775.                     window.setTimeout(function() {
  776.                         manager.scrollToDest(c, b - 1);
  777.                         manager.currentToolbar.dom.src = manager.currentToolbar.dom.src;
  778.                         window.setTimeout(function() {
  779.                             manager.scrollToDest(c, b);
  780.                             manager.currentToolbar.show()
  781.                         }, 100)
  782.                     }, 1000)
  783.                 }
  784.             }, false)
  785.         }
  786.     };
  787.     window[fnNameSpace].Manager.prototype.startIos7FixResizeInterval = function(a) {
  788.         if (typeof manager.ios7Interval !== "undefined") {
  789.             window.clearInterval(manager.ios7Interval)
  790.         }
  791.         manager.lastVisualViewportInfo = a;
  792.         manager.ios7Interval = window.setInterval(function() {
  793.             var b = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  794.             if ((manager.lastVisualViewportInfo.width !== b.width) || (manager.lastVisualViewportInfo.height !== b.height)) {
  795.                 manager.handleScroll()
  796.             }
  797.         }, 5000)
  798.     };
  799.     window[fnNameSpace].EventRegister = function(a) {
  800.         for (var b in a) {
  801.             window[fnNameSpace].util.addEvent(a[b].event, a[b].func, a[b].capture, a[b].element)
  802.         }
  803.     };
  804.     window[fnNameSpace].MouseEventsHandler = function() {
  805.         this.clickEvent = function(a) {};
  806.         this.mouseupEvent = function(a) {};
  807.         this.mouseoverEvent = function(a) {};
  808.         this.mouseoutEvent = function(a) {
  809.             this.handleMouseOutEvent()
  810.         };
  811.         this.mousedownEvent = function(a) {};
  812.         this.mousewheelEvent = function(a) {
  813.             if (manager.screenOverlayElement.style.display == "block") {
  814.                 a.preventDefault()
  815.             }
  816.         };
  817.         this.handleMouseOutEvent = function(a) {
  818.             manager.mouseOutEvent(a)
  819.         }
  820.     };
  821.     window[fnNameSpace].mouseEventsHandler = new window[fnNameSpace].MouseEventsHandler();
  822.     window[fnNameSpace].TouchEventsHandler = function() {
  823.         this.detectZoom = function(a) {
  824.             if (a.touches.length > 1) {
  825.                 return true
  826.             }
  827.             return false
  828.         };
  829.         this.touchstartEvent = function(a) {
  830.             if (typeof manager.currentToolbar === "undefined") {
  831.                 return
  832.             }
  833.             if (typeof manager.currentToolbar.stage === "undefined") {
  834.                 return
  835.             }
  836.             if (!manager.currentToolbar.isVisible) {
  837.                 return
  838.             }
  839.         };
  840.         this.touchmoveEvent = function(a) {
  841.             if (a.touches.length > manager.currentToolbar.config.hideOnXTouches && manager.screenOverlayElement.style.display == "none") {
  842.                 manager.touchCurrentCounter = 2;
  843.                 window[fnNameSpace].domHelper.hideiFrameWithOpacity(0)
  844.             } else {
  845.                 manager.touchCurrentCounter = 1
  846.             }
  847.         };
  848.         this.touchendEvent = function(b) {
  849.             if (typeof manager.currentToolbar === "undefined") {
  850.                 return
  851.             }
  852.             if (typeof manager.currentToolbar.stage === "undefined") {
  853.                 return
  854.             }
  855.             manager.touchCurrentCounter = 1;
  856.             var a = new window[fnNameSpace].StopWatch();
  857.             a.create(function() {
  858.                 manager.handleScroll()
  859.             }, 250, "Relocates toolbar after double click", true)
  860.         };
  861.         this.touchcancelEvent = function(a) {};
  862.         this.clickEvent = function(a) {}
  863.     };
  864.     window[fnNameSpace].touchEventsHandler = new window[fnNameSpace].TouchEventsHandler();
  865.     window[fnNameSpace].UiEventHandler = function() {
  866.         this.beforeunloadEvent = function(b) {
  867.             if (window[fnNameSpace].util.Browser.isIOS6) {
  868.                 manager.currentToolbar.hide()
  869.             }
  870.         };
  871.         this.loadEvent = function(b) {};
  872.         this.scrollEvent = function(b) {
  873.             if (b.target !== document) {
  874.                 return
  875.             }
  876.             if ((manager.currentToolbar) && (manager.currentToolbar.stage)) {
  877.                 manager.touchCurrentCounter = 1;
  878.                 manager.handleScroll(b)
  879.             }
  880.             this.checkScrollPosition()
  881.         };
  882.         this.resizeEvent = function(b) {
  883.             if (manager.l8FocusState && window[fnNameSpace].displayUtils.isPortrait()) {
  884.                 return
  885.             }
  886.             manager.handleResize(b);
  887.             return false
  888.         };
  889.         this.orientationChangeEvent = function(b) {
  890.             manager.handleOrientationChange(b)
  891.         };
  892.         this.yOffset = 0;
  893.         var a;
  894.         this.checkScrollPosition = function() {
  895.             if (manager.currentToolbar.config.serviceNotificationThresholds && window[fnNameSpace].displayUtils.isPortrait()) {
  896.                 if (typeof a !== undefined && a === window[fnNameSpace].displayUtils.getIframeZoomLevel()) {
  897.                     if (this.yOffset > window.pageYOffset) {
  898.                         manager.scrollDownAndUp();
  899.                         manager.scrollUp()
  900.                     } else {
  901.                         if (manager.monitorScrollDown === true && this.yOffset < window.pageYOffset) {
  902.                             manager.scrollDown()
  903.                         } else {
  904.                             if (this.yOffset < window.pageYOffset) {
  905.                                 manager.scrollDown()
  906.                             }
  907.                         }
  908.                     }
  909.                 }
  910.                 window.setTimeout(function() {
  911.                     a = window[fnNameSpace].displayUtils.getIframeZoomLevel()
  912.                 }, 10);
  913.                 this.yOffset = window.pageYOffset
  914.             }
  915.         }
  916.     };
  917.     window[fnNameSpace].uiEventHandler = new window[fnNameSpace].UiEventHandler();
  918.     window[fnNameSpace].Manager.prototype.toolbarPositionVerticalPosition = function(f) {
  919.         var d = window[fnNameSpace].util.Browser.isAndroid ? manager.currentToolbar.dom.parentElement.style.position : manager.currentToolbar.dom.style.position;
  920.         if (d === "absolute") {
  921.             return
  922.         }
  923.         var c = "";
  924.         var a = "";
  925.         var e = parseFloat(manager.currentToolbar.dom.parentElement.style.left);
  926.         var b = parseFloat(manager.currentToolbar.dom.parentElement.style.right);
  927.         if (f.topPosition == true) {
  928.             c = 0;
  929.             a = "auto"
  930.         } else {
  931.             c = "auto";
  932.             a = 0
  933.         }
  934.         manager.currentToolbar.setIframePositioning(c, a, e, b)
  935.     };
  936.     window[fnNameSpace].Manager.prototype.toolbarPositionControl = function(c) {
  937.         var e = "";
  938.         var a = "";
  939.         var d = "";
  940.         var b = "";
  941.         if (c.lr == "left" && c.tb == "bottom") {
  942.             a = c.y;
  943.             d = c.x
  944.         } else {
  945.             if (c.lr == "left" && c.tb == "top") {
  946.                 e = c.y;
  947.                 d = c.x
  948.             } else {
  949.                 if (c.lr == "right" && c.tb == "bottom") {
  950.                     a = c.y;
  951.                     b = c.x
  952.                 } else {
  953.                     if (c.lr == "right" && c.tb == "top") {
  954.                         e = c.y;
  955.                         b = c.x
  956.                     }
  957.                 }
  958.             }
  959.         }
  960.         manager.currentToolbar.setIframePositioning(e, a, d, b)
  961.     };
  962.     window[fnNameSpace].Manager.prototype.toolbarOpacityControl = function(c) {
  963.         var a = c.opacity;
  964.         var d = {
  965.             opacity: a
  966.         };
  967.         var b = {
  968.             opacity: a
  969.         };
  970.         if (manager.tbstatus.isMinimize) {
  971.             for (var e in b) {
  972.                 window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, e, b[e], true)
  973.             }
  974.         } else {
  975.             for (var e in d) {
  976.                 window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, e, d[e], true)
  977.             }
  978.         }
  979.     };
  980.     window[fnNameSpace].Manager.prototype.toolbarScreenOverlayVisible = {};
  981.     window[fnNameSpace].Manager.prototype.toolbarScreenOverlay = function(h, f) {
  982.         var d = document.getElementById(h);
  983.         if (!window[fnNameSpace].util.Browser.isIOS5) {
  984.             window[fnNameSpace].util.setStyleWithImportant(d, "-webkit-transform", "translateZ(997px)", true)
  985.         }
  986.         if (!d) {
  987.             return
  988.         }
  989.         var c = function(p, n, q) {
  990.             var m, l, j = "DXImageTransform.Microsoft.";
  991.             try {
  992.                 l = p.filters.item(j + n);
  993.                 m = true
  994.             } catch (o) {}
  995.             if (!m) {
  996.                 try {
  997.                     l = p.filters.item(n);
  998.                     m = true
  999.                 } catch (o) {}
  1000.             }
  1001.             if (m) {
  1002.                 l.Enabled = true;
  1003.                 if (q) {
  1004.                     for (var k in q) {
  1005.                         l[k] = q[k]
  1006.                     }
  1007.                 }
  1008.             } else {
  1009.                 l = "";
  1010.                 if (q) {
  1011.                     for (var k in q) {
  1012.                         l += k.toLowerCase() + "=" + q[k] + ","
  1013.                     }
  1014.                 }
  1015.                 if (q) {
  1016.                     l = "(" + l.substr(0, l.length - 1) + ")"
  1017.                 }
  1018.                 p.style.filter += "progid:" + j + n + l + " "
  1019.             }
  1020.             if (!p.style.zoom) {
  1021.                 p.style.zoom = 1
  1022.             }
  1023.         };
  1024.         var b = f.background;
  1025.         var g = f.backgroundImage;
  1026.         var a = f.opacity;
  1027.         if (f.transition > 0) {
  1028.             window[fnNameSpace].util.setStyleWithImportant(d, "opacity", "0", true);
  1029.             if (document.body.filters) {
  1030.                 c(d, "Alpha", {
  1031.                     Opacity: 100
  1032.                 })
  1033.             }
  1034.             if (b == "disable" || b == "") {
  1035.                 window[fnNameSpace].util.setStyleWithImportant(d, "opacity", a, true);
  1036.                 if (document.body.filters) {
  1037.                     c(d, "Alpha", {
  1038.                         Opacity: a * 100
  1039.                     })
  1040.                 }
  1041.             }
  1042.             window[fnNameSpace].util.setStyleWithImportant(d, "-webkit-transition", "opacity " + f.transition + "s ease", true);
  1043.             window[fnNameSpace].util.setStyleWithImportant(d, "-moz-transition", "opacity " + f.transition + "s ease", true);
  1044.             window[fnNameSpace].util.setStyleWithImportant(d, "transition", "opacity " + f.transition + "s ease", true)
  1045.         } else {
  1046.             window[fnNameSpace].util.setStyleWithImportant(d, "-webkit-transition", "", true);
  1047.             window[fnNameSpace].util.setStyleWithImportant(d, "-moz-transition", "", true);
  1048.             window[fnNameSpace].util.setStyleWithImportant(d, "transition", "", true)
  1049.         }
  1050.         if (b == "disable" || b == "") {
  1051.             window[fnNameSpace].util.setStyleWithImportant(d, "opacity", "0", true);
  1052.             if (document.body.filters) {
  1053.                 c(d, "Alpha", {
  1054.                     Opacity: 100
  1055.                 })
  1056.             }
  1057.             window.setTimeout(function() {
  1058.                 window[fnNameSpace].util.setStyleWithImportant(d, "display", "none", true)
  1059.             }, f.transition);
  1060.             return
  1061.         } else {
  1062.             window[fnNameSpace].util.setStyleWithImportant(d, "display", "block", true)
  1063.         }
  1064.         var e = (window[fnNameSpace].displayUtils.getIframeZoomLevel()) / 100;
  1065.         if (!window[fnNameSpace].util.Browser.isAndroid23) {
  1066.             window[fnNameSpace].util.setStyleWithImportant(d, "height", window.screen.height * e + "px", true);
  1067.             window[fnNameSpace].util.setStyleWithImportant(d, "top", "0px", true);
  1068.             window[fnNameSpace].util.setStyleWithImportant(d, "bottom", "auto", true)
  1069.         } else {
  1070.             window[fnNameSpace].util.setStyleWithImportant(d, "height", "1000%", true)
  1071.         }
  1072.         window[fnNameSpace].util.setStyleWithImportant(d, "width", "100%", true);
  1073.         delete window[fnNameSpace].Manager.prototype.toolbarScreenOverlayVisible[h];
  1074.         window[fnNameSpace].Manager.prototype.toolbarScreenOverlayVisible[h] = true;
  1075.         d.style.top = "0px";
  1076.         d.style.bottom = "auto";
  1077.         if (b == "image") {
  1078.             window[fnNameSpace].util.setStyleWithImportant(d, "background-image", g, true);
  1079.             window[fnNameSpace].util.setStyleWithImportant(d, "background-size", "100% 100%", true);
  1080.             window[fnNameSpace].util.setStyleWithImportant(d, "background-repeat", "no-repeat", true)
  1081.         } else {
  1082.             window[fnNameSpace].util.setStyleWithImportant(d, "background-color", b, true)
  1083.         }
  1084.         window.setTimeout(function() {
  1085.             window[fnNameSpace].util.setStyleWithImportant(d, "opacity", a, true)
  1086.         }, 0);
  1087.         if (document.body.filters) {
  1088.             c(d, "Alpha", {
  1089.                 Opacity: a * 100
  1090.             })
  1091.         }
  1092.     };
  1093.     window[fnNameSpace].Toolbar = function(a, b) {
  1094.         this.isReady = false;
  1095.         this.dom = a;
  1096.         this.queuedMessages = new window[fnNameSpace].Message.MessageQueue();
  1097.         this.isVisible = false;
  1098.         this.config = false;
  1099.         this.id = this.dom.id;
  1100.         this.isFirstLoad = true;
  1101.         this.isCurrentToolbar = false;
  1102.         this.zIndexLevel = (parseInt(b) > 0) ? b : 99999;
  1103.         this.stage;
  1104.         this.initialOpacityReset = false;
  1105.         this.lastOpacity = 1;
  1106.         this.init = function() {
  1107.             this.initialOpacityReset = true;
  1108.             window[fnNameSpace].util.setStyleWithImportant(this.dom, "opacity", "0", true);
  1109.             this.setStyleDisplay(true);
  1110.             if (this.dom.tagName.toLowerCase() != "iframe") {
  1111.                 throw "Expected iframe! got: " + this.dom.tagName
  1112.             }
  1113.             var c = this.dom;
  1114.             window[fnNameSpace].util.thread(function() {
  1115.                 if (Number(c.style.zIndex) <= Number(window[fnNameSpace].domHelper.maxZIndexOnPage)) {
  1116.                     window[fnNameSpace].util.setStyleWithImportant(c, "z-index", 2147483646, true)
  1117.                 }
  1118.             });
  1119.             return true
  1120.         };
  1121.         if (!this.initialToolbarIframe) {
  1122.             this.initialToolbarIframe = function() {
  1123.                 var e = {
  1124.                     "z-index": this.zIndexLevel,
  1125.                     position: this.config.Position,
  1126.                     bottom: this.config.Bottom,
  1127.                     right: this.config.Right,
  1128.                     top: this.config.Top,
  1129.                     left: this.config.Left,
  1130.                     padding: this.config.Padding,
  1131.                     margin: this.config.Margin,
  1132.                     border: this.config.Border,
  1133.                     "min-width": "0px",
  1134.                     "min-height": "0px",
  1135.                     "max-width": "none",
  1136.                     "max-height": "none",
  1137.                     background: "transparent"
  1138.                 };
  1139.                 if (this.config.Opacity !== "undefined") {
  1140.                     this.lastOpacity = this.config.Opacity
  1141.                 }
  1142.                 var c = {
  1143.                     scrolling: this.config.ATT_Scrolling,
  1144.                     frameborder: this.config.ATT_Frameborder,
  1145.                     scroll: this.config.ATT_Scroll,
  1146.                     allowTransparency: this.config.ATT_Allowtransparency
  1147.                 };
  1148.                 for (var d in e) {
  1149.                     window[fnNameSpace].util.setStyleWithImportant(this.dom, d, e[d], true)
  1150.                 }
  1151.                 for (var d in c) {
  1152.                     this.dom.setAttribute(d, c[d])
  1153.                 }
  1154.                 if (this.initialToolbarIframeSpecificDevice) {
  1155.                     this.initialToolbarIframeSpecificDevice(e, c)
  1156.                 }
  1157.             }
  1158.         }
  1159.         this.loadConfiguration = function(c) {
  1160.             this.config = c;
  1161.             this.stage = new window[fnNameSpace].StageLogicManager(this);
  1162.             this.changeIframeCSSPosition();
  1163.             this.move(c);
  1164.             return true
  1165.         };
  1166.         this.sendMessage = function(c) {
  1167.             c.to = this.id;
  1168.             if ((!this.isReady) && (!c.doNotQueue)) {
  1169.                 this.queuedMessages.add(c);
  1170.                 window[fnNameSpace].util.console("[" + this.id + "]Message was added to queue for toolbar " + this.id + " content: " + window[fnNameSpace].util.serialize(c), "messaging")
  1171.             } else {
  1172.                 window[fnNameSpace].message.send(c, this.dom);
  1173.                 window[fnNameSpace].util.console("[" + this.id + "]Message sent to toolbar " + this.id + " content: " + window[fnNameSpace].util.serialize(c), "messaging")
  1174.             }
  1175.         };
  1176.         this.sendQueuedMessages = function() {
  1177.             window[fnNameSpace].util.console("[" + this.id + "]sending queued messages", "messaging");
  1178.             while (message = this.queuedMessages.shift()) {
  1179.                 this.sendMessage(message)
  1180.             }
  1181.         };
  1182.         if (!this.setStyleDisplay) {
  1183.             this.setStyleDisplay = function(c) {
  1184.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, "display", c ? "block" : "none", true);
  1185.                 this.isVisible = c
  1186.             }
  1187.         }
  1188.         if (!this.getStylePosition) {
  1189.             this.getStylePosition = function() {
  1190.                 return this.dom.style.position
  1191.             }
  1192.         }
  1193.         this.hide = function() {
  1194.             if (!this.config) {
  1195.                 this.delayedShow = false;
  1196.                 return
  1197.             }
  1198.             if (this.initialOpacityReset) {
  1199.                 this.initialOpacityReset = false;
  1200.                 window[fnNameSpace].domHelper.showiFrameWithOpacity(0)
  1201.             }
  1202.             if (!this.isVisible) {
  1203.                 return
  1204.             }
  1205.             this.setStyleDisplay(false);
  1206.             if (window[fnNameSpace].util.Browser.isIOS7) {
  1207.                 window.clearInterval(manager.ios7Interval)
  1208.             }
  1209.             var c = new Object();
  1210.             c.message = "ToolbarHide";
  1211.             this.sendMessage(c)
  1212.         };
  1213.         this.show = function() {
  1214.             if (!this.config) {
  1215.                 this.delayedShow = true;
  1216.                 return
  1217.             }
  1218.             if (this.initialOpacityReset) {
  1219.                 this.initialOpacityReset = false;
  1220.                 window[fnNameSpace].domHelper.showiFrameWithOpacity(0, true)
  1221.             }
  1222.             var c = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  1223.             if (window[fnNameSpace].util.Browser.isIOS7) {
  1224.                 manager.startIos7FixResizeInterval(c)
  1225.             }
  1226.             if (!this.isVisible) {
  1227.                 this.setStyleDisplay(true);
  1228.                 this.move()
  1229.             } else {
  1230.                 return
  1231.             }
  1232.             var d = {};
  1233.             d.message = "ToolbarShow";
  1234.             d.isFirstLoad = this.isFirstLoad;
  1235.             var c = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  1236.             d.windowWidth = c.width;
  1237.             d.windowHeight = c.height;
  1238.             this.sendMessage(d);
  1239.             window[fnNameSpace].util.console("[" + this.id + "] running show on toolbar " + this.id, "hideAndShow")
  1240.         };
  1241.         if (!(typeof this.move === "function")) {
  1242.             this.move = function(c) {}
  1243.         }
  1244.         this.resize = function(f, c, d, e) {
  1245.             if (!d) {
  1246.                 d = false
  1247.             }
  1248.             if (this.stage) {
  1249.                 this.stage.resize(f, c, d, e)
  1250.             }
  1251.         };
  1252.         this.loadToolbar = function(c) {
  1253.             var d = this;
  1254.             if (!c) {
  1255.                 var c = d.config
  1256.             }
  1257.             if (d.isFirstLoad) {
  1258.                 d.loadConfiguration(c);
  1259.                 d.initialToolbarIframe();
  1260.                 d.onIframePositioningChange();
  1261.                 d.isFirstLoad = false
  1262.             }
  1263.             if (this.delayedShow == true) {
  1264.                 this.show()
  1265.             }
  1266.         };
  1267.         this.showL8CompletedCallback = function() {
  1268.             var c = new Object();
  1269.             c.message = "ShowL8CompletedCallback";
  1270.             this.sendMessage(c)
  1271.         };
  1272.         this.l8BlurEvent = function() {
  1273.             var c = new Object();
  1274.             c.message = "L8BlurEvent";
  1275.             this.sendMessage(c)
  1276.         };
  1277.         this.sendCurrentZoomLevelToToolbar = function(c) {
  1278.             if (!this.isVisible) {
  1279.                 return
  1280.             }
  1281.             var d = new Object();
  1282.             d.message = "ChangeZoom";
  1283.             d.zoom = parseFloat(window[fnNameSpace].displayUtils.getIframeZoomLevel()) + "%";
  1284.             d.pageBodyZoomLevel = window[fnNameSpace].displayUtils.getBodyZoomLevel();
  1285.             d.postShowIframe = c === true ? true : false;
  1286.             this.sendMessage(d)
  1287.         };
  1288.         this.updateStageSize = function(d, c) {
  1289.             var e = new Object();
  1290.             e.message = "UpdateStageSize";
  1291.             e.width = d;
  1292.             e.height = c;
  1293.             this.sendMessage(e)
  1294.         };
  1295.         this.onOrientationChange = function(e) {
  1296.             var f = new Object();
  1297.             f.message = "OrientationChange";
  1298.             var c = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  1299.             f.isPortrait = e;
  1300.             f.pageHeight = c.height;
  1301.             f.windowWidth = c.width;
  1302.             f.windowHeight = c.height;
  1303.             var d = window[fnNameSpace].displayUtils.calcScreenSize();
  1304.             f.screenWidth = d.width;
  1305.             f.screenHeight = d.height;
  1306.             this.sendMessage(f)
  1307.         };
  1308.         this.onFrameReady = function() {
  1309.             this.isReady = true;
  1310.             this.sendQueuedMessages()
  1311.         };
  1312.         if (!this.getIframePositioning) {
  1313.             this.getIframePositioning = function() {
  1314.                 return {
  1315.                     top: this.dom.style.top,
  1316.                     bottom: this.dom.style.bottom,
  1317.                     left: this.dom.style.left,
  1318.                     right: this.dom.style.right
  1319.                 }
  1320.             }
  1321.         }
  1322.         if (!this.setIframePositioning) {
  1323.             this.setIframePositioning = function(f, c, e, d) {
  1324.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, "top", f === "" ? "auto" : f, true);
  1325.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, "bottom", c === "" ? "auto" : c, true);
  1326.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, "left", e === "" ? "auto" : e, true);
  1327.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, "right", d === "" ? "auto" : d, true);
  1328.                 this.onIframePositioningChange()
  1329.             }
  1330.         }
  1331.         this.onIframePositioningChange = function() {
  1332.             var c = {};
  1333.             c.message = "IframePositioningChange";
  1334.             c.iframePositioning = this.getIframePositioning();
  1335.             this.sendMessage(c)
  1336.         };
  1337.         this.notifyScriptInjectionFinished = function(e, c) {
  1338.             var d = {};
  1339.             d.message = "ScriptInjectionFinished";
  1340.             d.id = e;
  1341.             d.result = c;
  1342.             this.sendMessage(d)
  1343.         };
  1344.         this.changeIframeCSSPosition = function() {
  1345.             if ((typeof this.config.changeCSSPositionZoomThreshold !== "undefined") && (this.config.changeCSSPositionZoomThreshold !== 0)) {
  1346.                 var d = window[fnNameSpace].displayUtils.getIframeZoomLevel();
  1347.                 var c = this.dom.style.position;
  1348.                 if (d < this.config.changeCSSPositionZoomThreshold) {
  1349.                     if (c === "fixed") {
  1350.                         this._setIframeCSSPosition("absolute");
  1351.                         this.iframePositionStateChanged = true
  1352.                     }
  1353.                 } else {
  1354.                     if ((this.iframePositionStateChanged) && (c == "absolute")) {
  1355.                         this._setIframeCSSPosition("fixed");
  1356.                         this.iframePositionStateChanged = false
  1357.                     }
  1358.                 }
  1359.             }
  1360.             return this._handleZoomThreshold()
  1361.         };
  1362.         this._setIframeCSSPosition = function(c) {
  1363.             if (window[fnNameSpace].dragdropManager) {
  1364.                 window[fnNameSpace].dragdropManager.setDragStyle("position", c)
  1365.             }
  1366.             window[fnNameSpace].util.setStyleWithImportant(this.dom, "position", c, true);
  1367.             this.config.Position = c;
  1368.             this.move(this.config)
  1369.         };
  1370.         this.calcAbsolutePosition = function(j) {
  1371.             if (this.getStylePosition() !== "absolute") {
  1372.                 return {
  1373.                     top: j.Top,
  1374.                     left: j.Left,
  1375.                     bottom: j.Bottom,
  1376.                     right: j.Right
  1377.                 }
  1378.             }
  1379.             var x = manager.currentToolbar;
  1380.             var s = this.dom.style.display;
  1381.             var u = this.dom.style.visibility;
  1382.             if (s === "none") {
  1383.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, "visibility", "hidden", true);
  1384.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, "display", "block", true)
  1385.             }
  1386.             var n;
  1387.             var c;
  1388.             var m = window[fnNameSpace].displayUtils;
  1389.             var t = m.getVisualViewportInfo();
  1390.             var z = t.width;
  1391.             var f = t.height;
  1392.             if (j.Top && (j.Top === "0px" || j.Top === "0%")) {
  1393.                 c = 0
  1394.             } else {
  1395.                 if (j.Bottom && (j.Bottom === "0px" || j.Bottom === "0%")) {
  1396.                     c = (f - x.dom.offsetHeight) / f
  1397.                 }
  1398.             }
  1399.             if (j.Left && (j.Left === "0px" || j.Left === "0%")) {
  1400.                 n = 0
  1401.             } else {
  1402.                 if (j.Right && (j.Right === "0px" || j.Right === "0%")) {
  1403.                     n = (z - x.dom.offsetWidth) / z
  1404.                 } else {
  1405.                     if ((j.Right && j.Right === "50%") || (j.Left && j.Left === "50%") || ((j.Position && j.Position === "relative") && (j.Margin && j.Margin === "auto"))) {
  1406.                         n = ((z - x.dom.offsetWidth) / z) / 2
  1407.                     }
  1408.                 }
  1409.             }
  1410.             var q = m.getBodyZoomLevel();
  1411.             var l = window.pageYOffset / q;
  1412.             var y = window.pageXOffset / q;
  1413.             var r = 0;
  1414.             var o = m.getComputedStyle(document.body, "position");
  1415.             var g = m.getComputedStyle(document.body, "top");
  1416.             if ((o && o !== "static" && o !== "relative") && (g && !isNaN(g))) {
  1417.                 try {
  1418.                     r = parseFloat(g)
  1419.                 } catch (w) {
  1420.                     r = 0
  1421.                 }
  1422.             }
  1423.             var v = 1;
  1424.             var k = 1;
  1425.             if (window[fnNameSpace].dragdropManager) {
  1426.                 v = window[fnNameSpace].dragdropManager.getScreenPosRatio().vertical;
  1427.                 k = window[fnNameSpace].dragdropManager.getScreenPosRatio().horizontal
  1428.             }
  1429.             var p = Math.max(l - r + ((f) * v * c), 0);
  1430.             var h = Math.max(y + ((z) * k * n), 0);
  1431.             window[fnNameSpace].util.setStyleWithImportant(this.dom, "display", s, true);
  1432.             window[fnNameSpace].util.setStyleWithImportant(this.dom, "visibility", u, true);
  1433.             var d = parseFloat(window[fnNameSpace].displayUtils.getComputedStyle(document.body, "right"));
  1434.             d = isNaN(d) ? 0 : d;
  1435.             p = parseInt(p) + "px";
  1436.             h = parseInt(h) + d + "px";
  1437.             return {
  1438.                 top: p,
  1439.                 left: h,
  1440.                 bottom: "",
  1441.                 right: ""
  1442.             }
  1443.         };
  1444.         this._handleZoomThreshold = function() {
  1445.             var d = window[fnNameSpace].displayUtils.isPortrait() ? this.config.hideZoomThreshold.portrait : this.config.hideZoomThreshold.landscape;
  1446.             if ((typeof d === "undefined") || (d === 0)) {
  1447.                 return false
  1448.             }
  1449.             var c = window[fnNameSpace].displayUtils.getIframeZoomLevel();
  1450.             if (c < d) {
  1451.                 window[fnNameSpace].domHelper.hideiFrameWithOpacity(0.3);
  1452.                 return true
  1453.             } else {
  1454.                 window[fnNameSpace].domHelper.showiFrameWithOpacity(0.6);
  1455.                 return false
  1456.             }
  1457.         };
  1458.         this.init()
  1459.     };
  1460.     if (window[fnNameSpace].Toolbar) {
  1461.         window[fnNameSpace].Toolbar.prototype.initialToolbarIframeSpecificDevice = function(g, d) {
  1462.             var b = window[fnNameSpace].displayUtils.getComputedStyle(document.body, "position");
  1463.             var f = window[fnNameSpace].displayUtils.getVisualViewportInfo().height;
  1464.             var c = window[fnNameSpace].displayUtils.isPortrait();
  1465.             var a = false;
  1466.             var e = {
  1467.                 portrait: {
  1468.                     iPhone4: 416,
  1469.                     iPhone5: 504
  1470.                 },
  1471.                 landscape: {
  1472.                     iPhone4: 268,
  1473.                     iPhone5: 268
  1474.                 }
  1475.             };
  1476.             if (b === "absolute" && window[fnNameSpace].util.Browser.isIOS6) {
  1477.                 if (c === true) {
  1478.                     if ((window[fnNameSpace].util.Browser.isiPhone4 && f >= e.portrait.iPhone4) || (window[fnNameSpace].util.Browser.isiPhone5 && f >= e.portrait.iPhone5)) {
  1479.                         a = true
  1480.                     }
  1481.                 } else {
  1482.                     if ((window[fnNameSpace].util.Browser.isiPhone4 && f >= e.landscape.iPhone4) || (window[fnNameSpace].util.Browser.isiPhone5 && f >= e.landscape.iPhone5)) {
  1483.                         a = true
  1484.                     }
  1485.                 }
  1486.             }
  1487.             if (a === true) {
  1488.                 this._setIframeCSSPosition("absolute")
  1489.             }
  1490.         }
  1491.     }
  1492.     window[fnNameSpace].StageLogicManager = function(b) {
  1493.         this.parentTB = b;
  1494.         var k = null;
  1495.         var h = null;
  1496.         var j = null;
  1497.         var l = function(m) {
  1498.             j = m
  1499.         };
  1500.         var f = function() {
  1501.             if (j === null) {
  1502.                 var m = window[fnNameSpace].displayUtils.getIFrameDesignDimensions();
  1503.                 l(parseFloat(m.width) / parseFloat(m.height))
  1504.             }
  1505.             return j
  1506.         };
  1507.         var g = function(n, m) {
  1508.             if ((typeof n == "undefined") && (typeof m == "undefined")) {
  1509.                 return
  1510.             }
  1511.             k = n;
  1512.             h = m
  1513.         };
  1514.         var e = function() {
  1515.             if (!d(k) || !d(h)) {
  1516.                 return undefined
  1517.             } else {
  1518.                 return {
  1519.                     width: k,
  1520.                     height: h
  1521.                 }
  1522.             }
  1523.         };
  1524.         var d = function(m) {
  1525.             return window[fnNameSpace].util.validateWidthHeight(m)
  1526.         };
  1527.         var c = function(m, t, v) {
  1528.             v = v || 1;
  1529.             var x = {};
  1530.             if (!d(m) || !d(t)) {
  1531.                 return undefined
  1532.             }
  1533.             var q = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  1534.             var n = q.width;
  1535.             var r = q.height;
  1536.             var s, o;
  1537.             var p = window[fnNameSpace].util.isNumberPercentageBased(m);
  1538.             var u = window[fnNameSpace].util.isNumberPercentageBased(t);
  1539.             if (p && u) {
  1540.                 s = n * parseFloat(m) / 100;
  1541.                 o = r * parseFloat(t) / 100
  1542.             } else {
  1543.                 if (p) {
  1544.                     s = n * parseFloat(m) / 100;
  1545.                     o = (parseFloat(s) * (1 / f()))
  1546.                 } else {
  1547.                     if (u) {
  1548.                         o = r * parseFloat(t) / 100;
  1549.                         s = (parseFloat(o) * f())
  1550.                     } else {
  1551.                         if (window[fnNameSpace].util.isNumberPixelBased(m) && window[fnNameSpace].util.isNumberPixelBased(t)) {
  1552.                             s = (parseFloat(m) * v);
  1553.                             o = (parseFloat(t) * v)
  1554.                         }
  1555.                     }
  1556.                 }
  1557.             }
  1558.             x.width = Math.ceil(s) + "px";
  1559.             x.height = Math.ceil(o) + "px";
  1560.             return x
  1561.         };
  1562.         if (!this.changeParentTBSize) {
  1563.             this.changeParentTBSize = function(n, m) {
  1564.                 window[fnNameSpace].util.setStyleWithImportant(this.parentTB.dom, "width", n, true);
  1565.                 window[fnNameSpace].util.setStyleWithImportant(this.parentTB.dom, "height", m, true)
  1566.             }
  1567.         }
  1568.         var a = function(q, o, p, s) {
  1569.             manager.updateAllFramesWithWindowSize();
  1570.             if (s) {
  1571.                 l(s)
  1572.             }
  1573.             var r = window[fnNameSpace].displayUtils.getIframeZoomLevel() / 100;
  1574.             var n = c(q, o, r);
  1575.             if (!n) {
  1576.                 var m = e();
  1577.                 if (!m) {
  1578.                     m = window[fnNameSpace].displayUtils.getIFrameDesignDimensions()
  1579.                 }
  1580.                 n = c(m.width, m.height, r)
  1581.             }
  1582.             if (n && n.width && n.height) {
  1583.                 this.changeParentTBSize(n.width, n.height);
  1584.                 g(q, o);
  1585.                 b.updateStageSize(n.width, n.height)
  1586.             }
  1587.         };
  1588.         this.resize = function(p, m, n, o) {
  1589.             a.call(this, p, m, n, o);
  1590.             b.move();
  1591.             if (window[fnNameSpace].dragdropManager != null) {
  1592.                 window[fnNameSpace].dragdropManager.resize()
  1593.             }
  1594.             if (window[fnNameSpace].OverlayTextBox != null) {
  1595.                 window[fnNameSpace].OverlayTextBox.resizeOverlayTextBox()
  1596.             }
  1597.         }
  1598.     };
  1599.     window[fnNameSpace].DOMHelper = function() {
  1600.         this.maxZIndexOnPage = 0;
  1601.         this.showiFrameTimeOut = 0;
  1602.         this.checkElementOnPageById = function(a) {
  1603.             if (!document.getElementById(a)) {
  1604.                 return false
  1605.             }
  1606.             return true
  1607.         };
  1608.         this.checkElementOnPageByTag = function(a) {
  1609.             if (!document.getElementsByTagName(a)[0]) {
  1610.                 return false
  1611.             }
  1612.             return true
  1613.         };
  1614.         this.checkElementOnPageByTagName = function(a) {
  1615.             return this.checkElementOnPageByTag(a)
  1616.         };
  1617.         this.getElementsByTagName = function(a) {
  1618.             if (!this.checkElementOnPageByTag(a)) {
  1619.                 return false
  1620.             }
  1621.             return document.getElementsByTagName(a)
  1622.         };
  1623.         this.getElement = function(a) {
  1624.             if (!this.checkElementOnPageById(a)) {
  1625.                 return false
  1626.             }
  1627.             return document.getElementById(a)
  1628.         };
  1629.         this.removeElement = function(a) {
  1630.             a.parentNode.removeChild(a)
  1631.         };
  1632.         this.removeElementById = function(b) {
  1633.             var a = this.getElement(b);
  1634.             if (a) {
  1635.                 this.removeElement(a)
  1636.             }
  1637.         };
  1638.         this.hideElement = function(a) {
  1639.             if (this.isElementVisible(a)) {
  1640.                 window[fnNameSpace].util.setStyleWithImportant(a, "display", "none", true)
  1641.             }
  1642.         };
  1643.         this.showElement = function(a) {
  1644.             if (!this.isElementVisible(a)) {
  1645.                 window[fnNameSpace].util.setStyleWithImportant(a, "display", "block", true)
  1646.             }
  1647.         };
  1648.         this.hideiFrameWithOpacity = function(a) {
  1649.             window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, "-webkit-transition", "opacity " + a + "s ease", true);
  1650.             window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, "opacity", "0", true);
  1651.             window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, "pointer-events", "none", true)
  1652.         };
  1653.         this.showiFrameWithOpacity = function(c, b) {
  1654.             c = typeof c !== "undefined" ? c : 0;
  1655.             if (manager.currentToolbar.initialOpacityReset === true) {
  1656.                 return
  1657.             }
  1658.             if (this.showiFrameTimeOut && this.showiFrameTimeOut > 1) {
  1659.                 window.clearTimeout(this.showiFrameTimeOut)
  1660.             }
  1661.             var a = (b === true) ? 0 : 700;
  1662.             this.showiFrameTimeOut = window.setTimeout(function() {
  1663.                 window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, "-webkit-transition", "opacity " + c + "s ease", true);
  1664.                 window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, "opacity", manager.currentToolbar.lastOpacity, true);
  1665.                 window[fnNameSpace].util.setStyleWithImportant(manager.currentToolbar.dom, "pointer-events", "all", true)
  1666.             }, a)
  1667.         };
  1668.         this.isElementVisible = function(a) {
  1669.             return (a.style.display !== "none")
  1670.         };
  1671.         this.getMaxZIndex = function(e) {
  1672.             var a = this.getElementsByTagName("*");
  1673.             var d = 0;
  1674.             for (var c = 0, f = a.length; c < f; c++) {
  1675.                 var b = Number(a[c].style.zIndex);
  1676.                 var g = Number(window[fnNameSpace].displayUtils.getComputedStyle(a[c], "zIndex"));
  1677.                 if (g > b) {
  1678.                     b = g
  1679.                 }
  1680.                 if (b > d) {
  1681.                     d = b
  1682.                 }
  1683.             }
  1684.             this.maxZIndexOnPage = d;
  1685.             return d
  1686.         };
  1687.         this.appendChildToHead = function(b) {
  1688.             var a = document.getElementsByTagName("head")[0];
  1689.             if (a == "undefined") {
  1690.                 return false
  1691.             }
  1692.             a.appendChild(b);
  1693.             return true
  1694.         }
  1695.     };
  1696.     window[fnNameSpace].domHelper = new window[fnNameSpace].DOMHelper();
  1697.     window[fnNameSpace].Util = function() {
  1698.         this.useSerialization = true;
  1699.         this.TOOLBAR_DATA_TAG = "TBData";
  1700.         this.TOOLBAR_DATA_ITEM_TAG = "TBDataItem";
  1701.         this.TOOLBAR_DATA_ATTRIBUTE = "toolbardata";
  1702.         this.NAME_ATTRIBUTE = "name";
  1703.         this.VALUE_ATTRIBUTE = "value";
  1704.         this.FN_TOOLBAR_SCRIPT = "fn_toolbar_script";
  1705.         this.addEvent = function(event, func, capture, element) {
  1706.             if ((typeof event === "undefined") || (typeof func === "undefined")) {
  1707.                 return
  1708.             }
  1709.             if (typeof capture === "undefined") {
  1710.                 capture = false
  1711.             }
  1712.             if (typeof element === "undefined") {
  1713.                 element = document
  1714.             }
  1715.             if (element.addEventListener) {
  1716.                 element.addEventListener(event, func, capture)
  1717.             } else {
  1718.                 if (element.attachEvent) {
  1719.                     element.attachEvent("on" + event, func)
  1720.                 } else {
  1721.                     element[event] = func
  1722.                 }
  1723.             }
  1724.         };
  1725.         this.setStyleWithImportant = function(element, prop, value, important) {
  1726.             if (element.style.setProperty) {
  1727.                 element.style.setProperty(prop, value, important ? "important" : "")
  1728.             } else {
  1729.                 element.style[prop] = value
  1730.             }
  1731.         };
  1732.         this.removeEvent = function(event, func, capture, element) {
  1733.             if ((typeof event === "undefined") || (typeof func === "undefined")) {
  1734.                 return
  1735.             }
  1736.             if (typeof capture === "undefined") {
  1737.                 capture = false
  1738.             }
  1739.             if (typeof element === "undefined") {
  1740.                 element = document
  1741.             }
  1742.             if (element.removeEventListener) {
  1743.                 element.removeEventListener(event, func, capture)
  1744.             } else {
  1745.                 if (element.detachEvent) {
  1746.                     element.detachEvent("on" + event, func)
  1747.                 } else {
  1748.                     element[event] = null
  1749.                 }
  1750.             }
  1751.         };
  1752.         this.LOG_TO_CONSOLE_MAP = {
  1753.             debug: "debug",
  1754.             info: "info",
  1755.             warn: "warn",
  1756.             error: "error"
  1757.         };
  1758.         this.console = function(msg, level) {
  1759.             var consoleLevel = this.LOG_TO_CONSOLE_MAP[level];
  1760.             if ((typeof console !== "undefined") && (typeof console[consoleLevel] === "function")) {
  1761.                 console[consoleLevel](msg)
  1762.             } else {
  1763.                 if ((typeof console !== "undefined") && (typeof console.log === "function") && (typeof consoleLevel !== "undefined")) {
  1764.                     console.log("[" + consoleLevel + "]\t" + msg)
  1765.                 }
  1766.             }
  1767.         };
  1768.         this.serialize = function(obj) {
  1769.             var t = typeof(obj);
  1770.             if (t != "object" || obj === null) {
  1771.                 if (t == "string") {
  1772.                     obj = '"' + obj + '"'
  1773.                 }
  1774.                 return String(obj)
  1775.             } else {
  1776.                 var n, v, json = [],
  1777.                     arr = (obj && obj.constructor == Array);
  1778.                 for (n in obj) {
  1779.                     if (obj.hasOwnProperty(n)) {
  1780.                         v = obj[n];
  1781.                         t = typeof(v);
  1782.                         if (t == "string") {
  1783.                             v = '"' + v + '"'
  1784.                         } else {
  1785.                             if (t == "object" && v !== null) {
  1786.                                 v = JSON.stringify(v)
  1787.                             }
  1788.                         }
  1789.                         json.push((arr ? "" : '"' + n + '":') + String(v))
  1790.                     }
  1791.                 }
  1792.                 return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}")
  1793.             }
  1794.         };
  1795.         this.deserialize = function(jsonString) {
  1796.             try {
  1797.                 if (jsonString === "") {
  1798.                     jsonString = '""'
  1799.                 }
  1800.                 eval("var object=" + jsonString + ";");
  1801.                 return object
  1802.             } catch (ex) {
  1803.                 this.console("Deserialize error! on string: " + jsonString, "info");
  1804.                 return
  1805.             }
  1806.         };
  1807.         this.registerLoadFunction = function(func) {
  1808.             if (window.addEventListener) {
  1809.                 window.addEventListener("load", func, false)
  1810.             } else {
  1811.                 if (window.attachEvent) {
  1812.                     window.attachEvent("onload", func)
  1813.                 } else {
  1814.                     var tmp1 = window.onload;
  1815.                     if (tmp1) {
  1816.                         window.onload = function() {
  1817.                             func();
  1818.                             tmp1()
  1819.                         }
  1820.                     } else {
  1821.                         window.onload = func
  1822.                     }
  1823.                 }
  1824.             }
  1825.         };
  1826.         this.fetchGetVariableValue = function(variable) {
  1827.             var query = window.location.search.substring(1);
  1828.             var vars = query.split("&");
  1829.             for (var i = 0; i < vars.length; i++) {
  1830.                 var pair = vars[i].split("=");
  1831.                 if (pair[0] == variable) {
  1832.                     return pair[1]
  1833.                 }
  1834.             }
  1835.             return false
  1836.         };
  1837.         this.xmlToObject = function(string, rootTag, item, keyTag, valueTag) {
  1838.             var parser;
  1839.             var response;
  1840.             try {
  1841.                 parser = new DOMParser();
  1842.                 response = parser.parseFromString(string, "text/xml");
  1843.                 response = this.parseDataXML(response, rootTag, item, keyTag, valueTag);
  1844.                 return response
  1845.             } catch (e) {}
  1846.         };
  1847.         this.parseDataXML = function(xml, rootTag, item, keyTag, valueTag) {
  1848.             var returnObj = new Object();
  1849.             var elem;
  1850.             var valuesArray;
  1851.             if (xml && xml.firstChild) {
  1852.                 elem = xml.firstChild;
  1853.                 if (xml.firstChild.target == "xml") {
  1854.                     elem = xml.firstChild.nextSibling
  1855.                 }
  1856.                 if (elem.tagName == rootTag) {
  1857.                     if (elem.children) {
  1858.                         valuesArray = elem.children
  1859.                     } else {
  1860.                         valuesArray = elem.childNodes
  1861.                     }
  1862.                 }
  1863.             }
  1864.             if (valuesArray) {
  1865.                 window[fnNameSpace].util.console("---------------------------    parsing " + rootTag + " data xml. valuesArray=" + valuesArray.length, "data")
  1866.             } else {
  1867.                 window[fnNameSpace].util.console(" ---------------------------    parsing " + rootTag + " data xml. valuesArray=" + valuesArray, "data")
  1868.             }
  1869.             if (valuesArray) {
  1870.                 for (var i = 0; i < valuesArray.length; i++) {
  1871.                     if (valuesArray[i].tagName != item) {
  1872.                         continue
  1873.                     }
  1874.                     var key = valuesArray[i].getAttribute(keyTag);
  1875.                     var value = valuesArray[i].getAttribute(valueTag);
  1876.                     returnObj[key] = unescape(value)
  1877.                 }
  1878.             }
  1879.             return returnObj
  1880.         };
  1881.         this.getCookieData = function(cookieName) {
  1882.             var cookiePrefix = cookieName + "=";
  1883.             var cookies = document.cookie.split(";");
  1884.             for (var i = 0; i < cookies.length; i++) {
  1885.                 var c = cookies[i];
  1886.                 while (c.charAt(0) == " ") {
  1887.                     c = c.substring(1, c.length)
  1888.                 }
  1889.                 var indx = c.indexOf(cookiePrefix);
  1890.                 if (indx >= 0) {
  1891.                     return c.substring(indx + cookiePrefix.length, c.length)
  1892.                 }
  1893.             }
  1894.             return null
  1895.         };
  1896.         this.initXMLHttpClient = function() {
  1897.             var xmlhttp;
  1898.             try {
  1899.                 xmlhttp = new XMLHttpRequest()
  1900.             } catch (e) {
  1901.                 var XMLHTTP_IDS = new Array("MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP");
  1902.                 var success = false;
  1903.                 for (var i = 0; i < XMLHTTP_IDS.length && !success; i++) {
  1904.                     try {
  1905.                         xmlhttp = new ActiveXObject(XMLHTTP_IDS[i]);
  1906.                         success = true
  1907.                     } catch (e) {}
  1908.                 }
  1909.                 if (!success) {
  1910.                     throw new Error("Unable to create XMLHttpRequest.")
  1911.                 }
  1912.             }
  1913.             return xmlhttp
  1914.         };
  1915.         this.trim = function(string) {
  1916.             return string.replace(/^\s*/, "").replace(/\s*$/, "")
  1917.         };
  1918.         this.thread = function(method) {
  1919.             setTimeout(method, 1)
  1920.         };
  1921.         this.isInteger = function(input) {
  1922.             var pos = input.indexOf("px");
  1923.             if (pos != -1) {
  1924.                 input = input.substr(0, pos - 1)
  1925.             }
  1926.             return (input.toString().search(/^-?[0-9]+$/) == 0)
  1927.         };
  1928.         this.loadScript = function(src, callback) {
  1929.             var head = document.getElementsByTagName("head")[0];
  1930.             var script = document.createElement("script");
  1931.             script.type = "text/javascript";
  1932.             var base = location.href.split("/");
  1933.             base.splice(-1, 1);
  1934.             base = base.join("/");
  1935.             var scriptPath = base + src;
  1936.             script.src = scriptPath;
  1937.             script.onreadystatechange = function() {
  1938.                 if (this.readyState == "complete") {
  1939.                     callback()
  1940.                 }
  1941.             };
  1942.             script.onload = callback;
  1943.             head.appendChild(script)
  1944.         };
  1945.         this.clone = function(obj) {
  1946.             if (obj instanceof HTMLElement) {
  1947.                 return obj.cloneNode()
  1948.             }
  1949.             var target = {};
  1950.             for (var i in obj) {
  1951.                 if (obj.hasOwnProperty(i)) {
  1952.                     if (typeof obj[i] == "object") {
  1953.                         target[i] = this.clone(obj[i])
  1954.                     } else {
  1955.                         target[i] = obj[i]
  1956.                     }
  1957.                 }
  1958.             }
  1959.             return target
  1960.         };
  1961.         this.validateWidthHeight = function(widthOrHeight) {
  1962.             if (!isNaN(parseInt(widthOrHeight)) || (widthOrHeight === "auto")) {
  1963.                 return true
  1964.             } else {
  1965.                 return false
  1966.             }
  1967.         };
  1968.         this.isNumberPixelBased = function(number) {
  1969.             if (typeof number === "undefined") {
  1970.                 return false
  1971.             }
  1972.             if (!isNaN(parseInt(number)) && (number.length >= 2) && number.substring(number.length - 2) === "px") {
  1973.                 return true
  1974.             } else {
  1975.                 return false
  1976.             }
  1977.         };
  1978.         this.isNumberPercentageBased = function(number) {
  1979.             if (typeof number === "undefined") {
  1980.                 return false
  1981.             }
  1982.             if (!isNaN(parseInt(number)) && (number.length >= 1) && number.substring(number.length - 1) === "%") {
  1983.                 return true
  1984.             } else {
  1985.                 return false
  1986.             }
  1987.         };
  1988.         this.Browser = (function() {
  1989.             var userAgent = navigator.userAgent.toLowerCase();
  1990.             var docMode = document.documentMode;
  1991.             var isOpera = check(/opera/);
  1992.             var isChrome = check(/\bchrome\b/);
  1993.             var isWebKit = check(/webkit/);
  1994.             var isSafari = !isChrome && check(/safari/);
  1995.             var isIE = !isOpera && check(/msie/);
  1996.             var isIE7 = isIE && (check(/msie 7/) || docMode === 7);
  1997.             var isIE8 = isIE && (check(/msie 8/) && docMode != 7);
  1998.             var isIE9 = isIE && check(/msie 9/);
  1999.             var isIE10 = isIE && check(/msie 10/);
  2000.             var isFirefox = !isWebKit && check(/gecko/);
  2001.             var isFirefox3 = isFirefox && check(/rv:1\.9/);
  2002.             var isIOS = check(/iphone|ipad|ipod/);
  2003.             var isIOS5 = isIOS && check(/iphone os 5_/);
  2004.             var isIOS6 = isIOS && check(/iphone os 6_/);
  2005.             var isIOS7 = isIOS && check(/iphone os 7_/);
  2006.             var isIOS8 = isIOS && check(/iphone os 8_/);
  2007.             var isiPhone4 = isIOS && (window.screen.height == (960 / 2));
  2008.             var isiPhone5 = isIOS && (window.screen.height == (1136 / 2));
  2009.             var isWindows = check(/windows/);
  2010.             var isWindows7 = isWindows && check(/windows nt 6.1/);
  2011.             var isWindows8 = isWindows && check(/windows nt 6.2/);
  2012.             var isAndroid = check(/android/);
  2013.             var isAndroid23 = isAndroid && check(/android 2\.3/);
  2014.             var isAndroid40 = isAndroid && check(/android 4\.0/);
  2015.             var isAndroid41 = isAndroid && check(/android 4\.1/);
  2016.             var isMobile = isAndroid || isIOS;
  2017.             var isChromeOniPhone = isIOS && check(/\bcrios\b/);
  2018.             var isAndroidTablet = isAndroid && !(check(/mobile/));
  2019.             var isIpad = check(/ipad/);
  2020.  
  2021.             function check(re) {
  2022.                 return re.test(userAgent)
  2023.             }
  2024.             return {
  2025.                 isOpera: isOpera,
  2026.                 isChrome: isChrome,
  2027.                 isWebKit: isWebKit,
  2028.                 isSafari: isSafari,
  2029.                 isIE: isIE,
  2030.                 isIE7: isIE7,
  2031.                 isIE8: isIE8,
  2032.                 isIE9: isIE9,
  2033.                 isIE10: isIE10,
  2034.                 isFirefox: isFirefox,
  2035.                 isFirefox3: isFirefox3,
  2036.                 isIOS: isIOS,
  2037.                 isIOS5: isIOS5,
  2038.                 isIOS6: isIOS6,
  2039.                 isIOS7: isIOS7,
  2040.                 isIOS8: isIOS8,
  2041.                 isiPhone4: isiPhone4,
  2042.                 isiPhone5: isiPhone5,
  2043.                 isWindows: isWindows,
  2044.                 isWindows7: isWindows7,
  2045.                 isWindows8: isWindows8,
  2046.                 isAndroid: isAndroid,
  2047.                 isAndroid23: isAndroid23,
  2048.                 isAndroid40: isAndroid40,
  2049.                 isAndroid41: isAndroid41,
  2050.                 isMobile: isMobile,
  2051.                 isChromeOniPhone: isChromeOniPhone,
  2052.                 isAndroidTablet: isAndroidTablet,
  2053.                 isIpad: isIpad
  2054.             }
  2055.         })()
  2056.     };
  2057.     window[fnNameSpace].util = new window[fnNameSpace].Util();
  2058.     window[fnNameSpace].DisplayUtils = function() {
  2059.         var d = function() {
  2060.             if (typeof window.orientation === "undefined") {
  2061.                 return false
  2062.             } else {
  2063.                 return (window.orientation === 0) ? true : false
  2064.             }
  2065.         };
  2066.         var a = function(l, m) {
  2067.             var k = window.getComputedStyle(l, null) || {};
  2068.             return k[m] || l.style[m]
  2069.         };
  2070.         var c = function() {
  2071.             var k = window.getComputedStyle(document.body);
  2072.             var l = 1;
  2073.             if (k && k.zoom) {
  2074.                 l = k.zoom;
  2075.                 if (window[fnNameSpace].util.isNumberPercentageBased(l)) {
  2076.                     l = parseFloat(l) / 100
  2077.                 } else {
  2078.                     if (!isNaN(parseFloat(l))) {
  2079.                         l = parseFloat(l)
  2080.                     }
  2081.                 }
  2082.             }
  2083.             return l
  2084.         };
  2085.         var g = function() {
  2086.             var k = c();
  2087.             return {
  2088.                 width: b("Width") / k,
  2089.                 height: b("Height") / k
  2090.             }
  2091.         };
  2092.         var j = function() {
  2093.             return {
  2094.                 width: (this.isPortrait()) ? screen.width : ((!window[fnNameSpace].util.Browser.isIOS) ? screen.width : screen.height),
  2095.                 height: (this.isPortrait()) ? screen.height : ((!window[fnNameSpace].util.Browser.isIOS) ? screen.height : screen.width)
  2096.             }
  2097.         };
  2098.         var e = function() {
  2099.             var k = {};
  2100.             if (window[fnNameSpace].util.Browser.isAndroid) {
  2101.                 var l = h();
  2102.                 var m = "portrait";
  2103.                 if (!d()) {
  2104.                     m = "landscape"
  2105.                 }
  2106.                 k.width = l[m].width + "px";
  2107.                 k.height = l[m].height + "px"
  2108.             } else {
  2109.                 k.width = window[fnNameSpace].displayUtils.calcScreenSize().width;
  2110.                 k.height = window[fnNameSpace].displayUtils.calcScreenSize().height
  2111.             }
  2112.             return k
  2113.         };
  2114.         var h = function() {
  2115.             var k = manager.currentToolbar.config;
  2116.             if (!k) {
  2117.                 throw "Util.getDeviceDetails() - configuration not set"
  2118.             }
  2119.             var m = {};
  2120.             m.portrait = {};
  2121.             m.landscape = {};
  2122.             m.portrait.width = k.PortraitSize.Width;
  2123.             m.portrait.height = k.PortraitSize.Height;
  2124.             if (window[fnNameSpace].util.Browser.isIOS) {
  2125.                 var l = 568;
  2126.                 var n = 480;
  2127.                 if (window.screen.height === l) {
  2128.                     m.landscape.width = (l / n) * k.LandscapeSize.Width
  2129.                 } else {
  2130.                     m.landscape.width = k.LandscapeSize.Width
  2131.                 }
  2132.             } else {
  2133.                 m.landscape.width = k.LandscapeSize.Width
  2134.             }
  2135.             m.landscape.height = k.LandscapeSize.Height;
  2136.             return m
  2137.         };
  2138.         var f = function() {
  2139.             var n;
  2140.             try {
  2141.                 var m = g();
  2142.                 var k = e();
  2143.                 n = ((m.width / parseInt(k.width)) * 100)
  2144.             } catch (l) {
  2145.                 n = 100
  2146.             }
  2147.             return n
  2148.         };
  2149.         var b = function(n) {
  2150.             if (window[fnNameSpace].util.Browser.isAndroid23) {
  2151.                 return window["inner" + n]
  2152.             } else {
  2153.                 if (window[fnNameSpace].util.Browser.isIOS) {
  2154.                     return window["inner" + n]
  2155.                 } else {
  2156.                     if (window[fnNameSpace].util.Browser.isAndroid) {
  2157.                         var m;
  2158.                         m = window["inner" + n] !== 0 && window["inner" + n];
  2159.                         m = m || document.documentElement && document.documentElement["client" + n] !== 0 && document.documentElement["client" + n];
  2160.                         m = m || document.body["client" + n];
  2161.                         return m
  2162.                     } else {
  2163.                         var l = document.documentElement && document.documentElement["client" + n] !== 0 && document.documentElement["client" + n];
  2164.                         if (window[fnNameSpace].util.Browser.isIE) {
  2165.                             return l || document.documentElement["offset" + n]
  2166.                         }
  2167.                         var m;
  2168.                         var k = document.documentElement && document.documentElement["scroll" + n] !== 0 && document.documentElement["scroll" + n];
  2169.                         if ((k && l) && (k === l)) {
  2170.                             if (window[fnNameSpace].util.Browser.isFirefox) {
  2171.                                 m = window["inner" + n] !== 0 && window["inner" + n]
  2172.                             } else {
  2173.                                 m = document.body["client" + n]
  2174.                             }
  2175.                         }
  2176.                         m = m || l;
  2177.                         m = m || window["inner" + n] !== 0 && window["inner" + n];
  2178.                         m = m || document.body["client" + n];
  2179.                         return m
  2180.                     }
  2181.                 }
  2182.             }
  2183.         };
  2184.         return {
  2185.             isPortrait: d,
  2186.             getComputedStyle: a,
  2187.             getBodyZoomLevel: c,
  2188.             getVisualViewportInfo: g,
  2189.             getIFrameDesignDimensions: e,
  2190.             getIframeZoomLevel: f,
  2191.             calcScreenSize: j
  2192.         }
  2193.     };
  2194.     window[fnNameSpace].displayUtils = new window[fnNameSpace].DisplayUtils();
  2195.     window[fnNameSpace].Message = function() {
  2196.         this.assignedObject;
  2197.         this.assignTo = function(c) {
  2198.             this.assignedObject = c;
  2199.             var b = this;
  2200.             window[fnNameSpace].util.addEvent("message", function(d) {
  2201.                 b.handleMessage.call(b, d)
  2202.             }, false, window);
  2203.             window[fnNameSpace].util.console("Message handler assigned")
  2204.         };
  2205.         this.send = function(c, b) {
  2206.             if (!b) {
  2207.                 return false
  2208.             }
  2209.             if ((typeof(window[fnNameSpace].Manager) != "undefined") && ((b.tagName == "IFRAME" || b.tagName == "iframe"))) {
  2210.                 b = b.contentWindow
  2211.             } else {
  2212.                 if (b != parent) {
  2213.                     return false
  2214.                 }
  2215.             }
  2216.             c.messageKey = fnMessageKey;
  2217.             if (window[fnNameSpace].util.useSerialization) {
  2218.                 c = window[fnNameSpace].util.serialize(c)
  2219.             }
  2220.             b.postMessage(c, "*");
  2221.             return true
  2222.         };
  2223.         var a = function(b) {
  2224.             if (typeof b == "undefined") {
  2225.                 return false
  2226.             }
  2227.             if (typeof b == "object") {
  2228.                 if (typeof b.messageKey != "string") {
  2229.                     return false
  2230.                 }
  2231.                 if (b.messageKey != fnMessageKey) {
  2232.                     return false
  2233.                 }
  2234.             } else {
  2235.                 if (typeof b == "string") {
  2236.                     if (typeof b.search != "function") {
  2237.                         return false
  2238.                     }
  2239.                     if (b.search(fnMessageKey) == -1) {
  2240.                         return false
  2241.                     }
  2242.                     if (b.search("message") == -1) {
  2243.                         return false
  2244.                     }
  2245.                     if (b.search("function") != -1) {
  2246.                         return false
  2247.                     }
  2248.                 } else {
  2249.                     return false
  2250.                 }
  2251.             }
  2252.             return true
  2253.         };
  2254.         this.triggerMessageEvent = function(c) {
  2255.             var b;
  2256.             window[fnNameSpace].util.console("Sending message: " + window[fnNameSpace].util.serialize(c), "messaging");
  2257.             if (!this.assignedObject) {
  2258.                 window[fnNameSpace].util.console("Unable to send message message.message. no object assigned. ", "messaging");
  2259.                 return
  2260.             }
  2261.             b = "on" + c.message;
  2262.             var d = typeof this.assignedObject[b];
  2263.             if (d !== "function") {
  2264.                 window[fnNameSpace].util.console("called event " + b + " was not found", "messaging");
  2265.                 return
  2266.             }
  2267.             this.assignedObject[b](c)
  2268.         };
  2269.         this.handleMessage = function(c) {
  2270.             var b = c.data;
  2271.             if (!a(b)) {
  2272.                 window[fnNameSpace].util.console("Invalid message rejected! " + window[fnNameSpace].util.serialize(b), "messaging");
  2273.                 return false
  2274.             }
  2275.             if (typeof(b) !== "object") {
  2276.                 b = window[fnNameSpace].util.deserialize(b)
  2277.             }
  2278.             this.triggerMessageEvent(b)
  2279.         }
  2280.     };
  2281.     window[fnNameSpace].message = new window[fnNameSpace].Message();
  2282.     var fnMessageKey = "FNMESSAGEKEY78dh782ijhk8abn2";
  2283.     window[fnNameSpace].Message.MessageQueue = function() {
  2284.         var a = 100;
  2285.         var c = true;
  2286.         var b = [];
  2287.         this.removeOldMessages = true;
  2288.         this.add = function(d) {
  2289.             while (b.length >= a) {
  2290.                 if (this.removeOldMessages) {
  2291.                     this.shift()
  2292.                 } else {
  2293.                     return
  2294.                 }
  2295.             }
  2296.             c = false;
  2297.             b.push(d)
  2298.         };
  2299.         this.shift = function() {
  2300.             if (c) {
  2301.                 return false
  2302.             }
  2303.             var d = b.shift();
  2304.             if ((!d) || (d == null)) {
  2305.                 c = true;
  2306.                 return false
  2307.             }
  2308.             return d
  2309.         };
  2310.         this.setMaxQueuedMessages = function(d) {
  2311.             if (parseInt(d) != d) {
  2312.                 throw "Cant set new max queued messages, excepting integer. sent value: " + d
  2313.             }
  2314.             if (a === d) {
  2315.                 return
  2316.             }
  2317.             a = d;
  2318.             while (a < b.length) {
  2319.                 this.shift()
  2320.             }
  2321.         }
  2322.     };
  2323.     window[fnNameSpace].ViewPort = function(c) {
  2324.         var k;
  2325.         var g = this;
  2326.         var d = function(m) {
  2327.             m = m || {};
  2328.             k = m.metaObject;
  2329.             if (k) {
  2330.                 f(k)
  2331.             } else {
  2332.                 l(m)
  2333.             }
  2334.         };
  2335.         var e = function() {
  2336.             var m = window[fnNameSpace].ViewPort.VIEWPORT_PROPERTIES;
  2337.             for (var n in m) {
  2338.                 var o = b(n);
  2339.                 g[o] = m[n]
  2340.             }
  2341.         };
  2342.         var l = function(n) {
  2343.             var m = "";
  2344.             for (var o in n) {
  2345.                 if ((typeof n[o] != "function") && (typeof o != "undefined") && (o.length >= "content".length) && (o.substring(0, "content".length) == "content") && (typeof n[o] != "undefined")) {
  2346.                     if (m.length) {
  2347.                         m = m + ", "
  2348.                     }
  2349.                     m = m + h(o) + "=" + n[o]
  2350.                 }
  2351.             }
  2352.             g.setMetaObj(m)
  2353.         };
  2354.         var a = function() {
  2355.             var m = document.createElement("meta");
  2356.             m.name = "viewport";
  2357.             m.content = "";
  2358.             m.id = "FNViewport";
  2359.             return m
  2360.         };
  2361.         var f = function(n) {
  2362.             var m = n.content;
  2363.             var o = m.split(",");
  2364.             if (o.length == 1) {
  2365.                 o = o[0].split(";")
  2366.             }
  2367.             e();
  2368.             for (var p = 0; p < o.length; p++) {
  2369.                 j(o[p])
  2370.             }
  2371.         };
  2372.         var j = function(m) {
  2373.             m = m.toLowerCase();
  2374.             m = m.replace(/^\s+|\s+$/g, "");
  2375.             var n = m.split("=");
  2376.             var o = b(n[0]);
  2377.             if (o) {
  2378.                 g[o] = n[1]
  2379.             } else {
  2380.                 window[fnNameSpace].util.console("Could not read VP variable: " + n[0] + " value:" + n[1])
  2381.             }
  2382.         };
  2383.         var b = function(n) {
  2384.             n = window[fnNameSpace].util.trim(n);
  2385.             switch (n) {
  2386.                 case "width":
  2387.                 case "height":
  2388.                     return "content" + n.substr(0, 1).toUpperCase() + n.substr(1);
  2389.                     break;
  2390.                 case "initial-scale":
  2391.                 case "minimum-scale":
  2392.                 case "maximum-scale":
  2393.                 case "user-scalable":
  2394.                     var m = n.split("-");
  2395.                     m[0] = m[0].substr(0, 1).toUpperCase() + m[0].substr(1);
  2396.                     m[1] = m[1].substr(0, 1).toUpperCase() + m[1].substr(1);
  2397.                     return "content" + m[0] + m[1];
  2398.                     break;
  2399.                 default:
  2400.                     window[fnNameSpace].util.console("Could not read VP variable: " + n);
  2401.                     break
  2402.             }
  2403.         };
  2404.         var h = function(o) {
  2405.             var n = o.match(/[A-Z][a-z]*/g);
  2406.             var p = "";
  2407.             for (var m = 0; m < n.length; m++) {
  2408.                 if (p.length) {
  2409.                     p += "-"
  2410.                 }
  2411.                 p += n[m].substr(0, 1).toLowerCase() + n[m].substr(1)
  2412.             }
  2413.             window[fnNameSpace].util.console(o + " converted to : " + p);
  2414.             return p
  2415.         };
  2416.         this.getMetaObj = function() {
  2417.             return k
  2418.         };
  2419.         this.setMetaObj = function(m) {
  2420.             if (!k) {
  2421.                 k = a()
  2422.             }
  2423.             if (typeof m === "string") {
  2424.                 k.content = m
  2425.             } else {
  2426.                 k.content = m.content
  2427.             }
  2428.             f(k)
  2429.         };
  2430.         this.updateMetaObj = function(m) {
  2431.             l(m)
  2432.         };
  2433.         this.update = function(n) {
  2434.             var m = n.getMetaObj();
  2435.             this.setMetaObj(m)
  2436.         };
  2437.         this.clone = function() {
  2438.             var m = {
  2439.                 metaObject: this.getMetaObj().cloneNode()
  2440.             };
  2441.             var n = new window[fnNameSpace].ViewPort(m);
  2442.             return n
  2443.         };
  2444.         d(c);
  2445.         return this
  2446.     };
  2447.     window[fnNameSpace].ViewPort.isMobileAwareSite = function() {
  2448.         var c = window[fnNameSpace].ViewPort.getViewports();
  2449.         var a;
  2450.         var d;
  2451.         for (var b = 0; b < c.length; b++) {
  2452.             a = c[b];
  2453.             d = a.getMetaObj();
  2454.             if ((d.content.toLowerCase().indexOf("minimum-scale=1") != -1) || (d.content.toLowerCase().indexOf("maximum-scale=1") != -1) || (d.content.toLowerCase().indexOf("user-scalable=no") != -1) || (d.content.toLowerCase().indexOf("width=device-width") != -1)) {
  2455.                 return true
  2456.             }
  2457.         }
  2458.         return false
  2459.     };
  2460.     window[fnNameSpace].ViewPort.getViewports = function() {
  2461.         var b = new Array();
  2462.         if (!window[fnNameSpace].domHelper.checkElementOnPageByTagName("META")) {
  2463.             return b
  2464.         }
  2465.         var a = window[fnNameSpace].domHelper.getElementsByTagName("META");
  2466.         for (var c = 0; c < a.length; c++) {
  2467.             if (a[c].name.toLowerCase() == "viewport") {
  2468.                 b.push(new window[fnNameSpace].ViewPort({
  2469.                     metaObject: a[c]
  2470.                 }))
  2471.             }
  2472.         }
  2473.         if (b) {
  2474.             return b
  2475.         }
  2476.     };
  2477.     window[fnNameSpace].ViewPort.disableUserScalable = function() {
  2478.         if (window[fnNameSpace].ViewPort.isMobileAwareSite()) {
  2479.             return
  2480.         }
  2481.         window[fnNameSpace].ViewPort.originalViewPortContent = null;
  2482.         var c = document.getElementsByTagName("meta");
  2483.         var e = -1;
  2484.         while (c[++e]) {
  2485.             if (c[e].name === "viewport") {
  2486.                 var d = c[e].content;
  2487.                 if (d.search("user-scalable=no") !== -1) {
  2488.                     return
  2489.                 } else {
  2490.                     var b = d.search("user-scalable=yes");
  2491.                     if (b !== -1) {
  2492.                         d = d.replace("user-scalable=yes", "user-scalable=no")
  2493.                     } else {
  2494.                         d = "user-scalable=no, " + d
  2495.                     }
  2496.                 }
  2497.                 window[fnNameSpace].ViewPort.originalViewPortContent = c[e].content;
  2498.                 c[e].content = d;
  2499.                 return
  2500.             }
  2501.         }
  2502.         var a = document.createElement("meta");
  2503.         a.id = fnNameSpace + "_ViewPortMetaTagId";
  2504.         a.name = "viewport";
  2505.         a.content = "user-scalable=no";
  2506.         document.head.appendChild(a)
  2507.     };
  2508.     window[fnNameSpace].ViewPort.restoreUserScalable = function() {
  2509.         if (window[fnNameSpace].ViewPort.originalViewPortContent) {
  2510.             var b = document.getElementsByTagName("meta");
  2511.             var c = -1;
  2512.             while (b[++c]) {
  2513.                 if (b[c].name === "viewport") {
  2514.                     b[c].content = "user-scalable=yes";
  2515.                     b[c].content = window[fnNameSpace].ViewPort.originalViewPortContent;
  2516.                     window[fnNameSpace].ViewPort.originalViewPortContent = null;
  2517.                     return
  2518.                 }
  2519.             }
  2520.         } else {
  2521.             var a = document.getElementById(fnNameSpace + "_ViewPortMetaTagId");
  2522.             if (a !== null) {
  2523.                 a.content = "user-scalable=yes";
  2524.                 document.head.removeChild(a)
  2525.             }
  2526.         }
  2527.     };
  2528.     window[fnNameSpace].ViewPort.createDefaultViewport = function() {};
  2529.     window[fnNameSpace].ViewPort.VIEWPORT_PROPERTIES = {
  2530.         width: "",
  2531.         height: "",
  2532.         "initial-scale": "",
  2533.         "minimum-scale": "",
  2534.         "maximum-scale": "",
  2535.         "user-scalable": ""
  2536.     };
  2537.     window[fnNameSpace].StopWatchManager = function() {
  2538.         this.watches = [];
  2539.         this.startNew = function(b, f, e, d) {
  2540.             var c;
  2541.             if ((!b) || (!f)) {
  2542.                 return false
  2543.             }
  2544.             if (!e) {
  2545.                 e = ""
  2546.             }
  2547.             if (d) {
  2548.                 c = window.setTimeout(b, f)
  2549.             } else {
  2550.                 c = window.setInterval(b, f)
  2551.             }
  2552.             var a = (this.watches.length != false) ? this.watches.length : 1;
  2553.             this.watches[a] = [];
  2554.             this.watches[a].watchId = c;
  2555.             this.watches[a].tickTime = f;
  2556.             this.watches[a].comment = e;
  2557.             this.watches[a].tickOnce = d;
  2558.             this.watches[a].methodToExecute = b;
  2559.             this.watches[a].frozen = false;
  2560.             return a
  2561.         };
  2562.         this.getRealWatchId = function(a) {
  2563.             return this.watches[a].watchId
  2564.         };
  2565.         this.start = function(b) {
  2566.             if (this.watches[b].frozen == false) {
  2567.                 return
  2568.             }
  2569.             var a = this.watches[b];
  2570.             this.remove(b);
  2571.             return this.startNew(a.methodToExecute, a.tickTime, a.comment, a.tickOnce)
  2572.         };
  2573.         this.stop = function(a) {
  2574.             this.watches[a].frozen = true;
  2575.             clearInterval(this.getRealWatchId(a))
  2576.         };
  2577.         this.remove = function(a) {
  2578.             this.stop(a);
  2579.             delete this.watches[a]
  2580.         }
  2581.     };
  2582.     window[fnNameSpace].stopWatchMgr = new window[fnNameSpace].StopWatchManager();
  2583.     window[fnNameSpace].StopWatch = function() {
  2584.         this.watchId = null;
  2585.         this.isRunning = false;
  2586.         this.tickMethod = null;
  2587.         this.create = function(a, e, d, c) {
  2588.             var b = null;
  2589.             b = window[fnNameSpace].stopWatchMgr.startNew(a, e, d, c);
  2590.             if (b) {
  2591.                 this.watchId = b;
  2592.                 this.isRunning = true;
  2593.                 this.tickMethod = a;
  2594.                 return true
  2595.             }
  2596.             return false
  2597.         };
  2598.         this.tick = function() {
  2599.             this.tickMethod()
  2600.         };
  2601.         this.start = function() {
  2602.             if (this.isRunning) {
  2603.                 return
  2604.             }
  2605.             this.watchId = window[fnNameSpace].stopWatchMgr.start(this.watchId);
  2606.             this.isRunning = true
  2607.         };
  2608.         this.stop = function() {
  2609.             window[fnNameSpace].stopWatchMgr.stop(this.watchId);
  2610.             this.isRunning = false
  2611.         };
  2612.         this.remove = function() {
  2613.             window[fnNameSpace].stopWatchMgr.remove(this.watchId);
  2614.             this.isRunning = false
  2615.         }
  2616.     };
  2617.     window[fnNameSpace].FlashPlayerManager = function() {
  2618.         this.modifyFlashPlayerWmode = function() {
  2619.             if (window[fnNameSpace].util.Browser.isIE) {
  2620.                 this._changeWmodeOnYoutube()
  2621.             } else {
  2622.                 if (window[fnNameSpace].util.Browser.isFirefox || window[fnNameSpace].util.Browser.isFirefox3 || window[fnNameSpace].util.Browser.isSafari || window[fnNameSpace].util.Browser.isOpera) {
  2623.                     this._changeWmodeOn("embed");
  2624.                     this._changeObjectType("application/x-silverlight", "windowless", "true")
  2625.                 } else {
  2626.                     if (window[fnNameSpace].util.Browser.isChrome) {
  2627.                         this._changeObjectType("application/x-silverlight", "windowless", "true")
  2628.                     }
  2629.                 }
  2630.             }
  2631.         };
  2632.         this._changeWmodeOnYoutube = function() {
  2633.             try {
  2634.                 if (!document) {
  2635.                     return false
  2636.                 }
  2637.                 var b = document.getElementsByTagName("object");
  2638.                 if (!b) {
  2639.                     return false
  2640.                 }
  2641.                 if (location.host.search("youtube") < 0) {
  2642.                     return false
  2643.                 }
  2644.                 for (var h = 0; h < b.length; h++) {
  2645.                     var g = b[h];
  2646.                     var a = location.href.split("?")[0].replace(/watch/, "embed/");
  2647.                     var d = location.href.split("?")[1].split("&");
  2648.                     for (var h = 0; h < d.length; h++) {
  2649.                         if (d[h].split("v=").length > 1) {
  2650.                             a += d[h].split("v=")[1];
  2651.                             d.splice(h, 1);
  2652.                             break
  2653.                         }
  2654.                     }
  2655.                     d.push("wmode=opaque");
  2656.                     a += "?" + d.join("&");
  2657.                     var l = g.clientHeight;
  2658.                     var c = g.clientWidth;
  2659.                     var k = g.parentElement;
  2660.                     k.removeChild(k.firstChild);
  2661.                     var f = document.createElement("iframe");
  2662.                     f.setAttribute("src", a);
  2663.                     f.setAttribute("height", l);
  2664.                     f.setAttribute("width", c);
  2665.                     k.appendChild(f)
  2666.                 }
  2667.             } catch (j) {
  2668.                 return false
  2669.             }
  2670.             return true
  2671.         };
  2672.         this._changeWmodeOn = function(c) {
  2673.             try {
  2674.                 if (!document) {
  2675.                     return false
  2676.                 }
  2677.                 var b = document.getElementsByTagName(c);
  2678.                 if (!b) {
  2679.                     return false
  2680.                 }
  2681.                 for (var a = 0; a < b.length; a++) {
  2682.                     if ((b[a].getAttribute("wmode") == null) || (b[a].getAttribute("wmode").toLowerCase() == "window")) {
  2683.                         b[a].setAttribute("wmode", "opaque");
  2684.                         if (b[a].outerHTML) {
  2685.                             b[a].outerHTML = b[a].outerHTML
  2686.                         }
  2687.                     }
  2688.                 }
  2689.             } catch (d) {
  2690.                 return false
  2691.             }
  2692.             return true
  2693.         };
  2694.         this._changeObjectType = function(m, g, b) {
  2695.             try {
  2696.                 if (!document) {
  2697.                     return false
  2698.                 }
  2699.                 var n = document.getElementsByTagName("object");
  2700.                 if (!n) {
  2701.                     return false
  2702.                 }
  2703.                 for (var f = 0; f < n.length; f++) {
  2704.                     if (n[f].type.search(m) < 0) {
  2705.                         continue
  2706.                     }
  2707.                     var k = n[f].getElementsByTagName("param");
  2708.                     var d = false;
  2709.                     if (k) {
  2710.                         for (var c = 0; c < k.length; c++) {
  2711.                             var h = k[c].getAttribute("name");
  2712.                             if (h && h.toLowerCase() == g) {
  2713.                                 k[c].setAttribute("value", b);
  2714.                                 d = true;
  2715.                                 break
  2716.                             }
  2717.                         }
  2718.                         if (!d) {
  2719.                             var a = document.createElement("param");
  2720.                             a.setAttribute("name", g);
  2721.                             a.setAttribute("value", b);
  2722.                             n[f].appendChild(a)
  2723.                         }
  2724.                         n[f].outerHTML = n[f].outerHTML
  2725.                     }
  2726.                 }
  2727.             } catch (l) {
  2728.                 return false
  2729.             }
  2730.             return true
  2731.         }
  2732.     };
  2733.     window[fnNameSpace].DragDropManager = function(a) {
  2734.         this._params = a;
  2735.         this._isMoveByTouch = false;
  2736.         this._offset = {
  2737.             x: 0,
  2738.             y: 0
  2739.         };
  2740.         this._dragDivMiddle = {
  2741.             x: 0,
  2742.             y: 0
  2743.         };
  2744.         this._inSuspendMode = false;
  2745.         this._screenDimensions = {
  2746.             width: 0,
  2747.             height: 0
  2748.         };
  2749.         this._screenPosRatio = {
  2750.             horizontal: 1,
  2751.             vertical: 1
  2752.         };
  2753.         this._screenPosRatioLast = {
  2754.             horizontal: 1,
  2755.             vertical: 1
  2756.         };
  2757.         this._lastPosition = {
  2758.             horizontal: "TB_HORIZONTAL_POSITION_RIGHT",
  2759.             vertical: "TB_VERTICAL_POSITION_BOTTOM"
  2760.         };
  2761.         this._currentOrientation = manager.lastNotifiedOrientation;
  2762.         this.restInitialIframePositioning = function() {
  2763.             var c = {
  2764.                 Top: this._params.initTop,
  2765.                 Left: this._params.initLeft,
  2766.                 Bottom: this._params.initBottom,
  2767.                 Right: this._params.initRight
  2768.             };
  2769.             this._screenPosRatio = {
  2770.                 horizontal: 1,
  2771.                 vertical: 1
  2772.             };
  2773.             var b = manager.currentToolbar.calcAbsolutePosition(c);
  2774.             this.moveDragDiv(null, b)
  2775.         };
  2776.         this.enableDragState = function(b) {
  2777.             if (this._params.dragToolbarPosition === "fixed") {
  2778.                 return
  2779.             }
  2780.             if (!manager) {
  2781.                 return
  2782.             }
  2783.             var c = manager.currentToolbar.dom;
  2784.             if (c) {
  2785.                 if (b || b == null) {
  2786.                     this._screenPosRatio = this._screenPosRatioLast;
  2787.                     if ((manager) && ((manager.tbstatus.isMinimize && this._params.allowDragMinimize) || (!manager.tbstatus.isMinimize && this._params.allowDragMaximize))) {
  2788.                         manager.loadToolbarPosition()
  2789.                     }
  2790.                 } else {
  2791.                     this.showDragDiv(false);
  2792.                     this._screenPosRatioLast = this._screenPosRatio;
  2793.                     this.restInitialIframePositioning()
  2794.                 }
  2795.             }
  2796.         };
  2797.         this.handleOnClick = function(b, c) {
  2798.             if (b._isMaximized === true) {
  2799.                 manager.minimizeToolbarRequest()
  2800.             } else {
  2801.                 manager.maximizeToolbarRequest()
  2802.             }
  2803.         };
  2804.         this.registerDragSupport = function() {
  2805.             window[fnNameSpace].util.console("Toolbar registration for Drag and Drop.");
  2806.             try {
  2807.                 if (this._params.dragToolbarPosition == "fixed") {
  2808.                     this.restInitialIframePositioning();
  2809.                     return
  2810.                 }
  2811.                 var d = document.createElement("div");
  2812.                 d.setAttribute("id", "dragDiv");
  2813.                 if (!window[fnNameSpace].util.Browser.isIOS5) {
  2814.                     window[fnNameSpace].util.setStyleWithImportant(d, "-webkit-transform", "translateZ(999px)", true)
  2815.                 }
  2816.                 window[fnNameSpace].DragDropManager.setElementStyle(d, this);
  2817.                 document.body.appendChild(d);
  2818.                 var b = this;
  2819.                 this.addEvent(d, "touchstart", function(e) {
  2820.                     if (e.preventDefault) {
  2821.                         e.preventDefault()
  2822.                     }
  2823.                     var f = e.target || e.srcElement || e.originalTarget || this;
  2824.                     b._isMoveByTouch = false;
  2825.                     window[fnNameSpace].util.setStyleWithImportant(f, "opacity", "0.7", true);
  2826.                     b._dragDivMiddle.x = parseInt(f.style.width) / 2;
  2827.                     b._dragDivMiddle.y = parseInt(f.style.height) / 2;
  2828.                     var g = b.getPosition(f);
  2829.                     b._offset = {
  2830.                         x: e.targetTouches[0].pageX - g.left,
  2831.                         y: e.targetTouches[0].pageY - g.top
  2832.                     };
  2833.                     b._screenDimensions = {
  2834.                         width: g.width,
  2835.                         height: g.height
  2836.                     }
  2837.                 });
  2838.                 this.addEvent(d, "touchmove", function(f) {
  2839.                     f.stopPropagation();
  2840.                     if (f.touches.length != 1) {
  2841.                         return
  2842.                     }
  2843.                     var g = f.target || f.srcElement || f.originalTarget || this;
  2844.                     var e = 0;
  2845.                     var h = 0;
  2846.                     if (g.style.position === "absolute") {
  2847.                         e = f.targetTouches[0].pageX - b._offset.x;
  2848.                         h = f.targetTouches[0].pageY - b._offset.y;
  2849.                         e = e < 0 ? 0 : ((e + g.offsetWidth) > b._screenDimensions.width) ? (e = b._screenDimensions.width - g.offsetWidth) : e
  2850.                     } else {
  2851.                         e = f.targetTouches[0].pageX - pageXOffset - b._dragDivMiddle.x;
  2852.                         h = f.targetTouches[0].pageY - pageYOffset - b._dragDivMiddle.y
  2853.                     }
  2854.                     window[fnNameSpace].util.setStyleWithImportant(g, "left", e + "px", true);
  2855.                     window[fnNameSpace].util.setStyleWithImportant(g, "top", h + "px", true);
  2856.                     window[fnNameSpace].util.setStyleWithImportant(g, "bottom", "auto", true);
  2857.                     window[fnNameSpace].util.setStyleWithImportant(g, "right", "auto", true);
  2858.                     b._isMoveByTouch = true;
  2859.                     f.preventDefault()
  2860.                 });
  2861.                 this.addEvent(d, "touchend", function(f) {
  2862.                     var h = f.target || f.srcElement || f.originalTarget || this;
  2863.                     window[fnNameSpace].util.setStyleWithImportant(h, "opacity", "0", true);
  2864.                     if (b._isMoveByTouch) {
  2865.                         b._isMoveByTouch = false;
  2866.                         var e = {
  2867.                             top: "",
  2868.                             left: "",
  2869.                             bottom: "",
  2870.                             right: ""
  2871.                         };
  2872.                         var g = b.getDimensions(h);
  2873.                         if (h.style.position === "absolute") {
  2874.                             e = b.calcPositionByXY(h, h.offsetLeft - pageXOffset, h.offsetTop - pageYOffset);
  2875.                             b.updateScreenRatio(g, e);
  2876.                             e = b.getAbsolutePosition(g, e)
  2877.                         } else {
  2878.                             e = b.calcPositionByXY(h, h.offsetLeft, h.offsetTop);
  2879.                             b.updateScreenRatio(g, e)
  2880.                         }
  2881.                         b.moveDragDiv(h, e);
  2882.                         if (manager) {
  2883.                             manager.storeToolbarPosition(b._lastPosition.vertical, b._lastPosition.horizontal)
  2884.                         }
  2885.                     } else {
  2886.                         b.handleOnClick(b, f)
  2887.                     }
  2888.                 });
  2889.                 this.enableDragState(false);
  2890.                 this.suspendDragDrop()
  2891.             } catch (c) {}
  2892.         };
  2893.         this.suspendDragDrop = function() {
  2894.             var b = manager.tbstatus.suspendDragDrop;
  2895.             if (b && !this._inSuspendMode) {
  2896.                 this.enableDragState(false);
  2897.                 this._inSuspendMode = true
  2898.             } else {
  2899.                 if (!b && this._inSuspendMode) {
  2900.                     this.enableDragState(true);
  2901.                     this._inSuspendMode = false
  2902.                 }
  2903.             }
  2904.         };
  2905.         this.getPosition = function(c) {
  2906.             var b = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  2907.             var e = 0;
  2908.             var d = 0;
  2909.             if (c.offsetParent) {
  2910.                 e = c.offsetLeft;
  2911.                 d = c.offsetTop;
  2912.                 while (c = c.offsetParent) {
  2913.                     e += c.offsetLeft;
  2914.                     d += c.offsetTop
  2915.                 }
  2916.             }
  2917.             return {
  2918.                 left: e,
  2919.                 top: d,
  2920.                 width: b.width,
  2921.                 height: b.height
  2922.             }
  2923.         };
  2924.         this.getDimensions = function(d) {
  2925.             var g = false;
  2926.             if (d.style.display !== "block") {
  2927.                 g = true;
  2928.                 var f = d.style.visibility;
  2929.                 var c = d.style.display;
  2930.                 window[fnNameSpace].util.setStyleWithImportant(d, "visibility", "hidden", true);
  2931.                 window[fnNameSpace].util.setStyleWithImportant(d, "display", "block", true)
  2932.             }
  2933.             var e = d.offsetWidth;
  2934.             var b = d.offsetHeight;
  2935.             if (g) {
  2936.                 window[fnNameSpace].util.setStyleWithImportant(d, "visibility", f, true);
  2937.                 window[fnNameSpace].util.setStyleWithImportant(d, "display", c, true)
  2938.             }
  2939.             return {
  2940.                 offsetWidth: e,
  2941.                 offsetHeight: b
  2942.             }
  2943.         };
  2944.         this.getScreenPosRatio = function() {
  2945.             return this._screenPosRatio
  2946.         };
  2947.         this.calcPosition = function(g) {
  2948.             var f = {
  2949.                 top: "",
  2950.                 left: "",
  2951.                 bottom: "",
  2952.                 right: ""
  2953.             };
  2954.             var e = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  2955.             var d = e.height;
  2956.             var c = e.width;
  2957.             var b = d / 2;
  2958.             if (this._lastPosition.vertical === "TB_VERTICAL_POSITION_TOP") {
  2959.                 f.top = this._params.verticalMargin
  2960.             } else {
  2961.                 if (this._lastPosition.vertical === "TB_VERTICAL_POSITION_MIDDLE") {
  2962.                     f.bottom = (b - (g.offsetHeight / 2)) + "px"
  2963.                 } else {
  2964.                     if (this._lastPosition.vertical === "TB_VERTICAL_POSITION_BOTTOM") {
  2965.                         f.bottom = this._params.verticalMargin
  2966.                     } else {
  2967.                         if (this._lastPosition.vertical && this._lastPosition.vertical.length > 0) {
  2968.                             percentagesHeight = Math.max((d - g.offsetHeight) / d, 0);
  2969.                             f.top = this._lastPosition.vertical = this._screenPosRatio.vertical * d * percentagesHeight + "px"
  2970.                         } else {
  2971.                             f.bottom = this._params.initBottom;
  2972.                             f.top = this._params.initTop
  2973.                         }
  2974.                     }
  2975.                 }
  2976.             }
  2977.             if (this._lastPosition.horizontal === "TB_HORIZONTAL_POSITION_LEFT") {
  2978.                 f.left = this._params.horizontalMargin
  2979.             } else {
  2980.                 if (this._lastPosition.horizontal === "TB_HORIZONTAL_POSITION_RIGHT") {
  2981.                     f.right = this._params.horizontalMargin
  2982.                 } else {
  2983.                     if (this._lastPosition.horizontal && this._lastPosition.horizontal.length > 0) {
  2984.                         percentagesWidth = Math.max((c - g.offsetWidth) / c, 0);
  2985.                         f.left = this._lastPosition.horizontal = this._screenPosRatio.horizontal * c * percentagesWidth + "px"
  2986.                     } else {
  2987.                         f.right = this._params.initRight;
  2988.                         f.left = this._params.initLeft
  2989.                     }
  2990.                 }
  2991.             }
  2992.             return f
  2993.         };
  2994.         this.setPosition = function(b, f) {
  2995.             if (this._inSuspendMode) {
  2996.                 return
  2997.             }
  2998.             if (b != null) {
  2999.                 this._lastPosition.vertical = b
  3000.             }
  3001.             if (f != null) {
  3002.                 this._lastPosition.horizontal = f
  3003.             }
  3004.             var e = document.getElementById("dragDiv");
  3005.             if (!e) {
  3006.                 return
  3007.             }
  3008.             var d = this.getDimensions(e);
  3009.             var c = this.calcPosition(d);
  3010.             this.updateScreenRatio(d, c);
  3011.             if (e.style.position === "absolute") {
  3012.                 c = this.getAbsolutePosition(d, c)
  3013.             }
  3014.             this.moveDragDiv(e, c);
  3015.             this.showDragDiv(true)
  3016.         };
  3017.         this.calcPositionByXY = function(c, g, f, e) {
  3018.             c = c || document.getElementById("dragDiv");
  3019.             if (!c) {
  3020.                 return
  3021.             }
  3022.             var b = {
  3023.                 top: "",
  3024.                 left: "",
  3025.                 bottom: "",
  3026.                 right: ""
  3027.             };
  3028.             var d = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  3029.             var l = d.width / 2;
  3030.             var k = d.height / 2;
  3031.             e = e || this._params.dragToolbarPosition;
  3032.             switch (e) {
  3033.                 case "four":
  3034.                     if (g < l) {
  3035.                         b.left = this._params.horizontalMargin;
  3036.                         this._lastPosition.horizontal = "TB_HORIZONTAL_POSITION_LEFT"
  3037.                     } else {
  3038.                         b.right = this._params.horizontalMargin;
  3039.                         this._lastPosition.horizontal = "TB_HORIZONTAL_POSITION_RIGHT"
  3040.                     }
  3041.                     if (f < k) {
  3042.                         b.top = this._params.verticalMargin;
  3043.                         this._lastPosition.vertical = "TB_VERTICAL_POSITION_TOP"
  3044.                     } else {
  3045.                         b.bottom = this._params.verticalMargin;
  3046.                         this._lastPosition.vertical = "TB_VERTICAL_POSITION_BOTTOM"
  3047.                     }
  3048.                     break;
  3049.                 case "six":
  3050.                     screenThirdY = d.height / 3;
  3051.                     if (g < l) {
  3052.                         b.left = this._params.horizontalMargin;
  3053.                         this._lastPosition.horizontal = "TB_HORIZONTAL_POSITION_LEFT"
  3054.                     } else {
  3055.                         b.right = this._params.horizontalMargin;
  3056.                         this._lastPosition.horizontal = "TB_HORIZONTAL_POSITION_RIGHT"
  3057.                     }
  3058.                     if (f < screenThirdY) {
  3059.                         b.top = this._params.verticalMargin;
  3060.                         this._lastPosition.vertical = "TB_VERTICAL_POSITION_TOP"
  3061.                     } else {
  3062.                         if ((f > screenThirdY) && f < (2 * screenThirdY)) {
  3063.                             b.bottom = k - parseInt(c.offsetHeight / 2) + "px";
  3064.                             this._lastPosition.vertical = "TB_VERTICAL_POSITION_MIDDLE"
  3065.                         } else {
  3066.                             b.bottom = this._params.verticalMargin;
  3067.                             this._lastPosition.vertical = "TB_VERTICAL_POSITION_BOTTOM"
  3068.                         }
  3069.                     }
  3070.                     break;
  3071.                 default:
  3072.                     var h = d.height - c.offsetHeight;
  3073.                     var j = d.width - c.offsetWidth;
  3074.                     b.top = this._lastPosition.vertical = (f > h ? h : (f < (c.offsetHeight / 4) ? 0 : f)) + "px";
  3075.                     b.left = this._lastPosition.horizontal = (g > j ? j : (g < (c.offsetWidth / 4) ? 0 : g)) + "px";
  3076.                     b.bottom = "";
  3077.                     b.right = "";
  3078.                     break
  3079.             }
  3080.             return b
  3081.         };
  3082.         this.getAbsolutePosition = function(e, b) {
  3083.             var d = {
  3084.                 top: "",
  3085.                 left: "",
  3086.                 bottom: "",
  3087.                 right: ""
  3088.             };
  3089.             var c = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  3090.             if (b.top.length > 0) {
  3091.                 d.top = parseInt(b.top) + pageYOffset + "px"
  3092.             } else {
  3093.                 d.top = pageYOffset + c.height - parseInt(b.bottom) - e.offsetHeight + "px"
  3094.             }
  3095.             if (b.left.length > 0) {
  3096.                 d.left = parseInt(b.left) + pageXOffset + "px"
  3097.             } else {
  3098.                 d.left = pageXOffset + c.width - parseInt(b.right) - e.offsetWidth + "px"
  3099.             }
  3100.             return d
  3101.         };
  3102.         this.updateScreenRatio = function(g, b) {
  3103.             var f = this._lastPosition.vertical === "TB_VERTICAL_POSITION_MIDDLE" ? g.offsetHeight / 2 : 0;
  3104.             var e = window[fnNameSpace].displayUtils.getVisualViewportInfo();
  3105.             var d = e.width;
  3106.             var c = e.height;
  3107.             if (b.top.length > 0) {
  3108.                 percentagesHeight = Math.max((c - g.offsetHeight), 0) / c;
  3109.                 if (percentagesHeight != 0) {
  3110.                     this._screenPosRatio.vertical = (parseInt(b.top) + f) / c / percentagesHeight
  3111.                 }
  3112.             } else {
  3113.                 this._screenPosRatio.vertical = (c - parseInt(b.bottom) - f) / c
  3114.             }
  3115.             if (b.left.length > 0) {
  3116.                 percentagesWidth = Math.max((d - g.offsetWidth), 0) / d;
  3117.                 if (percentagesWidth != 0) {
  3118.                     this._screenPosRatio.horizontal = parseInt(b.left) / d / percentagesWidth
  3119.                 }
  3120.             } else {
  3121.                 this._screenPosRatio.horizontal = (d - parseInt(b.right)) / d
  3122.             }
  3123.         };
  3124.         this.repositionAfterZoom = function() {
  3125.             if (this.isDragDivEnable()) {
  3126.                 this.setPosition()
  3127.             }
  3128.         };
  3129.         this.moveDragDiv = function(c, b) {
  3130.             c = c || document.getElementById("dragDiv");
  3131.             if (!c) {
  3132.                 return false
  3133.             }
  3134.             window[fnNameSpace].util.setStyleWithImportant(c, "left", b.left === "" ? "auto" : b.left, true);
  3135.             window[fnNameSpace].util.setStyleWithImportant(c, "top", b.top === "" ? "auto" : b.top, true);
  3136.             window[fnNameSpace].util.setStyleWithImportant(c, "bottom", b.bottom === "" ? "auto" : b.bottom, true);
  3137.             window[fnNameSpace].util.setStyleWithImportant(c, "right", b.right === "" ? "auto" : b.right, true);
  3138.             manager.currentToolbar.setIframePositioning(b.top, b.bottom, b.left, b.right);
  3139.             return true
  3140.         };
  3141.         this.showDragDiv = function(b) {
  3142.             var c = document.getElementById("dragDiv");
  3143.             if (!c) {
  3144.                 return
  3145.             }
  3146.             if (b) {
  3147.                 window[fnNameSpace].util.setStyleWithImportant(c, "display", "block", true);
  3148.                 window[fnNameSpace].util.setStyleWithImportant(c, "visibility", "", true);
  3149.                 window[fnNameSpace].util.setStyleWithImportant(c, "z-index", 2147483647, true)
  3150.             } else {
  3151.                 window[fnNameSpace].util.setStyleWithImportant(c, "display", "none", true);
  3152.                 window[fnNameSpace].util.setStyleWithImportant(c, "visibility", "hidden", true);
  3153.                 window[fnNameSpace].util.setStyleWithImportant(c, "z-index", "0", true)
  3154.             }
  3155.         };
  3156.         this.isDragDivEnable = function() {
  3157.             var b = document.getElementById("dragDiv");
  3158.             if (!b) {
  3159.                 return false
  3160.             }
  3161.             if (b.style.display === "block") {
  3162.                 return true
  3163.             }
  3164.             return false
  3165.         };
  3166.         this.setDragIcon = function(b) {
  3167.             var c = document.getElementById("dragDiv");
  3168.             if (!c) {
  3169.                 return
  3170.             }
  3171.             window[fnNameSpace].util.setStyleWithImportant(c, "background-image", "url('" + b + "')", true)
  3172.         };
  3173.         this.setDragStyle = function(b, c) {
  3174.             var d = document.getElementById("dragDiv");
  3175.             if (!d) {
  3176.                 return
  3177.             }
  3178.             d.style[b] = c
  3179.         };
  3180.         this.toolbarStateChanged = function() {
  3181.             try {
  3182.                 var b = manager.tbstatus.isMinimize;
  3183.                 if (typeof b === "undefined") {
  3184.                     return
  3185.                 } else {
  3186.                     if (b) {
  3187.                         this._isMaximized = false;
  3188.                         this.enableDragState(this._params.allowDragMinimize)
  3189.                     } else {
  3190.                         this._isMaximized = true;
  3191.                         this.enableDragState(this._params.allowDragMaximize)
  3192.                     }
  3193.                 }
  3194.             } catch (c) {}
  3195.         };
  3196.         this.resize = function() {
  3197.             var b = document.getElementById("dragDiv");
  3198.             if (b) {
  3199.                 window[fnNameSpace].util.setStyleWithImportant(b, "width", manager.currentToolbar.dom.style.width, true);
  3200.                 window[fnNameSpace].util.setStyleWithImportant(b, "height", manager.currentToolbar.dom.style.height, true);
  3201.                 if (b.style.position === "fixed") {
  3202.                     window[fnNameSpace].dragdropManager.repositionAfterZoom()
  3203.                 }
  3204.             }
  3205.         };
  3206.         this.orientationChange = function(b) {
  3207.             this._currentOrientation = b
  3208.         };
  3209.         this.addEvent = (function() {
  3210.             if (document.addEventListener) {
  3211.                 return function(e, d, c) {
  3212.                     if (e && e.nodeName || e === window) {
  3213.                         e.addEventListener(d, c, false)
  3214.                     } else {
  3215.                         if (e && e.length) {
  3216.                             for (var b = 0; b < e.length; b++) {
  3217.                                 addEvent(e[b], d, c)
  3218.                             }
  3219.                         }
  3220.                     }
  3221.                 }
  3222.             } else {
  3223.                 return function(e, d, c) {
  3224.                     if (e && e.nodeName || e === window) {
  3225.                         e.attachEvent("on" + d, function() {
  3226.                             return c.call(e, window.event)
  3227.                         })
  3228.                     } else {
  3229.                         if (e && e.length) {
  3230.                             for (var b = 0; b < e.length; b++) {
  3231.                                 addEvent(e[b], d, c)
  3232.                             }
  3233.                         }
  3234.                     }
  3235.                 }
  3236.             }
  3237.         })()
  3238.     };
  3239.     if (window[fnNameSpace].DragDropManager) {
  3240.         window[fnNameSpace].DragDropManager.setElementStyle = function(a, b) {
  3241.             if (!a) {
  3242.                 return
  3243.             }
  3244.             b = b || window;
  3245.             window[fnNameSpace].util.setStyleWithImportant(a, "min-height", "0px", true);
  3246.             window[fnNameSpace].util.setStyleWithImportant(a, "min-width", "0px", true);
  3247.             window[fnNameSpace].util.setStyleWithImportant(a, "border", "0", true);
  3248.             window[fnNameSpace].util.setStyleWithImportant(a, "margin", "0", true);
  3249.             window[fnNameSpace].util.setStyleWithImportant(a, "padding", "0", true);
  3250.             window[fnNameSpace].util.setStyleWithImportant(a, "background", "transparent", true);
  3251.             window[fnNameSpace].util.setStyleWithImportant(a, "opacity", "0", true);
  3252.             window[fnNameSpace].util.setStyleWithImportant(a, "background-size", "80%", true);
  3253.             window[fnNameSpace].util.setStyleWithImportant(a, "-webkit-user-select", "none", true);
  3254.             window[fnNameSpace].util.setStyleWithImportant(a, "display", "none", true);
  3255.             window[fnNameSpace].util.setStyleWithImportant(a, "position", "fixed", true);
  3256.             window[fnNameSpace].util.setStyleWithImportant(a, "background-image", "url('" + b._params.dragIconSrc + "')", true);
  3257.             window[fnNameSpace].util.setStyleWithImportant(a, "background-position", "50% 50%", true);
  3258.             window[fnNameSpace].util.setStyleWithImportant(a, "background-repeat", "no-repeat", true)
  3259.         }
  3260.     }
  3261.     if (top == window) {
  3262.         var manager = new window[fnNameSpace].Manager();
  3263.         var origOnLoadFnc = window.onload;
  3264.         window.onload = function(a) {
  3265.             if ((origOnLoadFnc !== "undefined") && (typeof(origOnLoadFnc) === "function")) {
  3266.                 origOnLoadFnc.apply(window)
  3267.             }
  3268.             window[fnNameSpace].uiEventHandler.loadEvent(a)
  3269.         };
  3270.         var intrvl = null;
  3271.         var numberOfRetries = 50;
  3272.         var checkWhenLoadedDone = function() {
  3273.             if (intrvl == null) {
  3274.                 return
  3275.             }
  3276.             if (document.readyState == "complete" || numberOfRetries == 0) {
  3277.                 window.setTimeout(function() {
  3278.                     manager.initManager()
  3279.                 }, 1000)
  3280.             } else {
  3281.                 intrvl = window.setTimeout(checkWhenLoadedDone, 500)
  3282.             }
  3283.             numberOfRetries--
  3284.         };
  3285.         if (document.readyState == "complete") {
  3286.             window.setTimeout(function() {
  3287.                 manager.initManager()
  3288.             }, 1000)
  3289.         } else {
  3290.             if (document.readyState == "loaded" || document.readyState == "interactive") {
  3291.                 if (intrvl == null) {
  3292.                     intrvl = window.setTimeout(checkWhenLoadedDone, 500)
  3293.                 }
  3294.             } else {
  3295.                 window[fnNameSpace].util.registerLoadFunction(function() {
  3296.                     window.setTimeout(function() {
  3297.                         manager.initManager()
  3298.                     }, 1000)
  3299.                 })
  3300.             }
  3301.         }
  3302.     }
  3303.     if (window[fnNameSpace].Toolbar) {
  3304.         window[fnNameSpace].Toolbar.prototype.move = function(d) {
  3305.             if (this.config.Position === "fixed") {
  3306.                 if (window[fnNameSpace].dragdropManager) {
  3307.                     if (window[fnNameSpace].dragdropManager.isDragDivEnable()) {
  3308.                         return
  3309.                     }
  3310.                 }
  3311.                 manager.currentToolbar.setIframePositioning(this.config.Top, this.config.Bottom, this.config.Left, this.config.Right);
  3312.                 return
  3313.             }
  3314.             var c = manager.currentToolbar;
  3315.             if (!d && !c.rememberedPositioning) {
  3316.                 console.log("move: - missing positioning");
  3317.                 return false
  3318.             }
  3319.             if (!d || (d == null) || (d == false)) {
  3320.                 d = c.rememberedPositioning
  3321.             }
  3322.             c.rememberedPositioning = d;
  3323.             var a = c.calcAbsolutePosition(c.rememberedPositioning);
  3324.             if (window[fnNameSpace].dragdropManager) {
  3325.                 window[fnNameSpace].dragdropManager.moveDragDiv(null, a);
  3326.                 return
  3327.             }
  3328.             var b = Math.min(parseFloat(a.top), document.body.scrollHeight - parseFloat(manager.currentToolbar.dom.style.height));
  3329.             manager.currentToolbar.setIframePositioning(b + "px", "", a.left, "")
  3330.         };
  3331.         window[fnNameSpace].Toolbar.prototype.moveOffset = function(b) {
  3332.             if (!b) {
  3333.                 return false
  3334.             }
  3335.             var a = 0;
  3336.             var c = 0;
  3337.             if (window[fnNameSpace].util.isNumberPixelBased(b.Top)) {
  3338.                 a = b.Top
  3339.             }
  3340.             if (window[fnNameSpace].util.isNumberPixelBased(b.Left)) {
  3341.                 c = b.Left
  3342.             }
  3343.             var f = manager.currentToolbar.getIframePositioning();
  3344.             var e = parseInt(f.top) + parseInt(a) + "px";
  3345.             var d = parseInt(f.left) + parseInt(c) + "px";
  3346.             manager.currentToolbar.setIframePositioning(e, f.bottom, d, f.right);
  3347.             return true
  3348.         };
  3349.         window[fnNameSpace].Toolbar.prototype.initialToolbarIframe = function() {
  3350.             var c = {
  3351.                 "z-index": 2147483646,
  3352.                 position: this.config.Position,
  3353.                 padding: this.config.Padding,
  3354.                 margin: this.config.Margin,
  3355.                 border: this.config.Border,
  3356.                 "min-width": "0px",
  3357.                 "min-height": "0px",
  3358.                 "max-width": "none",
  3359.                 "max-height": "none",
  3360.                 background: "transparent",
  3361.                 "-webkit-transform": "translateZ(998px)"
  3362.             };
  3363.             if (!window[fnNameSpace].util.Browser.isIOS5) {
  3364.                 c["-webkit-transform"] = "translateZ(998px)"
  3365.             }
  3366.             if (this.config.Opacity !== "undefined") {
  3367.                 this.lastOpacity = this.config.Opacity
  3368.             }
  3369.             var a = {
  3370.                 scrolling: this.config.ATT_Scrolling,
  3371.                 frameborder: this.config.ATT_Frameborder,
  3372.                 scroll: this.config.ATT_Scroll,
  3373.                 allowTransparency: this.config.ATT_Allowtransparency
  3374.             };
  3375.             for (var b in c) {
  3376.                 window[fnNameSpace].util.setStyleWithImportant(this.dom, b, c[b], true)
  3377.             }
  3378.             for (var b in a) {
  3379.                 this.dom.setAttribute(b, a[b])
  3380.             }
  3381.             if (this.initialToolbarIframeSpecificDevice) {
  3382.                 this.initialToolbarIframeSpecificDevice(c, a)
  3383.             }
  3384.         }
  3385.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement