/*
JavaScript responsible for frame busting
*/
var jvx_55ef9ac89bab4TraffickedInFrame = false,
jvx_55ef9ac89bab4SafeFrameSupported = false,
jvx_55ef9ac89bab4CanExpandFromFrame = true;
for(var jvxLoopVar=0; jvxLoopVar<1; jvxLoopVar++){
// skip this when bustExpansionOnly = 1, and continue execution
if(jvx_55ef9ac89bab4TraffickedInFrame && jvx_55ef9ac89bab4CanExpandFromFrame){
//hacky way to stop the execution in JS by using a dummy for loop and then break
break;
}
// Adding close button CSS style to document.head
var css = '.jvx_boxclose{padding:0px; margin:0px; top:1px; right:1px; position:absolute; width:20px; height:19px; display:block; text-decoration:none; color:#fff; background:#111; font-family:"Tahoma", Helvetica, sans-serif; text-align:center; font-size:20px; font-weight:bold; border-radius:50%; box-shadow:0px 0px 2px 0px #FFF; cursor:pointer; line-height:17px; opacity:1; border:2px Solid #999; -webkit-border:2px Solid #999;}',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
css += '.jvx_boxclose{ -webkit-transition:-webkit-transform .25s, opacity .25s; -moz-transition:-moz-transform .25s, opacity .25s; transition: transform .25s, opacity .25s; opacity:.55; -webkit-perspective: 1000; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden;backface-visibility: hidden;} .jvx_boxclose:hover{ -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); transform: rotate(360deg); opacity:1;}';
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
var CreativeUnit = (function(){
var isMSIE = false;
var hasFlashPlugin = (function(){
var flashPluginAvailable = false;
if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]){
flashPluginAvailable = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
}
if(!flashPluginAvailable && isMSIE){
// if we are here, this is for MSIE only.
try {
var flashObj = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(flashObj)
flashPluginAvailable = true;
} catch (ex) {
}
}
return flashPluginAvailable;
})();
addEvent(window, "message", receiveHtml5Message, false);
function receiveHtml5Message(e){
if(typeof e.data != "string"){
return;
}
var s = e.data.split(':', 10);
if(s && s.length >= 2 && s[0] == 'jvx_55ef9ac89bab4'){
var msg = s[1];
if(msg == 'openExpansion'){
jvx_55ef9ac89bab4.openExpansion(false, false);
} else if(msg == 'closeExpansion'){
jvx_55ef9ac89bab4.closeExpansion(false, false);
} else if(msg == 'expansionLoaded'){
//Remove bg image div once base layout iframe is loaded
//jvx_55ef9ac89bab4.hideBaseBg();
} else if(msg == 'recordUIR'){
jvx_55ef9ac89bab4.UIRRecorded = true;
}
}
}
function postHtml5Message(winRef, msg){
if(typeof(winRef.contentWindow) != 'undefined'){
winRef.contentWindow.postMessage('jvx_55ef9ac89bab4' + ':' + msg, "*");
} else {
winRef.postMessage('jvx_55ef9ac89bab4' + ':' + msg, "*");
}
}
function addEvent(el, event, fn, capture){
if(el.addEventListener){
el.addEventListener(event,fn,capture);
}else{
el.attachEvent("on" + event, fn);
}
}
function getElById(id){
return document.getElementById(id);
}
function getElByClass(cName){
if(document.getElementsByClassName){
return document.getElementsByClassName(cName);
}else if(document.querySelectorAll){ // For IE8
return document.querySelectorAll(cName);
}
}
function getBox(el){
return el.getBoundingClientRect();
}
function getElemByQuerySelect(el){
return document.querySelector('#'+el+', .'+el);
}
function getOffset(elem) {
if (elem.getBoundingClientRect) {
return getOffsetRect(elem);
} else { // old browser
return getOffsetSum(elem);
}
}
function getOffsetSum(elem) {
var top=0, left=0;
while(elem) {
top = top + parseInt(elem.offsetTop);
left = left + parseInt(elem.offsetLeft);
elem = elem.offsetParent;
}
return {top: top, left: left};
}
function getOffsetRect(elem) {
var box = elem.getBoundingClientRect();
var body = document.body;
var docElem = document.documentElement;
var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
var clientTop = docElem.clientTop || body.clientTop || 0;
var clientLeft = docElem.clientLeft || body.clientLeft || 0;
var top = box.top + scrollTop - clientTop;
var left = box.left + scrollLeft - clientLeft;
return { top: Math.round(top), left: Math.round(left) };
}
function getOffset(elem) {
if (elem.getBoundingClientRect) {
return getOffsetRect(elem);
} else {
return getOffsetSum(elem);
}
}
/**
* Creates and returns element from html chunk
* Uses innerHTML to create an element
*/
var toElement = (function(){
var div = document.createElement('div');
return function(html){
div.innerHTML = html;
var el = div.firstChild;
return div.removeChild(el);
};
})();
var getElComputedStyle = function(){
var func = null;
if (document.defaultView && document.defaultView.getComputedStyle) {
func = document.defaultView.getComputedStyle;
} else if (typeof(document.body.currentStyle) !== "undefined") {
func = function(element, anything) {
return element["currentStyle"];
};
}
return function(element, style) {
if(typeof func === 'function')
return func(element, null)[style];
}
}();
function hasClass(el, name){
var re = new RegExp('\\b' + name + '\\b');
return re.test(el.className);
}
function addClass(el, name){
if(!hasClass(el, name)){
if(el.classList && el.classList.length > 0){
el.className += ' ' + name;
} else {
el.className = name;
}
}
}
function removeClass(el, name){
var re = new RegExp('\\b' + name + '\\b');
el.className = el.className.replace(re, '');
}
function removeNode(el){
el.parentNode.removeChild(el);
}
function createImg(obj){
/* obj should be of this format - {'id':'image1','src':'http://www.jivox.com/image.jpg','width':'180','height':'150'} */
var id = obj.id,
src = obj.src,
width = obj.width,
height = obj.height,
str = '';
str += '';
return str;
}
function createSWF(obj){
var id = obj.id,
src = obj.src,
width = obj.width,
height = obj.height,
params = obj.params,
paramsHTMLStr = '',
str = '';
for(var paramName in params){
paramsHTMLStr += '';
}
str += '';
return str;
}
function createIframe(obj){
/* obj should be of this format - {'id':'frame1','src':'http://www.jivox.com/','width':'1024','height':'768'} */
var id = obj.id,
src = obj.src,
width = obj.width,
height = obj.height,
str = '';
str += '';
return str;
}
function createFIF(obj){
/* obj should be of this format - {'id':'frame1','src':'http://www.jivox.com/','width':'1024','height':'768'} */
var id = obj.id,
src = obj.src,
width = obj.width,
height = obj.height,
str = '';
src = '' + src;
str += '';
return str;
}
function createDivNode(id){
var divNode = document.createElement('div');
divNode.id = id;
return divNode;
}
function prependNode(cNode, pNode){
pNode.insertBefore(cNode, pNode.firstChild);
}
function clearNode(pNode, idPrefix){
var i = 0,
elList = pNode.getElementsByTagName('div'),
elLen = (elList) ? elList.length : 0;
for (i = 0; i < elLen; i++) {
var elId = elList[i].id;
if(elId && elId.indexOf(idPrefix) == 0){
pNode.removeChild(elList[i]);
return;
}
}
}
/**
* Helper that takes object literal
* and returns the object after removing blank values
* @param {Object} sourceObj
*/
function deleteBlankAttr(sourceObj){
for (var i in sourceObj) {
if (sourceObj[i] == "" || sourceObj[i] == "undefined") {
delete sourceObj[i];
}
}
return sourceObj;
}
/**
* Helper that takes object literal
* and add all properties to element.style
* @param {Element} node
* @param {Object} styles
*/
function addStyles(node, styles){
if(!isEmpty(styles)){
styles = deleteBlankAttr(styles);
var fChar = "",
nodeCSS = node.style.cssText;
if(nodeCSS){
fChar = " ";
if(nodeCSS[nodeCSS.length-1] != ";"){
nodeCSS += ";"; // For IE8 and less
}
}
for (var name in styles) {
if(styles.hasOwnProperty(name)){
nodeCSS += fChar +name+ ": " +styles[name]+ ";";
}
}
if(nodeCSS) node.style.cssText = nodeCSS.toString();
}
}
/**
* Helper that takes object literal
* and remove all properties to element.style
* @param {Element} el
* @param {Object} styles
*/
function removeStyles(el, styles){
if(!isEmpty(styles)){
// styles = deleteBlankAttr(styles);
for (var name in styles) {
if(styles.hasOwnProperty(name)){
el.style[name] = '';
}
}
}
}
/**
* Helper that creates a Div component with the Id passed
* and add default CSS class, innerText and extra styles to the component
* and then append the component to the main element
* @param {Main element to which new node has to appended } mainEl
* @param {Id for the new node} nodeId
* @param {default CSS class name to be added} className
* @param {innerText to the node} text
* @param {Object - styles to be added to the node} styleObj
*/
function addDivComponent(mainEl, nodeId, className, text, styleObj)
{
var node = createDivNode(nodeId);
node.innerHTML = text;
if(className != '')
addClass(node, className);
if(!isEmpty(styleObj))
addStyles(node, styleObj);
return mainEl.appendChild(node);
}
function setAttributes(el, attrs)
{
for(var key in attrs) {
el.setAttribute(key, attrs[key]);
}
}
function getBrowserPrefix(browserName){
var prefix = "";
if(!isEmpty(browserName)){
if((browserName == 'Chrome') || (browserName == 'Safari') || (browserName == 'iPhone') || (browserName == 'iPod') || (browserName == 'iPad'))
prefix = "webkit";
else if(browserName == 'Firefox')
prefix = "moz";
else if(browserName == 'Internet Explorer')
prefix = "ms";
else if(browserName == 'Opera')
prefix = "o";
else{
}
}
return prefix;
}
function getBrowserWindowProps() {
var browserWidth = 0, browserHeight = 0;
//For checking non-IE browsers Mozilla, Safari, Opera, Chrome.
if (typeof (window.innerWidth) == 'number') {
browserWidth = window.innerWidth;
browserHeight = window.innerHeight;
}
//All IE except version 4
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
browserWidth = document.documentElement.clientWidth;
browserHeight = document.documentElement.clientHeight;
}
//IE 4
else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
browserWidth = document.body.clientWidth;
browserHeight = document.body.clientHeight;
}
return [browserWidth, browserHeight];
};
function getCenterAlignXY(objWidth,objHeight){
var winPos = getBrowserWindowProps(),
objX = '';
if(window.innerWidth == document.documentElement.clientWidth) {
objX = (winPos[0] - objWidth) / 2 ;
} else {
var scrollWidth = window.innerWidth - document.documentElement.clientWidth;
objX = ((winPos[0]- scrollWidth) - objWidth) / 2 ;
}
var objY = (winPos[1] - objHeight) / 2 ;
objX = (objX < 0) ? 0 : objX;
objY = (objY < 0) ? 0 : objY;
return [objX,objY];
}
function isEmpty(obj) {
// null and undefined are "empty"
if (obj == null) return true;
// Assume if it has a length property with a non-zero value
if (obj.length === 0) return true;
if (obj.length && obj.length > 0) return false;
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) return false;
}
return true;
}
/* Function used to create an event manually with the help of CustomEvent constructor for the 'evtName' */
function createCustomEvent(evtName){
var event = null;
if (typeof CustomEvent === 'function') {
event = new CustomEvent(evtName)
} else { // For IE browser
event = document.createEvent("CustomEvent");
event.initCustomEvent(evtName, false, false, '');
}
if(!event) return;
return event;
}
function fireTracker(url){
var imgEl = document.createElement('img');
var finalURL = "";
if(!url.match("http://evs.jivox.com/jivox/serverAPIs/saveImpression.php")){
var replaceCacheBuster0 = url.replace('[timestamp]', Math.random());
var replaceCacheBuster1 = replaceCacheBuster0.replace('[randomNumber]', Math.random());
var replaceCacheBuster2 = replaceCacheBuster1.replace('{cacheBuster}', Math.random());
var replaceCacheBuster3 = replaceCacheBuster2.replace('{RANDOMNUM}', Math.random());
var replaceCacheBuster4 = replaceCacheBuster3.replace('%%CACHEBUSTER%%', Math.random());
finalURL = replaceCacheBuster4; //finalURL = replaceCacheBuster;
}else{
if(url.indexOf("?") == -1){
finalURL = url + "?r=" + Math.random();
}else{
finalURL = url + "&r=" + Math.random();
}
}
imgEl.src = finalURL;
}
function setStylesFromStr(node, styleStr){
if(styleStr == ''){
return;
}
var splittedStyles = styleStr.split(";");
var stylesLen = splittedStyles.length;
if(stylesLen < 1){
return;
}
for(var i=0;i 0)
totalFrames = time/40;
var fLeft = newLeft - cLeft;
if(fLeft != 0)
fLeft /= totalFrames;
var fTop = newTop - cTop;
if(fTop != 0)
fTop /= totalFrames;
var fWidth = newWidth - cWidth;
if(fWidth != 0)
fWidth /= totalFrames;
var fHeight = newHeight - cHeight;
if(fHeight != 0)
fHeight /= totalFrames;
var lcLeft = '', lcTop = '', lfLeft = '', lfTop = '';
doFrame(el, cLeft, newLeft, fLeft,
cTop, newTop, fTop, cWidth, newWidth, fWidth,
cHeight, newHeight, fHeight, callback, lcLeft, lfLeft, lcTop, lfTop);
};
function doFrame(el, cLeft, nLeft, fLeft, cTop, nTop, fTop, cWidth, nWidth, fWidth, cHeight, nHeight, fHeight, callback, lcLeft, lfLeft, lcTop, lfTop){
// console.log("eID" + el + "\n cLeft: " + cLeft + " nLeft: " + nLeft + " fLeft: " + fLeft + "\n cTop: " + cTop + " nTop: " + nTop + " fTop: " + fTop + // "\n cWidth: " + cWidth + " nWidth: " + nWidth + " fWidth: " + fWidth + "\n cHeight: " + cHeight + " nHeight: " + nHeight + " fHeight: " + fHeight)
// var el = document.getElementById(eID);
if(el == null)
return;
cLeft = moveSingleVal(cLeft, nLeft, fLeft);
cTop = moveSingleVal(cTop, nTop, fTop);
cWidth = moveSingleVal(cWidth, nWidth, fWidth);
cHeight = moveSingleVal(cHeight, nHeight, fHeight);
var elStyleObj = {'width':Math.round(cWidth) + 'px', 'height': Math.round(cHeight) + 'px'};
if(!isNaN(cLeft)){
elStyleObj['left'] = Math.round(cLeft) + 'px';
}
if(!isNaN(cTop)){
var key = 'top';
elStyleObj[key] = Math.round(cTop) + 'px';
}
addStyles(el, elStyleObj);
if((isNaN(cLeft) || cLeft == nLeft) && (isNaN(cTop) || cTop == nTop) && cHeight == nHeight && cWidth == nWidth)
{
if(callback != null)
callback();
return;
}
setTimeout(function(){ doFrame(el, cLeft, nLeft, fLeft,
cTop, nTop, fTop, cWidth, nWidth, fWidth,
cHeight, nHeight, fHeight, callback, lcLeft, lfLeft, lcTop, lfTop) }, 40);
};
function moveSingleVal(currentVal, finalVal, frameAmt){
if(frameAmt == 0 || currentVal == finalVal)
return finalVal;
currentVal += frameAmt;
if((frameAmt> 0 && currentVal>= finalVal)
|| (frameAmt <0 && currentVal <= finalVal))
{
return finalVal;
}
return currentVal;
};
/**
* Constructor Function / Class for the Creative Unit
*/
function CreativeUnit(uniqId){
this.id = uniqId;
this.playerParamsMap = {"reportingURL":"http:\/\/evs.jivox.com","ab_asset147_clickThroughURL":"http:\/\/www8.hp.com\/sg\/en\/business-solutions\/smb\/index.html","ab_asset158_clickThroughURL":"http:\/\/www8.hp.com\/sg\/en\/business-solutions\/smb\/index.html","creativeUnitType":"13","expandUnitType":"13","bDim":"728x90","eDim":"980x609","bUnitId":"1301","eUnitId":"1300","siteId":"04feae5c84eab9","campaignId":"73481","es_pId":"BKfhUx","ts_pId":"BKfhUx","jvxVer":"2","cMacro":"https:\/\/adclick.g.doubleclick.net\/aclk%3Fsa%3DL%26ai%3DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%26num%3D0%26cid%3D5GhD8p8f9yyJCrMWkV4WHiw9%26sig%3DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%26client%3Dca-pub-1728288586014899%26adurl%3D","r":"198400552","objectName":"jvx_55ef9ac89bab4","npl":"1","busted":"1","bustType":"1","0":"","serverURL":"http:\/\/as.jivox.com","expansionTopOffset":"100","expansionLeftOffset":"-130","disableExpClickThru":"1","delayLoad":"3","ab_asset123_clickThroughURL":"http%25253A%25252F%25252Fgoo.gl%25252F3sY19z","ab_asset124_clickThroughURL":"http%25253A%25252F%25252Fgoo.gl%25252F7ivI7D","ab_asset140_clickThroughURL":"http%25253A%25252F%25252Fgoo.gl%25252FEtdlhF","ab_asset135_clickThroughURL":"http%25253A%25252F%25252Fgoo.gl%25252FadcfrT","hideCloseBtn":"1","autoExpand":"1","expandUnitAs":"0","autoExpandUnitCollapseTime":"100000","autoExpandValidity":"0","expandEvent":"click"};
this.adUnitContainerId = 'adUnitContainer' + uniqId;
this.baseContainerId = 'baseContainer' + uniqId;
this.baseId = 'jvxBase' + uniqId;
this.base2Id = 'jvxBase' + uniqId + '0';
this.baseCloseId = 'baseClose' + uniqId;
this.baseBgId = 'baseBg' + uniqId;
this.baseBg2Id = 'baseBg' + uniqId + '0';
this.expansionContainerId = 'expansionContainer' + uniqId;
this.expansionId = 'expansion' + uniqId;
this.expansion2Id = 'expansion' + uniqId + '0';
this.expansionBgId = 'expansionBg' + uniqId;
this.logContainerId = 'logContainer' + uniqId;
this.closeExpansionId = 'closeExpansion' + uniqId;
this.expansionLoaderId = 'expansionLoader' + uniqId;
this.baseInterceptorId = 'baseInterceptor' + uniqId;
this.expInterceptorId = 'expInterceptor' + uniqId;
this.base2InterceptorId = 'baseInterceptor' + uniqId + '0';
this.maskId = 'mask' + uniqId;
this.loaderId = 'loader' + uniqId;
this.iBusterFrame = null;
/*Smooth responsive and stretch variables*/
this.baseType = 'html';
this.baseHasLayout = '1';
this.baseURL = 'http://as.jivox.com/unit/layout_renderer.php?creativeUnitType=13&expandUnitType=13&bDim=728x90&eDim=980x609&bUnitId=1301&eUnitId=1300&siteId=04feae5c84eab9&campaignId=73481&es_pId=BKfhUx&ts_pId=BKfhUx&jvxVer=2&cMacro=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253D&r=198400552&objectName=jvx_55ef9ac89bab4&npl=1&busted=1&bustType=1&objectName=jvx_55ef9ac89bab4&clickTagURL=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253Dhttp%253A%252F%252Fwww8.hp.com%252Fsg%252Fen%252Fbusiness-solutions%252Fsmb%252Findex.html&adUnitId=1301&jvxSessionId=1441766272.2248&delayLoad=0';
this.baseURL += '&base=1';
this.baseBgType = 'image';
this.baseBgURL = '';
this.baseBgColor = '';
this.baseFallbackType = '';
this.baseFallbackURL = '';
this.baseFallbackFileName = '';
this.baseFallbackWidgetSrc = '';
this.baseWidth = '728';
this.baseHeight = '90';
this.baseCloseRight = '0';
this.baseBehaviourId = '0';
this.behaviourId = '2';
this.behaviourName = 'Slide Down Push';
this.insertAdUnitContainerTo = 'slot';
this.insertAdUnitContainerAs = 'fc';
this.insertBaseTo = 'adUnitContainer';
this.insertBaseAs = 'fc';
this.expansionType = 'html';
this.expansionHasLayout = '1';
this.expansionURL = 'http://as.jivox.com/unit/layout_renderer.php?creativeUnitType=13&expandUnitType=13&bDim=728x90&eDim=980x609&bUnitId=1301&eUnitId=1300&siteId=04feae5c84eab9&campaignId=73481&es_pId=BKfhUx&ts_pId=BKfhUx&jvxVer=2&cMacro=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253D&r=198400552&objectName=jvx_55ef9ac89bab4&npl=1&busted=1&bustType=1&objectName=jvx_55ef9ac89bab4&clickTagURL=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253Dhttp%253A%252F%252Fwww8.hp.com%252Fsg%252Fen%252Fbusiness-solutions%252Fsmb%252Findex.html&adUnitId=1300&jvxSessionId=1441766272.2248';
this.expansionBgType = 'image';
this.expansionBgURL = '';
this.expansionBgColor = '#000000';
this.expansionFallbackType = '';
this.expansionFallbackURL = '';
this.expansionFallbackFileName = '';
this.expansionFallbackWidgetSrc = '';
this.expansionWidth = '980';
this.expansionHeight = '609';
this.expAnimSpeed = '0.5';
if(jvx_55ef9ac89bab4SafeFrameSupported){
this.insertExpansionTo = 'adUnitContainer';
} else {
this.insertExpansionTo = 'root';
}
this.insertExpansionAs = 'lc';
this.expansionOpen = false;
this.expansionHasOpened = false;
this.browserName = 'Chrome';
this.storeTransitionEndEvt = {};
this.autoExpandTimerRef = null;
this.autoCollapseTimerRef = null;
this.timeSpentOnAd = 0;
this.UIRTimer = null;
this.UIRRecorded = false;
this.DwellTimer = null;
this.DwellRecorded = true;
this.DwellElapsedTimer = null;
this.DwellElapsedTime = 0;
this.preStyleExpansion = false;
this.expInterceptorDomRef = null;
// this.sfCollapseFirst = false;
}
/*
Prototype object of the CreativeUnit. Add methods / properties to this so that they get shared
among all objects created out of this class but at the same time it's created only once.
*/
CreativeUnit.prototype = {
constructor:CreativeUnit,
onLoadEventHandler:function(event){
var eventSrc = event.target || event.srcElement;
if(eventSrc != 'undefined' && eventSrc != null){
if(eventSrc.id == this.expansionId){
var expLoader = getElById(this.expansionLoaderId);
if(expLoader){
expLoader.style.display = "none";
}
}
if(eventSrc.id == this.baseId){
this.hideBaseBg();
}
}
},
restyleExpansion:function(){
var that = this,
expEl = getElById(this.expansionContainerId);
var getCoords = function(){
var baseBox = "";
baseBox = getOffset(getElById(that.adUnitContainerId));
return baseBox;
};
var offLeft = parseInt(-130),
offTop = parseInt(100),
box = getCoords();
if(this.insertExpansionTo != "adUnitContainer"){
expEl.style.left = box.left - (parseInt(this.expansionWidth) - parseInt(this.baseWidth)) - offLeft + "px";
}else{
expEl.style.left = 0 - offLeft + "px";
}
},
renderBase:function(responsive){
if(responsive) {
var baseContainerNode = getElById(this.baseContainerId);
baseContainerNode.style.backgroundColor = this.baseBgColor;
var bNode = getElById(this.baseId);
var b2Node = getElById(this.base2Id);
if(bNode != null) {
var iframeNode = (bNode.nodeName.toLowerCase() == "iframe") ? bNode : b2Node;
var imgNode = (bNode.nodeName.toLowerCase() == "img") ? bNode : b2Node;
if(this.baseHasLayout == 1 && iframeNode != null) {
iframeNode.style.display = 'block';
if(imgNode != null) {
imgNode.style.display = 'none';
}
iframeNode.width = this.baseWidth;
iframeNode.height = this.baseHeight;
//Layout renderer should render new layout
/*Smooth responsive and stretch variables*/
postHtml5Message(iframeNode, 'reRenderLayout');
return;
}
else if(this.baseHasLayout != 1 && imgNode != null) {
imgNode.style.display = 'block';
if(iframeNode != null) {
iframeNode.style.display = 'none';
//Layout renderer should pause all the activities like video
postHtml5Message(iframeNode, 'pauseInteraction');
}
imgNode.width = this.baseWidth;
imgNode.height = this.baseHeight;
imgNode.src = this.baseURL;
return;
} else {
var origBaseId = this.baseId;
this.baseId = this.base2Id;
}
}
}
var that = this;
var baseHTMLStr = this.getBase();
var baseNode = toElement(baseHTMLStr);
var baseContainerNode = getElById(this.baseContainerId);
baseContainerNode.appendChild(baseNode);
addEvent(getElById(this.baseId), "load", function(event){ that.onLoadEventHandler(event); }, false);
if(this.baseId == this.base2Id) {
//Reset baseId to original value
this.baseId = origBaseId;
//Set style for baseNode
var baseNode = getElById(this.baseId);
baseNode.style.position = 'absolute';
baseNode.style.display = 'none';
if(bNode.nodeName.toLowerCase() == "iframe") {
//Layout renderer should pause all the activities like video
postHtml5Message(bNode, 'pauseInteraction');
}
//Set style for base2Node
var base2Node = getElById(this.base2Id);
base2Node.style.position = 'absolute';
base2Node.style.display = 'block';
//Add load event handler
addEvent(getElById(this.base2Id), "load", function(event){ that.onLoadEventHandler(event); }, false);
}
},
getBase:function(){
var baseType = this.baseType;
var str = "";
switch(baseType){
case "image":
str = this.getBaseImage();
break;
case "flash":
str = this.getBaseFlash();
break;
case "html":
str = this.getBaseHTML();
break;
default:
break;
}
return str;
},
getBaseImage:function(){
var obj = {};
obj.id = this.baseId;
obj.src = this.baseURL;
obj.width = this.baseWidth;
obj.height = this.baseHeight;
return createImg(obj);
},
getBaseFlash:function(){
if(!hasFlashPlugin){
return this.getBaseFallback();
}
var obj = {};
obj.id = this.baseId;
obj.src = this.baseURL;
obj.width = this.baseWidth;
obj.height = this.baseHeight;
obj.params = {'movie' : this.baseURL,
'wmode' : 'transparent',
'allowScriptAccess' : 'always',
'flashvars' : "objectName=jvx_55ef9ac89bab4&campaignId=73481&siteId=04feae5c84eab9&adUnitType=14&es_pId_BKfhUx&&eventReportingURL=http://evs.jivox.com/jivox/serverAPIs/saveImpression.php&eventId=1000&clickTag=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253Dhttp%253A%252F%252Fwww8.hp.com%252Fsg%252Fen%252Fbusiness-solutions%252Fsmb%252Findex.html"
};
return createSWF(obj);
},
getBaseHTML:function(){
var obj = {};
obj.id = this.baseId;
obj.src = this.baseURL;
obj.width = this.baseWidth;
obj.height = this.baseHeight;
return createIframe(obj);
},
getBaseFallback:function(){
var fallbackType = this.baseFallbackType;
var str = "";
switch(fallbackType){
case "image":
str = this.getBaseFallbackImage();
break;
case "widget":
str = this.getBaseFallbackWidget();
break;
case "swiffy":
case "html5":
str = this.getBaseFallbackHTML();
break;
default:
break;
}
return str;
},
getBaseFallbackImage:function(){
var obj = {};
obj.id = this.baseId;
obj.src = this.baseFallbackURL;
obj.width = this.baseWidth;
obj.height = this.baseHeight;
return createImg(obj);
},
getBaseFallbackWidget:function(){
var obj = {};
obj.id = this.baseId;
obj.src = this.baseFallbackWidgetSrc;
obj.width = this.baseWidth;
obj.height = this.baseHeight;
return createFIF(obj);
},
getBaseFallbackHTML:function(){
var obj = {};
obj.id = this.baseId;
obj.src = this.baseFallbackURL;
obj.width = this.baseWidth;
obj.height = this.baseHeight;
return createIframe(obj);
},
getBaseClose:function(){
var obj = {};
obj.id = this.baseCloseId;
obj.src = '';
obj.width = '';
obj.height = '';
return createImg(obj);
},
fnCallback:function(evt){
var ref = jvx_55ef9ac89bab4,
pName = '', targetId = '', key = '';
if(evt){
pName = evt.propertyName,
targetId = evt.target.id,
key = targetId;
}
if(targetId == ref.loaderId)
return;
/* var addPNameToKey = function(pName){
if(pName == 'width'){
key += evt.target.clientWidth;
}else if(pName == 'height'){
key += evt.target.clientHeight;
}else if(pName == 'top'){
key += evt.target.clientTop;
}else if(pName == 'left'){
key += evt.target.clientLeft;
}
return key;
};
*/
var executeCallBack = function(transitionEvt){
if(ref != 'undefined' && ref != null){
var el = getElById(ref.expansionId);
if(ref.expansionOpen){
if(transitionEvt){
postHtml5Message(el,'openExpansionComplete');
}
}else{
if(jvx_55ef9ac89bab4SafeFrameSupported && transitionEvt){
try{
$sf.ext.collapse();
}catch(e){}
}
if(transitionEvt){
postHtml5Message(el,'closeExpansionComplete');
}
/* Removing Styles from adUnitContainer which is set during openExpansion and adding default styles for Billboard */
/* End */
/* Removing Styles from document.body which is set during openExpansion for Sidekick */
/* End */
ref.expansionHasOpened = false;
}
}
};
if(!isEmpty(ref.storeTransitionEndEvt)){
if(!ref.storeTransitionEndEvt.hasOwnProperty(key)){ // If KEY not present in the object, add the New Key to the object and
ref.storeTransitionEndEvt[key] = targetId; // execute callback
if(targetId != ref.closeExpansionId){
executeCallBack(evt);
}
}else{
// log("already exist");
}
}else{
ref.storeTransitionEndEvt[key] = targetId;
if(targetId != ref.closeExpansionId){
executeCallBack(evt);
}
setTimeout(function(){ref.storeTransitionEndEvt = {};},200);
}
},
renderBaseBg:function(){
var bNode = createDivNode(this.baseBgId), //bg image for delayLoad and clickToLoad
pNode = getElById(this.baseContainerId);
bNode.style.width = this.baseWidth + "px";
bNode.style.height = this.baseHeight + "px";
bNode.style.position = "absolute";
bNode.style.top = "0px";
bNode.style.left = "0px";
bNode.style.opacity = "1";
pNode.appendChild(bNode);
bNode.style.background = this.baseBgColor + " url('" + this.baseBgURL + "') no-repeat";
},
hideBaseBg:function(){
var bNode = getElById(this.baseBgId);
var b2Node = getElById(this.baseBg2Id);
//Reduce opacity of bg image div so that unit iframe is visible
var browserPrefix = getBrowserPrefix(this.browserName);
var browserPrefixTransParam = "-" + browserPrefix + "-transition",
transStr = '0.5s ease-in-out';
var elemAttrStyle = {
'transition' : transStr,
'opacity' : '0'
};
elemAttrStyle[browserPrefixTransParam] = transStr;
addStyles(bNode, elemAttrStyle);
if(b2Node)
addStyles(b2Node, elemAttrStyle);
//Remove bg image div once base layout iframe is loaded
setTimeout(function() {
if(bNode)
removeNode(bNode);
if(b2Node)
removeNode(b2Node);
}, 500);
},
setAdUnitStyle:function(obj){
if(this.insertExpansionTo == "adUnitContainer") {
var transitionPos = "",
mainContStyle = {};
addStyles(getElById(this.adUnitContainerId), mainContStyle); // Setting CSS styles to #adUnitContainer
}
},
renderLoader:function(){
if(!getElById(this.expansionLoaderId)){
/* Expansion Wrapper Div */
var el = getElById(this.expansionContainerId);
var lwStyles = {'width': this.expansionWidth+"px",'height': this.expansionHeight+"px",'position': 'absolute','display': 'block','background': '#000000'},
lWrapper = addDivComponent(el, this.expansionLoaderId, '', '', lwStyles);
/* End */
getElById(this.expansionLoaderId).style.opacity = '0.8';
/* loader_css.php - where Loader Css styles and loader Div components are created and appended to $cntId */
/* Plugin - to create the loader depends on the LoaderType where corresponding Css Styles are added by default and Div s for respective loaderType is created */
/* PARAMETERS : Pass $cntId and $loaderType to append the loader to the respective Div */
var css = '',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
css = '.jvx_55ef9ac89bab4loadingSpinner { position: absolute; border-top-color: transparent; height: 20px; vertical-align: middle; width: 20px; border: 3px solid #444; border-top-color: transparent; border-radius: 50%; -webkit-animation: spin 1s infinite linear; -moz-animation: spin 1s infinite linear; -ms-animation: spin 1s infinite linear; animation: spin 1s infinite linear; } @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } @-ms-keyframes spin { 100% { -ms-transform: rotate(360deg); } } @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } @-keyframes spin { 100% { transform: rotate(360deg); } }';
/* Adding Css content to document.head */
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
/* End */
/**
* Helper that creates a Div component with the Id passed
* and add default CSS class, innerText and extra styles to the component
* and then append the component to the main element
* @param {Main element to which new node has to appended } mainEl
* @param {Id for the new node} nodeId
* @param {default CSS class name to be added} className
* @param {innerText to the node} text
* @param {Object - styles to be added to the node} styleObj
*/
function addDivComponent_v2(mainEl, nodeId, className, text, styleObj)
{
var node = document.createElement('div');
node.id = nodeId;
node.innerHTML = text;
if(className != ''){
if(node.classList && node.classList.length > 0){
node.className += ' ' + className;
} else {
node.className = className;
}
}
if(styleObj != ''){
var css = '';
for (var name in styleObj) {
if(styleObj.hasOwnProperty(name)){
try{
node.style[name] = styleObj[name];
} catch(e){
css += name+':'+styleObj[name]+';'; // added for IE8
}
}
}
if(css != '') node.style.cssText = css.toString();
}
return mainEl.appendChild(node);
}
/* Creating corresponding DIV s for the LoaderType */
var mainEl = document.getElementById('expansionLoader_55ef9ac89bab4'),
lSize = parseInt('22'),
loaderId = '',
elHeight = '', elWidth = '',
tTop = '', tLeft = '',
topPos = '', leftPos = '';
loaderId = 'loader_55ef9ac89bab4';
elHeight = parseInt(mainEl.style.height.replace("px",""));
elWidth = parseInt(mainEl.style.width.replace("px",""));
topPos = elHeight/2;
leftPos = elWidth/2;
var lStyles = {'top': topPos+"px", 'left': leftPos+"px", 'width': lSize + 'px', 'height': lSize + 'px', 'display':'block'},
loader = addDivComponent_v2(mainEl, loaderId, 'jvx_55ef9ac89bab4loadingSpinner', '', lStyles);
/* End */
}
},
getIBusterFrameInfo:function(){
if(typeof(jivoxIBusterAdObject) != "undefined"){
var hostIframes = document.body.getElementsByTagName("iframe"),
iFramesLen = (hostIframes) ? hostIframes.length : 0;
for(var i=0; i < iFramesLen; i++){
if(hostIframes[i].contentWindow == jivoxIBusterAdObject["jvx_55ef9ac89bab4"].foreignWindow){
cords = getBox(hostIframes[i]);
return [cords, hostIframes[i]];
// this.iBusterFrameCords = cords;
// this.iBusterFrame = hostIframes[i];
}
}
}
},
/* animation code */
animate:function(obj){
var styles = {},
expEl = getElById(this.expansionContainerId),
insertExpansionTo = this.insertExpansionTo,
left = Math.round(obj.baseBox.left),
top = Math.round(obj.baseBox.top),
right = Math.round(obj.baseBox.right),
bottom = Math.round(obj.baseBox.bottom),
expLeftOffset = parseInt('-130'),
expTopOffset = parseInt('100'),
startTimeOut = 100, endTimeOut = 100;
obj.browserPrefix = getBrowserPrefix(this.browserName);
obj.width = this.expansionWidth + "px";
obj.height = this.expansionHeight + "px";
var offLeft = "";
if(insertExpansionTo != "adUnitContainer"){
offLeft = parseInt(left) + parseInt(this.baseWidth);
obj.offsetLeft = offLeft - expLeftOffset + 'px';
obj.offsetTop = top + expTopOffset + 'px';
}else{
offLeft = parseInt(this.baseWidth)
obj.offsetLeft = offLeft - expLeftOffset + 'px';
obj.offsetTop = expTopOffset + 'px';
}
styles = createStyleObject(obj);
addStyles(expEl, styles);
if(offLeft != ""){
var newLeft = offLeft - expLeftOffset - parseInt(obj.width);
expEl.style.left = newLeft + "px";
}
if(obj.expansionOpen){
setTimeout(function() {
expEl.style.height = obj.height;
},startTimeOut);
}else{
}
},
/* Expansion code starts */
renderExpansionBg:function(){
var str = "";
var expansionContainerEl = getElById(this.expansionContainerId);
var expansionBgElement = null;
switch(this.expansionBgType){
case "image":
str = this.getExpansionBgImage();
break;
default:
break;
}
expansionBgEl = toElement(str);
expansionContainerEl.appendChild(expansionBgEl);
},
getExpansionBgImage:function(){
var obj = {};
obj.id = this.expansionBgId;
obj.src = this.expansionBgURL;
obj.width = this.expansionWidth;
obj.height = this.expansionHeight;
return createImg(obj);
},
renderExpansion:function(mobileVP){
var eNode = getElById(this.expansionId);
if(eNode != null) {
if(mobileVP) {
var winDim = getBrowserWindowProps();
//Re-style expansion container
var eContainerNode = getElById(this.expansionContainerId);
if(eContainerNode != null) {
//Reset width and height for expansion container
eContainerNode.style.width = winDim[0]+'px';
eContainerNode.style.height = winDim[1]+'px';
}
//Re-render expansion node in expansionType hybrid (!'C' and !'I')
var e2Node = getElById(this.expansion2Id);
var eIframeNode = (eNode.nodeName.toLowerCase() == "iframe") ? eNode : e2Node;
var eImgNode = (eNode.nodeName.toLowerCase() == "img") ? eNode : e2Node;
if(this.expansionHasLayout == 1 && eIframeNode != null) {
eIframeNode.style.display = 'block';
if(eImgNode != null) {
eImgNode.style.display = 'none';
}
eIframeNode.width = this.expansionWidth;
eIframeNode.height = this.expansionHeight;
//Reposition expansion div
// var mt = (winDim[1] - this.expansionHeight)/2 + 'px',
// ml = (winDim[0] - this.expansionWidth)/2 + 'px';
// // eIframeNode.style.margin = mt + ' 0 0 ' + ml;
//Post a message to layout renderer
/*Smooth responsive and stretch variables*/
postHtml5Message(eIframeNode, 'reRenderLayout');
if(eIframeNode.src == 'about:blank'){
eIframeNode.src = this.expansionURL;
}
return;
} else if(this.expansionHasLayout != 1 && eImgNode != null) {
eImgNode.style.display = 'block';
if(eIframeNode != null) {
eIframeNode.style.display = 'none';
//Layout renderer should pause all the activities like video
postHtml5Message(eIframeNode, 'pauseInteraction');
}
eImgNode.width = this.expansionWidth;
eImgNode.height = this.expansionHeight;
//Reposition expansion div
//Center align expansion node if expansion is an image no layout,
//If expansion has layout then layout_renderer takes care of alignment
var mt = (winDim[1] - this.expansionHeight)/2 + 'px',
ml = (winDim[0] - this.expansionWidth)/2 + 'px';
eImgNode.style.margin = mt + ' 0 0 ' + ml;
//Process image based expansion
eImgNode.src = this.expansionURL;
return;
} else {
var origExpansionId = this.expansionId;
this.expansionId = this.expansion2Id;
}
} else {
var eNodeSrc = eNode.src,
loaderEl = getElById(this.expansionLoaderId);
if(eNodeSrc == 'about:blank'){
eNodeSrc = this.expansionURL;
}
if(this.userInitAction && (eNodeSrc.indexOf('&userInitAction=1') == -1)){
// add this param so that expansion layout knows it got opened manualy and not an auto-expansion
if(loaderEl){
loaderEl.style.display = 'block'; // making loader visible when re-loading.
}
eNode.src = eNodeSrc + "&userInitAction=1";
}
return;
}
}
var expansionType = this.expansionType;
var that = this;
var str = "";
switch(expansionType){
case "image":
str = this.getExpansionImage();
break;
case "flash":
str = this.getExpansionFlash();
break;
case "html":
str = this.getExpansionHTML();
break;
default:
break;
}
if(!str) return false;
var expansionContainerNode = getElById(this.expansionContainerId);
var expansionNode = toElement(str);
expansionContainerNode.appendChild(expansionNode);
addEvent(getElById(this.expansionId), "load", function(event){ that.onLoadEventHandler(event); }, false);
if(this.expansionId == this.expansion2Id) {
//Reset expansionId to original value
this.expansionId = origExpansionId;
//Set style for eNode
var eNode = getElById(this.expansionId);
//eNode.style.position = 'absolute';
eNode.style.display = 'none';
if(eNode.nodeName.toLowerCase() == "iframe") {
//Layout renderer should pause all the activities like video
postHtml5Message(eNode, 'pauseInteraction');
}
//Set style for base2Node
var e2Node = getElById(this.expansion2Id);
//e2Node.style.position = 'absolute';
e2Node.style.display = 'block';
//Reposition expansion div
// var mt = (winDim[1] - this.expansionHeight)/2 + 'px',
// ml = (winDim[0] - this.expansionWidth)/2 + 'px';
// e2Node.style.margin = mt + ' 0 0 ' + ml;
//Add load event handler
addEvent(e2Node, "load", function(event){ that.onLoadEventHandler(event); }, false);
}
//Center align expansion node if expansion is an image no layout,
//If expansion has layout then layout_renderer takes care of alignment
if(mobileVP && expansionType == "image") {
var winDim = getBrowserWindowProps();
var eNode = getElById(this.expansionId);
var mt = (winDim[1] - this.expansionHeight)/2 + 'px',
ml = (winDim[0] - this.expansionWidth)/2 + 'px';
eNode.style.margin = mt + ' 0 0 ' + ml;
}
},
getExpansionImage:function(){
var obj = {};
obj.id = this.expansionId;
obj.src = this.expansionURL;
obj.width = this.expansionWidth;
obj.height = this.expansionHeight;
return createImg(obj);
},
getExpansionFlash:function(){
if(!hasFlashPlugin){
return this.getExpansionFallback();
}
var obj = {};
obj.id = this.expansionId;
obj.src = this.expansionURL;
obj.width = this.expansionWidth;
obj.height = this.expansionHeight;
obj.params = {'movie' : this.expansionURL,
'wmode' : 'transparent',
'allowScriptAccess' : 'always',
'flashvars' : "objectName=jvx_55ef9ac89bab4&campaignId=73481&siteId=04feae5c84eab9&adUnitType=14&es_pId_BKfhUx&&eventReportingURL=http://evs.jivox.com/jivox/serverAPIs/saveImpression.php&eventId=1000&clickTag=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253Dhttp%253A%252F%252Fwww8.hp.com%252Fsg%252Fen%252Fbusiness-solutions%252Fsmb%252Findex.html"
};
return createSWF(obj);
},
getExpansionHTML:function(){
var obj = {};
obj.id = this.expansionId;
obj.src = this.expansionURL;
if(this.userInitAction && parseInt(this.expansionHasLayout)){
// add this param so that expansion layout knows it got opened manualy and not an auto-expansion
obj.src += "&userInitAction=1";
}
obj.width = this.expansionWidth;
obj.height = this.expansionHeight;
return createIframe(obj);
},
getExpansionFallback:function(){
var fallbackType = this.expansionFallbackType;
var str = "";
switch(fallbackType){
case "image":
str = this.getExpansionFallbackImage();
break;
case "widget":
str = this.getExpansionFallbackWidget();
break;
case "swiffy":
case "html5":
str = this.getExpansionFallbackHTML();
break;
default:
break;
}
return str;
},
getExpansionFallbackImage:function(){
var obj = {};
obj.id = this.expansionId;
obj.src = this.expansionFallbackURL;
obj.width = this.expansionWidth;
obj.height = this.expansionHeight;
return createImg(obj);
},
getExpansionFallbackWidget:function(){
var obj = {};
obj.id = this.expansionId;
obj.src = this.expansionFallbackWidgetSrc;
obj.width = this.expansionWidth;
obj.height = this.expansionHeight;
return createFIF(obj);
},
getExpansionFallbackHTML:function(){
var obj = {};
obj.id = this.expansionId;
obj.src = this.expansionFallbackURL;
obj.width = this.expansionWidth;
obj.height = this.expansionHeight;
return createIframe(obj);
},
openClickThrough:function(){
window.open('https://adclick.g.doubleclick.net/aclk%3Fsa%3DL%26ai%3DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%26num%3D0%26cid%3D5GhD8p8f9yyJCrMWkV4WHiw9%26sig%3DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%26client%3Dca-pub-1728288586014899%26adurl%3Dhttp%3A%2F%2Fwww8.hp.com%2Fsg%2Fen%2Fbusiness-solutions%2Fsmb%2Findex.html');
this.recordEvent(1);
},
openExpansion:function(autoExpand, skipOpenEvent){
if(!jvx_55ef9ac89bab4CanExpandFromFrame){
return;
}
if(!this.expansionHasOpened){
if(jvx_55ef9ac89bab4SafeFrameSupported)
renderAdInsideSafeFrame();
this.expansionOpen = true;
this.userInitAction = autoExpand ? false : true;
if(!autoExpand && !skipOpenEvent){
this.recordEvent(37);
}
var obj = {};
obj.baseBox = getOffset(getElById(this.adUnitContainerId));
obj.animationDirection = "SlideBottom";
obj.animationSpeed = this.expAnimSpeed;
obj.expansionOpen = this.expansionOpen;
if(this.behaviourId != "" || this.behaviourId != "undefined")
obj.transitionType = parseInt(this.behaviourId); // hard code the value for testing
if(this.expansionOpen && !getElById(this.expansionLoaderId)){
this.renderLoader();
}
var expRendered = this.renderExpansion();
if(expRendered != false){
if(!this.expInterceptorDomRef){
}else{
this.expInterceptorDomRef.style.display = 'block';
}
this.expansionHasOpened = true;
if(this.expansionHasLayout == 1) {
postHtml5Message(getElById(this.expansionId),'openExpansion');
}
this.animate(obj);
}
}
},
closeExpansion:function(autoClose, skipCloseEvent){ // Only animation applied to hide, expUnit is not deleted
var that = this;
if(this.expansionHasOpened){
if(!autoClose && !skipCloseEvent){
this.recordEvent(47);
}
this.expansionOpen = false;
if(!autoClose){
if(this.autoExpandTimerRef != null){
clearTimeout(that.autoExpandTimerRef);
}
}
if(this.expansionHasLayout == 1) {
postHtml5Message(getElById(this.expansionId),'closeExpansion');
}
var obj = {};
obj.transitionType = parseInt(this.behaviourId); // hard code the value for testing
obj.animationDirection = "SlideBottom";
obj.animationSpeed = this.expAnimSpeed;
obj.baseBox = getOffset(getElById(this.adUnitContainerId));
obj.expansionOpen = this.expansionOpen;
if(this.expInterceptorDomRef){ // hide expansion interceptor if exists.
this.expInterceptorDomRef.style.display = 'none';
}
this.animate(obj);
}
},
loadExpansion:function(){
},
/* Expansion code ends */
onBaseMouseOver:function(){
},
onBaseMouseOut:function(){
},
onAdUnitMouseOut:function(){
var that = this;
clearTimeout(that.UIRTimer);
if(!this.DwellRecorded){
this.recordDwellEvent(49, this.DwellElapsedTime);
}
},
recordEvent:function(eventId,addnlParams){
var rand = Math.random();
var imgEl = document.createElement("img");
var esParams = "es_pId_BKfhUx";
var eventReportingURL = "http://evs.jivox.com/trk" + "/" + eventId + "/" + "73481/04feae5c84eab9/14/jvxSId_1441766272.2248";
eventReportingURL = esParams ? (eventReportingURL + "/" + esParams) : eventReportingURL;
eventReportingURL = addnlParams ? (eventReportingURL + "/" + addnlParams) : eventReportingURL;
eventReportingURL = eventReportingURL + "/jvxRandom_" + rand;
//eventReportingURL = (eventId == 1) ? (eventReportingURL + ";https://adclick.g.doubleclick.net/aclk%3Fsa%3DL%26ai%3DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%26num%3D0%26cid%3D5GhD8p8f9yyJCrMWkV4WHiw9%26sig%3DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%26client%3Dca-pub-1728288586014899%26adurl%3Dhttp%3A%2F%2Fwww8.hp.com%2Fsg%2Fen%2Fbusiness-solutions%2Fsmb%2Findex.html") : eventReportingURL;
imgEl.src = eventReportingURL;
},
recordUIREvent:function(eventId, elapsedTime){
if(this.UIRRecorded){
return;
}
this.recordEvent(eventId, elapsedTime);
this.UIRRecorded = true;
},
recordDwellEvent:function(eventId, elapsedTime){
var that = this;
if(this.DwellRecorded){
return;
}
clearTimeout(that.DwellTimer);
if(elapsedTime > 0){
var eventRecordParams = "es_et_" + elapsedTime;
this.recordEvent(eventId, eventRecordParams);
}
clearInterval(this.DwellElapsedTimer);
this.DwellElapsedTimer = null;
this.DwellElapsedTime = 0;
this.DwellRecorded = true;
this.DwellTimer = null;
},
renderAdUnitContainer:function(){
var cNode = createDivNode(this.adUnitContainerId);
var cords = [0,0];
var iBusterFrameInfo = this.getIBusterFrameInfo();
if(iBusterFrameInfo){
this.iBusterFrameCords = iBusterFrameInfo[0];
this.iBusterFrame = iBusterFrameInfo[1];
}
if(this.iBusterFrame != null){
var adFrame = this.iBusterFrame;
adFrame.style.height = "0px";
}
var pNode = null;
pNode = adFrame.parentNode;
cNode.style.position = "relative";
cNode.style.margin = "0 auto";
cNode.style.width = this.baseWidth + "px";
cNode.style.height = this.baseHeight + "px";
prependNode(cNode, pNode);
/* bgSkinUnit - align adUnit center portion in viewport */
},
getInsertToNode:function(insertTo){
var pNode = null;
insertTo = (insertTo == 'adUnitContainer') ? this.adUnitContainerId : insertTo;
if(insertTo == 'body'){
pNode = document.body;
}
else {
pNode = getElById(insertTo); // get the node by id
if(!pNode){
pNode = document.querySelector(insertTo);
}
if(!pNode){
if(getElByClass(insertTo))
pNode = getElByClass(insertTo)[0]; // get the node by class
}
}
pNode = (pNode == null) ? document.body : pNode;
return pNode;
},
renderBaseContainer:function(){
var insertBaseTo = this.insertBaseTo;
var pNode = this.getInsertToNode(insertBaseTo); //parent node
var cNode = createDivNode(this.baseContainerId); //child node
cNode.style.backgroundColor = this.baseBgColor;
/*Smooth responsive and stretch variables*/
prependNode(cNode, pNode);
},
renderExpansionContainer:function(){
var insertExpansionTo = this.insertExpansionTo;
var pNode = this.getInsertToNode(insertExpansionTo); //parent node
var cNode = createDivNode(this.expansionContainerId); //child node
if(insertExpansionTo != "adUnitContainer" && (this.expansionType == "image" || this.expansionType == "flash"))
cNode.style.cursor = "pointer";
cNode.style.backgroundColor = this.expansionBgColor;
cNode.style.zIndex = 1999998;
if(this.insertExpansionAs == "fc"){
prependNode(cNode, pNode);
}else{
pNode.appendChild(cNode);
}
},
getClosestDim:function(unitArr, pWidth, pHeight){
// COM: Setting winWidth = adSlotWidth, when there are multiple ad units and bpType='as'
var winDim = getBrowserWindowProps();
var currentWinWidth = winDim[0],
currentWinHeight = winDim[1];
var leastDiff = 10000;
var leastWidthDiff = 10000;
var leastHeightDiff = 10000;
var bestFitBannerDim = '';
var diffArr = new Array();
var cdwObj,cdhObj = {};
var chkDiff = false;
var smallestDiff = -1;
var smallestWidth, smallestDim = null;
for(var auIndex in unitArr){
var currentObjKey = unitArr[auIndex]['dimension'],
specifiedWidthAvl = unitArr[auIndex].hasOwnProperty('specifiedWidth');
var assetWidthVal = (specifiedWidthAvl) ? parseInt(unitArr[auIndex]['specifiedWidth']) :
parseInt(currentObjKey.split('x')[0]);
var assetWidth = assetWidthVal;
var assetHeight = parseInt(currentObjKey.split('x')[1]);
if(assetWidth == currentWinWidth) {
leastDiff = 0;
bestFitBannerDim = currentObjKey;
break;
} else if(assetWidth < currentWinWidth && (currentWinWidth - assetWidth) < leastDiff) {
leastDiff = (currentWinWidth - assetWidth);
bestFitBannerDim = currentObjKey;
}
if(smallestWidth == null || assetWidth < smallestWidth) {
smallestWidth = assetWidth;
smallestDim = currentObjKey;
}
}
if(bestFitBannerDim == '' && smallestDim != null) {
bestFitBannerDim = smallestDim;
}
return bestFitBannerDim;
},
setBaseProperties:function(bestFitDim){
var bestFitBase = {};
for(var auIndex in this.responsiveBaseUnitArr) {
bestFitBase = this.responsiveBaseUnitArr[auIndex];
if(bestFitBase['dimension'] == bestFitDim)
break;
}
if(bestFitBase) {
this.baseHasLayout = bestFitBase['hasLayout'];
this.baseBgType = '';
this.baseBgURL = '';
this.baseBgColor = '';
if(this.baseHasLayout == 1) {
this.baseType = 'html';
this.baseURL = 'http://as.jivox.com/unit/layout_renderer.php?creativeUnitType=13&expandUnitType=13&bDim=728x90&eDim=980x609&bUnitId=1301&eUnitId=1300&siteId=04feae5c84eab9&campaignId=73481&es_pId=BKfhUx&ts_pId=BKfhUx&jvxVer=2&cMacro=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253D&r=198400552&objectName=jvx_55ef9ac89bab4&npl=1&busted=1&bustType=1&objectName=jvx_55ef9ac89bab4&clickTagURL=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253Dhttp%253A%252F%252Fwww8.hp.com%252Fsg%252Fen%252Fbusiness-solutions%252Fsmb%252Findex.html';
this.baseURL += '&jvxSessionId=1441766272.2248';
if(bestFitBase['type'] == 'banner') {
this.baseURL += '&base=1';
}
this.baseURL += '&loadLayout=0';
this.baseBgType = bestFitBase['backgroundType'];
this.baseBgURL = bestFitBase['url'];
} else {
this.baseType = bestFitBase['backgroundType'];
this.baseURL = bestFitBase['url'];
}
if(bestFitBase['backgroundColor'] != null && bestFitBase['backgroundColor'] != '') {
this.baseBgColor = bestFitBase['backgroundColor'];
} else {
this.baseBgColor = '';
}
this.baseFallbackType = bestFitBase['fallbackType'];
this.baseFallbackURL = bestFitBase['fallbackURL'];
this.baseFallbackFileName = bestFitBase['fallbackFileName'];
//Todo: replace special characters, make sure that widget source is syntactically correct
this.baseFallbackWidgetSrc = bestFitBase['fallbackWidgetSrc'];
this.baseWidth = bestFitDim.split('x')[0];
this.baseHeight = bestFitDim.split('x')[1];
/*Smooth responsive and stretch variables*/
}
},
setExpandProperties:function(bestFitDim){
//log("Mobile best fit Expand: "+bestFitDim);
var bestFitExpand = {};
for(var auIndex in this.mobileExpandUnitArr) {
bestFitExpand = this.mobileExpandUnitArr[auIndex];
if(bestFitExpand['dimension'] == bestFitDim)
break;
}
if(bestFitExpand) {
this.expansionHasLayout = bestFitExpand['hasLayout'];
this.expansionType = '';
this.expansionURL = '';
this.expansionBgType = '';
this.expansionBgURL = '';
this.expansionBgColor = '';
if(this.expansionHasLayout == 1) {
this.expansionType = 'html';
var adUnitIdStr = '';
this.expansionURL = 'http://as.jivox.com/unit/layout_renderer.php?creativeUnitType=13&expandUnitType=13&bDim=728x90&eDim=980x609&&eUnitId=1300&siteId=04feae5c84eab9&campaignId=73481&es_pId=BKfhUx&ts_pId=BKfhUx&jvxVer=2&cMacro=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253D&r=198400552&objectName=jvx_55ef9ac89bab4&npl=1&busted=1&bustType=1&objectName=jvx_55ef9ac89bab4&clickTagURL=https%3A%2F%2Fadclick.g.doubleclick.net%2Faclk%253Fsa%253DL%2526ai%253DBtrcYwprvVd7fFNiOvgTRhISoCumBh8kHAAAAEAEgkam6HzgAWNH91fG4AmC_BbIBFHd3dy50ZWNocmVwdWJsaWMuY29tugEJZ2ZwX2ltYWdlyAEJ2gGaAWh0dHA6Ly93d3cudGVjaHJlcHVibGljLmNvbS9hcnRpY2xlL2FwcGxlLWZpZ2h0aW5nLXRoZS11cy1nb3Zlcm5tZW50LW9uLXR1cm5pbmctb3Zlci1lbmNyeXB0ZWQtaW1lc3NhZ2VzLz90YWc9bmwuZTAzNiZzX2NpZD1lMDM2JnR0YWc9ZTAzNiZmdGFnPVRSRWE5ODhmMWOYArXpA8ACAuACAOoCIC84MjY0L2FzaWEtdGVjaHJlcHVibGljL3NlY3VyaXR5-ALy0R6QA7AJmAPgA6gDAeAEAZAGAaAGFtgHAA%2526num%253D0%2526cid%253D5GhD8p8f9yyJCrMWkV4WHiw9%2526sig%253DAOD64_2jzAs1zGzvXLXADW7st_vBBYyb3w%2526client%253Dca-pub-1728288586014899%2526adurl%253Dhttp%253A%252F%252Fwww8.hp.com%252Fsg%252Fen%252Fbusiness-solutions%252Fsmb%252Findex.html'+adUnitIdStr;
this.expansionURL += '&jvxSessionId=1441766272.2248';
this.expansionBgType = bestFitExpand['backgroundType'];
this.expansionBgURL = bestFitExpand['url'];
} else {
this.expansionType = bestFitExpand['backgroundType'];
this.expansionURL = bestFitExpand['url'];
}
this.expansionBgColor = bestFitExpand['backgroundColor'];
if(this.expansionBgColor == '' || this.expansionBgColor == null) {
this.expansionBgColor = 'transparent';
}
this.expansionFallbackType = bestFitExpand['fallbackType'];
this.expansionFallbackURL = bestFitExpand['fallbackURL'];
this.expansionFallbackFileName = bestFitExpand['fallbackFileName'];
//Todo: replace special characters, make sure that widget source is syntactically correct
this.expansionFallbackWidgetSrc = bestFitExpand['fallbackWidgetSrc'];
this.expansionWidth = bestFitDim.split('x')[0];
this.expansionHeight = bestFitDim.split('x')[1];
}
},
onAdUnitMouseOver:function(e) {
var that = this;
this.DwellRecorded = false;
if(null == this.DwellElapsedTimer){
this.DwellElapsedTimer = setInterval(function(){ ++that.DwellElapsedTime; }, 1000);
}
if(null == this.DwellTimer){
var dwellTime = parseInt(60000) + 50; //adding 50ms to make sure setTimeOut is triggered after setInterval.
this.DwellTimer = setTimeout(function(){that.recordDwellEvent(49, that.DwellElapsedTime); },dwellTime);
}
if(!this.UIRRecorded){
this.UIRTimer = setTimeout(function(){that.recordUIREvent(48);},500);
}
},
clickHandler:function(eventSrc){
if(eventSrc){
var eventSrcId = eventSrc.id;
if(eventSrc.parentNode != null)
var parentId = eventSrc.parentNode.id;
if(eventSrcId == this.baseId || eventSrcId == this.base2Id){
this.openExpansion();
} else if(eventSrcId == this.baseBgId) {
} else if(eventSrcId == this.baseInterceptorId || eventSrcId == this.base2InterceptorId){
this.openExpansion();
} else if(eventSrcId == this.expansionId){
} else if(eventSrcId == this.expInterceptorId){
} else if(eventSrcId == this.closeExpansionId){
this.closeExpansion();
} else if(eventSrcId == this.baseCloseId) {
this.closeBase();
}
}
},
mouseoverHandler:function(eventSrc){
if(eventSrc){
var eventSrcId = eventSrc.id;
if(eventSrc.parentNode != null)
var parentId = eventSrc.parentNode.id;
if(eventSrcId == this.baseId || eventSrcId == this.base2Id || eventSrcId == this.baseInterceptorId){
if((this.lastHoverElemId != this.closeExpansionId && this.lastHoverElemId != this.expansionId) || jvx_55ef9ac89bab4SafeFrameSupported) { // doesn't check for lastHoverElemId on safeframe case, hover of document will not be fired in safeframe
this.onBaseMouseOver();
}
} else if(parentId != this.baseContainerId && parentId != this.countDownContainerId && eventSrcId != this.expansionId && eventSrcId != this.closeExpansionId){
if(!jvx_55ef9ac89bab4SafeFrameSupported){
this.onBaseMouseOut();
}
}
if(eventSrcId != this.expansionId && eventSrcId != this.closeExpansionId && eventSrcId != this.adUnitContainerId && eventSrcId != this.baseId && eventSrcId != this.base2Id && eventSrcId != this.countDownContainerId && eventSrcId != this.baseInterceptorId && eventSrcId != this.expInterceptorId && eventSrcId != this.expansionLoaderId && eventSrcId != this.expansionContainerId){
if(this.lastHoverElemId == this.baseId || this.lastHoverElemId == this.base2Id || this.lastHoverElemId == this.baseInterceptorId
|| this.lastHoverElemId == this.expInterceptorId || this.lastHoverElemId == this.expansionId
|| this.lastHoverElemId == this.closeExpansionId || this.lastHoverElemId == this.expansionLoaderId){
if((this.lastHoverElemId == this.baseId || this.lastHoverElemId == this.base2Id ) && eventSrcId == this.maskId){
var that = this;
clearTimeout(that.UIRTimer);
if(!this.DwellRecorded){
this.recordDwellEvent(49, this.DwellElapsedTime);
}
}else{
this.onAdUnitMouseOut();
}
}
} else {
this.onAdUnitMouseOver();
}
this.lastHoverElemId = eventSrcId;
}
},
mouseoutHandler:function(eventSrc){
if(eventSrc) {
var eventSrcId = eventSrc.id;
/* should work only when bustExpansionOnly and renderedInsideFrame and also in safeFrameSupport case */
if(eventSrcId == this.baseId || eventSrcId == this.baseInterceptorId || eventSrcId == this.expInterceptorId || eventSrcId == this.expansionId || eventSrcId == this.closeExpansionId || eventSrcId == this.countDownContainerId){
if(jvx_55ef9ac89bab4SafeFrameSupported){
this.onBaseMouseOut();
this.onAdUnitMouseOut();
}
}
/* End */
}
},
visibilityStateHandler:function(){
if(document.visibilityState == "hidden"){
// hasHidden = true;
}else{
if(!this.expansionOpen && this.expansionHasOpened){
/* explicit call to callback function when the visibility of the document changes on close expansion */
this.fnCallback();
}
}
},
onWindowResize:function(){
if(!jvx_55ef9ac89bab4SafeFrameSupported){
this.restyleExpansion();
}
},
eventController:function(event){
var eventSrc = event.target || event.srcElement;
var eventType = event.type;
if(eventType == 'click'){
this.clickHandler(eventSrc);
} else if(eventType == 'mouseover'){
this.mouseoverHandler(eventSrc);
} else if(eventType == 'mouseout'){
this.mouseoutHandler(eventSrc);
} else if(eventType == 'resize'){
this.onWindowResize();
} else if(eventType == 'orientationchange'){
this.onWindowResize();
} else if(eventType == 'visibilitychange'){
this.visibilityStateHandler();
}
},
delegateEvents:function(){
var that = this;
addEvent(document, "click", function(event){ that.eventController(event); }, false);
addEvent(document, "mouseover", function(event){ that.eventController(event); }, false);
addEvent(document, "mouseout", function(event){ that.eventController(event); }, false);
addEvent(window, "resize", function(event){ that.eventController(event); }, false);
addEvent(window, "orientationchange", function(event){ that.eventController(event); }, false);
var browserName = this.browserName;
if((browserName == 'Safari') || (browserName == 'iPhone') || (browserName == 'iPod') || (browserName == 'iPad')){
addEvent(document, "visibilitychange", function(event) { that.eventController(event); }, false);
}
},
getElById:function(id){
return getElById(id);
},
createDivNode:function(id){
return createDivNode(id);
},
appendNode:function(parentNode, childNode){
return parentNode.appendChild(childNode);
},
addEvent:function(el, event, fn, capture){
return addEvent(el, event, fn, capture);
},
init:function(){
this.renderAdUnitContainer();
this.renderBaseContainer();
this.renderBaseBg();
var that = this;
setTimeout(function(){
that.renderBase();
}, '3000');
/*
*/
// console.log("Load exp");
this.renderExpansionContainer();
var expEl = getElById(this.expansionContainerId);
addEvent(expEl, "transitionend", this.fnCallback, false);
this.delegateEvents();
var that = this,
clearUnitTimer = setInterval(function(){
var iBusterFrameInfo = that.getIBusterFrameInfo();
if(!iBusterFrameInfo){
clearInterval(clearUnitTimer);
var adUnitNode = getElById(that.adUnitContainerId),
adUnitPNode = (adUnitNode) ? adUnitNode.parentNode : "";
if(adUnitPNode) clearNode(adUnitPNode, that.adUnitContainerId);
if(that.insertExpansionTo != "adUnitContainer"){
var expNode = getElById(that.expansionContainerId),
expPNode = (expNode) ? expNode.parentNode : "";
if(expNode) clearNode(expPNode, that.expansionContainerId);
}
}
}, 1000);
}
};
return CreativeUnit;
})();
var jvx_55ef9ac89bab4 = new CreativeUnit("_55ef9ac89bab4");
jvx_55ef9ac89bab4.recordEvent(60); //creative load event
jvx_55ef9ac89bab4.init();
/*! srcdoc-polyfill - v0.1.1 - 2013-03-01
* http://github.com/jugglinmike/srcdoc-polyfill/
* Copyright (c) 2013 Mike Pennisi; Licensed MIT */
(function(t,e){var c,n,o=t.srcDoc,r=!!("srcdoc"in e.createElement("iframe")),i={compliant:function(t,e){e&&t.setAttribute("srcdoc",e)},legacy:function(t,e){var c;t&&t.getAttribute&&(e?t.setAttribute("srcdoc",e):e=t.getAttribute("srcdoc"),e&&(c="javascript: window.frameElement.getAttribute('srcdoc');",t.setAttribute("src",c),t.contentWindow&&(t.contentWindow.location=c)))}},s=t.srcDoc={set:i.compliant,noConflict:function(){return t.srcDoc=o,s}};if(!r)for(s.set=i.legacy,n=e.getElementsByTagName("iframe"),c=n.length;c--;)s.set(n[c])})(this,this.document);
} //for loop ends
/* Jivox © 2015 */