Guest User

Untitled

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