if(conleos==null){var conleos={}}if(conleos.utils==null){conleos.utils={}}if(CLUtils==null){var CLUtils=conleos.utils}conleos.utils.contains=function(B,A){return conleos.utils.indexOf(B,A)!=-1};conleos.utils.indexOf=function(C,B){for(var A=0;A<C.length;A++){if(C[A]==B){return A}}return -1};conleos.utils.trim=function(A){if(A==null){return null}else{return A.replace(/^\s+/,"").replace(/\s+$/,"")}};conleos.utils.trimToNull=function(A){if(A==null){return null}else{A=conleos.utils.trim(A);if(A.length==0){A=null}return A}};conleos.utils.trimToEmpty=function(A){if(A==null){return""}else{return conleos.utils.trim(A)}};conleos.utils.isEmpty=function(A){return A==null||A.length==0};jQuery.jScrollPane={active:[]};jQuery.fn.jScrollPane=function(A){A=jQuery.extend({scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:true,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true},A);return this.each(function(){var J=jQuery(this);if(jQuery(this).parent().is(".jScrollPaneContainer")){var v=A.maintainPosition?J.offset().top-jQuery(this).parent().offset().top:0;var H=jQuery(this).parent();var W=H.innerWidth();var w=H.outerHeight();var I=w;if(H.unmousewheel){H.unmousewheel()}jQuery(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",H).remove();J.css({top:0})}else{var v=0;this.originalPadding=J.css("paddingTop")+" "+J.css("paddingRight")+" "+J.css("paddingBottom")+" "+J.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(J.css("paddingLeft"))||0)+(parseInt(J.css("paddingRight"))||0);var W=J.innerWidth();var w=J.innerHeight();var I=w;J.wrap(jQuery("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:w+"px",width:W+"px"}));jQuery(document).bind("emchange",function(x,y,p){J.jScrollPane(A)})}var g=this.originalSidePaddingTotal;J.css({height:"auto",width:W-A.scrollbarWidth-A.scrollbarMargin-g+"px",paddingRight:A.scrollbarMargin+"px"});var e=J.outerHeight();var b=w/e;if(b<0.99){var E=J.parent();E.append(jQuery("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:A.scrollbarWidth+"px"}),jQuery("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:A.scrollbarWidth+"px"}))));var s=jQuery(">.jScrollPaneTrack",E);var K=jQuery(">.jScrollPaneTrack .jScrollPaneDrag",E);if(A.showArrows){var Z;var u;var M;var j;var c=function(){if(j>4||j%4==0){r(m+u*U)}j++};var G=function(p){jQuery("body").unbind("mouseup",G);Z.removeClass("jScrollActiveArrowButton");clearInterval(M)};var S=function(){jQuery("body").bind("mouseup",G);Z.addClass("jScrollActiveArrowButton");j=0;c();M=setInterval(c,100)};E.append(jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:A.scrollbarWidth+"px"}).html("").bind("mousedown",function(){Z=jQuery(this);u=-1;S();this.blur();return false}),jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:A.scrollbarWidth+"px"}).html("").bind("mousedown",function(){Z=jQuery(this);u=1;S();this.blur();return false}));if(A.arrowSize){I=w-A.arrowSize-A.arrowSize;s.css({height:I+"px",top:A.arrowSize+"px"})}else{var k=jQuery(">.jScrollArrowUp",E).height();A.arrowSize=k;I=w-k-jQuery(">.jScrollArrowDown",E).height();s.css({height:I+"px",top:k+"px"})}}var o=jQuery(this).css({position:"absolute",overflow:"visible"});var B;var R;var U;var m=0;var P=b*w/2;var T=function(x,z){var y=z=="X"?"Left":"Top";return x["page"+z]||(x["client"+z]+(document.documentElement["scroll"+y]||document.body["scroll"+y]))||0};var Y=function(){return false};var n=function(){f();B=K.offset(false);B.top-=m;R=I-K[0].offsetHeight;U=2*A.wheelSpeed*R/e};var C=function(p){n();P=T(p,"Y")-m-B.top;jQuery("body").bind("mouseup",N).bind("mousemove",a);if(jQuery.browser.msie){jQuery("body").bind("dragstart",Y).bind("selectstart",Y)}return false};var N=function(){jQuery("body").unbind("mouseup",N).unbind("mousemove",a);P=b*w/2;if(jQuery.browser.msie){jQuery("body").unbind("dragstart",Y).unbind("selectstart",Y)}};var r=function(x){x=x<0?0:(x>R?R:x);m=x;K.css({top:x+"px"});var y=x/R;o.css({top:((w-e)*y)+"px"});J.trigger("scroll")};var a=function(p){r(T(p,"Y")-B.top-P)};var h=Math.max(Math.min(b*(w-A.arrowSize*2),A.dragMaxHeight),A.dragMinHeight);K.css({height:h+"px"}).bind("mousedown",C);var d;var L;var F;var l=function(){if(L>8||L%4==0){r((m-((m-F)/2)))}L++};var t=function(){clearInterval(d);jQuery("body").unbind("mouseup",t).unbind("mousemove",X)};var X=function(p){F=T(p,"Y")-B.top-P};var O=function(p){n();X(p);L=0;jQuery("body").bind("mouseup",t).bind("mousemove",X);d=setInterval(l,100);l()};s.bind("mousedown",O);if(E.mousewheel){E.mousewheel(function(x,z){n();f();var y=m;r(m-z*U);var p=y!=m;return !p},false)}var D;var Q;function V(){var p=(D-m)/A.animateStep;if(p>1||p<-1){r(m+p)}else{r(D);f()}}var f=function(){if(Q){clearInterval(Q);delete D}};var q=function(y,p){if(typeof y=="string"){$e=jQuery(y,this);if(!$e.length){return }y=$e.offset({relativeTo:this}).top}f();var x=-y/(w-e)*R;if(!p||A.animateTo){D=x;Q=setInterval(V,A.animateInterval)}else{r(x)}};J[0].scrollTo=q;J[0].scrollBy=function(x){var p=-parseInt(o.css("top"))||0;q(p+x)};n();q(-v,true);jQuery.jScrollPane.active.push(J[0])}else{J.css({height:w+"px",width:W-this.originalSidePaddingTotal+"px",padding:this.originalPadding})}})};jQuery(window).bind("unload",function(){var B=jQuery.jScrollPane.active;for(var A=0;A<B.length;A++){B[A].scrollTo=B[A].scrollBy=null}});(function(A){A.fn.addOption=function(){var H=function(N,J,L,O){var M=document.createElement("option");M.value=J,M.text=L;var P=N.options;var I=P.length;if(!N.cache){N.cache={};for(var K=0;K<I;K++){N.cache[P[K].value]=K}}if(typeof N.cache[J]=="undefined"){N.cache[J]=I}N.options[N.cache[J]]=M;if(O){M.selected=true}};var C=arguments;if(C.length==0){return this}var G=true;var B=false;var E,D,F;if(typeof (C[0])=="object"){B=true;E=C[0]}if(C.length>=2){if(typeof (C[1])=="boolean"){G=C[1]}else{if(typeof (C[2])=="boolean"){G=C[2]}}if(!B){D=C[0];F=C[1]}}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return }if(B){for(var I in E){H(this,I,E[I],G)}}else{H(this,D,F,G)}});return this};A.fn.ajaxAddOption=function(D,F,B,E,C){if(typeof (D)!="string"){return this}if(typeof (F)!="object"){F={}}if(typeof (B)!="boolean"){B=true}this.each(function(){var G=this;A.getJSON(D,F,function(H){A(G).addOption(H,B);if(typeof E=="function"){if(typeof C=="object"){E.apply(G,C)}else{E.call(G)}}})});return this};A.fn.removeOption=function(){var B=arguments;if(B.length==0){return this}var D=typeof (B[0]);var C,E;if(D=="string"||D=="object"||D=="function"){C=B[0]}else{if(D=="number"){E=B[0]}else{return this}}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return }if(this.cache){this.cache=null}var F=false;var I=this.options;if(!!C){var G=I.length;for(var H=G-1;H>=0;H--){if(C.constructor==RegExp){if(I[H].value.match(C)){F=true}}else{if(I[H].value==C){F=true}}if(F&&B[1]===true){F=I[H].selected}if(F){I[H]=null}F=false}}else{if(B[1]===true){F=I[E].selected}else{F=true}if(F){this.remove(E)}}});return this};A.fn.sortOptions=function(C){var B=typeof (C)=="undefined"?true:!!C;this.each(function(){if(this.nodeName.toLowerCase()!="select"){return }var F=this.options;var D=F.length;var G=[];for(var E=0;E<D;E++){G[E]={v:F[E].value,t:F[E].text}}G.sort(function(I,H){o1t=I.t.toLowerCase(),o2t=H.t.toLowerCase();if(o1t==o2t){return 0}if(B){return o1t<o2t?-1:1}else{return o1t>o2t?-1:1}});for(var E=0;E<D;E++){F[E].text=G[E].t;F[E].value=G[E].v}});return this};A.fn.selectOptions=function(D,B){var C=D;var E=typeof (D);var F=B||false;if(E!="string"&&E!="function"&&E!="object"){return this}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return this}var I=this.options;var G=I.length;for(var H=0;H<G;H++){if(C.constructor==RegExp){if(I[H].value.match(C)){I[H].selected=true}else{if(F){I[H].selected=false}}}else{if(I[H].value==C){I[H].selected=true}else{if(F){I[H].selected=false}}}}});return this};A.fn.copyOptions=function(D,C){var B=C||"selected";if(A(D).size()==0){return this}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return this}var G=this.options;var E=G.length;for(var F=0;F<E;F++){if(B=="all"||(B=="selected"&&G[F].selected)){A(D).addOption(G[F].value,G[F].text)}}});return this};A.fn.containsOption=function(E,C){var D=false;var B=E;var F=typeof (B);var G=typeof (C);if(F!="string"&&F!="function"&&F!="object"){return G=="function"?this:D}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return this}if(D&&G!="function"){return false}var J=this.options;var H=J.length;for(var I=0;I<H;I++){if(B.constructor==RegExp){if(J[I].value.match(B)){D=true;if(G=="function"){C.call(J[I])}}}else{if(J[I].value==B){D=true;if(G=="function"){C.call(J[I])}}}}});return G=="function"?this:D};A.fn.selectedValues=function(){var B=[];this.find("option:selected").each(function(){B[B.length]=this.value});return B}})(jQuery);(function(A){A.fn.replaceCombobox=function(J){var E=[];J=A.extend({className:"jquery-combobox",scrollContainerClassName:"container",maxHeight:150,zIndex:2,callback:function(){return[]}},J||{});var F=J.zIndex;var G=["jScrollPaneTrack","jScrollPaneDrag","jScrollPaneDragTop","jScrollPaneDragBottom","jScrollArrowUp","jScrollArrowDown",J.className+"-item"];var D=function(M,L){var K=false;A.each(L,function(){if(M.hasClass(this)){K=true}});return K};var I=function(){if(E&&E.length>0){B()}var Q=A(this);var P=Q.parent();var M=P.find("."+J.className+"-values");var N=P.find(".jScrollPaneContainer");var L=N.find("."+J.scrollContainerClassName);var K=0;var O=Q.outerWidth();Q.addClass(J.className+"-open");Q.unbind("click");N.width(O);L.width(O);M.width(O);N.height(J.maxHeight);L.height(J.maxHeight);M.height(J.maxHeight);M.show();M.find("."+J.className+"-item").each(function(){var R=A(this);R.bind("click",H);K+=R.height()});K+=4;if(K>J.maxHeight){K=J.maxHeight}N.height(K);L.height(K);M.height(K);L.jScrollPane();L.jScrollPane();Q.bind("click",B);E=Q;return false};var B=function(M){if(E&&E.length>0&&!(M&&M.target&&D(A(M.target),G))){var L=E.parent();var K=L.find("."+J.className+"-values");E.unbind("click");E.removeClass(J.className+"-open");K.hide();E.bind("click",I);E=[];return false}return true};var H=function(){var N=A(this);if(N.hasClass(J.className+"-item")){var L=N.attr("key");var O=N.parents("."+J.className+"-box:first");var K=O.find("select");var P=O.find("."+J.className+"-current div");var M=K.find("option[value="+L+"]");K.selectOptions(M.attr("value"));P.text(M.text());B();C(J.callback(N,J))}};var C=function(L){if(L.length>0){var K=L.find("."+J.scrollContainerClassName);K.empty();L.find("option").each(function(){var M=A(this);K.append('<div key="'+M.attr("value")+'" class="'+J.className+'-item">'+M.text()+"</div>")});K.find("."+J.className+"-item").each(function(){A(this).bind("click",H)});L.find("."+J.className+"-current div").text(L.find("option:selected").text())}};A("html").bind("click",B);return this.each(function(){var L=A(this);L.hide();L.wrapAll('<div class="'+J.className+'-box" style="position: relative;"></div>');var N=L.parent();N.css({zIndex:F--});N.prepend('<div class="'+J.className+'-values" style="position: absolute;"></div>');N.prepend('<div class="'+J.className+'-current"></div>');var K=N.find("."+J.className+"-current");var M=N.find("."+J.className+"-values");K.append("<div></div>");M.append('<div class="'+J.scrollContainerClassName+'"></div>');M.find("."+J.scrollContainerClassName).jScrollPane();C(N);M.hide();K.bind("click",I)})}})(jQuery);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="A6F46D11DD2BB1FA19DA546CAEE96332";dwr.engine._sessionCookieName="JSESSIONID";dwr.engine._allowGetForSafariButMakeForgeryEasier="false";dwr.engine._scriptTagProtection="throw 'allowScriptTagRemoting is false.';";dwr.engine._defaultPath="/bcc/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._unloading=false;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(){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{A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseNo}}A.httpMethod="POST";A.async=true;A.timeout=0;A.path=dwr.engine._defaultPath;A.preHooks=[];A.postHooks=[];A.errorHandler=dwr.engine._pollErrorHandler;A.warningHandler=dwr.engine._pollErrorHandler;A.handlers[0]={callback:function(B){dwr.engine._pollRetries=0;setTimeout(dwr.engine._poll,B)}};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.timeoutId=setTimeout(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&&!window.opera)){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.batchId;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("style","display:none;");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(B){var C={url:B.path+B.mode,body:null};if(B.isPoll==true){C.url+="ReverseAjax.dwr"}else{if(B.map.callCount==1){C.url+=B.map["c0-scriptName"]+"."+B.map["c0-methodName"]+".dwr"}else{C.url+="Multiple."+B.map.callCount+".dwr"}}var E=location.href.match(/jsessionid=([^?]+)/);if(E!=null){C.url+=";jsessionid="+E[1]}var D;if(B.httpMethod=="GET"){B.map.callCount=""+B.map.callCount;C.url+="?";for(D in B.map){if(typeof B.map[D]!="function"){C.url+=encodeURIComponent(D)+"="+encodeURIComponent(B.map[D])+"&"}}C.url=C.url.substring(0,C.url.length-1)}else{C.body="";if(document.all&&!window.opera){var A=[];for(D in B.map){if(typeof B.map[D]!="function"){A.push(D+"="+B.map[D]+dwr.engine._postSeperator)}}C.body=A.join("")}else{for(D in B.map){if(typeof B.map[D]!="function"){C.body+=D+"="+B.map[D]+dwr.engine._postSeperator}}}C.body=dwr.engine._contentRewriteHandler(C.body)}C.url=dwr.engine._urlRewriteHandler(C.url);return C};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 }if(dwr.engine._unloading){dwr.engine._debug("Ignoring reply from server as page is unloading.");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({status:A,responseText:E,contentType:G})}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);if(!C.completed){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){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){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.timeoutId){clearTimeout(B.timeoutId);delete B.timeoutId}if(B.map&&(B.map.batchId||B.map.batchId==0)){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._unloader=function(){dwr.engine._unloading=true;dwr.engine._batchQueue.length=0;for(var A in dwr.engine._batches){var B=dwr.engine._batches[A];if(B&&B.map){if(B.req){B.req.abort()}dwr.engine._clearUp(B)}}};if(window.addEventListener){window.addEventListener("unload",dwr.engine._unloader,false)}else{if(window.attachEvent){window.attachEvent("onunload",dwr.engine._unloader)}}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(H,C,F,A){var D=dwr.engine._lookup(C,F,A);if(D){return D}if(document.all&&!window.opera){var B=["Array:["];for(var G=0;G<F.length;G++){if(G!=0){B.push(",")}H.paramCount++;var I="c"+dwr.engine._batch.map.callCount+"-e"+H.paramCount;dwr.engine._serializeAll(H,C,F[G],I);B.push("reference:");B.push(I)}B.push("]");E=B.join("")}else{var E="Array:[";for(var G=0;G<F.length;G++){if(G!=0){E+=","}H.paramCount++;var I="c"+dwr.engine._batch.map.callCount+"-e"+H.paramCount;dwr.engine._serializeAll(H,C,F[G],I);E+="reference:";E+=I}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}}};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}}};var viewUpdateBeanLookup={};var processDWRResult=function(F){var C=F.message;if(C&&C!=null){alert(C)}if(F.success){var B=F.updateBeans;for(var A=0;A<B.length;A++){var D=B[A];var G=D.beanName;var E=viewUpdateBeanLookup[G];if(E==null){alert("Missing updateFunction for beanname '"+G+"'")}else{E(D)}}}else{alert("AJAX Operation failed: "+C)}};function errh(A){alert(A)}dwr.engine.setErrorHandler(errh);var redirect=function(A){window.location.href=A.redirectURL};var alertBox=function(B){var A=B.alertMessage;if(A){alert(A)}};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.redirect=redirect;viewUpdateBeanLookup.alert=alertBox}function selectModelSubSet(A){DWRConfiguratorManager.selectModelSubSet(appData,A,processDWRResult)}function selectModel(A){DWRConfiguratorManager.selectModel(appData,A,processDWRResult)}var contentModelUpdate=function(C){var B=jQuery("#modelSubSetTable").find("img.modelSubSet");updateSelection(B,C.modelSubSetId);var A=jQuery("#modelTables").find("img.model");updateSelection(A,C.modelId);var D=jQuery("#modelTables").find("div.modelTable");updateElementsVisibility(D,"modelTable-"+C.modelSubSetId)};var updateSelection=function(C,B){for(var D=0;D<C.length;D++){var E=C[D];var A=E.id;if(A.match(new RegExp(".*-"+B))){E.src="images/dev/itemSelected.gif";E.alt="*"}else{E.src="images/dev/itemUnselected.gif";E.alt="O"}}};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.contentModelUpdate=contentModelUpdate}var globalRotateable=null;function selectExtColor(A){globalRotateable=null;DWRConfiguratorManager.selectExtColor(appData,A,processDWRResult)}function selectIntColor(A){globalRotateable=false;DWRConfiguratorManager.selectIntColor(appData,A,processDWRResult)}var contentColorsUpdate=function(B){var A=jQuery("#extColorTables");if(A!=null){var C="part-"+B.extColorPartId;A.find("img.extColor").each(function(){var E=jQuery(this);var D=E.attr("id")==C?"colorButtonSelected":"colorButtonUnselected";E.attr("class","clickable extColor "+D)});updateExtInfosToSelected();C="part-"+B.intColorPartId;jQuery("#intColorTables").find("img.intColor").each(function(){var E=jQuery(this);var D=E.attr("id")==C?"colorButtonSelected":"colorButtonUnselected";E.attr("class","clickable intColor "+D)})}};var updateExtInfosToSelected=function(){var A=jQuery("#extColorTables").find("table.extColorTable");for(var B=0;B<A.length;B++){var C=getIdFromPrefixedIdAttr(A[B]);updateSection(C)}};var updateSection=function(A){var B=jQuery("#extColorTable-"+A).find("img.colorButtonSelected");if(B.size()>0){updateExtInfoTo(jQuery(B.get(0)),A)}};var updateExtInfoToPartId=function(B,A){updateExtInfoTo(jQuery("#part-"+B),A)};var updateExtInfoTo=function(B,D){var E=jQuery("#extSelectedInfo-"+D);if(B!=null){var A=B.attr("textValue");var C=B.attr("price");E.html(A+" - "+C)}else{E.html("&nbsp;")}};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.contentColorsUpdate=contentColorsUpdate}function togglePartSelection(E,D){var C=getUpdatePartIds(D);var B=jQuery("#partId-"+E+"-selection");var A=B.attr("src").indexOf("Unselected")==-1;if(A){DWRConfiguratorManager.deselectPart(appData,E,C,processDWRResult)}else{DWRConfiguratorManager.selectPart(appData,E,C,processDWRResult)}}var contentPartsUpdate=function(E){var A=E.partUpdateInfos;for(var D=0;D<A.length;D++){var C=A[D];var F=jQuery("#partId-"+C.id+"-selection");if(C.selected){if(F.attr("src").indexOf("images/dev/option")!=-1){F.attr("src","images/dev/optionSelected.gif")}else{F.attr("src","images/dev/itemSelected.gif")}F.alt="*"}else{if(F.attr("src").indexOf("images/dev/option")!=-1){F.attr("src","images/dev/optionUnselected.gif")}else{F.attr("src","images/dev/itemUnselected.gif")}F.attr("alt","O")}var B=jQuery("#partId-"+C.id+"-price");B.html(C.price)}};var switchToPartSubset=function(A){var C=jQuery("#equipmentTables").find("tbody.partSection");updateElementsVisibility(C,"partSection-"+A);var B=jQuery("#equipmentPartSections").find("tr.partSubSetRow");updateCSSClass(B,"partSectionHeadline-"+A,"partSubSetRow headlineGray clickable","partSubSetRow clickable")};var updateCSSClass=function(E,F,A,D){for(var C=0;C<E.length;C++){var B=E[C];if(B.id==F){B.className=A}else{B.className=D}}};var getUpdatePartIds=function(A){var D=jQuery("#"+A).find("tbody tr.part");var C=new Array(D.length);for(var B=0;B<D.length;B++){C[B]=D[B].getAttribute("partId")}return C};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.contentPartsUpdate=contentPartsUpdate}var rotateForward=function(){DWRConfiguratorManager.rotateImage(appData,true,processDWRResult)};var rotateBackward=function(){DWRConfiguratorManager.rotateImage(appData,false,processDWRResult)};var updateImageIndex=function(){DWRConfiguratorManager.updateImageIndex(appData,currentImageIndex,processDWRResult)};var imagesArray=[];var pixelPerStep=50;var imageWidth=655;var IMAGE_LOAD_DELAY_TIME=250;var interValId;var delayAnim=100;var rotationStep=1;var currentImageIndex=0;var startXCoord=0;var lastImageUpdate=0;var readyForAborting=false;function setAbortReady(){readyForAborting=true}function initImages(D,A,C,F){var E=window.location.href;var B=E.indexOf("tvi=v.equipment")!=-1;if(readyForAborting&&!document.all&&!B){window.stop()}if(F){currentImageIndex=F}currentImageIndex=currentImageIndex%D.length;if(!A){imagesArray=D}jQuery("#rotationHolder").onmousedown=null;document.onmouseup=null;jQuery("#staticImageHolder").css("display","none");jQuery("#360ImageHolder").css("display","none");jQuery("#partImageHolder").css("display","none");jQuery("#partImageCloseButton").css("display","none");if(globalRotateable==null&&C!=null){jQuery("#rotationButton").css("visibility",C?"visible":"hidden")}else{if(globalRotateable!=null&&!globalRotateable){jQuery("#rotationButton").css("visibility","hidden")}}if(A){jQuery("#partImageHolder").css("display","block");jQuery("#partImageHolderIMG").attr("src",D[0]);jQuery("#partImageCloseButton").css("display","block")}else{if(imagesArray.length==1){jQuery("#staticImageHolderIMG").attr("src",imagesArray[0]);jQuery("#staticImageHolder").css("display","block")}else{jQuery("#360ImageHolder").css("display","block");document.getElementById("rotationHolder").onmousedown=startRotate;document.onmouseup=stopRotate;pixelPerStep=imageWidth/imagesArray.length/2;jQuery("#imageHolder").empty();initRotationStep(0);lastImageUpdate=new Date().getTime();window.setTimeout("initRemainingRotationSteps("+lastImageUpdate+")",IMAGE_LOAD_DELAY_TIME)}}}function closePartImage(){initImages(imagesArray,false)}var startRotate=function(A){if(!A){A=window.event}if(A.button==0||document.all&&A.button==1){document.onmousemove=handleMovement;startXCoord=A.clientX;return false}};var stopRotate=function(A){if(!A){A=window.event}if(A.button==0||document.all&&A.button==1){if(document.onmousemove!=null){document.onmousemove=null;updateImageIndex()}return false}};var handleMovement=function(B){if(!B){B=window.event}var C=B.clientX;var A=getNewIndex(C);if(A!=currentImageIndex){displayImageIndex(A);startXCoord=C}return false};function getNewIndex(B){if(imagesArray.length==0){return 0}var C=(startXCoord-B)/pixelPerStep;if(C>0){C=Math.floor(C)}else{C=Math.ceil(C)}var A=currentImageIndex-C;if(A<0){A=(A%imagesArray.length)+imagesArray.length}if(A>=imagesArray.length){A=A%imagesArray.length}return A}function displayImageIndex(A){blockImage(currentImageIndex);currentImageIndex=A;showImage(currentImageIndex)}function getIdForImageIndex(A){return"image"+A}function blockImage(A){var B=document.getElementById(getIdForImageIndex(A));if(B!=null){B.style.display="none"}}function showImage(A){var B=document.getElementById(getIdForImageIndex(A));if(B!=null){B.style.display="block"}}function startAnim(A){if(interValId==null){rotationStep=A?imagesArray.length-1:1;interValId=setInterval("animate()",delayAnim)}}function stopAnim(){if(interValId!=null){clearInterval(interValId);interValId=null}}function animate(){blockImage(currentImageIndex);currentImageIndex=(currentImageIndex+rotationStep)%imagesArray.length;showImage(currentImageIndex)}function controlAnimation(D,B){var A;var C;if(D){A=document.getElementById("arrowLeft");C=B?"images/intro_arror_left_hover.jpg":"images/intro_arror_left.jpg"}else{A=document.getElementById("arrowRight");C=B?"images/intro_arror_right_hover.jpg":"images/intro_arror_right.jpg"}A.src=C;if(B){startAnim(D)}else{stopAnim()}}var mediaAreaUpdate=function(C){initImages(C.imageURLs,false,C.rotateable,C.currentImageIndex);var A=C.extColorTextImageURL;var B=jQuery("#extColorIMG");if(B!=null&&A!=null){B.attr("src",A)}};function initRemainingRotationSteps(B){if(lastImageUpdate<=B){for(var A=1;A<imagesArray.length;A++){initRotationStep(A)}}}function initRotationStep(C){var A=(C+currentImageIndex)%imagesArray.length;var B=document.createElement("img");B.src=imagesArray[A];B.id=getIdForImageIndex(A);B.style.display=A==currentImageIndex?"block":"none";B.alt="";document.getElementById("imageHolder").appendChild(B)}if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.mediaAreaUpdate=mediaAreaUpdate}var totalPriceClassSuffix="";var summaryCellFuncs=[function(A){return A.text},function(A){return A.price}];var summaryCellCreator=function(A){var B=document.createElement("td");if(A.cellNum==0){B.className="totalPrice"+totalPriceClassSuffix}else{B.className="totalPriceValue"+totalPriceClassSuffix}return B};var equipmentRowCellCreator=function(A){var B=document.createElement("td");if(A.cellNum==0){B.className="price"}else{B.className="priceValue"}return B};var summaryUpdate=function(A){jQuery("#basicPrice").html(A.basicPrice);var B=jQuery("tbody#totalPrices td:first");if(B.hasClass("totalPriceGer")){totalPriceClassSuffix="Ger"}dwr.util.removeAllRows("priceRows");dwr.util.addRows("priceRows",A.equipmentPrices,summaryCellFuncs,{cellCreator:equipmentRowCellCreator});dwr.util.removeAllRows("totalPrices");dwr.util.addRows("totalPrices",A.totalPrices,summaryCellFuncs,{cellCreator:summaryCellCreator})};var processMonthlyRateUpdate=function(C){var A=jQuery("#monthlyRateText");var B=C.newMonthlyRate;A.html(B)};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.summaryUpdate=summaryUpdate;viewUpdateBeanLookup.financingMonthlyRateUpdateBean=processMonthlyRateUpdate}var getUpdateParts=function(){var A=[];if($("wheels")!=null){A=getUpdatePartIds("wheels")}else{if($("equipmentTables")!=null){A=getUpdatePartIds("equipmentTables")}}return A};var resolveConflict=function(C){var D=C.split("-");var A=[];if(D[0].length>0){A=D[0].split(",")}var B=[];if(D[1].length>0){B=D[1].split(",")}DWRConfiguratorManager.resolveConflict(appData,A,B,getUpdateParts(),processDWRResult)};var conflictUndo=function(){DWRConfiguratorManager.conflictUndo(appData,getUpdateParts(),processDWRResult)};var triggerConflictDialog=function(){DWRConfiguratorManager.triggerConflict(appData,processDWRResult)};var conflictCellFuncs=[function(A){return"<img onclick=\"resolveConflict('"+A.solutionString+'\')" class="vmiddle clickable" src="'+A.rowImage+'" alt="" />'},function(A){return"<div onclick=\"resolveConflict('"+A.solutionString+'\')" class="clickable">'+A.partText+"</div>"},function(A){return"<div onclick=\"resolveConflict('"+A.solutionString+'\')" class="clickable">'+A.priceText+"</div>"}];var conflictRowCellCreator=function(A){var B=document.createElement("td");if(A.cellNum==0){B.className="conflictRowImage"}else{if(A.cellNum==1){B.className="conflictRowText"}else{if(A.cellNum==2){B.className="conflictRowPrice"}}}return B};var conflictDialogUpdate=function(G){var C=jQuery("#conflictDialog");jQuery("#conflictHeadline").attr("src",G.headlineImg);jQuery("#conflictIntroText").html(G.introText);jQuery("#conflictAlternativesHeadline").html(G.alternativesText);jQuery("#conflictUndo").find("div").get(0).innerHTML=G.undoText;dwr.util.removeAllRows("conflictRows");var M=G.alternativeList;for(var E=0;E<M.length;E++){var B=M[E];var H=B.partImage;var F=B.addPartsText;var J=B.removePartsText;var K=B.priceText;var A=B.addPartIds;var L=B.removePartIds;var I=buildConflictSolutionString(A,L);var D;if(A.length>0){D=[{rowImage:H!=null?H:"images/assistant_arrow_add.gif",partText:F,priceText:K,solutionString:I}];dwr.util.addRows("conflictRows",D,conflictCellFuncs,{cellCreator:conflictRowCellCreator,escapeHtml:false})}if(L.length>0){D=[{rowImage:H!=null?H:"images/assistant_arrow_remove.gif",partText:J,priceText:K,solutionString:I}];dwr.util.addRows("conflictRows",D,conflictCellFuncs,{cellCreator:conflictRowCellCreator,escapeHtml:false})}}openDialogDIV(C)};var conflictResolvedUpdate=function(A){closeCurrentDialog()};var buildConflictSolutionString=function(A,E){var D="";for(var C=0;C<A.length;C++){if(C>0){D+=","}D+=A[C]}D+="-";for(var B=0;B<E.length;B++){if(B>0){D+=","}D+=E[B]}return D};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.conflictDialogUpdate=conflictDialogUpdate}if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.conflictResolvedUpdate=conflictResolvedUpdate}var closeFinanceGERWindow=function(){closeCurrentDialog();updateFinanceSessionGER()};var displayFinanceSettingsGER=function(){DWRConfiguratorManager.getFinanceSettingsGER(appData,processDWRResult)};var updateFinanceSessionGER=function(){var financeSettings=eval("("+document.getElementById("CalculationResults").value+")");var praemieLightSettings=eval("("+document.getElementById("PraemieLightResults").value+")");DWRConfiguratorManager.updateFinanceSessionGER(appData,financeSettings,praemieLightSettings,processDWRResult)};var displayFinanceSettings=function(){DWRConfiguratorManager.getFinanceSettings(appData,processDWRResult)};var updateFinanceSettings=function(){var B=jQuery("#firstrate").val();var A=jQuery("#duration").val();var C=jQuery("#rate").val();DWRConfiguratorManager.updateFinanceSettings(appData,B,A,C,processDWRResult)};var updateFinanceQuotation=function(){var A=jQuery("#financialCalcQuotations").val();DWRConfiguratorManager.updateFinanceQuotation(appData,A,processDWRResult)};var durationArray=new Array();var firstrateArray=new Array();var rateArray=new Array();var rateValueArray=new Array();var financeSettingsUpdate=function(A){var B=A.financeSettings;jQuery("#financialCalcHeadlineTextImage").attr("src",A.headerImageURL);updateSelector(B);updateArrays(B);changeDuration(B.selectedDuration);changeFirstrate(B.selectedDuration,B.selectedFirstrate);changeRate(B.selectedDuration,B.selectedFirstrate);jQuery("#financialCalcIntroText").html(B.introText);jQuery("#durationFieldLabel").html(B.durationLabel);jQuery("#firstrateFieldLabel").html(B.firstrateLabel);jQuery("#rateFieldLabel").html(B.rateLabel);jQuery("#financialCalcQuotationRemark").html(B.quotationRemark);jQuery("#financialCalcQuotationText").html(B.quotationText);jQuery("#financialCalcSaveButton").html(B.saveUrl.alt);if(B.campaignText!=null){jQuery("#financialCalcCampaignText").html(B.campaignText);jQuery("#financialCalcCampaignText").css("display","block")}else{jQuery("#financialCalcCampaignText").css("display","none")}jQuery("#financialCalcQuotationDescription").html(B.quotationDescription);if(B.modelText!=null){jQuery("#financialCalcModelText").html(B.modelText);jQuery("#financialCalcModelText").css("display","block")}else{jQuery("#financialCalcModelText").css("display","none")}closeCurrentDialog();openDialogDIV(jQuery("#financialCalcDialog"))};var updateArrays=function(F){rateArray=[];rateArrayLU=[];durationArray=[];durationArrayLU=[];firstrateArray=[];firstrateArrayLU=[];rateValueArray=[];for(var E=0;E<F.rateSequence.length;E++){var D=F.rateSequence[E];rateArray.push({id:D.rateValue,value:D.rateText});rateArrayLU[D.rateValue]=D.rateText}for(var C=0;C<F.durationSequence.length;C++){var G=F.durationSequence[C];durationArray.push({id:G.durationValue,value:G.durationText});durationArrayLU[G.durationValue]=G.durationText;rateValueArray[G.durationValue]=new Array();firstrateArray[G.durationValue]=new Array();firstrateArrayLU[G.durationValue]=new Array();for(var B=0;B<G.firstrateSequence.length;B++){var A=G.firstrateSequence[B];firstrateArray[G.durationValue].push({id:A.firstrateValue,value:A.firstrateText});firstrateArrayLU[G.durationValue][A.firstrateValue]=A.firstrateText;rateValueArray[G.durationValue][A.firstrateValue]=A.rateValue}}};var updateSelector=function(G){var C=jQuery("#financialCalcQuotations")[0];clearSelectBox(C);var E=C.options;var B=G.quotations.list;var A=-1;for(var D=0;D<B.length;D++){var F=B[D];E[D]=new Option(F.text,F.id);if(F.selected){A=D}}C.selectedIndex=A};var financeSettingsGERUpdate=function(B){var A=jQuery("#financialCalcDialogGERIFrame");A.src=B.IFrameURL;setDocumentDomain("seat.com");closeCurrentDialog();openDialogDIV(jQuery("#financialCalcDialogGER"))};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.financeSettingsUpdate=financeSettingsUpdate;viewUpdateBeanLookup.financeSettingsGERUpdate=financeSettingsGERUpdate}var Seat={Financing:{Banner:null,dto:null,displayFinancing:function(){DWRConfiguratorManager.getFinancingSettings(appData,processDWRResult)},processFinancingSettings:function(D){Seat.Financing.dto=D;closeCurrentDialog();var C=jQuery("#financingDialog");Seat.FF.populateDialogHeader(C);var B=jQuery("#financingDialogFormular");B.children().detach();var A=jQuery("#id-ff-banner");A.children().detach();Seat.FF.create(B);openDialog(C,jQuery("#modalDiv"));if(D.errorMessages!=null){alert(D.errorMessages[0]);D.errorMessages=null}},processCloseFinancingDialog:function(A){Seat.Financing.closeDialog()},closeDialog:function(){closeCurrentDialog()},Control:{changed:false,calculated:false,valueChanged:function(){Seat.Financing.Control.changed=true;Seat.Financing.Control.calculated=false;Seat.Financing.Control.updateButtons()},valueCalculated:function(){Seat.Financing.Control.changed=false;Seat.Financing.Control.calculated=true;Seat.Financing.Control.updateButtons()},valueCommitted:function(){Seat.Financing.Control.changed=false;Seat.Financing.Control.calculated=false;Seat.Financing.Control.updateButtons()},updateButtons:function(){var A=jQuery("#id-ff-button-commit");var B=jQuery("#id-ff-button-refresh");if(Seat.Financing.Control.changed){B.show()}else{B.hide()}if(Seat.Financing.Control.calculated){A.show()}else{A.hide()}}}},FF:{create:function(M){var H=Seat.FF.createMainTable();M.append(H);var C=jQuery("#id-ff-main");C.append(Seat.FF.createHeaderTable());C.append(Seat.FF.createTabsDiv());C.append(Seat.FF.createDescriptionTable());C.append(Seat.FF.createFormTable());var A=jQuery("#id-ff-banner");A.append(Seat.FF.createBannerTable());Seat.FF.populateHeader();Seat.FF.populateTabs();var D=jQuery("#id-ff-description");var J=Seat.Financing.dto.tabs[Seat.Financing.dto.selectedTab].description;D.append(J);var B=Seat.UI.createFormularTableEl(Seat.Financing.dto.formLeftTitle);var E=jQuery("#id-ff-form-left");E.append(B);Seat.FF.createFormInnerTable(B,Seat.Financing.dto.formLeftElements);var I=Seat.UI.createFormularTableEl(Seat.Financing.dto.formRightTitle);var L=jQuery("#id-ff-form-right");L.append(I);Seat.FF.createFormInnerTable(I,Seat.Financing.dto.formRightElements);Seat.FF.populateFormButtons();var G=Seat.Financing.Banner;var F=jQuery("#id-ff-banner-left");F.append(Seat.UI.createBanner(G.imageLeftUrl,G.linkLeftUrl,""));var K=jQuery("#id-ff-banner-right");K.append(Seat.UI.createBanner(G.imageRightUrl,G.linkRightUrl,""));return H},populateDialogHeader:function(F){var A=Seat.UI.createImage(Seat.Financing.dto.headlineImageURL,null,null,"");var C=jQuery("<div></div>").attr("class","ff-dialog-headline");C.append(A);F.append(C);var D=Seat.UI.createImage(Seat.Financing.dto.backImageURL,null,null,"");var B=jQuery("<div></div>").attr("class","ff-dialog-close-text");B.append(D);B.click(function(){Seat.Financing.closeDialog()});F.append(B);var G=Seat.UI.createImage("images/financing/close_button.gif",null,null,"");var E=jQuery("<div></div>").attr("class","ff-dialog-close-button");E.click(function(){Seat.Financing.closeDialog()});E.append(G);F.append(E)},populateHeader:function(){var E=Seat.UI.createImage(Seat.Financing.dto.titleImageURL,null,null,"");var A=jQuery("#id-ff-header-left");A.append(E).append("<br />");A.append(Seat.Financing.dto.subTitleRowOne+"<br />");A.append(Seat.Financing.dto.subTitleRowTwo+"<br />");A.append(Seat.Financing.dto.subTitleRowThree+"<br /><br />");var F=Seat.UI.createImage(Seat.Financing.dto.modelImageURL,275,125,"");F.attr("style","vertical-align:bottom;");var C=jQuery("#id-ff-header-center");C.append(F);var H=jQuery("#id-ff-header-right");var D=jQuery("<a/>").attr("href",Seat.Financing.dto.printURL).attr("class","ff-header-right-link");var G=jQuery("<div/>").attr("class","ff-header-right-print-div");var B=Seat.UI.createImage("images/financing/print.png",13,11,"");G.append(B).append("&nbsp;").append("Drucken (PDF)");H.append(D.append(G))},populateTabs:function(){if(Seat.Financing.dto.tabs.length==3){Seat.FF.populateTab(0,"left");Seat.FF.populateTab(1,"center");Seat.FF.populateTab(2,"right")}else{alert("Error: wrong number of tabs for layout.")}},populateTab:function(B,A){var D=Seat.UI.createImage(Seat.Financing.dto.tabs[B].titleImageURL,null,null,"");D.attr("class","ff-tab-div-title-"+A);D.click(function(){Seat.FF.tabClicked(B)});var E=jQuery("#id-ff-tab-"+A);var C=jQuery("#id-ff-tab-div");C.append(D);if(Seat.Financing.dto.tabs[B].subTitleImageURL!=null){var G=null;if(Seat.Financing.dto.selectedTab==B){G=Seat.UI.createImage("images/financing/arrow_gray.png",5,9,"")}else{G=Seat.UI.createImage("images/financing/arrow.png",5,9,"")}G.attr("class","ff-tab-div-arrow-"+A);G.click(function(){Seat.FF.tabClicked(B)});var F=Seat.UI.createImage(Seat.Financing.dto.tabs[B].subTitleImageURL,null,null,"");F.attr("class","ff-tab-div-subtitle-"+A);F.click(function(){Seat.FF.tabClicked(B)});C.append(G).append(F)}E.click(function(){Seat.FF.tabClicked(B)})},tabClicked:function(A){Seat.Financing.dto.selectedTab=A;DWRConfiguratorManager.updateFinancingSettings(appData,Seat.Financing.dto,processDWRResult)},populateFormButtons:function(){var G=jQuery("<table/>").attr("style","width:100%;");var H=jQuery("<tr/>");var E=jQuery("<td/>").attr("class","ff-form-inner-td-left-button");var D=jQuery("<td/>").attr("class","ff-form-inner-td-refresh-button");var C=jQuery("<td/>").attr("class","ff-form-inner-td-center-button");var A=jQuery("<td/>").attr("class","ff-form-inner-td-commit-button");G.append(H.append(E).append(D).append(C).append(A));var I=jQuery("#id-ff-form-button");var B="images/financing/arrow.png";var J=Seat.UI.createButton("refresh",B,5,9,"&nbsp;"+Seat.Financing.dto.calculate,"Kalkulieren",function(){Seat.FF.updateSettings()});var F=Seat.UI.createButton("commit",B,5,9,"&nbsp;"+Seat.Financing.dto.accept,"Übernehmen",function(){Seat.FF.commitSettings()});A.append(J);A.append(F);I.append(G);Seat.Financing.Control.updateButtons()},createFormInnerTable:function(A,C){for(var B=0;B<C.length;B++){var D=C[B];switch(D.type){case"type-label":Seat.UI.createLabelRow(A,D);break;case"type-string":Seat.UI.createTextFieldRow(A,Seat.UI.StringValidator,D);break;case"type-date":Seat.UI.createTextFieldRow(A,Seat.UI.DateValidator,D);break;case"type-double":Seat.UI.createTextFieldRow(A,Seat.UI.DoubleValidator,D);break;case"type-integer":Seat.UI.createTextFieldRow(A,Seat.UI.IntegerValidator,D);break;case"type-select-combo":Seat.UI.createSelectComboRow(A,D);break;case"type-select-radio":Seat.UI.createSelectRadioRow(A,D);break;default:alert("Unknown type: "+D.type);break}}jQuery(".jquery-combobox-box").each(function(E){var F=2000;jQuery(this).attr("style","position: relative; z-index:"+(F-E)+";")});return A},createMainTable:function(){return Seat.UI.createOneColumnTable("main")},createHeaderTable:function(){return Seat.UI.createThreeColumnTable("header")},createTabsDiv:function(){var A=jQuery("<div></div>").attr("class","ff-tab-div").attr("id","id-ff-tab-div");A.append(Seat.FF.createFormTabsInnerDiv("left",Seat.Financing.dto.selectedTab==0?"enabled":"disabled"));A.append(Seat.FF.createFormTabsInnerDiv("center",Seat.Financing.dto.selectedTab==1?"enabled":"disabled"));A.append(Seat.FF.createFormTabsInnerDiv("right",Seat.Financing.dto.selectedTab==2?"enabled":"disabled"));return A},createFormTabsInnerDiv:function(B,A){var C=jQuery("<div></div>").attr("class","ff-tab-div-"+B+"-"+A).attr("id","id-ff-tab-"+B);var D=jQuery("<div></div>").attr("class","ff-tab-div-inner-"+B+"-"+A);return C.append(D)},createDescriptionTable:function(){return Seat.UI.createOneColumnTable("description")},createFormTable:function(){var B=jQuery("<table/>").attr("class","ff-form-table");B.attr("cellspacing","0");B.attr("cellpadding","0");var D=jQuery("<tr/>").attr("class","ff-form-tr");var F=jQuery("<tr/>").attr("class","ff-form-button-tr");var E=jQuery("<td/>").attr("id","id-ff-form-left").attr("class","ff-form-td-left").attr("rowspan","2");var A=jQuery("<td/>").attr("id","id-ff-form-center").attr("class","ff-form-td-center").attr("rowspan","2");var C=jQuery("<td/>").attr("id","id-ff-form-right").attr("class","ff-form-td-right");var G=jQuery("<td/>").attr("id","id-ff-form-button").attr("class","ff-form-td-button");D.append(E).append(A).append(C);F.append(G);return B.append(D).append(F)},createBannerTable:function(){var A=jQuery("<table/>").attr("class","ff-banner-table");var C=jQuery("<tr/>").attr("class","ff-banner-tr");var D=jQuery("<td/>").attr("class","ff-banner-td-left").attr("id","id-ff-banner-left");var B=jQuery("<td/>").attr("class","ff-banner-td-right").attr("id","id-ff-banner-right");return A.append(C.append(D).append(B))},updateSettings:function(){Seat.Financing.Control.valueCalculated();DWRConfiguratorManager.updateFinancingSettings(appData,Seat.Financing.dto,processDWRResult)},commitSettings:function(){Seat.Financing.Control.valueCommitted();Seat.Financing.closeDialog();DWRConfiguratorManager.commitFinancingSettings(appData,Seat.Financing.dto,processDWRResult)}},UI:{createOneColumnTable:function(B){var A=jQuery("<table/>").attr("class","ff-"+B+"-table");A.attr("cellspacing","0");A.attr("cellpadding","0");var C=jQuery("<tr/>").attr("class","ff-"+B+"-tr");var D=jQuery("<td/>").attr("id","id-ff-"+B).attr("class","ff-"+B+"-td");return A.append(C.append(D))},createThreeColumnTable:function(D){var B=jQuery("<table/>").attr("class","ff-"+D+"-table");B.attr("cellspacing","0");B.attr("cellpadding","0");var E=jQuery("<tr/>").attr("class","ff-"+D+"-tr");var F=jQuery("<td/>").attr("id","id-ff-"+D+"-left").attr("class","ff-"+D+"-td-left");var A=jQuery("<td/>").attr("id","id-ff-"+D+"-center").attr("class","ff-"+D+"-td-center");var C=jQuery("<td/>").attr("id","id-ff-"+D+"-right").attr("class","ff-"+D+"-td-right");return B.append(E.append(F).append(A).append(C))},createFormularTableEl:function(F){var C=jQuery("<b/>").append(F);var B=jQuery("<label/>").append(C);var E=jQuery("<td/>").attr("class","ff-form-inner-td-headline").append(B);var D=jQuery("<tr/>").append(E);var A=jQuery("<table/>").attr("class","ff-form-inner-table");A.attr("cellspacing","0");A.attr("cellpadding","0");A.append(D);return A},createButton:function(E,A,F,G,I,H,B){var D=jQuery("<div/>").attr("class","ff-button").attr("id","id-ff-button-"+E);var C=Seat.UI.createImage(A,F,G,H);D.append(C).append(I);D.click(B);return D},createImage:function(C,B,D,A){var E=jQuery("<img/>").attr("src",C).attr("alt",A);if(B!=null&&D!=null){E.attr("width",B).attr("height",D)}return E},createBanner:function(D,C,A){var B=jQuery("<a/>").attr("href",C);return B.append(Seat.UI.createImage(D,329,100,A))},createLabelRow:function(B,C){var A=Seat.UI.createBaseRow(B,C.label,C.unit);A.attr("id",C.id);A.append(C.values[C.selectedIndex])},createTextFieldRow:function(B,C,D){var A=Seat.UI.createBaseRow(B,D.label,D.unit);var F=jQuery("<input/>").attr("size",D.size).attr("type","text").attr("class","ff-form-text");var E=D.values[D.selectedIndex];F.attr("name",D.id).attr("value",E!=null?E:"");F.change(function(){D.values[D.selectedIndex]=F.attr("value");Seat.UI.updateOnChange(D)});F.keydown(function(G){C.validate(G,F.attr("value"))});A.append(F)},createSelectComboRow:function(B,E){var A=Seat.UI.createBaseRow(B,E.label,E.unit);var F=jQuery("<select/>").attr("style","width:"+E.size*10+"px;");F.attr("name",E.id);F.attr("id","ff-select-"+E.id);for(var D=0;D<E.values.length;D++){var C=jQuery("<option/>").attr("value",D);C.append(E.values[D]);if(D==E.selectedIndex){C.attr("selected","true")}F.append(C)}A.append(F);jQuery("#ff-select-"+E.id).replaceCombobox({callback:function(H,G){E.selectedIndex=H.attr("key");Seat.UI.updateOnChange(E)}})},createSelectRadioRow:function(D,I){if(I.type=="type-select-radio"){var A="images/financing/radio_on.gif";var B="images/financing/radio_off.gif";var O="radioGroup"+Math.floor(Math.random()*10000);var F=Seat.UI.createBaseRow(D,I.label,"");F.attr("class","ff-form-inner-td-center-radio");var E=jQuery("<table/>").attr("class","ff-form-radio");var L=jQuery("<tr/>").attr("class","ff-form-radio-tr");F.append(E.append(L));for(var H=0;H<I.values.length;H++){if(H>0){var N=jQuery("<td/>").attr("class","ff-form-radio-td-space").append("&nbsp;");L.append(N)}else{var J=jQuery("<td/>").attr("style","width:100%;");L.append(J)}var K=jQuery("<td/>").attr("class","ff-form-radio-td-text").append(I.values[H]);var G=jQuery("<td/>").attr("class","ff-form-radio-td-icon");var C=jQuery("<div/>").attr("style","position:relative;top:2px;");var M=jQuery("<img/>").attr("id","id-ff-form-radio-icon-"+H).attr("width","14");M.attr("height","14").attr("border","0").attr("name",O);if(H==I.selectedIndex){M.attr("src",A)}else{M.attr("src",B)}L.append(K).append(G.append(C.append(M)));M.click(function(){var Q=jQuery("img[name='"+this.name+"']");for(var P=0;P<Q.length;P++){Q[P].setAttribute("src",B);if(this==Q[P]){I.selectedIndex=P}}this.setAttribute("src",A);Seat.UI.updateOnChange(I)})}}},updateOnChange:function(B){Seat.Financing.Control.valueChanged();if(Seat.Financing.dto.updateIds!=null){for(var A=0;A<Seat.Financing.dto.updateIds.length;A++){if(Seat.Financing.dto.updateIds[A]==B.id){Seat.FF.updateSettings()}}}},createBaseRow:function(B,G,D){var E=jQuery("<tr/>").attr("class","ff-form-inner-tr");var C=jQuery("<label/>").attr("class","ff-form-inner-label").append(G);var H=jQuery("<td/>").attr("class","ff-form-inner-td-left").append(C);var A=jQuery("<td/>").attr("class","ff-form-inner-td-center");var F=jQuery("<td/>").attr("class","ff-form-inner-td-right").append("&nbsp;"+D);B.append(E.append(H).append(A).append(F));return A},DoubleValidator:{validate:function(A,B){var C=A.keyCode;if(C==188){if(B.indexOf(",")!=-1){A.preventDefault()}}else{if(C==37||C==39||C==9||C==46){}else{if(C==8){A.stopPropagation()}else{if(C<48||(C>57&&C<96)||C>105){A.preventDefault()}}}}}},IntegerValidator:{validate:function(A,B){var C=A.keyCode;if(C==37||C==39||C==9||C==46){}else{if(C==8){A.stopPropagation()}else{if(C<48||(C>57&&C<96)||C>105){A.preventDefault()}}}}},DateValidator:{validate:function(A,B){}},StringValidator:{validate:function(A,B){}}}};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.financingSettings=Seat.Financing.processFinancingSettings;viewUpdateBeanLookup.closeFinancingDialog=Seat.Financing.processCloseFinancingDialog}Seat.Financing.Banner={imageLeftUrl:"images/financing/test_banner_left.jpg",linkLeftUrl:"http://configurator.seat.de/bcc/configurator.do?tvi=v.yourseat&cou=007&ses=1",imageRightUrl:"images/financing/test_banner_right.jpg",linkRightUrl:"http://configurator.seat.de/bcc/configurator.do?tvi=v.yourseat&cou=007&ses=1"};var displayPartInfo=function(A){DWRConfiguratorManager.getPartInfo(appData,A,false,processDWRResult)};var displayStandardPartInfo=function(A){DWRConfiguratorManager.getPartInfo(appData,A,true,processDWRResult)};var displayStandardEquipmentInfo=function(){DWRConfiguratorManager.getStandardEquipmentInfo(appData,processDWRResult)};var displayDealerSearch=function(){DWRConfiguratorManager.getDealerSearchInfo(appData,processDWRResult)};var displayHelp=function(){DWRConfiguratorManager.getHelpInfo(appData,processDWRResult)};var executeDealerSearch=function(){var E=jQuery("#dealerSearchParamTitle").val();var A=[];var C=jQuery("#dealerFormTextFields div.dealerFormElement input");for(var D=0;D<C.length;D++){var B=C[D];A.push({fieldId:B.name,value:B.value})}var F=jQuery("#dealerSearchParamCheckbox")[0].checked;var G=jQuery("#dealerSearchParamRegionId").val();var H=jQuery("#dealerSearchParamDealerId").val();var I=jQuery("#dealerSearchParamMessage").val();DWRConfiguratorManager.executeDealerSearch(appData,E,A,F,G,H,I,processDWRResult)};var partInfoUpdate=function(D){if(D.showAsDialog){closeCurrentDialog();var C=D.imageURL;var E=D.infoText;if(C!=null||E!=null){var A=jQuery("#partInfoImage");if(C!=null){A.attr("src",C);A.css("display","block")}else{A.attr("src","");A.css("display","none")}var F=jQuery("#partInfoText");var B=jQuery("#partInfoTextPad");if(E!=null){F.html(E);F.css("display","block");B.css("display","block")}else{F.html("&nbsp;");F.css("display","none");B.css("display","none")}openDialogDIV(jQuery("#partInfoDialog"),{closeFunction:displayStandardEquipmentInfo})}}else{partImageUpdate(D)}};var helpInfoUpdate=function(A){jQuery("#simpleHeadlineText").attr("src",A.helpHeadlineTextImage);jQuery("#simpleHeadlineMaintext").html(A.helpMainText);openDialogDIV(jQuery("#simpleHeadlineTextDialog"))};var partImageUpdate=function(B){var A=B.imageURL;if(A==null||A.length==0){A="images/default/image655x298.gif"}initImages([A],true);updatePartInfoTextMediaArea(B.infoText)};function updatePartInfoTextMediaArea(A){if(A==null){A=""}jQuery("#partInfoTextHolder").html(A)}var cellFuncHeadline=[function(A){return A.headline}];var cellFuncStandard=[function(A){return A.partText}];var rowCreatorHeadline=function(A){var B=document.createElement("td");B.className="contentHeadline";return B};var standardEquipmentInfoUpdate=function(M){jQuery("#standardEquipHeadline").attr("src",M.headlineImg);jQuery("#standardEquipModelName").html(M.modelText);dwr.util.removeAllRows("standardEquipSectionRows");var O=M.standardSections;for(var J=0;J<O.length;J++){var N=O[J];var F=[{headline:'<img src="'+N.headlineImage+'" alt="'+N.headlineImageAlt+'" />'}];dwr.util.addRows("standardEquipSectionRows",F,cellFuncHeadline,{cellCreator:rowCreatorHeadline,escapeHtml:false});var D=N.sectionCollection;for(var H=0;H<D.length;H++){var P=D[H];var C=M.partInfoLabel;var E=P.infoAvailable?' <span class="clickable underline" style="padding-left: 30px;" onclick="displayStandardPartInfo(\''+P.partId+"')\">"+C+"<span>":"";F=[{partText:"- "+P.partText+E}];dwr.util.addRows("standardEquipSectionRows",F,cellFuncStandard,{escapeHtml:false})}}var B=false;var A=false;var I=false;var G=M.ecoData;if(G!=null){B=G.co2EmissionCombinedLabel!=null&&G.co2EmissionCombinedValue!=null&&G.co2EmissionCombinedValue.length>0;A=G.consumptionCombinedLabel!=null&&G.consumptionCombinedValue!=null&&G.consumptionCombinedValue.length>0;I=G.pkwEnVkv!=null;var L=G.co2EmissionCombinedLabel+":"+G.co2EmissionCombinedValue;jQuery("#ecoInfo1Text").html(dwr.util.escapeHtml(L));var K=G.consumptionCombinedLabel+":"+G.consumptionCombinedValue;jQuery("#ecoInfo2Text").html(dwr.util.escapeHtml(K));if(I){jQuery("#pkwEnVkv").html(dwr.util.escapeHtml(G.pkwEnVkv))}else{jQuery("#pkwEnVkv").html("&nbsp;")}}jQuery("#ecoInfo1").css("display",B?"block":"none");jQuery("#ecoInfo2").css("display",A?"block":"none");jQuery("#pkwEnVkv").css("display",I?"block":"none");openDialogDIV(jQuery("#standardEquipDialog"))};var dealerArray=[];var dealerSearchViewInfoUpdate=function(C){jQuery("#dealerSearchForm").css("display","block");jQuery("#dealerSearchConfirmation").css("display","none");jQuery("#dealerSearchHeadlineTextImage").attr("src",C.headlineTextImageURL);jQuery("#dealerSearchIntroText").html(C.introText);jQuery("#dealerSearchRegionTextImage").attr("src",C.regionTextImageURL);jQuery("#dealerSearchDealerTextImage").attr("src",C.dealerTextImageURL);jQuery("#dealerSearchMessageTextImage").attr("src",C.messageTextImageURL);jQuery("#dealerSearchCheckText").attr("src",C.legalNoteTextImageURL);jQuery("#dealerSearchSendButton").find("span")[0].innerHTML=C.sendText;jQuery("#dealerSearchTitle").attr("src",C.titleTextImageURL);if(C.useTitle){jQuery("#dealerSearchTitleDiv").css("display","block");jQuery("#dealerSearchTitleMr").html(C.titleTextMale);jQuery("#dealerSearchTitleMrs").html(C.titleTextFemale)}else{jQuery("#dealerSearchTitleDiv").css("display","none")}updateDynamicFields(C);var D=document.getElementById("dealerSearchParamRegionId").options;for(B=D.length-1;B>0;B--){D[B]=null}for(var B=0;B<C.regionList.length;B++){var A=C.regionList[B];D[B]=new Option(A.label,A.value)}dealerArray=C.dealerLists;updateDealerList();openDialogDIV(jQuery("#dealerSearchDialog"));openDialogDIV(jQuery("#dealerSearchDialog"))};var updateDealerList=function(){var A=jQuery("#dealerSearchParamRegionId")[0].selectedIndex;var B=dealerArray[A];var D=jQuery("#dealerSearchParamDealerId")[0].options;for(i=D.length-1;i>0;i--){D[i]=null}for(i=0;i<B.length;i++){var C=B[i];D[i]=new Option(C.label,C.value)}};var updateDynamicFields=function(F){var B=jQuery("#dealerFormTextFields")[0];while(B.hasChildNodes()){B.removeChild(B.firstChild)}var C=false;var E=F.textfields;for(var G=0;G<E.length;G++){var D=E[G];C|=D.requiresLegal;if(G%2==1){var H=document.createElement("div");H.className="dealerFormFieldSpacer";H.innerHTML="&nbsp;";B.appendChild(H)}var I=document.createElement("div");I.setAttribute("id","dealerSearchDynamicField-"+D.name);I.className="dealerFormElement";var A=document.createElement("div");A.className="dealerSearchLabelDIV";A.innerHTML='<img src="'+D.labelImg+'" alt="" />&nbsp;<span></span>';I.appendChild(A);var J=document.createElement("input");J.className="dealerSearchDialogField";J.setAttribute("size","30");J.setAttribute("maxlength","30");J.setAttribute("type","text");J.setAttribute("name",D.name);J.setAttribute("value",D.value);I.appendChild(J);B.appendChild(I)}jQuery("#dealerSearchLegalCheckbox").css("display",C?"block":"none")};var dealerSearchExecuteUpdateBean=function(C){if(C.formDataValid){jQuery("#dealerSearchForm").css("display","none");var H=jQuery("#dealerSearchConfirmation");H.css("display","block");H.html(C.successMessage);repositionDialog()}else{var D='<img class="vMiddle" src="'+C.errorImg+'" alt="">';if(C.checkboxMissing){jQuery("#dealerSearchLegalCheckbox").find("span")[0].innerHTML=D}else{jQuery("#dealerSearchLegalCheckbox").find("span")[0].innerHTML=""}var I='<img src="'+C.errorImg+'" alt="">';var A=C.fieldIdErrorSet;for(var E=0;E<A.length;E++){var J=jQuery("#dealerSearchDynamicField-"+A[E]).find("div.dealerSearchLabelDIV span")[0];J.innerHTML=I}var F=C.fieldIdOkSet;for(var B=0;B<F.length;B++){var G=jQuery("#dealerSearchDynamicField-"+F[B]).find("div.dealerSearchLabelDIV span")[0];G.innerHTML=""}}};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.partInfoUpdate=partInfoUpdate;viewUpdateBeanLookup.standardEquipmentInfoUpdate=standardEquipmentInfoUpdate;viewUpdateBeanLookup.dealerSearchViewInfoUpdate=dealerSearchViewInfoUpdate;viewUpdateBeanLookup.dealerSearchExecuteUpdateBean=dealerSearchExecuteUpdateBean;viewUpdateBeanLookup.helpInfoUpdate=helpInfoUpdate}var loginUser=function(){var B=jQuery("#username").value;var A=jQuery("#password").value;if(loginValuesValid(B,A)){alert("Bitte Benutzernamen und Passwort eingeben.")}else{DWRConfiguratorManager.loginUser(appData,B,A,processDWRResult)}};function loginValuesValid(B,A){return(B==null||B.length==0)||(A==null||A.length==0)}var loginUpdate=function(A){alert(A.errorMessage)};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.loginUpdate=loginUpdate}var dialogType=null;var openAudiWADialogAngebot=function(){dialogType="Angebot";DWRConfiguratorManager.openAudiWADialogAngebot(appData,processDWRResult)};var openAudiWADialogBestellung=function(){dialogType="Bestellung";DWRConfiguratorManager.openAudiWADialogBestellung(appData,processDWRResult)};var submitAudiWADialog=function(){if(dialogType!=null){var B=jQuery("#anrede").val();var D=jQuery("#vorname").val();var A=jQuery("#nachname").val();var G=jQuery("#strasse").val();var I=jQuery("#hausnummer").val();var H=jQuery("#plz").val();var F=jQuery("#ort").val();var L=jQuery("#telefon").val();var J=jQuery("#stammnummer").val();var K=jQuery("#auslieferungszentrum").val();var C=jQuery("#mfcvorname").val();var E=jQuery("#mfcnachname").val();DWRConfiguratorManager.submitAudiWADialog(appData,dialogType,B,D,A,G,I,H,F,L,J,C,E,K,processDWRResult)}};var audiwaDialogUpdate=function(A){jQuery("#audiwaheadline").attr("src",A.headlineImage);jQuery("#anredeLabel").html(A.anredeLabel);jQuery("#anredeValueHerr").html(A.anredeValueHerr);jQuery("#anredeValueFrau").html(A.anredeValueFrau);jQuery("#vornameLabel").html(A.vornameLabel);jQuery("#nachnameLabel").html(A.nachnameLabel);jQuery("#strasseLabel").html(A.strasseLabel);jQuery("#hausnummerLabel").html(A.hausnummerLabel);jQuery("#plzLabel").html(A.plzLabel);jQuery("#ortLabel").html(A.ortLabel);jQuery("#telefonLabel").html(A.telefonLabel);jQuery("#stammnummerLabel").html(A.stammnummerLabel);jQuery("#auslieferungsZentrumLabel").html(A.auslieferungsZentrumLabel);jQuery("#mfcVornameLabel").html(A.mfcVornameLabel);jQuery("#mfcNachnameLabel").html(A.mfcNachnameLabel);jQuery("#createPDFLabel").html("PDF ERZEUGEN");openDialogDIV(jQuery("#audiwaDialog"))};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.audiwaDialogUpdate=audiwaDialogUpdate}var VirtualGarage={SLOTS:3,DETAILS_HEIGHT:219,CHECKX_IMG:"checkx.png",CHECKX_IMG_CHECKED:"checkx_checked.png",CHECK_IMG:"check.png",CHECK_IMG_CHECKED:"check-checked.png",CHECK_IMG_ERROR:"check-error.png",openCategory:0,virtualGarageBean:null,registerDialogBean:null,saveName:null,loginClubSEATUser:function(){var B=jQuery("#clubUsername").val();var A=jQuery("#clubPassword").val();if(B!=null&&A!=null){DWRConfiguratorManager.loginClubSEATUser(appData,B,A,processDWRResult)}},registerClubSEATUser:function(C,B,A){DWRConfiguratorManager.registerClubSEATUser(appData,C,B,A,processDWRResult)},showVirtualGarage:function(){VirtualGarage.saveName=null;DWRConfiguratorManager.virtualGarageDialog(appData,processDWRResult)},prepareSave:function(){DWRConfiguratorManager.prepareSaveConfiguration(appData,processDWRResult)},openSaveConfiguration:function(){var A=VirtualGarage.saveName;if(A==null){DWRConfiguratorManager.saveDialog(appData,processDWRResult)}},saveConfiguration:function(){var A=CLUtils.trimToNull(jQuery("#saveName").attr("value"));VirtualGarage.saveName=A;if(A==null){DWRConfiguratorManager.saveConfiguration(appData,A,processDWRResult);closeCurrentDialog()}},loadConfiguration:function(A){DWRConfiguratorManager.loadConfiguration(appData,A,processDWRResult)},deleteConfigurationDialog:function(){DWRConfiguratorManager.deleteConfigurationDialog(appData,processDWRResult)},registerDialog:function(){DWRConfiguratorManager.registerDialog(appData,processDWRResult)},deleteConfiguration:function(B,A){if(confirm("Wollen Sie diese Konfiguration wirklich endg\u00FCltig l\u00F6schen?")){VirtualGarage.virtualGarageBean.availableConfigurations.splice(VirtualGarage.findAvailableConfigurationIndex(B),1);DWRConfiguratorManager.deleteConfiguration(appData,B,A,processDWRResult)}},deleteConfigurations:function(A){DWRConfiguratorManager.deleteConfigurations(appData,A,processDWRResult)},renameConfiguration:function(E,B){var C=VirtualGarage.findAvailableConfigurationIndex(E);var D=VirtualGarage.virtualGarageBean.availableConfigurations[C].text;var A=prompt("Bitte geben Sie einen neuen Namen ein!",D);if(A!=null){VirtualGarage.virtualGarageBean.availableConfigurations[C].text=A;DWRConfiguratorManager.renameConfiguration(appData,E,B,A,processDWRResult)}},addConfiguration:function(){var E=VirtualGarage.virtualGarageBean.displayedConfigurations;if(E.length<VirtualGarage.SLOTS){var F=E.length;var A=new Array(F);for(var D=0;D<F;D++){A[D]=E[D].configId}var B=VirtualGarage.virtualGarageBean.availableConfigurations;var C=-1;for(D=0;D<B.length&&C==-1;D++){var G=B[D].configId;if(!CLUtils.contains(A,G)){C=D}}if(C>-1){VirtualGarage.getConfigurationForSlot(B[C].configId,F)}}},getConfigurationForSlot:function(B,A){DWRConfiguratorManager.getConfigurationForSlot(appData,B,A,processDWRResult)},openVirtualGarageDialog:function(B){VirtualGarage.saveName=null;closeCurrentDialog();VirtualGarage.virtualGarageBean=B;var A=jQuery("#garageDialog");VirtualGarage.addHeader(A,B.headerTextImage,B.closeDialogTextImage);VirtualGarage.addVGContent(A,B);VirtualGarage.addShadow(A);var C=jQuery("#garageDialog tr.summary div.closed");C.click(VirtualGarage.toggleCategory);openDialog(A,jQuery("#modalDiv"));C.eq(VirtualGarage.openCategory).click()},openLoginDialog:function(A){closeCurrentDialog();openDialog(jQuery("#loginDialog"),jQuery("#modalDiv"))},openRegisterDialog:function(A){closeCurrentDialog();VirtualGarage.registerDialogBean=A;var B=jQuery("#registerDialog");B.find("div.delay").remove();VirtualGarage.addHeader(B,null,A.closeDialogTextImage);VirtualGarage.addRegisterContent(B,A);VirtualGarage.addShadow(B);openDialog(B,jQuery("#modalDiv"))},openDeleteDialog:function(B){closeCurrentDialog();var A=jQuery("#deleteDialog");VirtualGarage.addHeader(A,null,B.closeDialogTextImage);VirtualGarage.addDeleteContent(A,B);VirtualGarage.addShadow(A);openDialog(A,jQuery("#modalDiv"));A.find(".imagecontainer").jScrollPane()},openSaveDialog:function(A){closeCurrentDialog();var B=jQuery("#saveDialog");VirtualGarage.addHeader(B,null,A.closeDialogTextImage);VirtualGarage.addSaveContent(B,A);VirtualGarage.addShadow(B);openDialog(B,jQuery("#modalDiv"))},processSlotUpdate:function(A){if(A.vehicleInfoUpdateBean==null){VirtualGarage.virtualGarageBean.displayedConfigurations.splice(A.slotIndex,1)}else{VirtualGarage.virtualGarageBean.displayedConfigurations[A.slotIndex]=A.vehicleInfoUpdateBean}VirtualGarage.openVirtualGarageDialog(VirtualGarage.virtualGarageBean)},processSlotRenameUpdate:function(C){var B=C.slotIndex;var A=C.newName;alert("processSlotRenameUpdate: Not yet implemented")},processRegistrationResult:function(B){var A=B.errorMessage;if(A==null){closeCurrentDialog()}else{jQuery("#registerDialog div.delay").remove();VirtualGarage.setErrorEnabled(jQuery("#regEMail"),true,A)}},addHeader:function(D,A,F){D.find(".header").remove();var E=jQuery('<div class="header"/>');if(A!=null){jQuery('<img src="'+A+'" alt=""/>').appendTo(E)}var B=jQuery('<div class="close"/>');B.appendTo(E);jQuery('<img src="'+F+'" alt=""/>').appendTo(B);jQuery('<a href="javascript:closeCurrentDialog();"><img src="images/financing/close_button.gif" alt=""/></a>').appendTo(B);var C=D.children();if(C.length==0){E.appendTo(D)}else{E.insertBefore(C.first())}},addShadow:function(A){if(A.find("div.shadow-top-left").length==0){jQuery('<div class="shadow-top-left"/>').appendTo(A);jQuery('<div class="shadow-top-right"/>').appendTo(A);jQuery('<div class="shadow-bottom-left"/>').appendTo(A);jQuery('<div class="shadow-bottom-right"/>').appendTo(A);jQuery('<div class="shadow-top"/>').appendTo(A);jQuery('<div class="shadow-bottom"/>').appendTo(A);jQuery('<div class="shadow-left"/>').appendTo(A);jQuery('<div class="shadow-right"/>').appendTo(A)}},addVGContent:function(C,D){C.find(".content").remove();var B=jQuery('<div class="content"/>');var E=jQuery('<div class="white"/>');E.appendTo(B);VirtualGarage.addVGWhiteContent(E,D);var A=jQuery('<div class="black"/>');VirtualGarage.addVGBlackContent(A,D);A.appendTo(B);B.insertAfter(C.find(".header"))},addVGWhiteContent:function(K,I){var R=jQuery("<table/>");R.appendTo(K);var D=jQuery('<tr class="select">');D.appendTo(R);var M=jQuery('<td rowspan="6" class="first">');M.appendTo(D);var E=I.displayedConfigurations.length;var A=E>0?I.headerInfoText:I.headerInfoEmptyText;jQuery('<div class="headline"><p>'+DWRUtil.replaceXmlCharacters(A)+"<p></p></div>").appendTo(M);if(I.displayedConfigurations.length<VirtualGarage.SLOTS){jQuery('<div><a class="addButton" href="javascript:VirtualGarage.addConfiguration();">'+I.newConfigurationText.toUpperCase()+"</a></div>").appendTo(M)}var U=new Array(E);for(var Q=0;Q<E;Q++){U[Q]=I.displayedConfigurations[Q].configId}for(Q=0;Q<E;Q++){var F=I.displayedConfigurations[Q];var C=jQuery("<td/>");C.appendTo(D);var H=jQuery("<select/>");H.appendTo(C);for(var P=0;P<I.availableConfigurations.length;P++){var S=I.availableConfigurations[P];if(!CLUtils.contains(U,S.configId)||S.configId==F.configId){var L=jQuery('<option value="'+S.configId+'">'+DWRUtil.replaceXmlCharacters(S.text)+"</option>");if(S.configId==F.configId){L.attr("selected","selected")}L.appendTo(H)}}H.replaceCombobox({callback:function(Y,V){var a=-1;var X=jQuery("#garageDialog div.white tr.select select");var Z=Y.parent().parent().parent().siblings("select");for(var W=0;W<X.length;W++){if(X[W]==Z[0]){a=W}}VirtualGarage.getConfigurationForSlot(Y.attr("key"),a)}});jQuery('<div class="rename"><a href="javascript:VirtualGarage.renameConfiguration('+F.configId+", "+Q+');"><img class="rename" src="images/dialog/rename.png" alt=""/></a></div>').appendTo(C)}for(Q=E;Q<VirtualGarage.SLOTS;Q++){jQuery("<td/>").appendTo(D)}var T=jQuery('<tr class="image">');T.appendTo(R);for(Q=0;Q<E;Q++){F=I.displayedConfigurations[Q];C=jQuery('<td class="image"/>');C.appendTo(T);var G=jQuery('<div class="car"/>');G.appendTo(C);var B=jQuery('<img src="'+F.vehicleFrontImage+'" alt=""/>');B.attr("class",F.vehicleFrontImage.indexOf("yai")>-1?"yai":"car");B.appendTo(G);var J=jQuery('<img src="'+F.vehicleRearImage+'" alt=""/>');J.attr("class",F.vehicleRearImage.indexOf("yai")>-1?"yaireverse":"carreverse");J.hide();J.appendTo(G);jQuery('<div class="rotate"><a href="javascript:VirtualGarage.rotateImage('+Q+');"><img src="images/dialog/rotate.png" alt=""/></a></div>').appendTo(G)}for(Q=E;Q<VirtualGarage.SLOTS;Q++){jQuery('<td class="image"><div class="car"><img class="empty" src="images/slot-empty.jpg" alt=""/></div></td>').appendTo(T)}var N=jQuery('<tr class="price">');N.appendTo(R);for(Q=0;Q<E;Q++){F=I.displayedConfigurations[Q];C=jQuery("<td/>");C.appendTo(N);jQuery('<div class="name"><img src="'+F.trimTextImage+'" alt=""/></div>').appendTo(C);jQuery('<div><img src="'+F.priceTextImage+'" alt=""/></div>').appendTo(C);jQuery('<div><a class="link" href="javascript:finance('+F.configId+')">'+DWRUtil.replaceXmlCharacters(F.instalmentsText)+"</a></div>").appendTo(C)}for(Q=E;Q<VirtualGarage.SLOTS;Q++){jQuery("<td/>").appendTo(N)}var O=jQuery('<tr class="test">');O.appendTo(R);for(Q=0;Q<E;Q++){F=I.displayedConfigurations[Q];C=jQuery("<td/>");C.appendTo(O);jQuery('<a class="button" href="javascript:testDrive('+F.configId+');">'+DWRUtil.replaceXmlCharacters(I.testDriveButtonText.toUpperCase())+"</a>").appendTo(C)}for(Q=E;Q<VirtualGarage.SLOTS;Q++){jQuery("<td/>").appendTo(O)}},addVGBlackContent:function(C,E){var F=E.displayedConfigurations;var G=F.length;var A=jQuery('<div class="headline"/>');A.appendTo(C);var B=jQuery("<table/>");B.appendTo(A);var L=jQuery("<tr/>");L.appendTo(B);jQuery('<td class="first">'+DWRUtil.replaceXmlCharacters(E.configurationText)+"</td>").appendTo(L);for(var D=0;D<G;D++){var I=E.displayedConfigurations[D];var J=jQuery("<td/>");J.appendTo(L);jQuery('<a href="javascript:printConfig('+I.configId+');"><img src="images/dialog/print_white.png" alt=""/></a>').appendTo(J);jQuery('<a href="javascript:VirtualGarage.deleteConfiguration('+I.configId+", "+D+');"><img src="images/dialog/delete_white.png" alt=""/></a>').appendTo(J)}for(D=G;D<VirtualGarage.SLOTS;D++){jQuery("<td/>").appendTo(L)}var H=jQuery('<div class="optionlist">');H.appendTo(C);var K=jQuery("<table/>");K.appendTo(H);VirtualGarage.addVGSummary(E,K,"motorText","motorContent");VirtualGarage.addVGEngineDetails(E,K);VirtualGarage.addVGBlackEditRow(E,K);VirtualGarage.addVGBlackSeparator(K);VirtualGarage.addVGSummary(E,K,"exteriorColorText","exteriorContent");VirtualGarage.addVGDetails(E,K,"exteriorContent");VirtualGarage.addVGBlackEditRow(E,K);VirtualGarage.addVGBlackSeparator(K);VirtualGarage.addVGSummary(E,K,"interiorColorText","interiorContent");VirtualGarage.addVGDetails(E,K,"interiorContent");VirtualGarage.addVGBlackEditRow(E,K);VirtualGarage.addVGBlackSeparator(K);VirtualGarage.addVGSummary(E,K,"tyreText","tireContent");VirtualGarage.addVGDetails(E,K,"tireContent");VirtualGarage.addVGBlackEditRow(E,K);VirtualGarage.addVGBlackSeparator(K);VirtualGarage.addVGSummary(E,K,"optionText","optionContent");VirtualGarage.addVGDetails(E,K,"optionContent");VirtualGarage.addVGBlackEditRow(E,K);VirtualGarage.addVGBlackSeparator(K)},buildCategories:function(H,C){var J=H.displayedConfigurations;var I=VirtualGarage.buildCategoryOrder(H,C);var G=new Array(I.length);for(var F=0;F<I.length;F++){var D=I[F];var B={label:null,vehicleOptions:new Array(J.length)};for(var E=0;E<J.length;E++){var A=VirtualGarage.findCategoryBean(J[E],D,C);if(A!=null){if(B.label==null){B.label=A.categoryText}B.vehicleOptions[E]=A.options}}G[F]=B}return G},findCategoryBean:function(B,D,E){var A=B[E].categories;for(var C=0;C<A.length;C++){if(A[C].categoryId==D){return A[C]}}return null},buildCategoryOrder:function(H,A){var J=H.displayedConfigurations;var B=H.partSubSetOrder;var F=new Array();for(var E=0;E<J.length;E++){var G=J[E][A].categories;for(var D=0;D<G.length;D++){var C=G[D].categoryId;if(!CLUtils.contains(F,C)){F.push(C)}}}D=0;var I=new Array(F.length);for(E=0;E<B.length;E++){if(CLUtils.contains(F,B[E])){I[D++]=B[E]}}return I},addVGEngineDetails:function(J,N){var K=J.displayedConfigurations;var L=K.length;var B=jQuery('<tr class="hidden"/>');B.appendTo(N);var Q=jQuery('<td colspan="5"/>');Q.appendTo(B);var D=jQuery('<div class="details"/>');D.appendTo(Q);var I=jQuery("<table/>");I.appendTo(D);var H=VirtualGarage.buildCategories(J,"motorContent");for(var F=0;F<H.length;F++){var A=H[F];var P=jQuery("<tr/>");P.appendTo(I);jQuery('<td class="category">'+DWRUtil.replaceXmlCharacters(A.label)+"</td>").appendTo(P);for(var E=0;E<L;E++){var O=A.vehicleOptions[E];var M=jQuery('<td class="info"/>');M.appendTo(P);for(var C=0;C<O.length;C++){var G=O[C];jQuery("<div>"+DWRUtil.replaceXmlCharacters(G.descriptionText)+"</div>").appendTo(M)}}for(E=L;E<VirtualGarage.SLOTS;E++){jQuery('<td class="info"/>').appendTo(P)}}},addVGDetails:function(E,O,I){var G=E.displayedConfigurations;var C=G.length;var P=jQuery('<tr class="hidden"/>');P.appendTo(O);var A=jQuery('<td colspan="5"/>');A.appendTo(P);var B=jQuery('<div class="details"/>');B.appendTo(A);var R=jQuery("<table/>");R.appendTo(B);var J=VirtualGarage.buildCategories(E,I);for(var N=0;N<J.length;N++){var K=J[N];var Q=VirtualGarage.maxOptions(K);for(var M=0;M<Q;M++){var F=jQuery("<tr/>");F.appendTo(R);if(M==0){jQuery('<td class="category" rowspan="'+Q+'">'+DWRUtil.replaceXmlCharacters(K.label)+"</td>").appendTo(F)}for(var L=0;L<C;L++){var D=K.vehicleOptions[L];if(D!=null&&D.length>M){var H=D[M];jQuery('<td class="price">'+DWRUtil.replaceXmlCharacters(H.priceText)+"</td>").appendTo(F);jQuery('<td class="description"><div>'+DWRUtil.replaceXmlCharacters(H.descriptionText)+"</div></td>").appendTo(F)}else{jQuery('<td class="price"/>').appendTo(F);jQuery('<td class="description"/>').appendTo(F)}}for(L=C;L<VirtualGarage.SLOTS;L++){jQuery('<td class="price"/>').appendTo(F);jQuery('<td class="description"/>').appendTo(F)}}}},addVGSummary:function(E,H,A,C){var F=E.displayedConfigurations;var G=F.length;var I=jQuery('<tr class="summary"/>');I.appendTo(H);jQuery('<td><div class="closed">'+DWRUtil.replaceXmlCharacters(E[A])+"</div></td>").appendTo(I);for(var D=0;D<G;D++){var B=F[D];jQuery('<td><div class="total">'+DWRUtil.replaceXmlCharacters(B[C].totalPriceText)+"</div></td>").appendTo(I)}for(D=G;D<VirtualGarage.SLOTS;D++){jQuery("<td/>").appendTo(I)}jQuery('<td class="scrollbarspace"/>').appendTo(I)},addVGBlackEditRow:function(C,B){var E=C.displayedConfigurations;var D=E.length;var F=jQuery('<tr class="hidden"/>');F.appendTo(B);jQuery("<td/>").appendTo(F);for(var A=0;A<D;A++){jQuery('<td><div class="edit"><a class="edit" href="javascript:VirtualGarage.loadConfiguration('+E[A].configId+');">'+DWRUtil.replaceXmlCharacters(C.editText.toUpperCase())+"</a></div></td>").appendTo(F)}for(A=D;A<VirtualGarage.SLOTS;A++){jQuery("<td/>").appendTo(F)}jQuery('<td class="scrollbarspace"></td>').appendTo(F)},addVGBlackSeparator:function(B){var C=jQuery("<tr/>");C.appendTo(B);for(var A=0;A<4;A++){jQuery('<td><div class="underline"></div></td>').appendTo(C)}jQuery('<td class="scrollbarspace"></td>').appendTo(C)},toggleCategory:function(B){var I=jQuery(B.target).parent().parent();var G=I.parent().children();var H=false;var C=0;for(var E=0;E<G.length;E++){var D=G.eq(E);if(G[E].className=="hidden"){if(H){var F=D.find("div.details");D.show();if(F.length!=0&&F.height()>VirtualGarage.DETAILS_HEIGHT){F.height(VirtualGarage.DETAILS_HEIGHT);F.jScrollPane()}}else{D.hide()}}else{H=G[E]==I[0];var A=D.children().eq(0).children().eq(0);if(A.attr("className")!="underline"){A.attr("className",H?"open":"closed");if(H){VirtualGarage.openCategory=C}C++}}}return false},rotateImage:function(A){var C=jQuery("#garageDialog div.car > img").eq(A*2);var B=jQuery("#garageDialog div.car > img").eq(A*2+1);if(C.css("display")=="none"){C.show();B.hide()}else{C.hide();B.show()}},maxOptions:function(D){var A=0;var F=D.vehicleOptions;var E=F.length;for(var C=0;C<E;C++){var B=F[C];if(B!=null&&B.length>A){A=B.length}}return A},findAvailableConfigurationIndex:function(C){var B=VirtualGarage.virtualGarageBean.availableConfigurations;for(var A=0;A<B.length;A++){if(B[A].configId==C){return A}}return -1},addDeleteContent:function(K,H){K.find(".content").remove();var C=jQuery('<div class="content"/>');C.insertAfter(K.find(".header"));jQuery('<div class="title"><img src="'+H.headerTextImage+'" alt=""/></div>').appendTo(C);jQuery('<div class="info">'+DWRUtil.replaceXmlCharacters(H.headerInfoText)+"</div>").appendTo(C);jQuery('<div class="listtext">'+DWRUtil.replaceXmlCharacters(H.listText)+"</div>").appendTo(C);var J=jQuery('<div class="border"/>');J.appendTo(C);var I=jQuery('<div class="imagecontainer"/>');I.appendTo(J);for(var F=0;F<H.configurations.length;F++){var B=H.configurations[F];var D=jQuery('<div class="vehicle"/>');D.appendTo(I);var L=jQuery('<div class="car"/>');L.appendTo(D);var E=jQuery('<img src="'+B.vehicleImage+'" alt=""/>');E.attr("class",B.vehicleImage.indexOf("yai")>-1?"yai":"car");E.appendTo(L);var A=jQuery('<div class="check"/>');A.appendTo(L);var G=jQuery('<img src="images/dialog/checkx.png" alt=""/>');G.appendTo(A);G.click(VirtualGarage.toggleCheckedX);G.attr("configId",B.configId);L.appendTo(D);jQuery('<div class="date">'+DWRUtil.replaceXmlCharacters(B.date)+"</div>").appendTo(D);jQuery('<div class="name"><img src="'+B.vehicleTextImage+'" alt=""/></div>').appendTo(D)}var M=jQuery('<div class="buttons"/>');M.appendTo(C);jQuery('<div class="button-left"><a class="button" href="javascript:closeCurrentDialog();">'+DWRUtil.replaceXmlCharacters(H.abortButtonText.toUpperCase())+"</a></div>").appendTo(M);jQuery('<div class="button-right"><a class="button" href="javascript:VirtualGarage.triggerDelete();">'+DWRUtil.replaceXmlCharacters(H.deleteButtonText.toUpperCase())+"</a></div>").appendTo(M)},toggleCheckedX:function(B){var C=B.target;var D=C.src;var E=D.lastIndexOf("/");var A=VirtualGarage.isCheckedX(C)?VirtualGarage.CHECKX_IMG:VirtualGarage.CHECKX_IMG_CHECKED;C.src=D.substring(0,E+1)+A},isCheckedX:function(A){var C=A.src;var D=C.lastIndexOf("/");var B=C.substring(D+1,C.length);return B==VirtualGarage.CHECKX_IMG_CHECKED},triggerDelete:function(){var B=jQuery("#deleteDialog div.check img");var A=new Array();for(var C=0;C<B.length;C++){var D=B.eq(C);if(VirtualGarage.isCheckedX(B[C])){A.push(D.attr("configId"))}}closeCurrentDialog();VirtualGarage.deleteConfigurations(A)},addRegisterContent:function(H,G){H.find(".content").remove();var C=jQuery('<div class="content"/>');C.insertAfter(H.find(".header"));jQuery('<div class="title"><img src="'+G.headlineTextImage+'" alt=""/></div>').appendTo(C);jQuery('<div class="info">'+DWRUtil.replaceXmlCharacters(G.infoText)+"</div>").appendTo(C);jQuery('<div class="smalltitle">'+DWRUtil.replaceXmlCharacters(G.titleText)+"</div>").appendTo(C);var F=jQuery("<div/>");F.appendTo(C);var J=jQuery('<input id="regEMail" class="large" type="text" name="email" value="'+DWRUtil.replaceXmlCharacters(G.emailLabel)+'"/>');J.appendTo(F);J.attr("defaultValue",G.emailLabel);jQuery('<div class="error">'+DWRUtil.replaceXmlCharacters(G.errorEmailInvalidText)+"</div>").appendTo(C);var D=jQuery("<div/>");D.appendTo(C);var K=jQuery('<input id="regPassword1" class="large" type="password" name="password1" value="'+DWRUtil.replaceXmlCharacters(G.password1Label)+'"/>');K.appendTo(D);K.attr("defaultValue",G.password1Label);jQuery('<div class="error"/>').appendTo(C);var A=jQuery("<div/>");A.appendTo(C);var B=jQuery('<input id="regPassword2" class="large" type="password" name="password2" value="'+DWRUtil.replaceXmlCharacters(G.password2Label)+'"/>');B.appendTo(A);B.attr("defaultValue",G.password2Label);jQuery('<div class="error">'+DWRUtil.replaceXmlCharacters(G.errorPasswordNotEqualText)+"</div>").appendTo(C);jQuery('<div><img id="regAccept" src="images/dialog/check.png" alt=""/>'+DWRUtil.replaceXmlCharacters(G.acceptPreText)+' <a class="underline" href="'+G.acceptLink1+'">'+DWRUtil.replaceXmlCharacters(G.acceptLink1Text)+"</a>"+DWRUtil.replaceXmlCharacters(G.acceptText)+'<a class="underline" href="'+G.acceptLink2+'">'+DWRUtil.replaceXmlCharacters(G.acceptLink2Text)+"</a>"+DWRUtil.replaceXmlCharacters(G.acceptPostText)+"</div>").appendTo(C);jQuery('<div class="error">'+DWRUtil.replaceXmlCharacters(G.errorAcceptText)+"</div>").appendTo(C);jQuery('<div><img id="regSubscribe" src="images/dialog/check-checked.png" alt=""/>'+DWRUtil.replaceXmlCharacters(G.subscribeText)+"</div>").appendTo(C);var I=jQuery('<div class="buttons"/>');I.appendTo(C);jQuery('<div class="button-left"><a class="button" href="javascript:closeCurrentDialog()">'+DWRUtil.replaceXmlCharacters(G.backButtonText.toUpperCase())+"</a></div>").appendTo(I);jQuery('<div class="button-right"><a class="button" href="javascript:VirtualGarage.validate()">'+DWRUtil.replaceXmlCharacters(G.registerButtonText.toUpperCase())+"</a></div>").appendTo(I);var E=C.find("input");E.focus(function(L){L.target.select()});E.focusout(function(M){var L=M.target;if(CLUtils.trim(L.value).length==0){L.value=L.defaultValue}});C.find("img").click(VirtualGarage.toggleChecked)},isErrorEnabled:function(A){return A.parent().next().css("visibility")=="visible"},setErrorEnabled:function(C,B,G){var A=C.attr("nodeName");if(A=="INPUT"){C.attr("class",B?"large-error":"large")}if(A=="IMG"){var F=C.attr("src");var H=F.lastIndexOf("/");var E=F.substring(0,H+1);C.attr("src",E+(B?VirtualGarage.CHECK_IMG_ERROR:VirtualGarage.CHECK_IMG))}var D=C.parent().next();if(G!=null){D.text(G)}D.css("visibility",B?"visible":"hidden")},toggleChecked:function(B){var C=B.target;var D=C.src;var E=D.lastIndexOf("/");var A=VirtualGarage.isChecked(C)?VirtualGarage.CHECK_IMG:VirtualGarage.CHECK_IMG_CHECKED;C.src=D.substring(0,E+1)+A},isChecked:function(A){var C=A.src;var D=C.lastIndexOf("/");var B=C.substring(D+1,C.length);return B==VirtualGarage.CHECK_IMG_CHECKED},validate:function(){var L=jQuery("#regEMail");var H=L.attr("value");var K=jQuery("#regPassword1").attr("value");var C=jQuery("#regPassword2");var J=C.attr("value");var D=jQuery("#regAccept");var E=VirtualGarage.isChecked(D[0]);var B=VirtualGarage.isChecked(jQuery("#regSubscribe")[0]);var A=H==null||H.indexOf("@")==-1||H.lastIndexOf(".")<=H.indexOf("@");VirtualGarage.setErrorEnabled(L,A,VirtualGarage.registerDialogBean.errorEmailInvalidText);var F=!A;if(K!=J){VirtualGarage.setErrorEnabled(C,true,VirtualGarage.registerDialogBean.errorPasswordNotEqualText);F=false}else{if(K.length<8){VirtualGarage.setErrorEnabled(C,true,VirtualGarage.registerDialogBean.errorPasswordToShortText);F=false}else{VirtualGarage.setErrorEnabled(C,false)}}VirtualGarage.setErrorEnabled(D,!E);F&=E;if(E){VirtualGarage.toggleChecked({target:D[0]})}if(F){var G=jQuery("#registerDialog");var I=jQuery('<div class="delay"/>');I.appendTo(G);jQuery('<img src="images/wait.gif" alt=""/>').appendTo(I);VirtualGarage.registerClubSEATUser(H,K,B)}},addSaveContent:function(E,B){E.find(".content").remove();var D=jQuery('<div class="content"/>');D.insertAfter(E.find(".header"));jQuery('<div class="title"><img src="'+B.headerTextImage+'" alt=""/></div>').appendTo(D);var H=jQuery('<div class="car"/>');H.appendTo(D);var G=jQuery('<img src="'+B.vehicleImage+'" alt=""/>');G.attr("class",B.vehicleImage.indexOf("yai")>-1?"yai":"car");G.appendTo(H);jQuery('<div class="trim"><img src="'+B.trimTextImage+'" alt=""/></div>').appendTo(D);jQuery('<div class="engine">'+DWRUtil.replaceXmlCharacters(B.engineText)+"</div>").appendTo(D);jQuery('<div class="info">'+DWRUtil.replaceXmlCharacters(B.nameLabelText)+"</div>").appendTo(D);var C=jQuery('<div class="form"/>');C.appendTo(D);var F=jQuery('<input id="saveName" class="large" name="name"/>');F.appendTo(C);F.attr({value:B.configurationName,defaultValue:B.configurationName});var A=jQuery('<div class="buttons"/>');A.appendTo(D);if(!CLUtils.isEmpty(B.leftButtonText)&&!CLUtils.isEmpty(B.leftButtonLink)){jQuery('<div class="button-left"><a class="button" href="'+B.leftButtonLink+'">'+DWRUtil.replaceXmlCharacters(B.leftButtonText.toUpperCase())+"</a></div>").appendTo(A)}if(!CLUtils.isEmpty(B.rightButtonText)&&!CLUtils.isEmpty(B.rightButtonLink)){jQuery('<div class="button-right"><a class="button" href="'+B.rightButtonLink+'">'+DWRUtil.replaceXmlCharacters(B.rightButtonText.toUpperCase())+"</a></div>").appendTo(A)}}};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.garageDialogUpdate=VirtualGarage.openVirtualGarageDialog;viewUpdateBeanLookup.loginDialogUpdate=VirtualGarage.openLoginDialog;viewUpdateBeanLookup.registerDialogUpdate=VirtualGarage.openRegisterDialog;viewUpdateBeanLookup.virtualGarageSlotUpdateBean=VirtualGarage.processSlotUpdate;viewUpdateBeanLookup.slotRenameUpdateBean=VirtualGarage.processSlotRenameUpdate;viewUpdateBeanLookup.deleteConfigurationsDialogUpdate=VirtualGarage.openDeleteDialog;viewUpdateBeanLookup.registerClubSEATUserResult=VirtualGarage.processRegistrationResult;viewUpdateBeanLookup.saveConfigurationDialogUpdate=VirtualGarage.openSaveDialog}jQuery(document).ready(function(){var A=jQuery("#loginDialog form input");A.focus(function(B){B.target.select()});A.focusout(function(C){var B=C.target;if(CLUtils.trim(B.value).length==0){B.value=B.defaultValue}})});var processNextAction=function(B){var A=B.nextAction;if(A!=null){if(A=="virtualGarage"){VirtualGarage.showVirtualGarage()}else{if(A=="saveConfiguration"){VirtualGarage.saveConfiguration()}}}};if(typeof (viewUpdateBeanLookup)=="undefined"){alert("DWREngine: DWRResultProcessor not available.")}else{viewUpdateBeanLookup.nextActionUpdateBean=processNextAction}var currentDialogDIV=null;var contentClearerDIV=null;var functionOnClose=null;var originalDomain=null;var introMode=false;try{originalDomain=document.domain}catch(ex){}function setDocumentDomain(B){try{document.domain=B}catch(A){}}var updateElementsVisibility=function(C,D){for(var B=0;B<C.length;B++){var A=C[B];if(A.id==D){A.style.display=""}else{A.style.display="none"}}};var getIdFromPrefixedIdAttr=function(C){var A=C.id;var B=A.indexOf("-");if(B!=-1){return A.substr(B+1)}else{alert("idString contains no '-':"+A);return null}};function setIntroMode(A){introMode=A}function isIntroMode(){return typeof (introMode)!="undefined"&&introMode}var adaptContentSizeToBrowserWindow=function(){var C=jQuery("#myBody").height();var A;if(isIntroMode()){A=C-20-579-20-40;jQuery("#contentCenter").css("overflow","hidden");jQuery("#content").css("overflow","hidden")}else{A=C-20-32-1-323-27-27-20-20-20;jQuery("#content").css("overflow","auto");A=A<138?138:A}jQuery("#contentCenter").css("height",A+"px");jQuery("#content").css("height",(A+20+20)+"px");var B=jQuery("#spacingElementModel");if(B.size()==0){B=jQuery("#spacingElementColors")}if(B.size()==0){B=jQuery("#spacingElementWheels")}if(B.size()==0){B=jQuery("#spacingElementEquipment")}if(B.size()>0){B.css("height",(A-18)+"px")}if(isDialogOpen()){repositionDialog()}};var clearSelectBox=function(B){var A=B.options;for(var C=A.length-1;C>0;C--){A[C]=null}};var openDialogDIV=function(B,A){openDialog(B,jQuery("#clearContentArea"),A)};var openDialog=function(C,B,A){A=A?A:{};currentDialogDIV=C;contentClearerDIV=B;functionOnClose=A.closeFunction?A.closeFunction:null;repositionDialog()};var closeCurrentDialog=function(){if(currentDialogDIV!=null){if(functionOnClose!=null){functionOnClose()}currentDialogDIV.css("display","none");contentClearerDIV.css("display","none");currentDialogDIV=null}};var isDialogOpen=function(){return currentDialogDIV!=null&&currentDialogDIV.css("display")=="block"};var repositionDialog=function(){contentClearerDIV.css("display","none");var O=jQuery(window).width();var P=jQuery(window).height();var C=jQuery(document);var N=C.width();var I=C.height();var D=C.scrollLeft();var B=C.scrollTop();var M=jQuery(currentDialogDIV);var L=M.outerHeight();var F=M.outerWidth();jQuery("#documentHeight").html(jQuery(document).height());jQuery("#documentWidth").html(O);jQuery("#clientHeight").html(I);jQuery("#clientWidth").html(N);jQuery("#scrollLeft").html(D);jQuery("#screenTop").html(B);jQuery("#dialogHeight").html(L);jQuery("#dialogWidth").html(F);contentClearerDIV.css("width",O+"px");contentClearerDIV.css("height",P+"px");contentClearerDIV.css("top","0px");contentClearerDIV.css("left","0px");contentClearerDIV.css("display","block");var H=(((P-L)>>1)+B);var E=(((O-F)>>1)+D);if(P<L){var J=Math.abs(I-L);var A=B/(I-P);H=Math.floor(A*J)}if(O<F){var G=Math.abs(N-F);var K=D/(N-O);E=Math.floor(K*G)}currentDialogDIV.css("top",H+"px");currentDialogDIV.css("left",E+"px");currentDialogDIV.css("display","block")};var resizeCode=function(){if(isDialogOpen()){adaptContentSizeToBrowserWindow()}};var openPrintWindow=function(A){openMyWin(A,816,600,0,0,"print")};function openMyWin(E,D,G,C,A,F){var B=window.open("about:blank",F,"width="+D+",height="+G+",left="+C+",top="+A);B.close();B=window.open(E,F,"width="+D+",height="+G+",left="+C+",top="+A+",scrollbars=yes,resizable=yes,status=no,location=no,locationbar=no,menubar=no");B.focus()}function openTestDriveLinkGER(A){A=A.replace(/.*probefahrt.asp?/,"https://ssl.seat.de/kontakt_neu/f_probefahrt.asp?");A.replace(/quelle=142/,"quelle=194");window.open(A,"popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1080,height=860,left=200,top=50")}function changeDuration(A){$("duration").value=A;$("durationField").value=durationArrayLU[A]}function changeFirstrate(A,B){$("firstrate").value=B;$("firstrateField").value=firstrateArrayLU[A][B]}function changeRate(B,C){var A=rateValueArray[B][C];$("rate").value=A;$("rateField").value=rateArrayLU[A]}function increase(F,E){var B=E;var D=F.length;for(var C=0;C<F.length;C++){var A=F[C].id;D=D-1;if(A==E){D=1}if(D==0){B=A}}return B}function decrease(F,E){var B=E;var D=E;for(var C=0;C<F.length;C++){var A=F[C].id;if(A==E){B=D}else{D=A}}return B}function increaseDuration(){var A=increase(durationArray,$("duration").value);var B=$("firstrate").value;if(typeof rateValueArray[A][B]!="undefined"){changeDuration(A);changeRate(A,B)}}function decreaseDuration(){var A=decrease(durationArray,$("duration").value);var B=$("firstrate").value;if(typeof rateValueArray[A][B]!="undefined"){changeDuration(A);changeRate(A,B)}}function increaseFirstrate(){var A=$("duration").value;var B=increase(firstrateArray[A],$("firstrate").value);if(typeof rateValueArray[A][B]!="undefined"){changeFirstrate(A,B);changeRate(A,B)}}function decreaseFirstrate(){var A=$("duration").value;var B=decrease(firstrateArray[A],$("firstrate").value);if(typeof rateValueArray[A][B]!="undefined"){changeFirstrate(A,B);changeRate(A,B)}}function changeDurationAndFirstrate(B){for(var C in rateValueArray){for(var A in rateValueArray[C]){if(rateValueArray[C][A]==B){changeDuration(C);changeFirstrate(C,A);changeRate(C,A);return }}}}function increaseRate(){changeDurationAndFirstrate(increase(rateArray,$("rate").value))}function decreaseRate(){changeDurationAndFirstrate(decrease(rateArray,$("rate").value))}var buttonBarWidth=null;var visibleButtonBarWidth=null;var maxScrollLeft=null;var scrollIntervalId=null;var mouseX=0;var SCROLL_THRESHOLD=120;var SCROLL_LEFT_THRESHOLD=SCROLL_THRESHOLD;var SCROLL_RIGHT_THRESHOLD=980-SCROLL_THRESHOLD;var MAX_SCROLL_STEP_SIZE=10;var arrowScrollingIntervalId=null;var arrowScrollingSteps=0;var carlineInfos=[];var currentConfigureLink=null;var scrollButtonBarViaArrows=function(){var A=jQuery("#buttonBar");var B=Math.max(0,Math.min(A.scrollLeft()+arrowScrollingSteps,maxScrollLeft));A.scrollLeft(B)};function addCarlineForIntro(A){carlineInfos.push(A)}function numberOfCarlineInfos(){return carlineInfos.length}var scrollButtonBar=function(){var D=jQuery("#buttonBar");var G=mouseX-D.offset().left;var F=G<120?0:maxScrollLeft;var H=D.scrollLeft();var C=F-H;if(C!=0){var I=H;if(G>=SCROLL_RIGHT_THRESHOLD){var E=G-SCROLL_RIGHT_THRESHOLD;var B=E/SCROLL_THRESHOLD;var A=MAX_SCROLL_STEP_SIZE*B;I=Math.min(Math.round(H+A),maxScrollLeft)}else{if(G<SCROLL_LEFT_THRESHOLD){var E=G;var B=(SCROLL_THRESHOLD-E)/SCROLL_THRESHOLD;var A=-MAX_SCROLL_STEP_SIZE*B;I=Math.max(0,Math.round(H+A))}}if(I!=H){D.scrollLeft(I)}}};var startScrollAnimation=function(){if(scrollIntervalId==null){scrollIntervalId=setInterval("scrollButtonBar()",20)}};var stopScrollAnimation=function(){if(scrollIntervalId!=null){window.clearInterval(scrollIntervalId);scrollIntervalId=null}};function getNumberOfCarlineInfos(){return carlineInfos.length}function buildupIntropage(){var C=jQuery("#introButtonContainer");for(var B=0;B<carlineInfos.length;B++){var A=carlineInfos[B];if(B==0){jQuery("#configureButtonLink").attr("href",A.link)}C.append('<div class="carlineButton" id="'+A.name+'"/>');var D=jQuery("#introButtonContainer").find("div.carlineButton:last");D.append('<div class="header"><a href="'+A.link+'">&nbsp;'+A.nameAsImage+"</a></div>");D.append('<div class="thumbnail"><a href="'+A.link+'">&nbsp;<img src="'+A.thumbnailImage+'" alt=""/></a></div>');D.bind("mouseover",{index:B},fadeInNewLargeImage)}jQuery("#largeImageContainer").append('<img id="currentLargeImage" src="'+carlineInfos[0].largeImage+'" alt="" />');if(getNumberOfCarlineInfos()>8){jQuery("#carline-scroll-left").show().hover(function(){jQuery("#carline-scroll-left").attr("src","images/intro_arror_left_hover.jpg");if(arrowScrollingIntervalId==null){arrowScrollingSteps=-8;arrowScrollingIntervalId=setInterval("scrollButtonBarViaArrows()",30)}},function(){jQuery("#carline-scroll-left").attr("src","images/intro_arror_left.jpg");if(arrowScrollingIntervalId!=null){window.clearInterval(arrowScrollingIntervalId);arrowScrollingIntervalId=null}});jQuery("#carline-scroll-right").show().hover(function(){jQuery("#carline-scroll-right").attr("src","images/intro_arror_right_hover.jpg");if(arrowScrollingIntervalId==null){arrowScrollingSteps=8;arrowScrollingIntervalId=setInterval("scrollButtonBarViaArrows()",30)}},function(){jQuery("#carline-scroll-right").attr("src","images/intro_arror_right.jpg");if(arrowScrollingIntervalId!=null){window.clearInterval(arrowScrollingIntervalId);arrowScrollingIntervalId=null}})}}var timeoutId=null;var fadeInNewLargeImage=function(C){if(timeoutId!=null){clearTimeout(timeoutId)}var A=carlineInfos[C.data.index];var B=A.largeImage;var D=A.link;timeoutId=setTimeout("startFading('"+B+"', '"+D+"')",400)};function startFading(A,D){var C=jQuery("#currentLargeImage");if(A!=C.attr("src")){var B=jQuery("#configureButton");B.hide();jQuery("#configureButtonLink").attr("href",D);C.fadeOut("normal",function(){C.attr("src",A);C.fadeIn("normal",function(){B.show()})})}};