﻿
		/*
 * 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;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&&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.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=eval("parent");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 (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) {if(this.styObj) this.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="hidden";};p.actionPlay=function(){};p.actionStop=function(){};p.actionShow=function(){this.show();};p.actionHide=function(){this.hide();};p.actionLaunch=function(){};function ObjLayerActionExit(){if(this.frameElement&&this.frameElement.id&&this.frameElement.id.indexOf('DLG_content')==0) trivCloseDialog();else 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) {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':'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='<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) { return A.mouseDown(e);};B.onmousemove=function(e) { return A.mouseMove(e);};B.onmouseup=function(e) { return A.mouseUp(e);};B.ondblclick=function(e) { return A.mouseDblClk(e);};B.oncontextmenu=function(e) { return 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);var D=t;switch (A){case 1:if (C) 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);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.mouseDown=function(e){if(!e) e=window.event;if(e.which==1||(!e.which&&e.button==1)) return this.processMouseAct(e,1);return t;};p.mouseMove=function(e){return this.processMouseAct(e,2);};p.mouseUp=function(e){return this.processMouseAct(e,3);};p.mouseDblClk=function(e){if(!e) e=window.event;if(e.which==1||(!e.which&&e.button==1)) return this.processMouseAct(e,4);return t;};p.contextMenu=function(e){return this.processMouseAct(e,5);};p.keyDown=function(e){if(typeof(pageKey)=='function'){if (!e) e=window.event;var A=e.keyCode;var B=((e.altKey?1:0)|(e.ctrlKey?2:0)|(e.shiftKey?4:0));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 trivCloseDialog(){var A;var B=false;if(this.frameElement&&this.frameElement.parentNode){for(i=0;i<this.frameElement.parentNode.childNodes.length;i++){if(this.frameElement.parentNode.childNodes[i].id=='DLG_hiddenClose'){A=this.frameElement.parentNode.childNodes[i];break;}};if(A&&A.onclick){A.onclick();B=true;}};return B;};function trivOnFocus() {if (window.trivOnFocusDisabled) return;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);}};function trivAlert(A,B,C,D){if(trivWeb20Popups&&window.jsTrivDlgMsgBox){var E=new jsTrivDlgMsgBox(A,B,C,f,D);E.create();}else alert(C);};function trivCloseWnd() {if(this.frameElement&&this.frameElement.id&&this.frameElement.id.indexOf('DLG_content')==0) trivCloseDialog();else window.close();};function trivMailTo(A){window.top.document.location.href='mailto:'+A;}
