/*
* Copyright (C) 2007 Trivantis Corporation
*/
var theApp=new webtoraAppl();var is=theApp.is;var trivDebug=0;var trivAddMsgFunc=null;var trivDebugWnd='';var trivSaveMsg='';var trivWeb20Popups=false;var DEFAULT_VIEW='Desktop';var transformScale=1;function freeMemory(A){A=(A||'ie,edge,ios').toLowerCase();if ((theApp.is.ie&&A.indexOf('ie')!=-1)||(theApp.is.ieEdge&&A.indexOf('edge')!=-1)||(theApp.is.iOS&&A.indexOf('ios')!=-1)) (getPagePlayer()||{}).bForceReload=t;};function createInitClickDiv(A,B){var C=document.createElement('div');var D=C.style;C.setAttribute('id',"initClickDiv");D.position='absolute';D.backgroundColor='rgb(77, 77, 77)';D.opacity='.9';D.width='100%';D.height='100%';D.top='0px';D.left='0px';D.textAlign='center';D.zIndex=999999;C.onclick=function(){if (!B) jsOpaUtils.createPooledMedia();triv$('#initClickDiv').remove();if (A) A();};var E=document.createElement('span');D=E.style;E.innerHTML=trivstrBGNCR;D.color='white';D.position='relative';D.top='40%';D.fontSize='36pt';C.appendChild(E);document.body.appendChild(C);};function enableAutoStart(A){if(bAutoStartOnPage&&typeof(AudioContext)!="undefined"&&is.chrome){var B=new AudioContext();if(B.state!="running") createInitClickDiv(A,t);else A();}else A();};function trivLogMsg(A,B){if ((!trivDebug)||(B&&!(trivDebug&B))) return;var C=findTrivLogMsg(window,true);if (C.trivDebug){if (A){if (C.trivSaveMsg.length) C.trivSaveMsg+='
';C.trivSaveMsg+=A;};if (!C.trivDebugWnd&&C.opening==1) setTimeout("trivLogMsg()",200);else if (!C.trivDebugWnd||C.trivDebugWnd.closed||!C.trivDebugWnd.location){C.opening=1;C.trivDebugWnd=C.open('trivantisdebug.html','TrivantisDebug','width=400,height=400,scrollbars=0,resizable=1,menubar=0,toolbar=0,location=0,status=0');setTimeout("trivLogMsg()",200);}else{if (C.trivAddMsgFunc){A=C.trivSaveMsg;C.trivSaveMsg='';C.trivAddMsgFunc(A);}}}};function findTrivLogMsg(A,B){if (B&&A.opener&&(!A.parent.SCOPreviewWnd)&&(!A.opener.rbnPubl)&&A.opener.trivLogMsg) return findTrivLogMsg(A.opener,false);var C=A;while (A&&A.parent&&A.parent!=A){try{if (A.parent.document&&!A.parent.SCOPreviewWnd&&!A.parent.rbnPubl&&A.parent.trivLogMsg) C=A.parent;} catch (e){};A=A.parent;};return C;};var winW=screen.width;var winH=screen.height;function findWH(A){var B=A?0:(is.ns?16:20);winW=(is.ns)?getDisplayWindow().innerWidth-B:getDisplayDocument().body.offsetWidth-B;winH=(is.ns)?getDisplayWindow().innerHeight:getDisplayDocument().body.offsetHeight;};function ObjLayer(A,B,C){var D=this;if (!ObjLayer.bInit&&!C) InitObjLayers();D.frame=C||self;if (is.ie10orLess){D.ele=D.event=D.frame.document.all[A];D.styObj=D.frame.document.all[A].style;D.doc=document;D.x=D.ele.offsetLeft;D.y=D.ele.offsetTop;D.w=D.ele.offsetWidth;D.h=D.ele.offsetHeight;}else{D.ele=D.event=document.getElementById(A);D.styObj=D.ele.style;D.doc=document;D.x=D.ele.offsetLeft;D.y=D.ele.offsetTop;D.w=D.ele.offsetWidth;D.h=D.ele.offsetHeight;};D.id=A;D.unique=1;D.pref=B;D.hasMoved=false;D.newX=null;D.newY=null;};ObjLayer.arrPref=[];ObjLayer.arrRef=[];ObjLayer.arrRef.i=0;ObjLayer.bInit=false;var p=ObjLayer.prototype;p.actionGoTo=ObjLayerActionGoTo;p.actionGoToNewWindow=ObjLayerActionGoToNewWindow;function ObjLayerActionGoTo(A,B,C,D){try{var E=null;var F=D!=null?D:true;if (B){if (B=="opener") E=parent.opener;else if (B=="_top") E=eval("parent");else if (B=="NewWindow") E=open(A,'NewWindow');else if (B=="OPATop"&&isOPAPub()) E=getDisplayWindow();else{var G=eval("parent");var H=0;while (H0) ObjLayer.arrRef[ObjLayer.arrRef.length]=(A==='')?C.layers[i].name:A+'.document.'+C.layers[i].name;}};if (ObjLayer.arrRef.i=4&&D!==null) K+=' width:'+D+'px;';if (J>=5&&E!==null){K+=' height:'+E+'px;';if (J<9||I.indexOf('clip')==-1) K+=' clip:rect(0px '+D+'px '+E+'px 0px);';};if (J>=6&&F!==null) K+=' visibility:'+(F?'inherit':'hidden')+';';if (J>=7&&G!==null) K+=' z-index:'+G+';';if (J>=8&&H!==null) K+=' background:'+H+';';if (J==9&&I!==null) K+=' '+I;K+='}\n';return K;};function writeStyleSheets(A){var B='';document.write(B);};function getHTTP(A,B,C){var D=0,E=0;if (B=='GET'&&C){A+='?'+C;C=null;};trivLogMsg('Issuing '+B+' to '+A+(C?(' for ['+C+']'):''));if (!E&&A.indexOf("http")==0&&(A.indexOf(location.protocol)<0||A.indexOf(location.host)<0)){try{var F=document.getElementsByTagName("body").item(0);var G=document.getElementById("xdomainIframe");if (!G){G=document.createElement("iframe");G.setAttribute("name","xdomainIframe");G.setAttribute("id","xdomainIframe");G.style.display="none";G.style.width="0px";G.style.height="0px";F.appendChild(G);};var H=document.getElementById("xdomainForm");if (!H){H=document.createElement("form");H.setAttribute("id","xdomainForm");H.setAttribute("method",B);H.setAttribute("target","xdomainIframe");G.appendChild(H);};if (C){H.innerHTML='';var I=C.split('&');for (var i=0;iD.offsetHeight?getDisplayWindow().frameElement.parentNode:window.top;E.onscroll=function(e) { return A.iosScroll(e);};}};A.currMouseObj=0;A.arDelayAct=[];A.arTransInWnds=[];A.arTransOutWnds=[];var F=function(){if (!isOPAPub()) myTop.onresize=window.onResizeOrig;};if (theApp.is.ie10orLess){window.attachEvent('onbeforeunload',function() { F();});window.attachEvent('onunload',function() { F();});}else{window.addEventListener('unload',function() { F();},t);}};p.getDisplayPageDiv=function(){return this.div;};p.rcdGetAttData=function(){var A=rcdObj.rcdData['att_'+rcdObj.view];if (A==u) A=rcdObj.rcdData['att_'+DEFAULT_VIEW];return A;};p.hasPageTrans=function(){return!!this.rcdGetAttData().transId;};p.doPageTrans=function(A,B,C){var D=this;if (D.hasPageTrans()){var E=isOPAPub()?getPagePlayer().getCurrentPage().div:D.div;var F=D.rcdGetAttData();if (F.transId==35){E.style.opacity=0;D.anchorFrontDiv.style.opacity=0;var G=F.transDur*400;FX.fadeIn(E,D.anchorFrontDiv,{ duration:G,complete:function() { C();} });}else{var H=F.transId;if(H==32||H==33) H=jsTrans.xlateTrans(H,n,t);doDivTrans(f,D.anchorFrontDiv,H,F.transDur,function() { },n,n,n,n,-1,A,(B?B.div:n));doDivTrans(f,E,H,F.transDur,function() { C();},n,n,n,n,-1,A,(B?B.div:n));}}};p.processMouseAct=function(e,A){if (!e) e=window.event;var B=(e.target?e.target:e.srcElement?e.srcElement:null);var C=this.getDivObj(B);var D=t;switch (A){case 1:if (C&&(!(C instanceof jsWndTextButton)||(C instanceof jsWndTextButton&&e.which!=32))) D=C.mouseDown(e);else if (typeof (pageClick)=='function') D=pageClick(e);break;case 2:this.setCurrMouseObj(C);if (C) D=C.mouseMove(e);break;case 3:if (C) D=C.mouseUp(e);this.resetMenus(C);break;case 4:if (C&&C.mouseDblClk) D=C.mouseDblClk(e);break;case 5:if (C&&C.contextMenu) D=C.contextMenu(e);else if (typeof (pageRClick)=='function'){pageRClick(e);return cancelEvent(e);};break;};return D;};p.resetMenus=function(A){for (var i=0,B=arWnds.length;i0)){createInitClickDiv(function(){cont();});}else cont();};function opaOnUnload(){myTop.onresize=window.onResizeOrig;};function opaOnResize(){var A=pagePlayer&&pagePlayer.activePage&&pagePlayer.activePage.iframe&&pagePlayer.activePage.iframe.contentWindow.onresize;if (A) A();if (window.onResizeOrig&&typeof onResizeOrig=='function') window.onResizeOrig();};function onPageLoad(){enableAutoStart(function() {if (!isOPAPub()){if (myTop!=window){window.onResizeOrig=myTop.onresize;myTop.onresize=onResize;}};trivPage=new wndPagePublished();if (window.init_pageTracking) init_pageTracking();setRcdView(t);if (trivPage.hasPageTrans()&&!isOPAPub()){trivPage.doPageTrans(n,n,function(){updateAnchorDiv();});}else updateAnchorDiv();bPageLoaded=t;});};function onResize(){if (!document.body) return;setRcdView(f);if (window.onResizeOrig&&typeof onResizeOrig=='function') window.onResizeOrig();};function setRcdView(A){function getViewFromRL(){var B=n;try{if (M.parent) B=M.parent._respView||(getTitleMgrHandle()&&M.parent&&M.parent.parent?M.parent.parent._respView:n);}catch(e) {};return B;};var C=f,D=f,E=f,F=f,G=rcdObj.view,H=rcdObj.deviceView,I=n,J=f,K=n,L=n,M=getDisplayWindow(),N=getViewFromRL();I='Desktop';if (isMobile.any()) I=getDevice()+getOrientation();else if (N||!window.bSingleScrubView){var O=window.pgWidth_desktop?window.pgWidth_desktop:1009,P=window.pgWidth_tabletPort?window.pgWidth_tabletPort:785,Q=window.pgWidth_phonePort?window.pgWidth_phonePort:480,R=getScreenHeight()=O||(w=1009) I='TabletLandscape';else if (w>=P) I=getOrientation()=='Landscape'?'PhoneLandscape':'TabletPortrait';else I='PhonePortrait';};if (wB.innerHeight){waitForRender(function() {window.scrollTo(D.left,D.top);trivPage.div.scrollTop=0;trivPage.div.scrollLeft=0;if (A) A();});}};function getFillBrowserScale(){var A=getCurrentPageDiv();var B=getDisplayWindow();triv$(A).show();var C=triv$(A).width();var D=triv$(A).height();findWH(t);var E=triv$(B).height();var F=triv$(B).width();if (isMobile.any()&&is.iOS){var G=getOrientation()=='Landscape',H=B.screen.height,I=B.screen.width;E=G?I:H;F=G?H:I;};var J=(E>1?E-1:winH>0?winH:100);var K=(F>0?F:winW>0?winW:100);var L=K/C;var M=J/D;if (window.bFitWidth){var N=D*L;if (JC.offsetHeight?getDisplayWindow().frameElement.parentNode:window.top;var E=C.nodeName=="DIV"&&C.scrollHeight>C.offsetHeight?D.scrollTop:D.scrollY;E/=A;var F=getDisplayWindow().top.innerHeight;var G=getAncestorIframe(getDisplayWindow());if(G){if(G.style.height) F=parseInt(G.style.height);else if (G.id=='course-iframe'&&G.parentElement.parentElement.tagName=='ION-CONTENT'){var H=parseInt(G.parentElement.style.marginTop);if (H>0) F-=H;}};trivPage.anchorFrontDiv.style.top=(E)+'px';trivArExec (arWnds,function(J){if (J.dwFlags&0x100000&&J.dwFlags&0x1000){var I=J.rcdGetAttData().objData.a[3][1];J.rtRect.y=(F-((B-I)*A))/A;J.div.style.top=J.rtRect.y+'px';}});};function updateAnchorDiv(){var A=(trivPage&&trivPage.div?trivPage.div.style:n);if (A&&trivPage.anchorFrontDiv){var B=trivPage.anchorFrontDiv.style;B.cssText=A.cssText;B.position='fixed';B.backgroundImage='';B.backgroundColor='';B.backgroundSize='';B.pointerEvents='none';B.overflow='';if (isOPAPub()&&is.iOS&&isInIframe()){if (trivPage.anchorFrontDiv.parentNode!=trivPage.div){triv$(trivPage.anchorFrontDiv).remove();triv$(trivPage.anchorFrontDiv).appendTo(trivPage.div);};B.position='absolute';B.transform='';B.width='';B.height='';var C=getAncestorIframe(getDisplayWindow()).parentElement;var D=C.scrollTop;C.scrollTop=1;C.scrollTop=D;}else if (theApp.is.ie10orLess&&trivPage.anchorFrontDiv.parentNode.tagName.toLowerCase()!='svg'){triv$(trivPage.anchorFrontDiv).wrap('');};if (!B.zIndex||B.zIndex<9000) B.zIndex=9000;}};function updateDivs(){if (window.rcdObj){var A=trivPage.div.style;var B=rcdObj['pgStyle_'+rcdObj.view];if (B){A.cssText=B;updateAnchorDiv();if (isLOPopup()||!isSPPCapable()) A.visibility='';};var C=rcdObj['backgrd_'+rcdObj.view];var D=getDisplayDocument();if (C&&D.body.style.backgroundColor!=C[0]) D.body.style.backgroundColor=C[0];if (C&&A.backgroundImage!=C[1]) A.backgroundImage=C[1];if (C) A.backgroundSize=""+Math.round(Number(C[4])*Number(C[2]))+"px "+Math.round(Number(C[4])*Number(C[3]))+"px";};if (arWnds) for (var i=0;imyTop.innerWidth?"Portrait":"Landscape";};function getDevice(){return isMobile.anyPhone()?"Phone":isMobile.any()?"Tablet":"Desktop";};function loadIncFiles(A,B){window.bRespDesign=!!B;var C="device_##0/"+A+".js",D=getDevice(),E='TabletLandscape',F='TabletPortrait',G='PhoneLandscape',H='PhonePortrait';E=viewOverrideMap[E]||E;F=viewOverrideMap[F]||F;G=viewOverrideMap[G]||G;H=viewOverrideMap[H]||H;if (!B||['Desktop','Tablet','Phone'].indexOf(D)==-1) D='Desktop';if (D=='Desktop') addScriptToHead(getLocStr(C,D));if (B){if (D=='Desktop'||D=='Tablet'){addScriptToHead(getLocStr(C,E));addScriptToHead(getLocStr(C,F));};if (D=='Desktop'||D=='Phone'){addScriptToHead(getLocStr(C,G));addScriptToHead(getLocStr(C,H));}}};function trivCenter(A){if (window.bFillWindow) return;try{A=A||getFillBrowserScale();var B=theApp.is.mobile&&window.bFitMobile?A.scale:1;var C=trivPage.div.style;var D=getDisplayDocument();var E=getDisplayWindow().innerWidth;if (!E) E=D.documentElement.clientWidth?D.documentElement.clientWidth:D.body.clientWidth;if (parseInt(C.width)*B>=E){C.left='0px';C.marginLeft='';}else{C.left='50%';C.marginLeft='-'+(Math.round((parseInt(C.width)*B/2)))+'px';};updateAnchorDiv();} catch (e){if (window.console) console.log(e);}};function checkLeavePage(){if (trivPageExited) return;if (trivActFBCnt<=0){if (trivProcessTest&&(bDoProcessTest||trivGoToPage==null)){bDoProcessTest=false;processTest(1);}else if (trivExitPage.transOutDone&&trivExitPage.transOutDone()==false){setTimeout('checkLeavePage()',100);}else{trivLeavePage();};return;};setTimeout('checkLeavePage()',100);};function trivLeavePage(){trivCompleteCnt--;if (trivCompleteCnt<=0){if (window.saveVariable) saveVariable('TrivantisEPS','T');hasProcessedExitActions=f;eval(trivGoToPage);trivGoToPage=n;trivPageExited=t;setTimeout(function(){trivPageExited=f;hasProcessedExitActions=f;},750);}};function trivExitPage(A,B,C){trivExitPage.afterFeedBackCallback=null;if (A.indexOf("ObjLayerAction")>=0||A.indexOf(".action")>=0||A.indexOf("history.back()")>=0) trivGoToPage=A;else trivGoToPage='ObjLayerActionGoTo("'+A+'"'+(C?',"OPATop"':'')+')';if (!hasProcessedExitActions){findWH();if (trivCheckQuestions(A,B)=="return") return;hasProcessedExitActions=true;if (trivExitPage.trivExitPageItemExits) trivExitPage.trivExitPageItemExits();setTimeout('checkLeavePage()',100);}};function setExitPgAfterFeedbackCB(A,B){trivExitPage.afterFeedBackCallback=function(){trivActFBCnt--;if (A) trivExitPage(A,B);else setTimeout('checkLeavePage()',0);};};function loadApiScript(A,B){if(window.location.protocol=="file:") return;var C,D,E='script',F=window.getDisplayDocument?getDisplayDocument():document,G=F.getElementsByTagName(E)[0];switch (A){case 'ALLINONE':D='http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f4809142ed80608';id='triv-allinone';break;case 'FB':D='//connect.facebook.net/en_US/all.js#xfbml=1';id='facebook-jssdk';break;case 'TWITTER':D='//platform.twitter.com/widgets.js';id='twitter-wjs';break;case 'PLUSONE':D='https://apis.google.com/js/plusone.js';id='triv-plusone';break;};if(!F.getElementById(id)){C=F.createElement(E);C.id=id;if (B) C.onload=B;C.src=D;G.parentNode.insertBefore(C,G);}};function trivCheckQuestions(A,B){if (window.arQuest){if (window.answerAllQuestions&&B){for (var i=0;i0&&A!='~~~null~~~'){var B=A.split('#');if (B&&B.length>1){var C=B[0].split(',');var D=B[1].split('');var E=4;for (var i=0;i0){var C=B.shift();if (typeof (C.c)!='undefined') B=C.c.concat(B);A(C,i,B);i++;}};PageTrackingObj.prototype.savePageTracking=function(){var A='';var B=[];var C=[];this.IterateTree(function(G,i,H){if (G.v!=0){B.push(G.id);C.push(G.v);}});for (var i=0;i");else triv$('