DialogUtils=new function(){this._modalDialog;this._callback;this.common={titlebar:"no",toolbar:"no",status:"no",menubar:"no",resizable:"no",scrollbars:"no"};this._focusEvent=function(){var A=DialogUtils._modalDialog;if(A){if(A.closed){DialogUtils._modalDialog=0;window.detachEvent("onfocus",DialogUtils._focusEvent);DialogUtils._modalDialog=0;if(DialogUtils._callback){DialogUtils._callback();DialogUtils._callback=0}}else{setTimeout(function(){try{if(DialogUtils._modalDialog&&!DialogUtils._modalDialog.closed){A.focus()}else{DialogUtils._focusEvent()}}catch(B){}},5)}}};this._attachFocusEvent=function(B,D,A){if(B.contentWindow){B=B.contentWindow}if(!A){A=new Array()}A[B.name]=true;var F=(B.document||B.contentDocument||B.contentWindow.document);if(B&&B.attachEvent){B.attachEvent("onfocus",D);var C=B.frames;for(i=0;i<C.length;i++){if(!A[C[i].name]){DialogUtils._attachFocusEvent(C[i],D,A)}}var E=F.getElementsByTagName("IFRAME");for(i=0;i<E.length;i++){if(!A[E[i].name]){DialogUtils._attachFocusEvent(E[i],D,A)}}}};this.showDialog=function(B,C,A,G){B=B.replace(/[(^\s)|(\s$)]/g,"");var E="";if(A){A.top=parseInt(screen.availHeight-(A.height?A.height:200))/2;A.left=parseInt(screen.availWidth-(A.width?A.width:200))/2;for(var D in A){E+=(","+D+"="+A[D])}}common=this.common;for(var D in common){E+=(","+D+"="+common[D])}E=E.substr(1);var F=DialogUtils._modalDialog;if(G){DialogUtils._callback=G}DialogUtils._modalDialog=window.open(B,C,E);DialogUtils._modalDialog.focus();DialogUtils._modalDialog.cookie=window.cookie};this.closeDialog=function(A){if(!DialogUtils._modalDialog&&opener){return opener.DialogUtils.closeDialog(A)}if(!DialogUtils._modalDialog){return }if(!DialogUtils._modalDialog.closed){DialogUtils._modalDialog.close()}if(this._callback){this._callback(A)}}};if(dwr==null){var dwr={}}if(dwr.engine==null){dwr.engine={}}if(DWREngine==null){var DWREngine=dwr.engine}dwr.engine.setErrorHandler=function(A){dwr.engine._errorHandler=A};dwr.engine.setWarningHandler=function(A){dwr.engine._warningHandler=A};dwr.engine.setTextHtmlHandler=function(A){dwr.engine._textHtmlHandler=A};dwr.engine.setTimeout=function(A){dwr.engine._timeout=A};dwr.engine.setPreHook=function(A){dwr.engine._preHook=A};dwr.engine.setPostHook=function(A){dwr.engine._postHook=A};dwr.engine.setHeaders=function(A){dwr.engine._headers=A};dwr.engine.setParameters=function(A){dwr.engine._parameters=A};dwr.engine.XMLHttpRequest=1;dwr.engine.IFrame=2;dwr.engine.ScriptTag=3;dwr.engine.setRpcType=function(A){if(A!=dwr.engine.XMLHttpRequest&&A!=dwr.engine.IFrame&&A!=dwr.engine.ScriptTag){dwr.engine._handleError(null,{name:"dwr.engine.invalidRpcType",message:"RpcType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag"});return }dwr.engine._rpcType=A};dwr.engine.setHttpMethod=function(A){if(A!="GET"&&A!="POST"){dwr.engine._handleError(null,{name:"dwr.engine.invalidHttpMethod",message:"Remoting method must be one of GET or POST"});return }dwr.engine._httpMethod=A};dwr.engine.setOrdered=function(A){dwr.engine._ordered=A};dwr.engine.setAsync=function(A){dwr.engine._async=A};dwr.engine.setActiveReverseAjax=function(A){if(A){if(dwr.engine._activeReverseAjax){return }dwr.engine._activeReverseAjax=true;dwr.engine._poll()}else{if(dwr.engine._activeReverseAjax&&dwr.engine._pollReq){dwr.engine._pollReq.abort()}dwr.engine._activeReverseAjax=false}};dwr.engine.defaultErrorHandler=function(B,A){dwr.engine._debug("Error: "+A.name+", "+A.message,true);if(B==null||B==""){alert("A server error has occured.")}else{if(B.indexOf("0x80040111")!=-1){dwr.engine._debug(B)}else{alert(B)}}};dwr.engine.defaultWarningHandler=function(B,A){dwr.engine._debug(B)};dwr.engine.beginBatch=function(){if(dwr.engine._batch){dwr.engine._handleError(null,{name:"dwr.engine.batchBegun",message:"Batch already begun"});return }dwr.engine._batch=dwr.engine._createBatch()};dwr.engine.endBatch=function(B){var A=dwr.engine._batch;if(A==null){dwr.engine._handleError(null,{name:"dwr.engine.batchNotBegun",message:"No batch in progress"});return }dwr.engine._batch=null;if(A.map.callCount==0){return }if(B){dwr.engine._mergeBatch(A,B)}if(dwr.engine._ordered&&dwr.engine._batchesLength!=0){dwr.engine._batchQueue[dwr.engine._batchQueue.length]=A}else{dwr.engine._sendData(A)}};dwr.engine.setPollMethod=function(A){dwr.engine.setPollType(A)};dwr.engine.setMethod=function(A){dwr.engine.setRpcType(A)};dwr.engine.setVerb=function(A){dwr.engine.setHttpMethod(A)};dwr.engine.setPollType=function(){dwr.engine._debug("Manually setting the Poll Type is not supported")};dwr.engine._origScriptSessionId="7C04EAE957DEB75ECCCADEC29AF9541C";dwr.engine._sessionCookieName="JSESSIONID";dwr.engine._allowGetForSafariButMakeForgeryEasier="false";dwr.engine._scriptTagProtection="throw 'allowScriptTagRemoting is false.';";dwr.engine._defaultPath=getContextPath()+"/dwr";dwr.engine._pollWithXhr="false";dwr.engine._scriptSessionId=null;dwr.engine._getScriptSessionId=function(){if(dwr.engine._scriptSessionId==null){dwr.engine._scriptSessionId=dwr.engine._origScriptSessionId+Math.floor(Math.random()*1000)}return dwr.engine._scriptSessionId};dwr.engine._errorHandler=dwr.engine.defaultErrorHandler;dwr.engine._warningHandler=dwr.engine.defaultWarningHandler;dwr.engine._preHook=null;dwr.engine._postHook=null;dwr.engine._batches={};dwr.engine._batchesLength=0;dwr.engine._batchQueue=[];dwr.engine._rpcType=dwr.engine.XMLHttpRequest;dwr.engine._httpMethod="POST";dwr.engine._ordered=false;dwr.engine._async=true;dwr.engine._batch=null;dwr.engine._timeout=0;dwr.engine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];dwr.engine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];dwr.engine._activeReverseAjax=false;dwr.engine._outstandingIFrames=[];dwr.engine._pollReq=null;dwr.engine._pollCometInterval=200;dwr.engine._pollRetries=0;dwr.engine._maxPollRetries=0;dwr.engine._textHtmlHandler=null;dwr.engine._headers=null;dwr.engine._parameters=null;dwr.engine._postSeperator="\n";dwr.engine._defaultInterceptor=function(A){return A};dwr.engine._urlRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._contentRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._replyRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._nextBatchId=0;dwr.engine._propnames=["rpcType","httpMethod","async","timeout","errorHandler","warningHandler","textHtmlHandler"];dwr.engine._partialResponseNo=0;dwr.engine._partialResponseYes=1;dwr.engine._partialResponseFlush=2;dwr.engine._execute=function(K,B,I,H){var E=false;if(dwr.engine._batch==null){dwr.engine.beginBatch();E=true}var D=dwr.engine._batch;var G=[];for(var C=0;C<arguments.length-3;C++){G[C]=arguments[C+3]}if(D.path==null){D.path=K}else{if(D.path!=K){dwr.engine._handleError(D,{name:"dwr.engine.multipleServlets",message:"Can't batch requests to multiple DWR Servlets."});return }}var A;var J=G[G.length-1];if(typeof J=="function"||J==null){A={callback:G.pop()}}else{A=G.pop()}dwr.engine._mergeBatch(D,A);D.handlers[D.map.callCount]={exceptionHandler:A.exceptionHandler,callback:A.callback};var F="c"+D.map.callCount+"-";D.map[F+"scriptName"]=B;D.map[F+"methodName"]=I;D.map[F+"id"]=D.map.callCount;for(C=0;C<G.length;C++){dwr.engine._serializeAll(D,[],G[C],F+"param"+C)}D.map.callCount++;if(E){dwr.engine.endBatch()}};dwr.engine._poll=function(B){if(!dwr.engine._activeReverseAjax){return }var A=dwr.engine._createBatch();A.map.id=0;A.map.callCount=1;A.isPoll=true;if(dwr.engine._pollWithXhr=="true"){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseNo}else{if(navigator.userAgent.indexOf("Gecko/")!=-1){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseYes}else{if(navigator.userAgent.indexOf("Safari/")){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseYes}else{A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseNo}}}A.httpMethod="POST";A.async=true;A.timeout=0;A.path=(B)?B:dwr.engine._defaultPath;A.preHooks=[];A.postHooks=[];A.errorHandler=dwr.engine._pollErrorHandler;A.warningHandler=dwr.engine._pollErrorHandler;A.handlers[0]={callback:function(C){dwr.engine._pollRetries=0;setTimeout("dwr.engine._poll()",C)}};dwr.engine._sendData(A);if(A.rpcType==dwr.engine.XMLHttpRequest&&A.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._checkCometPoll()}};dwr.engine._pollErrorHandler=function(B,A){dwr.engine._pollRetries++;dwr.engine._debug("Reverse Ajax poll failed (pollRetries="+dwr.engine._pollRetries+"): "+A.name+" : "+A.message);if(dwr.engine._pollRetries<dwr.engine._maxPollRetries){setTimeout("dwr.engine._poll()",10000)}else{dwr.engine._activeReverseAjax=false;dwr.engine._debug("Giving up.")}};dwr.engine._createBatch=function(){var A={map:{callCount:0,page:window.location.pathname+window.location.search,httpSessionId:dwr.engine._getJSessionId(),scriptSessionId:dwr.engine._getScriptSessionId()},charsProcessed:0,paramCount:0,parameters:{},headers:{},isPoll:false,handlers:{},preHooks:[],postHooks:[],rpcType:dwr.engine._rpcType,httpMethod:dwr.engine._httpMethod,async:dwr.engine._async,timeout:dwr.engine._timeout,errorHandler:dwr.engine._errorHandler,warningHandler:dwr.engine._warningHandler,textHtmlHandler:dwr.engine._textHtmlHandler};if(dwr.engine._preHook){A.preHooks.push(dwr.engine._preHook)}if(dwr.engine._postHook){A.postHooks.push(dwr.engine._postHook)}var C,B;if(dwr.engine._headers){for(C in dwr.engine._headers){B=dwr.engine._headers[C];if(typeof B!="function"){A.headers[C]=B}}}if(dwr.engine._parameters){for(C in dwr.engine._parameters){B=dwr.engine._parameters[C];if(typeof B!="function"){A.parameters[C]=B}}}return A};dwr.engine._mergeBatch=function(A,D){var E,C;for(var B=0;B<dwr.engine._propnames.length;B++){E=dwr.engine._propnames[B];if(D[E]!=null){A[E]=D[E]}}if(D.preHook!=null){A.preHooks.unshift(D.preHook)}if(D.postHook!=null){A.postHooks.push(D.postHook)}if(D.headers){for(E in D.headers){C=D.headers[E];if(typeof C!="function"){A.headers[E]=C}}}if(D.parameters){for(E in D.parameters){C=D.parameters[E];if(typeof C!="function"){A.map["p-"+E]=""+C}}}};dwr.engine._getJSessionId=function(){var C=document.cookie.split(";");for(var B=0;B<C.length;B++){var A=C[B];while(A.charAt(0)==" "){A=A.substring(1,A.length)}if(A.indexOf(dwr.engine._sessionCookieName+"=")==0){return A.substring(dwr.engine._sessionCookieName.length+1,A.length)}}return""};dwr.engine._checkCometPoll=function(){for(var B=0;B<dwr.engine._outstandingIFrames.length;B++){var E="";var C=dwr.engine._outstandingIFrames[B];try{E=dwr.engine._getTextFromCometIFrame(C)}catch(A){dwr.engine._handleWarning(C.batch,A)}if(E!=""){dwr.engine._processCometResponse(E,C.batch)}}if(dwr.engine._pollReq){var D=dwr.engine._pollReq;var E=D.responseText;if(E!=null){dwr.engine._processCometResponse(E,D.batch)}}if(dwr.engine._outstandingIFrames.length>0||dwr.engine._pollReq){setTimeout("dwr.engine._checkCometPoll()",dwr.engine._pollCometInterval)}};dwr.engine._getTextFromCometIFrame=function(B){var A=B.contentWindow.document.body;if(A==null){return""}var C=A.innerHTML;if(C.indexOf("<PRE>")==0||C.indexOf("<pre>")==0){C=C.substring(5,C.length-7)}return C};dwr.engine._processCometResponse=function(D,E){if(E.charsProcessed==D.length){return }if(D.length==0){E.charsProcessed=0;return }var B=D.indexOf("//#DWR-START#",E.charsProcessed);if(B==-1){E.charsProcessed=D.length;return }var A=D.lastIndexOf("//#DWR-END#");if(A==-1){return }if(D.charCodeAt(A+11)==13&&D.charCodeAt(A+12)==10){E.charsProcessed=A+13}else{E.charsProcessed=A+11}var C=D.substring(B+13,A);dwr.engine._receivedBatch=E;dwr.engine._eval(C);dwr.engine._receivedBatch=null};dwr.engine._sendData=function(E){E.map.batchId=dwr.engine._nextBatchId;dwr.engine._nextBatchId++;dwr.engine._batches[E.map.batchId]=E;dwr.engine._batchesLength++;E.completed=false;for(var D=0;D<E.preHooks.length;D++){E.preHooks[D]()}E.preHooks=null;if(E.timeout&&E.timeout!=0){E.interval=setInterval(function(){dwr.engine._abortRequest(E)},E.timeout)}if(E.rpcType==dwr.engine.XMLHttpRequest){if(window.XMLHttpRequest){E.req=new XMLHttpRequest()}else{if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){E.req=dwr.engine._newActiveXObject(dwr.engine._XMLHTTP)}}}var A,C;if(E.req){if(E.async){E.req.onreadystatechange=function(){if(typeof dwr!="undefined"){dwr.engine._stateChange(E)}}}if(E.isPoll){dwr.engine._pollReq=E.req;if(!document.all){E.req.batch=E}}var B=navigator.userAgent.indexOf("Safari/");if(B>=0){var G=navigator.userAgent.substring(B+7);if(parseInt(G,10)<400){if(dwr.engine._allowGetForSafariButMakeForgeryEasier=="true"){E.httpMethod="GET"}else{dwr.engine._handleWarning(E,{name:"dwr.engine.oldSafari",message:"Safari GET support disabled. See getahead.org/dwr/server/servlet and allowGetForSafariButMakeForgeryEasier."})}}}E.mode=E.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;C=dwr.engine._constructRequest(E);try{E.req.open(E.httpMethod,C.url,E.async);try{for(A in E.headers){var I=E.headers[A];if(typeof I=="string"){E.req.setRequestHeader(A,I)}}if(!E.headers["Content-Type"]){E.req.setRequestHeader("Content-Type","text/plain")}}catch(H){dwr.engine._handleWarning(E,H)}E.req.send(C.body);if(!E.async){dwr.engine._stateChange(E)}}catch(H){dwr.engine._handleError(E,H)}}else{if(E.rpcType!=dwr.engine.ScriptTag){var F=E.isPoll?"dwr-if-poll-"+E.map.batchId:"dwr-if-"+E.map["c0-id"];if(E.isPoll&&window.ActiveXObject){E.htmlfile=new window.ActiveXObject("htmlfile");E.htmlfile.open();E.htmlfile.write("<html>");E.htmlfile.write("<div><iframe className='wibble' src='javascript:void(0)' id='"+F+"' name='"+F+"' onload='dwr.engine._iframeLoadingComplete("+E.map.batchId+");'></iframe></div>");E.htmlfile.write("</html>");E.htmlfile.close();E.htmlfile.parentWindow.dwr=dwr;E.document=E.htmlfile}else{E.div=document.createElement("div");document.body.appendChild(E.div);E.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' style='width:0px;height:0px;border:0;' id='"+F+"' name='"+F+"' onload='dwr.engine._iframeLoadingComplete ("+E.map.batchId+");'></iframe>";E.document=document}E.iframe=E.document.getElementById(F);E.iframe.batch=E;E.mode=E.isPoll?dwr.engine._ModeHtmlPoll:dwr.engine._ModeHtmlCall;if(E.isPoll){dwr.engine._outstandingIFrames.push(E.iframe)}C=dwr.engine._constructRequest(E);if(E.httpMethod=="GET"){E.iframe.setAttribute("src",C.url)}else{E.form=E.document.createElement("form");E.form.setAttribute("id","dwr-form");E.form.setAttribute("action",C.url);E.form.setAttribute("target",F);E.form.target=F;E.form.setAttribute("method",E.httpMethod);for(A in E.map){var I=E.map[A];if(typeof I!="function"){var J=E.document.createElement("input");J.setAttribute("type","hidden");J.setAttribute("name",A);J.setAttribute("value",I);E.form.appendChild(J)}}E.document.body.appendChild(E.form);E.form.submit()}}else{E.httpMethod="GET";E.mode=E.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;C=dwr.engine._constructRequest(E);E.script=document.createElement("script");E.script.id="dwr-st-"+E.map["c0-id"];E.script.src=C.url;document.body.appendChild(E.script)}}};dwr.engine._ModePlainCall="/call/plaincall/";dwr.engine._ModeHtmlCall="/call/htmlcall/";dwr.engine._ModePlainPoll="/call/plainpoll/";dwr.engine._ModeHtmlPoll="/call/htmlpoll/";dwr.engine._constructRequest=function(A){var B={url:A.path+A.mode,body:null};if(A.isPoll==true){B.url+="ReverseAjax.dwr"}else{if(A.map.callCount==1){B.url+=A.map["c0-scriptName"]+"."+A.map["c0-methodName"]+".dwr"}else{B.url+="Multiple."+A.map.callCount+".dwr"}}var D=location.href.match(/jsessionid=([^?]+)/);if(D!=null){B.url+=";jsessionid="+D[1]}var C;if(A.httpMethod=="GET"){A.map.callCount=""+A.map.callCount;B.url+="?";for(C in A.map){if(typeof A.map[C]!="function"){B.url+=encodeURIComponent(C)+"="+encodeURIComponent(A.map[C])+"&"}}B.url=B.url.substring(0,B.url.length-1)}else{B.body="";for(C in A.map){if(typeof A.map[C]!="function"){B.body+=C+"="+A.map[C]+dwr.engine._postSeperator}}B.body=dwr.engine._contentRewriteHandler(B.body)}B.url=dwr.engine._urlRewriteHandler(B.url);return B};dwr.engine._stateChange=function(C){var B;if(C.completed){dwr.engine._debug("Error: _stateChange() with batch.completed");return }var F=C.req;try{if(F.readyState!=4){return }}catch(D){dwr.engine._handleWarning(C,D);dwr.engine._clearUp(C);return }try{var E=F.responseText;E=dwr.engine._replyRewriteHandler(E);var A=F.status;if(E==null||E==""){dwr.engine._handleWarning(C,{name:"dwr.engine.missingData",message:"No data received from server"})}else{if(A!=200){dwr.engine._handleError(C,{name:"dwr.engine.http."+A,message:F.statusText})}else{var G=F.getResponseHeader("Content-Type");if(!G.match(/^text\/plain/)&&!G.match(/^text\/javascript/)){if(G.match(/^text\/html/)&&typeof C.textHtmlHandler=="function"){C.textHtmlHandler()}else{dwr.engine._handleWarning(C,{name:"dwr.engine.invalidMimeType",message:"Invalid content type: '"+G+"'"})}}else{if(C.isPoll&&C.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._processCometResponse(E,C)}else{if(E.search("//#DWR")==-1){dwr.engine._handleWarning(C,{name:"dwr.engine.invalidReply",message:"Invalid reply from server"})}else{B=E}}}}}}catch(D){dwr.engine._handleWarning(C,D)}dwr.engine._callPostHooks(C);dwr.engine._receivedBatch=C;if(B!=null){B=B.replace(dwr.engine._scriptTagProtection,"")}dwr.engine._eval(B);dwr.engine._receivedBatch=null;dwr.engine._validateBatch(C);dwr.engine._clearUp(C)};dwr.engine._validateBatch=function(A){if(!A.completed){for(var B=0;B<A.map.callCount;B++){if(A.handlers[B]!=null){dwr.engine._handleWarning(A,{name:"dwr.engine.incompleteReply",message:"Incomplete reply from server"});break}}}};dwr.engine._iframeLoadingComplete=function(A){var B=dwr.engine._batches[A];if(B){dwr.engine._validateBatch(B)}};dwr.engine._remoteHandleCallback=function(A,F,E){var C=dwr.engine._batches[A];if(C==null){dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId="+A,true);return }try{var B=C.handlers[F];C.handlers[F]=null;if(!B){dwr.engine._debug("Warning: Missing handlers. callId="+F,true)}else{if(typeof B.callback=="function"){B.callback(E)}}}catch(D){dwr.engine._handleError(C,D)}};dwr.engine._remoteHandleException=function(A,E,D){var C=dwr.engine._batches[A];if(C==null){dwr.engine._debug("Warning: null batch in remoteHandleException",true);return }var B=C.handlers[E];C.handlers[E]=null;if(B==null){dwr.engine._debug("Warning: null handlers in remoteHandleException",true);return }if(D.message==undefined){D.message=""}if(typeof B.exceptionHandler=="function"){B.exceptionHandler(D.message,D)}else{if(typeof C.errorHandler=="function"){C.errorHandler(D.message,D)}}};dwr.engine._remoteHandleBatchException=function(C,A){var B=(dwr.engine._receivedBatch==null&&A!=null);if(B){dwr.engine._receivedBatch=dwr.engine._batches[A]}if(C.message==undefined){C.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,C);if(B){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[A])}};dwr.engine._remotePollCometDisabled=function(C,A){dwr.engine.setActiveReverseAjax(false);var B=(dwr.engine._receivedBatch==null&&A!=null);if(B){dwr.engine._receivedBatch=dwr.engine._batches[A]}if(C.message==undefined){C.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,C);if(B){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[A])}};dwr.engine._remoteBeginIFrameResponse=function(B,A){if(B!=null){dwr.engine._receivedBatch=B.batch}dwr.engine._callPostHooks(dwr.engine._receivedBatch)};dwr.engine._remoteEndIFrameResponse=function(A){dwr.engine._clearUp(dwr.engine._receivedBatch);dwr.engine._receivedBatch=null};dwr.engine._eval=function(script){if(script==null){return null}if(script==""){dwr.engine._debug("Warning: blank script",true);return null}return eval(script)};dwr.engine._abortRequest=function(A){if(A&&!A.completed){clearInterval(A.interval);dwr.engine._clearUp(A);if(A.req){A.req.abort()}dwr.engine._handleError(A,{name:"dwr.engine.timeout",message:"Timeout"})}};dwr.engine._callPostHooks=function(A){if(A.postHooks){for(var B=0;B<A.postHooks.length;B++){A.postHooks[B]()}A.postHooks=null}};dwr.engine._clearUp=function(B){if(!B){dwr.engine._debug("Warning: null batch in dwr.engine._clearUp()",true);return }if(B.completed=="true"){dwr.engine._debug("Warning: Double complete",true);return }if(B.div){B.div.parentNode.removeChild(B.div)}if(B.iframe){for(var C=0;C<dwr.engine._outstandingIFrames.length;C++){if(dwr.engine._outstandingIFrames[C]==B.iframe){dwr.engine._outstandingIFrames.splice(C,1)}}B.iframe.parentNode.removeChild(B.iframe)}if(B.form){B.form.parentNode.removeChild(B.form)}if(B.req){if(B.req==dwr.engine._pollReq){dwr.engine._pollReq=null}delete B.req}if(B.map&&B.map.batchId){delete dwr.engine._batches[B.map.batchId];dwr.engine._batchesLength--}B.completed=true;if(dwr.engine._batchQueue.length!=0){var A=dwr.engine._batchQueue.shift();dwr.engine._sendData(A)}};dwr.engine._handleError=function(A,B){if(typeof B=="string"){B={name:"unknown",message:B}}if(B.message==null){B.message=""}if(B.name==null){B.name="unknown"}if(A&&typeof A.errorHandler=="function"){A.errorHandler(B.message,B)}else{if(dwr.engine._errorHandler){dwr.engine._errorHandler(B.message,B)}}if(A){dwr.engine._clearUp(A)}};dwr.engine._handleWarning=function(A,B){if(typeof B=="string"){B={name:"unknown",message:B}}if(B.message==null){B.message=""}if(B.name==null){B.name="unknown"}if(A&&typeof A.warningHandler=="function"){A.warningHandler(B.message,B)}else{if(dwr.engine._warningHandler){dwr.engine._warningHandler(B.message,B)}}if(A){dwr.engine._clearUp(A)}};dwr.engine._serializeAll=function(B,D,C,A){if(C==null){B.map[A]="null:null";return }switch(typeof C){case"boolean":B.map[A]="boolean:"+C;break;case"number":B.map[A]="number:"+C;break;case"string":B.map[A]="string:"+encodeURIComponent(C);break;case"object":if(C instanceof String){B.map[A]="String:"+encodeURIComponent(C)}else{if(C instanceof Boolean){B.map[A]="Boolean:"+C}else{if(C instanceof Number){B.map[A]="Number:"+C}else{if(C instanceof Date){B.map[A]="Date:"+C.getTime()}else{if(C&&C.join){B.map[A]=dwr.engine._serializeArray(B,D,C,A)}else{B.map[A]=dwr.engine._serializeObject(B,D,C,A)}}}}}break;case"function":break;default:dwr.engine._handleWarning(null,{name:"dwr.engine.unexpectedType",message:"Unexpected type: "+typeof C+", attempting default converter."});B.map[A]="default:"+C;break}};dwr.engine._lookup=function(E,C,A){var D;for(var B=0;B<E.length;B++){if(E[B].data==C){D=E[B];break}}if(D){return"reference:"+D.name}E.push({data:C,name:A});return null};dwr.engine._serializeObject=function(C,H,G,B){var F=dwr.engine._lookup(H,G,B);if(F){return F}if(G.nodeName&&G.nodeType){return dwr.engine._serializeXml(C,H,G,B)}var E="Object_"+dwr.engine._getObjectClassName(G)+":{";var D;for(D in G){if(typeof G[D]!="function"){C.paramCount++;var A="c"+dwr.engine._batch.map.callCount+"-e"+C.paramCount;dwr.engine._serializeAll(C,H,G[D],A);E+=encodeURIComponent(D)+":reference:"+A+", "}}if(E.substring(E.length-2)==", "){E=E.substring(0,E.length-2)}E+="}";return E};dwr.engine._errorClasses={Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError};dwr.engine._getObjectClassName=function(C){if(C&&C.constructor&&C.constructor.toString){var D=C.constructor.toString();var A=D.match(/function\s+(\w+)/);if(A&&A.length==2){return A[1]}}if(C&&C.constructor){for(var B in dwr.engine._errorClasses){if(C.constructor==dwr.engine._errorClasses[B]){return B}}}if(C){var D=Object.prototype.toString.call(C);var A=D.match(/\[object\s+(\w+)/);if(A&&A.length==2){return A[1]}}return"Object"};dwr.engine._serializeXml=function(C,F,E,B){var D=dwr.engine._lookup(F,E,B);if(D){return D}var A;if(window.XMLSerializer){A=new XMLSerializer().serializeToString(E)}else{if(E.toXml){A=E.toXml}else{A=E.innerHTML}}return"XML:"+encodeURIComponent(A)};dwr.engine._serializeArray=function(C,H,G,B){var F=dwr.engine._lookup(H,G,B);if(F){return F}var E="Array:[";for(var D=0;D<G.length;D++){if(D!=0){E+=","}C.paramCount++;var A="c"+dwr.engine._batch.map.callCount+"-e"+C.paramCount;dwr.engine._serializeAll(C,H,G[D],A);E+="reference:";E+=A}E+="]";return E};dwr.engine._unserializeDocument=function(A){var C;if(window.DOMParser){var E=new DOMParser();C=E.parseFromString(A,"text/xml");if(!C.documentElement||C.documentElement.tagName=="parsererror"){var B=C.documentElement.firstChild.data;B+="\n"+C.documentElement.firstChild.nextSibling.firstChild.data;throw B}return C}else{if(window.ActiveXObject){C=dwr.engine._newActiveXObject(dwr.engine._DOMDocument);C.loadXML(A);return C}else{var D=document.createElement("div");D.innerHTML=A;return D}}};dwr.engine._newActiveXObject=function(A){var D;for(var C=0;C<A.length;C++){try{D=new ActiveXObject(A[C]);break}catch(B){}}return D};dwr.engine._debug=function(F,D){var A=false;try{if(window.console){if(D&&window.console.trace){window.console.trace()}window.console.log(F);A=true}else{if(window.opera&&window.opera.postError){window.opera.postError(F);A=true}}}catch(C){}if(!A){var B=document.getElementById("dwr-debug");if(B){var E=F+"<br/>"+B.innerHTML;if(E.length>2048){E=E.substring(0,2048)}B.innerHTML=E}}};function UI(){}(function(){var A={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(E){for(var B=0;B<E.length;B++){var C=E[B].string;var D=E[B].prop;this.versionSearchString=E[B].versionSearch||E[B].identity;if(C){if(C.indexOf(E[B].subString)!=-1){return E[B].identity}}else{if(D){return E[B].identity}}}},searchVersion:function(C){var B=C.indexOf(this.versionSearchString);if(B==-1){return }return parseFloat(C.substring(B+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};A.init();switch(A.browser){case"Firefox":case"Mozilla":case"Netscape":break;case"Explorer":UI.ie=true}})();(function(){if(UI.ie){UI.getEventSource=function(B){return B.srcElement};UI.getEventKeyCode=function(B){return B.keyCode};UI.addEventListener=function(C,B,D){return C.attachEvent("on"+B,D)};UI.removeEventListener=function(C,B,D){return C.detachEvent("on"+B,D)}}else{UI.getEventSource=function(B){return B.target};UI.getEventKeyCode=function(B){return B.which};var A;UI.addEventListener=function(D,B,C){if(A){C[B]=function(E){return C.call(D,E)};window.addEventListener(B,C[B],true)}else{D.addEventListener(B,C,false)}};UI.removeEventListener=function(D,B,C){if(A){window.removeEventListener(B.replace(/^on/,""),C[B],true);C[B]=null}else{D.removeEventListener(B.replace(/^on/,""),C,false)}}}})();UI.cancelEvent=function(A){if(A.stopPropagation){A.stopPropagation()}if(A.preventDefault){A.preventDefault()}A.keyCode=0;A.returnValue=false;A.cancelBubble=false;return false};function $(A){return document.getElementById(A)}function $Page(E,H,G,A){var F={titlebar:"no",toolbar:"no",status:"no",menubar:"no",resizable:"no",scrollbars:"no"};if(H){var D="";for(var C in H){D+=("&"+C+"="+escape(H[C]))}E+=("?"+(D.length?D.substr(1):""))}if(G){var B="";if(A){A.top=parseInt(screen.availHeight-(A.height?A.height:200))/2;A.left=parseInt(screen.availWidth-(A.width?A.width:200))/2;for(var C in A){B+=(","+C+"="+A[C])}}for(var C in F){B+=(","+C+"="+F[C])}B=B.substr(1);window.open(E,G,B)}else{window.location.href=E}}function $PF(A){if(typeof (A)=="string"){A=$(A)}do{if(A.domNode){A=A.domNode}if(A.tagName&&A.tagName.toLowerCase()=="form"){return A}A=A.parentNode}while(A)}function $AddE(A,C){var B="";for(kp in C){B=B+"<input type='hidden' name='"+kp.name+"' value='"+kp.value+"'/>"}A.innerHTML=B}var selectedForums;function lookupForums(D){if(!(D.callback&&D.selected)){alert("please specify callback and selected")}var A=D.selected;selectedForums=A;var C;try{C=getCommonDialogInfo("ForumLookup")}catch(B){C=parent.getCommonDialogInfo("ForumLookup")}DialogUtils.showDialog(C.url,C.title,{height:350,width:350},D.callback)}var selectedProfiles;function lookupProfiles(D){if(!(D.callback&&D.selected)){alert("please specify callback and selected")}var A=D.selected;selectedProfiles=A;var C;try{C=getCommonDialogInfo("ProfileLookup")}catch(B){C=parent.getCommonDialogInfo("ProfileLookup")}DialogUtils.showDialog(C.url,C.title,{height:350,width:350},D.callback)}function $CE(A){return UI.cancelEvent(A)}var DATE_CHAR=/[\d\/\t\b\u0000]/;var NUMB_CHAR=/[\d\t\b\u0000]/;var ALPH_CHAR=/[a-zA-Z\t\b\u0000]/;var ANUM_CHAR=/[\w\t\b\u0000]/;var NUME_CHAR=/[\d\.\t\b\u0000]/;var POSI_CHAR=/[123456789\t\b\u0000]/;var TEXT_CHAR=/[\w\.\s\,\&\*\'\"\:\;\t\b\u0000]/;function getEventKeyCode(A){return UI.getEventKeyCode(A)}function isKeyPressDate(A){return(A.ctrlKey||A.altKey||DATE_CHAR.test(String.fromCharCode(getEventKeyCode(A))))}function isKeyPressNumber(A){return(A.ctrlKey||A.altKey||NUMB_CHAR.test(String.fromCharCode(getEventKeyCode(A))))}function isKeyPressAlpha(A){return(A.ctrlKey||A.altKey||ALPH_CHAR.test(String.fromCharCode(getEventKeyCode(A))))}function isKeyPressAlphaNumeric(A){return(A.ctrlKey||A.altKey||ANUM_CHAR.test(String.fromCharCode(getEventKeyCode(A))))}function isKeyPressNumeric(A){return(A.ctrlKey||A.altKey||NUME_CHAR.test(String.fromCharCode(getEventKeyCode(A))))}function isKeyPressPositive(A){return(A.ctrlKey||A.altKey||POSI_CHAR.test(String.fromCharCode(getEventKeyCode(A))))}function isKeyPressText(A){return(A.ctrlKey||A.altKey||TEXT_CHAR.test(String.fromCharCode(getEventKeyCode(A))))}function searchForGamer(){var A=document.getElementById("searchText").value;A=A.replace(/^\s*/,"").replace(/\s*$/,"");if(A.length>0){form.submit()}else{alert("Please enter any gamer name to search");document.getElementById("searchText").value="";document.getElementById("searchText").focus()}}function openAdvertisePage(){alert("yet to do")}var underlay;function showVeil(){if(!underlay){underlay=new eva.ajax.ProcessingVeil({id:"dialog3_underlay","class":""})}underlay.show();loader()}function hideVeil(){underlay.hide();document.getElementById("loader").style.display="none"}function loader(){document.getElementById("loader").style.display="block"}function uploadDataContent(C,E){if(!/(\.(swf))$/i.test(C.game.value)){var A=dijit.byId("GameUploadDialog");A.hide();var D=function(){$("game").value="";A.show()};showAlert("Please upload a Game file","Game Upload",D);$("game").value="";return false}var B={form:C,handleAs:"json",handle:E};dojo.io.iframe.send(B)}function showGameInvitation(){var B=dijit.byId("InviteViewPane");B.setHref(getCommonDialogInfo("MultiplayerInvite").url);var A=dojo.fadeIn({node:B.domNode,duration:400});dojo.connect(A,"beforeBegin",function(){dojo.style(B.domNode,"display","block");B.toggle();_positionIt()});A.play()}function hideGameInvitation(){var B=dijit.byId("InviteViewPane");if(B.open){var A=dojo.fadeOut({node:B.domNode,duration:400});dojo.connect(A,"onEnd",function(){dojo.style(B.domNode,"display","none");B.toggle();_positionIt()});A.play()}}function _positionIt(A){var B=dijit.byId("InviteViewPane");if(B.domNode.style.display=="block"){dojo.style(B.domNode,"top",(dijit.getViewport().t+0)+"px")}}function findInvitation(){try{if(!page){HomeModule.hasMultiplayerInvite(findInvitationCallback)}}catch(A){}}function findInvitationCallback(A){if(A){showGameInvitation()}else{setTimeout(findInvitation,5000)}}function rejectMInvitation(A,C){var B=function(D){hideGameInvitation();findInvitation()};HomeModule.rejectInvitation({sessionId:A,participationId:C},B)}function acceptMInvite(A,B,C){window.location.href=getCommonDialogInfo("MultiplayerAccept").url+"?sessionId="+A+"&participantId="+B+"&chatSession="+C;hideGameInvitation()}function showAlert(C,B,A){if(B){$("CommonMessage_title").innerHTML=B}else{$("CommonMessage_title").innerHTML="Gamecarte"}$("information").innerHTML=C;var D=function(){showFlashComponents();dijit.byId("CommonMessage").hide();if(A){A()}};$("CommonMessage_Close").onclick=D;dijit.byId("CommonMessage").show()}function onClickSearch(){if((dijit.byId("isGame").checked==false)&&(dijit.byId("isGamer").checked==false)&&(dijit.byId("isForum").checked==false)){hideFlashComponents();showAlert("Please check at least one checkbox");return false}var B=$("searchText").value;if(B.length!=0){if(dijit.byId("isForum").checked==true){setSearchSelected(dijit.byId("isForum"))}if(dijit.byId("isGamer").checked==true){setSearchSelected(dijit.byId("isGamer"))}if(dijit.byId("isGame").checked==true){setSearchSelected(dijit.byId("isGame"))}genericsearch.submit()}else{if(B.length==0){var A=getHomePage("homePage");$Page(A)}}}function setSearchSelected1(A){$("hidGen"+A.toTitleCase()).value=true}function validateGenericSearch(){if((dijit.byId("isGame").checked==false)&&(dijit.byId("isGamer").checked==false)&&(dijit.byId("isForum").checked==false)){hideFlashComponents();showAlert("Please check at least one checkbox");$("searchText").focus();return false}var A=$("searchText").value;A=A.replace(/^\s*/,"").replace(/\s*$/,"");if(A.length!=0){if(dijit.byId("isForum").checked==true){setSearchSelected(dijit.byId("isForum"))}if(dijit.byId("isGamer").checked==true){setSearchSelected(dijit.byId("isGamer"))}if(dijit.byId("isGame").checked==true){setSearchSelected(dijit.byId("isGame"))}genericsearch.submit();return true}else{if(A.length==0){showAlert("Please enter the value to make a search");$("searchText").focus();return false}}}var flashComponents=[];function showFlashComponents(){for(var A=0;A<flashComponents.length;A++){$(flashComponents[A]+"Image").style.display="none";$(flashComponents[A]+"Flash").style.display="block"}}function hideFlashComponents(){for(var A=0;A<flashComponents.length;A++){$(flashComponents[A]+"Image").style.display="block";$(flashComponents[A]+"Flash").style.display="none"}}function initializeDialogs(){dojo.connect(dijit.byId("language"),"onCancel",showFlashComponents);dojo.connect(dijit.byId("login"),"onCancel",showFlashComponents);dojo.connect(dijit.byId("forgotPassword"),"onCancel",showFlashComponents);dojo.connect(dijit.byId("feedBack"),"onCancel",showFlashComponents)}function closeChngLangDlg(){showFlashComponents();dijit.byId("language").hide()}function showLoginDlg(){hideFlashComponents();dijit.byId("login").show()}function closeLoginDlg(){showFlashComponents();dijit.byId("login").hide()}function showFPasswdDlg(){$("profileName").value="";$("email").value="";dijit.byId("login").hide();setTimeout(function(){dijit.byId("forgotPassword").show()},500)}function closeFPasswdDlg(){$("profileName").value="";$("email").value="";showFlashComponents();dijit.byId("forgotPassword").hide()}function changePasswd(){var D=dijit.byId("profileName").value;var B=dijit.byId("email").value;var C=dijit.byId("forgotPassword");var A=function(){hideFlashComponents();C.show()};if(!(B.validateEmail())){hideFlashComponents();C.hide();showAlert("Invalid Email ","Change Email",A)}if((D=="")){var C=dijit.byId("forgotPassword");var A=function(){hideFlashComponents();C.show()};hideFlashComponents();C.hide();showAlert("Please enter the Username","",A);return false}if((B=="")){var C=dijit.byId("forgotPassword");var A=function(){hideFlashComponents();C.show()};hideFlashComponents();C.hide();showAlert("Please enter the Email","",A);return false}var E=function(H){if(H==5){var G=dijit.byId("forgotPassword");var F=function(){hideFlashComponents();G.show()};G.hide();showAlert("Invalid Email or Username","",F)}else{if(H==0){dijit.byId("forgotPassword").hide();hideFlashComponents();showAlert("Your password has been changed and sent to your Email account")}}};HomeModule.resetPassword({profileName:D,email:B},E)}function showFbackDlg(){hideFlashComponents();dijit.byId("feedBack").show()}function hideFbackDlg(){$("feedbackText").value="";showFlashComponents();dijit.byId("feedBack").hide()}function sendFeedback(){var B=dijit.byId("feedBack");var C=$("feedbackText").value;var A=function(){hideFbackDlg()};if(C==""){B.hide();showAlert("Please enter your Feedback","Gamecarte",A)}$("feedbackText").value="";var D=function(E){if(E==1){dijit.byId("feedBack").hide();showAlert("Feedback sent successfully","Gamecarte",A)}};if(C!=""){HomeModule.sendFeedBack({message:C},D)}}function changeSiteLanguage(C){var A=function(E){if(E==0){window.location.href=getContextPath()+"/controller/common/home/homepage/open"}};var D=$("changeLanguage").elements;for(var B=0;B<D.length;B++){if(D[B].type=="radio"){if(D[B].checked){C=D[B].value;HomeModule.changeLanguage({languageCode:C},A)}}}}function closeLoginInfo(){dijit.byId("loginmsg").hide();showLoginDlg()}dojo.addOnLoad(initializeDialogs);if(typeof UserGames!="function"){function UserGames(){this.parentRequired=false;this.title=null;this.message=null;this.chatSession=null;this.descending=false;this.favoriteGame=false;this.sortBy=null;this.emailIds=[];this.gameId=0;this.gameStateId=0;this.pageSize=0;this.selectedItems=[];this.chatMessages=[];this.resultSize=0;this.gameRating=0;this.selects=[];this.sessionId=null;this.removed=[];this.selected=[];this.saleItemId=0;this.messageCounter=0;this.page=0;this.identifier=null;this.genre=null;this.developerName=null}}if(typeof tournament!="function"){function tournament(){this.createdDate=null;this.parentRequired=false;this.secondsUnit=[];this.chatSession=null;this.variantPoints=[];this.contacts=null;this.easyPoints=[];this.faq=null;this.topScore=[];this.tournamentSessionId=null;this.variantGameCount=[];this.selectedItems=[];this.chatMessages=[];this.thirdQualifier=[];this.gameInfoId=null;this.timeLimit=[];this.hoursUnit=[];this.hardPoints=[];this.selected=[];this.fisrRoundStartTime=null;this.messageCounter=0;this.page=0;this.hardGameCount=[];this.gameName=null;this.endDate=null;this.mediumGameCount=[];this.minutesUnit=[];this.startDate=null;this.title=null;this.primaryQualifier=[];this.rules=null;this.roundId=null;this.roundName=[];this.iconURL=null;this.descending=false;this.timeUnit=[];this.sortBy=null;this.gameId=null;this.pageSize=0;this.mediumPoints=[];this.startTime=[];this.resultSize=0;this.additinalInfo=null;this.tournamentLogo=null;this.maximumParticipants=null;this.easyGameCount=[];this.pageId=null;this.description=null;this.rowCount=null;this.createdTournamentId=null;this.secondaryQualifier=[];this.identifier=null;this.tournamentId=null}}if(typeof valueList!="function"){function valueList(){this.descending=false;this.context=null;this.rowCount=0;this.identifier=null;this.sortField=null;this.pageSize=0;this.currentPage=0;this.parent=null}}if(typeof valueList!="function"){function valueList(){}}if(typeof profile!="function"){function profile(){this.parentRequired=false;this.searchText=null;this.chatSession=null;this.oldEmail=null;this.securityKey=null;this.date=null;this.newEmail=null;this.descending=false;this.locked=false;this.languageCode=0;this.sortBy=null;this.pageSize=0;this.profileId=0;this.selectedItems=[];this.verifyPassword=null;this.resultSize=0;this.password=null;this.gender=null;this.forumId=0;this.confirmEmail=null;this.chatMessages=[];this.parentId=0;this.theme=null;this.gameInfoId=0;this.maxAllowed=null;this.subscribed=false;this.dateField=null;this.groupName=null;this.oldPassword=null;this.packageCodeSubscribe=null;this.selected=[];this.removed=[];this.country=null;this.homePage=null;this.profileName=null;this.page=0;this.messageCounter=0;this.forumIds=null;this.gameName=null;this.email=null;this.identifier=null;this.packageCode=null}}if(typeof valueList!="function"){function valueList(){this.descending=false;this.context=null;this.rowCount=0;this.identifier=null;this.sortField=null;this.pageSize=0;this.currentPage=0;this.parent=null}}if(typeof message!="function"){function message(){this.parentRequired=false;this.message=null;this.chatSession=null;this.messageId=0;this.playersList=[];this.contactName=null;this.descending=false;this.sortBy=null;this.UTC=0;this.onlineContactsSelect=[];this.pageSize=0;this.selectedItems=[];this.chatMessages=[];this.resultSize=0;this.contactType=null;this.selects=[];this.invitationId=0;this.contactId=0;this.sessionId=null;this.selected=[];this.receiverId=0;this.messageCounter=0;this.page=0;this.identifier=null;this.subject=null}}if(typeof lookup!="function"){function lookup(){this.resultSize=0;this.chatMessages=[];this.parentRequired=false;this.selects=[];this.chatSession=null;this.lookupText=null;this.key=0;this.descending=false;this.selected=[];this.removed=[];this.sortBy=null;this.messageCounter=0;this.page=0;this.identifier=null;this.pageSize=0;this.selectedItems=[];this.gamerId=0;this.gamerName=null}}if(typeof forum!="function"){function forum(){this.resultSize=0;this.chatMessages=[];this.forumId=0;this.parentRequired=false;this.forumType=0;this.title=null;this.searchText=null;this.chatSession=null;this.ownerId=0;this.topicName=null;this.descending=false;this.selected=[];this.contentDescription=null;this.topicId=0;this.sortBy=null;this.messageCounter=0;this.page=0;this.forumIds=null;this.identifier=null;this.forumStatus=null;this.pageSize=0;this.selectedItems=[]}}if(dwr==null){var dwr={}}if(dwr.engine==null){dwr.engine={}}if(DWREngine==null){var DWREngine=dwr.engine}if(HomeModule==null){var HomeModule={}}HomeModule._path=getContextPath()+"/dwr";HomeModule.resetPassword=function(B,A){dwr.engine._execute(HomeModule._path,"HomeModule","resetPassword",B,A)};HomeModule.rejectInvitation=function(B,A){dwr.engine._execute(HomeModule._path,"HomeModule","rejectInvitation",B,A)};HomeModule.changeLanguage=function(B,A){dwr.engine._execute(HomeModule._path,"HomeModule","changeLanguage",B,A)};HomeModule.sendFeedBack=function(B,A){dwr.engine._execute(HomeModule._path,"HomeModule","sendFeedBack",B,A)};HomeModule.hasMultiplayerInvite=function(A){dwr.engine._execute(HomeModule._path,"HomeModule","hasMultiplayerInvite",A)};HomeModule.createRoundAndInvite=function(B,A){dwr.engine._execute(HomeModule._path,"HomeModule","createRoundAndInvite",B,A)};String.prototype.trim=function(){return this.replace(/^[ \t]+|[ \t]+$/g,"")};String.prototype.trimNull=function(){var A=this.replace(/^[ \t]+|[ \t]+$/g,"");return A.length?A:null};String.prototype.trimZero=function(){var A=this.replace(/^[ \t]+|[ \t]+$/g,"");A=A.unprefix("0");return A.length?parseInt(A):0};String.prototype.trimDate=function(){var A=this.replace(/^[ \t]+|[ \t]+$/g,"");return this.length?A:"00/00/0000"};String.prototype.trimDateNull=function(){var A=this.replace(/^[ \t]+|[ \t]+$/g,"");return(this.length&&A!="00/00/0000")?this:null};String.prototype.unescapeHTML=function(){return this.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&nbsp;/g," ")};String.prototype.escapeHTML=function(){return this.replace(/\&/g,"&amp;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\s/g,"&nbsp;")};String.prototype.prefix=function(E,D){var C=this.trim();var B="";if(C.length<D){for(var A=D-C.length;A>0;A--){B+=E}}return B+C};String.prototype.unprefix=function(C){var A=this.trim();var B=C.length;while(A.indexOf(C)==0){A=A.substring(1)}return A};String.prototype.postfix=function(E,D){var C=this.trim();var B="";if(C.length<D){for(var A=D-C.length;A==0;A--){B+="0"}}return C+B};String.prototype.toTitleCase=function(){if(this.length==0){return""}return this.charAt(0).toUpperCase()+this.substring(1)};String.prototype.formatText=function(){return this.replace(/[\u2019\u2018\u2032]/g,"'").replace(/[\u201D\u201C\u2033]/g,'"')};String.objectToString=function(C){var B="{";for(var A in C){p=C[A];if(typeof (p)=="function"){B+=A+":"+p+","}else{if(typeof (p)=="string"){B+=A+':"'+p.replace(/\"/g,'"')+'",'}else{if(p.length!=null){String.arrayToString(p)}else{alert(describeObject(C));throw ({description:"String.objectToString:Does not support embedded object!"})}}}}B+="}";return B.replace(",}","}")};String.objectShallowToString=function(C){var B="{";for(var A in C){p=C[A];if(typeof (p)=="function"){B+=A+":"+p+","}else{B+=A+':"'+p+'",'}}B+="}";return B.replace(",}","}")};String.arrayToString=function(D){var C,B;var A="[";for(B=0;B<D.length;B++){C=D[B];if(typeof (C)=="number"){A+=C+","}else{if(typeof (C)=="string"){A+='"'+C.replace(/\"/g,'\\"')+'",'}else{if(C.splice){if(C.length==0){A+="[],"}else{A+=String.arrayToString(C)+","}}else{if(typeof (C)=="object"){throw ({description:"String.arrayToString:Does not support embedded object!"})}else{throw ({description:"String.arrayToString:UNKNOWN TYPE!"})}}}}}A+="]";return A.replace(",]","]")};String.prototype.toObject=function(){var text=this.replace(/\n/g," ");text=text.replace(/\r/g," ");if(text.match(/^\s*\{.*\}\s*$/)){text="["+text+"][0]"}return eval(text)};String.compare=function(F,D){var C=F.length;var B=D.length;var A=(C>B?B:C);var E=0;while(E<A){var G=F.charCodeAt(E)-D.charCodeAt(E++);if(G!=0){return G}}if(F[E]){return F.charCodeAt(E)}if(D[E]){return -D.charCodeAt(E)}return 0};String.prototype.formatCurrency=function(){var A=this.length-3;var C=(this.length?true:false);var B=this.unprefix("0");if(B.indexOf(",")==-1){if(C&&!B){B="0"}while(A>0){B=B.substr(0,A)+","+B.substr(A);A-=3}}return B};String.prototype.isValidDate=function(){var dateValue=this.trim();if(dateValue.length==0){return false}var matchArray=dateValue.match(/^(\d{2})(\/)(\d{2})(\/)(\d{4})$/);if(matchArray==null){return false}day=eval(matchArray[3]);month=eval(matchArray[1]);year=eval(matchArray[5]);if(month<1||month>12){return false}if(day<1||day>31){return false}if((month==4||month==6||month==9||month==11)&&day==31){return false}if(month==2){var isleap=(year%4==0&&(year%100!=0||year%400==0));if(day>29||(day==29&&!isleap)){return false}}return true};if(dwr==null){var dwr={}}if(dwr.util==null){dwr.util={}}if(DWRUtil==null){var DWRUtil=dwr.util}dwr.util._escapeHtml=true;dwr.util.setEscapeHtml=function(A){dwr.util._escapeHtml=A};dwr.util._shouldEscapeHtml=function(A){if(A&&A.escapeHtml!=null){return A.escapeHtml}return dwr.util._escapeHtml};dwr.util.escapeHtml=function(A){var C=document.createElement("div");var B=document.createTextNode(A);C.appendChild(B);return C.innerHTML};dwr.util.unescapeHtml=function(A){var B=document.createElement("div");B.innerHTML=A.replace(/<\/?[^>]+>/gi,"");return B.childNodes[0]?B.childNodes[0].nodeValue:""};dwr.util.replaceXmlCharacters=function(A){A=A.replace("&","+");A=A.replace("<","\u2039");A=A.replace(">","\u203A");A=A.replace("'","\u2018");A=A.replace('"',"\u201C");return A};dwr.util.containsXssRiskyCharacters=function(A){return(A.indexOf("&")!=-1||A.indexOf("<")!=-1||A.indexOf(">")!=-1||A.indexOf("'")!=-1||A.indexOf('"')!=-1)};dwr.util.onReturn=function(A,B){if(!A){A=window.event}if(A&&A.keyCode&&A.keyCode==13){B()}};dwr.util.selectRange=function(C,D,A){C=dwr.util._getElementById(C,"selectRange()");if(C==null){return }if(C.setSelectionRange){C.setSelectionRange(D,A)}else{if(C.createTextRange){var B=C.createTextRange();B.moveStart("character",D);B.moveEnd("character",A-C.value.length);B.select()}}C.focus()};if(document.getElementById){dwr.util.byId=function(){var C=new Array();for(var B=0;B<arguments.length;B++){var A=arguments[B];if(typeof A=="string"){A=document.getElementById(A)}if(arguments.length==1){return A}C.push(A)}return C}}else{if(document.all){dwr.util.byId=function(){var C=new Array();for(var B=0;B<arguments.length;B++){var A=arguments[B];if(typeof A=="string"){A=document.all[A]}if(arguments.length==1){return A}C.push(A)}return C}}}var $;if(!$){$=dwr.util.byId}dwr.util.toDescriptiveString=function(F,A,I){if(A===undefined){A=1}var C={};if(dwr.util._isObject(I)){C=I}var G={escapeHtml:false,baseIndent:"",childIndent:"\u00A0\u00A0",lineTerminator:"\n",oneLineMaxItems:5,shortStringMaxLength:13,propertyNameMaxLength:30};for(var B in G){if(!(B in C)){C[B]=G[B]}}var H={document:true,ownerDocument:true,all:true,parentElement:true,parentNode:true,offsetParent:true,children:true,firstChild:true,lastChild:true,previousSibling:true,nextSibling:true,innerHTML:true,outerHTML:true,innerText:true,outerText:true,textContent:true,attributes:true,style:true,currentStyle:true,runtimeStyle:true,parentTextEdit:true};function E(P,J,L,W){var M="";try{if(typeof P=="string"){var S=P;if(J==0&&S.length>W.shortStringMaxLength){S=S.substring(0,W.shortStringMaxLength-3)+"..."}if(W.escapeHtml){var X=S.split("\n");for(var Q=0;Q<X.length;Q++){X[Q]=dwr.util.escapeHtml(X[Q])}S=X.join("\n")}if(J==0){S=S.replace(/\n|\r|\t/g,function(Y){switch(Y){case"\n":return"\\n";case"\r":return"";case"\t":return"\\t"}})}else{S=S.replace(/\n|\r|\t/g,function(Y){switch(Y){case"\n":return W.lineTerminator+D(L+1,W);case"\r":return"";case"\t":return"\\t"}})}M='"'+S+'"'}else{if(typeof P=="function"){M="function"}else{if(dwr.util._isArray(P)){if(J==0){if(P.length>0){M="[...]"}else{M="[]"}}else{var V=[];V.push("[");var R=0;for(var Q=0;Q<P.length;Q++){if(!(Q in P)){continue}var T=P[Q];if(R>0){V.push(", ")}if(J==1){if(R==W.oneLineMaxItems){V.push("...");break}}else{V.push(W.lineTerminator+D(L+1,W))}if(Q!=R){V.push(Q);V.push(":")}V.push(E(T,J-1,L+1,W));R++}if(J>1){V.push(W.lineTerminator+D(L,W))}V.push("]");M=V.join("")}}else{if(dwr.util._isObject(P)&&!dwr.util._isDate(P)){if(J==0){M=dwr.util._detailedTypeOf(P)}else{var V=[];if(dwr.util._detailedTypeOf(P)!="Object"){V.push(dwr.util._detailedTypeOf(P));if(typeof P.valueOf()!="object"){V.push(":");V.push(E(P.valueOf(),1,L,W))}V.push(" ")}V.push("{");var U=dwr.util._isHTMLElement(P);var R=0;for(var K in P){var O=P[K];if(U){if(!O){continue}if(typeof O=="function"){continue}if(H[K]){continue}if(K.toUpperCase()==K){continue}}if(R>0){V.push(", ")}if(J==1){if(R==W.oneLineMaxItems){V.push("...");break}}else{V.push(W.lineTerminator+D(L+1,W))}V.push(K.length>W.propertyNameMaxLength?K.substring(0,W.propertyNameMaxLength-3)+"...":K);V.push(":");V.push(E(O,J-1,L+1,W));R++}if(J>1&&R>0){V.push(W.lineTerminator+D(L,W))}V.push("}");M=V.join("")}}else{M=""+P}}}}return M}catch(N){return(N.message?N.message:""+N)}}function D(L,J){var M=[];M.push(J.baseIndent);for(var K=0;K<L;K++){M.push(J.childIndent)}return M.join("")}return E(F,A,0,C)};dwr.util.useLoadingMessage=function(A){var B;if(A){B=A}else{B="Loading"}dwr.engine.setPreHook(function(){var D=dwr.util.byId("disabledZone");if(!D){D=document.createElement("div");D.setAttribute("id","disabledZone");D.style.position="absolute";D.style.zIndex="1000";D.style.left="0px";D.style.top="0px";D.style.width="100%";D.style.height="100%";document.body.appendChild(D);var C=document.createElement("div");C.setAttribute("id","messageZone");C.style.position="absolute";C.style.top="0px";C.style.right="0px";C.style.background="red";C.style.color="white";C.style.fontFamily="Arial,Helvetica,sans-serif";C.style.padding="4px";D.appendChild(C);var E=document.createTextNode(B);C.appendChild(E);dwr.util._disabledZoneUseCount=1}else{dwr.util.byId("messageZone").innerHTML=B;D.style.visibility="visible";dwr.util._disabledZoneUseCount++}});dwr.engine.setPostHook(function(){dwr.util._disabledZoneUseCount--;if(dwr.util._disabledZoneUseCount==0){dwr.util.byId("disabledZone").style.visibility="hidden"}})};dwr.util.setHighlightHandler=function(A){dwr.util._highlightHandler=A};dwr.util.yellowFadeHighlightHandler=function(A){dwr.util._yellowFadeProcess(A,0)};dwr.util._yellowFadeSteps=["d0","b0","a0","90","98","a0","a8","b0","b8","c0","c8","d0","d8","e0","e8","f0","f8"];dwr.util._yellowFadeProcess=function(A,B){A=dwr.util.byId(A);if(B<dwr.util._yellowFadeSteps.length){A.style.backgroundColor="#ffff"+dwr.util._yellowFadeSteps[B];setTimeout("dwr.util._yellowFadeProcess('"+A.id+"',"+(B+1)+")",200)}else{A.style.backgroundColor="transparent"}};dwr.util.borderFadeHighlightHandler=function(A){A.style.borderWidth="2px";A.style.borderStyle="solid";dwr.util._borderFadeProcess(A,0)};dwr.util._borderFadeSteps=["d0","b0","a0","90","98","a0","a8","b0","b8","c0","c8","d0","d8","e0","e8","f0","f8"];dwr.util._borderFadeProcess=function(A,B){A=dwr.util.byId(A);if(B<dwr.util._borderFadeSteps.length){A.style.borderColor="#ff"+dwr.util._borderFadeSteps[B]+dwr.util._borderFadeSteps[B];setTimeout("dwr.util._borderFadeProcess('"+A.id+"',"+(B+1)+")",200)}else{A.style.backgroundColor="transparent"}};dwr.util.focusHighlightHandler=function(B){try{B.focus()}catch(A){}};dwr.util._highlightHandler=null;dwr.util.highlight=function(B,A){if(A&&A.highlightHandler){A.highlightHandler(dwr.util.byId(B))}else{if(dwr.util._highlightHandler!=null){dwr.util._highlightHandler(dwr.util.byId(B))}}};dwr.util.setValue=function(F,G,C){if(G==null){G=""}if(C==null){C={}}var H=F;if(typeof F=="string"){F=dwr.util.byId(F);if(F&&F.id!=H){F=null}}var A=null;if(F==null){A=document.getElementsByName(H);if(A.length>=1){F=A.item(0)}}if(F==null){dwr.util._debug("setValue() can't find an element with id/name: "+H+".");return }dwr.util.highlight(F,C);if(dwr.util._isHTMLElement(F,"select")){if(F.type=="select-multiple"&&dwr.util._isArray(G)){dwr.util._selectListItems(F,G)}else{dwr.util._selectListItem(F,G)}return }if(dwr.util._isHTMLElement(F,"input")){if(F.type=="radio"||F.type=="checkbox"){if(A&&A.length>=1){for(var D=0;D<A.length;D++){var E=A.item(D);if(E.type!=F.type){continue}if(dwr.util._isArray(G)){E.checked=false;for(var B=0;B<G.length;B++){if(G[B]==E.value){E.checked=true}}}else{E.checked=(E.value==G)}}}else{F.checked=(G==true)}}else{F.value=G}return }if(dwr.util._isHTMLElement(F,"textarea")){F.value=G;return }if(G.nodeType){if(G.nodeType==9){G=G.documentElement}G=dwr.util._importNode(F.ownerDocument,G,true);F.appendChild(G);return }if(dwr.util._shouldEscapeHtml(C)&&typeof (G)=="string"){if(F.textContent){F.textContent=G}else{if(F.innerText){F.innerText=G}else{F.innerHTML=dwr.util.escapeHtml(G)}}}else{F.innerHTML=G}};dwr.util._selectListItems=function(D,E){var C=false;var B;var A;for(B=0;B<D.options.length;B++){D.options[B].selected=false;for(A=0;A<E.length;A++){if(D.options[B].value==E[A]){D.options[B].selected=true}}}if(C){return }for(B=0;B<D.options.length;B++){for(A=0;A<E.length;A++){if(D.options[B].text==E[A]){D.options[B].selected=true}}}};dwr.util._selectListItem=function(C,D){var B=false;var A;for(A=0;A<C.options.length;A++){if(C.options[A].value==D){C.options[A].selected=true;B=true}else{C.options[A].selected=false}}if(B){return }for(A=0;A<C.options.length;A++){C.options[A].selected=(C.options[A].text==D)}};dwr.util.getValue=function(I,J){if(J==null){J={}}var G=I;if(typeof I=="string"){I=dwr.util.byId(I);if(I&&I.id!=G){I=null}}var A=null;if(I==null){A=document.getElementsByName(G);if(A.length>=1){I=A.item(0)}}if(I==null){dwr.util._debug("getValue() can't find an element with id/name: "+G+".");return""}if(dwr.util._isHTMLElement(I,"select")){if(I.type=="select-multiple"){var D=new Array();for(var F=0;F<I.options.length;F++){var H=I.options[F];if(H.selected){var E=H.getAttributeNode("value");if(E&&E.specified){D.push(H.value)}else{D.push(H.text)}}}return D}else{var B=I.selectedIndex;if(B!=-1){var H=I.options[B];var E=H.getAttributeNode("value");if(E&&E.specified){return H.value}return H.text}else{return""}}}if(dwr.util._isHTMLElement(I,"input")){if(I.type=="radio"){if(A&&A.length>=1){for(var F=0;F<A.length;F++){var C=A.item(F);if(C.type==I.type){if(C.checked){return C.value}}}}return I.checked}if(I.type=="checkbox"){if(A&&A.length>=1){var D=[];for(var F=0;F<A.length;F++){var C=A.item(F);if(C.type==I.type){if(C.checked){D.push(C.value)}}}return D}return I.checked}return I.value}if(dwr.util._isHTMLElement(I,"textarea")){return I.value}if(dwr.util._shouldEscapeHtml(J)){if(I.textContent){return I.textContent}else{if(I.innerText){return I.innerText}}}return I.innerHTML};dwr.util.getText=function(B){B=dwr.util._getElementById(B,"getText()");if(B==null){return null}if(!dwr.util._isHTMLElement(B,"select")){dwr.util._debug("getText() can only be used with select elements. Attempt to use: "+dwr.util._detailedTypeOf(B)+" from  id: "+orig+".");return""}var A=B.selectedIndex;if(A!=-1){return B.options[A].text}else{return""}};dwr.util.setValues=function(C,A){var B="";if(A&&A.prefix){B=A.prefix}if(A&&A.idPrefix){B=A.idPrefix}dwr.util._setValuesRecursive(C,B)};dwr.util._setValuesRecursive=function(C,E){if(dwr.util._isArray(C)&&C.length>0&&dwr.util._isObject(C[0])){for(var B=0;B<C.length;B++){dwr.util._setValuesRecursive(C[B],E+"["+B+"]")}}else{if(dwr.util._isObject(C)&&!dwr.util._isArray(C)){for(var D in C){var A=E?E+"."+D:D;if(dwr.util._isObject(C[D])&&!dwr.util._isArray(C[D])||dwr.util._isArray(C[D])&&C[D].length>0&&dwr.util._isObject(C[D][0])){dwr.util._setValuesRecursive(C[D],A)}else{if(typeof C[D]=="function"){}else{if(dwr.util.byId(A)!=null||document.getElementsByName(A).length>=1){dwr.util.setValue(A,C[D])}}}}}}};dwr.util.getValues=function(C,A){if(typeof C=="string"||dwr.util._isHTMLElement(C)){return dwr.util.getFormValues(C)}else{var B="";if(A!=null&&A.prefix){B=A.prefix}if(A!=null&&A.idPrefix){B=A.idPrefix}dwr.util._getValuesRecursive(C,B);return C}};dwr.util.getFormValues=function(A){var F=null;if(typeof A=="string"){F=document.forms[A];if(F==null){F=dwr.util.byId(A)}}else{if(dwr.util._isHTMLElement(A)){F=A}}if(F!=null){if(F.elements==null){alert("getFormValues() requires an object or reference to a form element.");return null}var D={};var B;var E;for(var C=0;C<F.elements.length;C++){if(F[C].type in {button:0,submit:0,reset:0,image:0,file:0}){continue}if(F[C].name){B=F[C].name;E=dwr.util.getValue(B)}else{if(F[C].id){B=F[C].id}else{B="element"+C}E=dwr.util.getValue(F[C])}D[B]=E}return D}};dwr.util._getValuesRecursive=function(C,E){if(dwr.util._isArray(C)&&C.length>0&&dwr.util._isObject(C[0])){for(var B=0;B<C.length;B++){dwr.util._getValuesRecursive(C[B],E+"["+B+"]")}}else{if(dwr.util._isObject(C)&&!dwr.util._isArray(C)){for(var D in C){var A=E?E+"."+D:D;if(dwr.util._isObject(C[D])&&!dwr.util._isArray(C[D])||dwr.util._isArray(C[D])&&C[D].length>0&&dwr.util._isObject(C[D][0])){dwr.util._getValuesRecursive(C[D],A)}else{if(typeof C[D]=="function"){}else{if(dwr.util.byId(A)!=null||document.getElementsByName(A).length>=1){C[D]=dwr.util.getValue(A)}}}}}}};dwr.util.addOptions=function(N,F){N=dwr.util._getElementById(N,"addOptions()");if(N==null){return }var C=dwr.util._isHTMLElement(N,"select");var I=dwr.util._isHTMLElement(N,["ul","ol"]);if(!C&&!I){dwr.util._debug("addOptions() can only be used with select/ul/ol elements. Attempt to use: "+dwr.util._detailedTypeOf(N));return }if(F==null){return }var H=arguments.length;var O={};var M=arguments[H-1];if(H>2&&dwr.util._isObject(M)){O=M;H--}var G=null;if(H>=3){G=arguments[2]}var D=null;if(H>=4){D=arguments[3]}if(!O.optionCreator&&C){O.optionCreator=dwr.util._defaultOptionCreator}if(!O.optionCreator&&I){O.optionCreator=dwr.util._defaultListItemCreator}var L,J,K;if(dwr.util._isArray(F)){for(var E=0;E<F.length;E++){O.data=F[E];O.text=null;O.value=null;if(C){if(G!=null){if(D!=null){O.text=dwr.util._getValueFrom(F[E],D);O.value=dwr.util._getValueFrom(F[E],G)}else{O.text=O.value=dwr.util._getValueFrom(F[E],G)}}else{O.text=O.value=dwr.util._getValueFrom(F[E])}if(O.text!=null||O.value){var B=O.optionCreator(O);B.text=O.text;B.value=O.value;N.options[N.options.length]=B}}else{O.value=dwr.util._getValueFrom(F[E],G);if(O.value!=null){K=O.optionCreator(O);if(dwr.util._shouldEscapeHtml(O)){O.value=dwr.util.escapeHtml(O.value)}K.innerHTML=O.value;N.appendChild(K)}}}}else{if(D!=null){if(!C){alert("dwr.util.addOptions can only create select lists from objects.");return }for(var A in F){O.data=F[A];O.value=dwr.util._getValueFrom(F[A],G);O.text=dwr.util._getValueFrom(F[A],D);if(O.text!=null||O.value){var B=O.optionCreator(O);B.text=O.text;B.value=O.value;N.options[N.options.length]=B}}}else{if(!C){dwr.util._debug("dwr.util.addOptions can only create select lists from objects.");return }for(var A in F){if(typeof F[A]=="function"){continue}O.data=F[A];if(!G){O.value=A;O.text=F[A]}else{O.value=F[A];O.text=A}if(O.text!=null||O.value){var B=O.optionCreator(O);B.text=O.text;B.value=O.value;N.options[N.options.length]=B}}}}dwr.util.highlight(N,O)};dwr.util._getValueFrom=function(A,B){if(B==null){return A}else{if(typeof B=="function"){return B(A)}else{return A[B]}}};dwr.util._defaultOptionCreator=function(A){return new Option()};dwr.util._defaultListItemCreator=function(A){return document.createElement("li")};dwr.util.removeAllOptions=function(B){B=dwr.util._getElementById(B,"removeAllOptions()");if(B==null){return }var A=dwr.util._isHTMLElement(B,"select");var C=dwr.util._isHTMLElement(B,["ul","ol"]);if(!A&&!C){dwr.util._debug("removeAllOptions() can only be used with select, ol and ul elements. Attempt to use: "+dwr.util._detailedTypeOf(B));return }if(A){B.options.length=0}else{while(B.childNodes.length>0){B.removeChild(B.firstChild)}}};dwr.util.addRows=function(E,D,A,B){E=dwr.util._getElementById(E,"addRows()");if(E==null){return }if(!dwr.util._isHTMLElement(E,["table","tbody","thead","tfoot"])){dwr.util._debug("addRows() can only be used with table, tbody, thead and tfoot elements. Attempt to use: "+dwr.util._detailedTypeOf(E));return }if(!B){B={}}if(!B.rowCreator){B.rowCreator=dwr.util._defaultRowCreator}if(!B.cellCreator){B.cellCreator=dwr.util._defaultCellCreator}var C,F;if(dwr.util._isArray(D)){for(F=0;F<D.length;F++){B.rowData=D[F];B.rowIndex=F;B.rowNum=F;B.data=null;B.cellNum=-1;C=dwr.util._addRowInner(A,B);if(C!=null){E.appendChild(C)}}}else{if(typeof D=="object"){F=0;for(var G in D){B.rowData=D[G];B.rowIndex=G;B.rowNum=F;B.data=null;B.cellNum=-1;C=dwr.util._addRowInner(A,B);if(C!=null){E.appendChild(C)}F++}}}dwr.util.highlight(E,B)};dwr.util._addRowInner=function(A,B){var D=B.rowCreator(B);if(D==null){return null}for(var E=0;E<A.length;E++){var C=A[E];if(typeof C=="function"){B.data=C(B.rowData,B)}else{B.data=C||""}B.cellNum=E;var F=B.cellCreator(B);if(F!=null){if(B.data!=null){if(dwr.util._isHTMLElement(B.data)){F.appendChild(B.data)}else{if(dwr.util._shouldEscapeHtml(B)&&typeof (B.data)=="string"){F.innerHTML=dwr.util.escapeHtml(B.data)}else{F.innerHTML=B.data}}}D.appendChild(F)}}return D};dwr.util._defaultRowCreator=function(A){return document.createElement("tr")};dwr.util._defaultCellCreator=function(A){return document.createElement("td")};dwr.util.removeAllRows=function(C,A){C=dwr.util._getElementById(C,"removeAllRows()");if(C==null){return }if(!A){A={}}if(!A.filter){A.filter=function(){return true}}if(!dwr.util._isHTMLElement(C,["table","tbody","thead","tfoot"])){dwr.util._debug("removeAllRows() can only be used with table, tbody, thead and tfoot elements. Attempt to use: "+dwr.util._detailedTypeOf(C));return }var D=C.firstChild;var B;while(D!=null){B=D.nextSibling;if(A.filter(D)){C.removeChild(D)}D=B}};dwr.util.setClassName=function(B,A){B=dwr.util._getElementById(B,"setClassName()");if(B==null){return }B.className=A};dwr.util.addClassName=function(B,A){B=dwr.util._getElementById(B,"addClassName()");if(B==null){return }B.className+=" "+A};dwr.util.removeClassName=function(C,A){C=dwr.util._getElementById(C,"removeClassName()");if(C==null){return }var B=new RegExp("(^|\\s)"+A+"(\\s|$)","g");C.className=C.className.replace(B,"")};dwr.util.toggleClassName=function(C,A){C=dwr.util._getElementById(C,"toggleClassName()");if(C==null){return }var B=new RegExp("(^|\\s)"+A+"(\\s|$)");if(B.test(C.className)){C.className=C.className.replace(B,"")}else{C.className+=" "+A}};dwr.util.cloneNode=function(B,A){B=dwr.util._getElementById(B,"cloneNode()");if(B==null){return null}if(A==null){A={}}var C=B.cloneNode(true);if(A.idPrefix||A.idSuffix){dwr.util._updateIds(C,A)}else{dwr.util._removeIds(C)}B.parentNode.insertBefore(C,B);return C};dwr.util._updateIds=function(D,A){if(A==null){A={}}if(D.id){D.setAttribute("id",(A.idPrefix||"")+D.id+(A.idSuffix||""))}var C=D.childNodes;for(var B=0;B<C.length;B++){var E=C.item(B);if(E.nodeType==1){dwr.util._updateIds(E,A)}}};dwr.util._removeIds=function(C){if(C.id){C.removeAttribute("id")}var B=C.childNodes;for(var A=0;A<B.length;A++){var D=B.item(A);if(D.nodeType==1){dwr.util._removeIds(D)}}};dwr.util.cloneNodeForValues=function(A,C,B){A=dwr.util._getElementById(A,"cloneNodeForValues()");if(A==null){return null}if(B==null){B={}}var D;if(B.idPrefix!=null){D=B.idPrefix}else{D=A.id||""}return dwr.util._cloneNodeForValuesRecursive(A,C,D,B)};dwr.util._cloneNodeForValuesRecursive=function(A,C,E,I){if(dwr.util._isArray(C)){var G=[];for(var D=0;D<C.length;D++){var H=C[D];var F=dwr.util._cloneNodeForValuesRecursive(A,H,E+"["+D+"]",I);G.push(F)}return G}else{if(dwr.util._isObject(C)&&!dwr.util._isArray(C)){var F=A.cloneNode(true);if(I.updateCloneStyle&&F.style){for(var B in I.updateCloneStyle){F.style[B]=I.updateCloneStyle[B]}}dwr.util._replaceIds(F,A.id,E);A.parentNode.insertBefore(F,A);dwr.util._cloneSubArrays(C,E,I);return F}}return null};dwr.util._replaceIds=function(F,H,C){if(F.id){var B=null;if(F.id==H){B=C}else{if(F.id.length>H.length){if(F.id.substr(0,H.length)==H){var A=F.id.charAt(H.length);if(A=="."||A=="["){B=C+F.id.substr(H.length)}}}}if(B){F.setAttribute("id",B)}else{F.removeAttribute("id")}}var E=F.childNodes;for(var D=0;D<E.length;D++){var G=E.item(D);if(G.nodeType==1){dwr.util._replaceIds(G,H,C)}}};dwr.util._cloneSubArrays=function(C,F,A){for(prop in C){var B=C[prop];if(dwr.util._isArray(B)){if(B.length>0&&dwr.util._isObject(B[0])){var E=F+"."+prop;var D=dwr.util.byId(E);if(D!=null){dwr.util._cloneNodeForValuesRecursive(D,B,E,A)}}}else{if(dwr.util._isObject(B)){dwr.util._cloneSubArrays(B,F+"."+prop,A)}}}};dwr.util._getElementById=function(B,A){var C=B;B=dwr.util.byId(B);if(B==null){dwr.util._debug(A+" can't find an element with id: "+C+".")}return B};dwr.util._isHTMLElement=function(C,E){if(C==null||typeof C!="object"||C.nodeName==null){return false}if(E!=null){var D=C.nodeName.toLowerCase();if(typeof E=="string"){return D==E.toLowerCase()}if(dwr.util._isArray(E)){var A=false;for(var B=0;B<E.length&&!A;B++){if(D==E[B].toLowerCase()){A=true}}return A}dwr.util._debug("dwr.util._isHTMLElement was passed test node name that is neither a string or array of strings");return false}return true};dwr.util._detailedTypeOf=function(A){var B=typeof A;if(B=="object"){B=Object.prototype.toString.apply(A);B=B.substring(8,B.length-1)}return B};dwr.util._isObject=function(A){return(A&&typeof A=="object")};dwr.util._isArray=function(A){return(A&&A.join)};dwr.util._isDate=function(A){return(A&&A.toUTCString)?true:false};dwr.util._importNode=function(F,E,B){var D;if(E.nodeType==1){D=F.createElement(E.nodeName);for(var C=0;C<E.attributes.length;C++){var A=E.attributes[C];if(A.nodeValue!=null&&A.nodeValue!=""){D.setAttribute(A.name,A.nodeValue)}}if(typeof E.style!="undefined"){D.style.cssText=E.style.cssText}}else{if(E.nodeType==3){D=F.createTextNode(E.nodeValue)}}if(B&&E.hasChildNodes()){for(C=0;C<E.childNodes.length;C++){D.appendChild(dwr.util._importNode(F,E.childNodes[C],true))}}return D};dwr.util._debug=function(F,D){var A=false;try{if(window.console){if(D&&window.console.trace){window.console.trace()}window.console.log(F);A=true}else{if(window.opera&&window.opera.postError){window.opera.postError(F);A=true}}}catch(C){}if(!A){var B=document.getElementById("dwr-debug");if(B){var E=F+"<br/>"+B.innerHTML;if(E.length>2048){E=E.substring(0,2048)}B.innerHTML=E}}};String.prototype.validateEmail=function(){return/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/.test(this)};
