﻿
		/*
 * Copyright (C) 2007 Trivantis Corporation
 */

	
var theApp=new webtoraAppl();var is=theApp.is;var trivDebug=0;var trivAddMsgFunc=null;var trivDebugWnd='';var trivSaveMsg='';function trivLogMsg(A){if(!trivDebug) {return;};var B=findTrivLogMsg(window,true);if(B.trivDebug){if(A){if(B.trivSaveMsg.length) {B.trivSaveMsg+='<br />';};B.trivSaveMsg+=A;};if(!B.trivDebugWnd&&B.opening==1){setTimeout("trivLogMsg()",200);}else if(!B.trivDebugWnd||B.trivDebugWnd.closed||!B.trivDebugWnd.location){B.opening=1;B.trivDebugWnd=B.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(B.trivAddMsgFunc){A=B.trivSaveMsg;B.trivSaveMsg='';B.trivAddMsgFunc(A);}}}};function findTrivLogMsg(A,B) {if(B&&A.opener&&(!A.opener.btnSaveTitle)&&A.opener.trivLogMsg) {return findTrivLogMsg(A.opener,false);};while(A) {if(A.parent&&A.parent!=A&&(!A.parent.btnSaveTitle)&&A.parent.trivLogMsg) {A=A.parent;}else {break;}};return A;};var winW=screen.width;var winH=screen.height;function findWH() {winW=(is.ns)?window.innerWidth-16:document.body.offsetWidth-20;winH=(is.ns)?window.innerHeight:document.body.offsetHeight;};function ObjLayer(A,B,C) {var D=this;if (!ObjLayer.bInit&&!C) {InitObjLayers();};D.frame=C||self;if (is.ns) {if (is.ns5) {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;}else if (is.ns4) {if (!C) {if (!B) {B=ObjLayer.arrPref[A];};D.styObj=(B)?eval("document."+B+".document."+A):document.layers[A];}else {D.styObj=(B)?eval("frame.document."+B+".document."+A):C.document.layers[A];};D.ele=D.event=D.styObj;D.doc=D.styObj.document;D.x=D.styObj.left;D.y=D.styObj.top;D.w=D.styObj.clip.width;D.h=D.styObj.clip.height;}}else if (is.ie) {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;};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) {var E=null;var F=D!=null?D:true;if(B) {if(B=="opener") E=parent.opener;else if(B=="_top") E=window.top;else if(B=="NewWindow") E=open(A,'NewWindow');else {var G=eval("parent");var H=0;while(H<G.length) {if(G.frames[H].name==B) {E=G.frames[H];break;};H++;};if(C) {H=0;G=E;while(H<G.length) {if(G.frames[H].name==C) {E=G.frames[H];break;};H++;}};try{if(!E.closed&&E.trivExitPage) {E.trivExitPage(A,F);return;}}catch(e){}}};if(!E) E=window;try{if(!E.closed) E.location.href=A;}catch(e){}};function ObjLayerActionGoToNewWindow(A,B,C) {var D;B=B?B.replace(/\s+/g,"_"):B;if ((C.indexOf('left=')==-1)&&(C.indexOf('top=')==-1)) C+=GetNewWindXAndYPos(C);D=window.open(A,B,C,false);if(D) D.focus();return D;};function preload(A) {setTimeout(function(){if (!document.images) return;var B=[];for (var i=0;i<A.length;i++) {B[i]=new Image();B[i].src=A[i];}},100);};p.moveTo=function(x,y) {var A=this;if (x!==null) {A.x=x;if(A.styObj) {A.styObj.left=A.x;}};if (y!==null) {A.y=y;if(A.styObj) {A.styObj.top=A.y;}}};p.moveBy=function(x,y) {this.moveTo(this.x+x,this.y+y);};p.clipInit=function(t,r,b,l) {if (!is.ns4) {if (arguments.length==4) {this.clipTo(t,r,b,l);}else {this.clipTo(0,this.ele.offsetWidth,this.ele.offsetHeight,0);}}};p.clipTo=function(t,r,b,l) {var A=this;if(!A.styObj) {return;};if (is.ns4) {A.styObj.clip.top=t;A.styObj.clip.right=r;A.styObj.clip.bottom=b;A.styObj.clip.left=l;}else {A.styObj.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";}};p.show=function() {if(this.styObj) {this.styObj.visibility="inherit";}};p.hide=function() {if(this.styObj) {this.styObj.visibility=(is.ns4)?"hide":"hidden";}};p.actionPlay=function(){};p.actionStop=function(){};p.actionShow=function(){this.show();};p.actionHide=function(){this.hide();};p.actionLaunch=function(){};function ObjLayerActionExit(){window.top.close();};p.actionExit=ObjLayerActionExit;p.actionChangeContents=function(){};p.actionTogglePlay=function(){};p.isVisible=function() {if(!this.styObj||this.styObj.visibility=="hide"||this.styObj.visibility=="hidden") {return false;}else {return true;}};p.write=function(A) {if (is.ns4) {this.doc.open();this.doc.write(A);this.doc.close();}else this.event.innerHTML=A;};function InitObjLayers(A) {var B=document;if (!ObjLayer.bInit) {ObjLayer.bInit=true;};if (is.ns) {if (A) {ref=eval('document.'+A+'.document');}else {A='';if(is.ns5) {B.layers=B.getElementsByTagName("*");ref=B;}else {ref=B;}};for (var i=0;i<ref.layers.length;i++) {var C;if(is.ns5) {if(ref.layers[i]) {C=ref.layers[i].tagName;}else {C=null;}}else {C=ref.layers[i].name;};if(C) {ObjLayer.arrPref[C]=A;if (!is.ns5&&ref.layers[i].doc.layers.length>0) {ObjLayer.arrRef[ObjLayer.arrRef.length]=(A==='')?ref.layers[i].name:A+'.document.'+ref.layers[i].name;}}};if (ObjLayer.arrRef.i<ObjLayer.arrRef.length) {InitObjLayers(ObjLayer.arrRef[ObjLayer.arrRef.i++]);}};return true;};function buildCSS(A,B,C,D,E,F,G,H,I) {var J=arguments.length;var K=(B!==null&&C!==null)?'#'+A+' {position:absolute; left:'+B+'px; top:'+C+'px;':'#'+A+' {position:relative;';if (J>=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':((is.ns4)?'hide':'hidden'))+';';};if (J>=7&&G!==null) {K+=' z-index:'+G+';';};if (J>=8&&H!==null) {K+=(is.ns4)?' layer-background-color:'+H+';':' background:'+H+';';};if (J==9&&I!==null) {K+=' '+I;};K+='}\n';return K;};function writeStyleSheets(A) {var B='<style type="text/css">\n';B+=A;B+='</style>';document.write(B);};function getHTTP(A,B,C){var D;if(B=='GET') {if(C) {A+='?'+C;C=null;}};var E='Issuing '+B+' to '+A;if(C) E+=' for ['+C+']';trivLogMsg(E);var F=0;try {if (window.XMLHttpRequest) {D=new XMLHttpRequest();D.open(B,A,false);D.onreadystatechange=null;if(B=='POST') {D.setRequestHeader('Content-Type','application/x-www-form-urlencoded');};D.send(C);F=1;}}catch(e){};if (!F&&window.ActiveXObject) {D=new ActiveXObject("Microsoft.XMLHTTP");if (D) {D.open(B,A,false);if(B=='POST') {D.setRequestHeader('Content-Type','application/x-www-form-urlencoded');};D.send(C);}};trivLogMsg('ReturnCode = '+D.status+' Received Data ['+D.responseText+']');return D;};function GenRand(A,B){return Math.floor(Math.random()*(B-A+1)+A);};function GetNewWindXAndYPos(A) {var B="\\s*([^,\\s]*)\\s*";var C=new RegExp("width="+B,"i");C.test(A);var D=RegExp.$1;C=new RegExp("height="+B,"i");C.test(A);var E=RegExp.$1;var F=(screen.width-D)/2;var G=(screen.height-E)/2;return ',left='+F+',top='+G;};function UniEscape(s){if(s==null) return '';var A=escape(String(s));A.replace(/%u/g,'%5Cu');return A;};function UniUnescape(s){if(s==null) return '';return(unescape(String(s).replace(/%5Cu/g,'%u')));};function HtmlEscape(s){if(s==null) return '';var A=escape(String(s));A=HtmlUni(A);return A;};function HtmlUni(s){var A="";if(s!=null){for(i=0;i<s.length;i++){if(s.charAt(i)=='%'&&s.length>(i+5)&&s.charAt(i+1)=='u'){A+="%26%23";i+=2;uniString=s.substring(i,i+4);uniInt=parseInt(uniString,16);A+=uniInt;i+=3;A+="%3B";}else{A+=s.charAt(i);}}};return A;};function wndPagePublished(){var A=this;A.rtData1=-1;A.rtData2=-1;var B=document.getElementById("wndPage");A.div=B;if (B){B.onmousedown=function(e) { A.mouseDown(e);};B.onmousemove=function(e) { A.mouseMove(e);};B.onmouseup=function(e) { A.mouseUp(e);};B.ondblclick=function(e) { A.mouseDblClk(e);};B.oncontextmenu=function(e) { A.contextMenu(e);};document.onkeydown=function(e) { A.keyDown(e);};};A.currMouseObj=0;A.arDelayAct=[];A.arTransInWnds=[];A.arTransOutWnds=[];};p=wndPagePublished.prototype;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);switch (A){case 1:if (C) C.mouseDown(e);else if(typeof(pageClick)=='function') pageClick(e);break;case 2:this.setCurrMouseObj(C);if (C) C.mouseMove(e);break;case 3:if (C) C.mouseUp(e);break;case 4:if (C&&C.mouseDblClk) C.mouseDblClk(e);break;case 5:if (C&&C.contextMenu) C.contextMenu(e);else if(typeof(pageRClick)=='function'){pageRClick(e);return cancelEvent(e);};break;}};p.mouseDown=function(e){if(!e) e=window.event;if(e.which==1||(!e.which&&e.button==1)) this.processMouseAct(e,1);};p.mouseMove=function(e){this.processMouseAct(e,2);};p.mouseUp=function(e){this.processMouseAct(e,3);};p.mouseDblClk=function(e){if(!e) e=window.event;if(e.which==1||(!e.which&&e.button==1)) this.processMouseAct(e,4);};p.contextMenu=function(e){this.processMouseAct(e,5);};p.keyDown=function(e){if(typeof(pageKey)=='function'){if(!e) e=window.event;var A=0;var B=0;if(e.keyCode==18) B|=1;else if(e.keyCode==17) B|=2;else if(e.keyCode==16) B|=4;else A=e.keyCode;pageKey(A,B);}};p.setCurrMouseObj=function(A) {var B=this.currMouseObj;if(B!=A){if (B&&B.mouseExit) B.mouseExit();this.currMouseObj=A;if (A&&A.mouseEnter) A.mouseEnter();}};p.getDivObj=function(A){var B=0;while(!B&&A){B=(A.popM?A.popM:(A.tObj?A.tObj:0));A=A.parentNode;};return B;};p.issueShowActions=function(A){trivIssueShowActs(A);};p.doAction=function(A){if (typeof A!='undefined') A();};p.findWndByObj=function (o){return o.wnd;};p.fixA=function(){if (theApp.is.ie) trivArExec(document.getElementsByTagName("A"),function(o){o.style.cursor='hand';});};function cwObjPub(){this.arChld=[];};p=cwObjPub.prototype;p.getTrans=function(A){var B=this.transData;return (B?(A?B[0]:B[1]):0);};p.getTransSpeed=function(A){var B=this.transData;return (B?(A?B[2]:B[3]):0);};p.getTransDelay=function(A){var B=this.transData;return (B?(A?B[4]:B[5]):0);};p.getXPos=function(){return this.rect.x;};p.getYPos=function(){return this.rect.y;};trivGoToPage=null;trivCompleteCnt=1;hasProcessedExitActions=false;trivWndFeedback=null;trivWndImmFeedback=null;currFeedbackIdx=0;trivPageExited=false;trivNumQuestions=0;trivProcessTest=0;function trivOnFocus() {if(trivWndFeedback) {try{if(!trivWndFeedback.closed){trivWndFeedback.close();trivWndFeedback=null;}}catch(e){};setTimeout('checkLeavePage()',100);}};function checkLeavePage(){if(trivWndFeedback==null||trivWndFeedback.closed){trivWndFeedback=null;currFeedbackIdx++;if(currFeedbackIdx>(trivNumQuestions-1)) {if(trivProcessTest&&(bInProcessTest||trivGoToPage==null)) {bInProcessTest=false;processTest(1);}else if (trivExitPage.transOutDone&&trivExitPage.transOutDone()==false){setTimeout('checkLeavePage()',100);}else trivLeavePage();return;}else if(!checkQuestions(true)) return;};setTimeout('checkLeavePage()',100);};function trivLeavePage(){trivCompleteCnt--;if(trivCompleteCnt<=0){if (trivLeavePage.trivSaveVars) trivLeavePage.trivSaveVars();hasProcessedExitActions=false;eval(trivGoToPage);trivGoToPage=null;trivPageExited=true;}};function trivExitPage(A,B){if(A.indexOf("ObjLayerAction")>=0||A.indexOf(".action")>=0||A.indexOf("history.back()")>=0) trivGoToPage=A;else trivGoToPage='ObjLayerActionGoTo("'+A+'")';if(!hasProcessedExitActions){findWH();if (trivExitPage.trivExitPageChkExit) if (trivExitPage.trivExitPageChkExit(B)===0) return;hasProcessedExitActions=true;if (trivExitPage.trivExitPageItemExits) trivExitPage.trivExitPageItemExits();setTimeout('checkLeavePage()',100);}}
