/*
* 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=getDisplayDocument();var D=C.createElement('div');var E=D.style;var F=function(){if (B) jsOpaUtils.createPooledMedia();else if (theApp.is.safari){var H=C.createElement("audio");H.setAttribute("src","nada.mp3");H.play();};triv$('#initClickDiv',C).remove();if (A) A();if(isMobile.any()&&!B) trivArExec(arAudioVideo,function(I){if (I instanceof jsWndVideo&&(I.dwFlags&0x20000)&&!I.bPlaying) I.play();});};D.setAttribute('id',"initClickDiv");E.position='absolute';E.backgroundColor='rgb(77, 77, 77)';E.opacity='.9';E.width='100%';E.height='100%';E.top='0px';E.left='0px';E.textAlign='center';E.zIndex=999999;D.onclick=F;var G=C.createElement('span');E=G.style;G.innerHTML=trivstrBGNCR;E.color='white';E.position='relative';E.top='40%';E.fontSize='36pt';D.appendChild(G);C.body.appendChild(D);};function enableAutoStart(A,B){if (!isOPAPub()||B){if (window.bAutoStartOnPage||(B&&((getDisplayWindow().pooledAudioCnt+getDisplayWindow().pooledVideoCnt)>0)&&isMobile.any())){if ((theApp.is.safari&&(parseInt(theApp.is.safariVer)>=11))||(theApp.is.ff&&parseInt(theApp.is.ffVer)>=66)||(theApp.is.chrome&&parseInt(theApp.is.chromeVer)>=64)||isMobile.any()){var C=getDisplayDocument();var D=C.createElement("audio");D.setAttribute("src","nada.mp3");var E=D.play();if (E!==undefined){E.then(function () {A();},function (F) {if (F.name==="NotAllowedError") {createInitClickDiv(A,(isMobile.any()&&B));return;};if (window.console) console.log(F&&F.name);A();return;});return;}}}};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;i=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 (bRcdTitle&&rcdObj.view!='Desktop'&&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 (JD.offsetHeight;I=G?H.scrollTop:H.scrollY;I/=F;var J=getDisplayWindow().top.innerHeight;var K=getAncestorIframe(getDisplayWindow());if(K){if(K.style.height) J=parseInt(K.style.height);else if (K.id=='course-iframe'&&K.parentElement.parentElement.tagName=='ION-CONTENT'){var L=parseInt(K.parentElement.style.marginTop);if (L>0) J-=L;}};var M=triv$(trivPage.anchorFrontDiv);if (A){var N=M.data('timeoutAnchor');clearTimeout(N);if (N!='~animating~'){N=setTimeout(function() {M.data('timeoutAnchor','~animating~');M.animate({ 'top':I },200,function() {M.css('top',I+'px');M.data('timeoutAnchor',null);});},400);M.data('timeoutAnchor',N);}}else{M.css('top',I+'px');};E=triv$(trivPage.div).height();trivArExec (arWnds,function(P){if (P.dwFlags&0x100000&&P.dwFlags&0x1000){var O=P.rcdGetAttData().objData.a[3][1];P.rtRect.y=(J-((E-O)*F))/F;P.div.style.top=P.rtRect.y+'px';}});};function updateAnchorDiv(){var A=(window.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 (is.iOS&&isInIframe(window,t)){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());var D=C?C.parentElement:null;if (D){var E=D.scrollTop;D.scrollTop=1;D.scrollTop=E;}}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(){var A=getWebWindowInfo(),B=A?window.parent['webwnd'+A.webwndObjId]:n,C=B&&!!(B.dwFlags&0x80000000);if (C) return 'Desktop';else return isMobile.anyPhone()?"Phone":isMobile.any()?"Tablet":"Desktop";};function getFlagFitMobile(){var A=getWebWindowInfo(),B=A?window.parent['webwnd'+A.webwndObjId]:n,C=B&&!!(B.dwFlags&0x80000000);return!C&&window.bFitMobile;};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$('