jQuery.ajaxSettings.traditional=true;
/*
 * jQuery Form Plugin
 * version: 3.17 (25-SEP-2012)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Project repository: https://github.com/malsup/form
 * Dual licensed under the MIT and GPL licenses:
 *    http://malsup.github.com/mit-license.txt
 *    http://malsup.github.com/gpl-license-v2.txt
 */
(function(e){var b={};b.fileapi=e("<input type='file'/>").get(0).files!==undefined;b.formdata=window.FormData!==undefined;e.fn.ajaxSubmit=function(p){if(!this.length){d("ajaxSubmit: skipping submit process - no element selected");return this}var r,C,l,o=this;if(typeof p=="function"){p={success:p}}r=this.attr("method");C=this.attr("action");l=(typeof C==="string")?e.trim(C):"";l=l||window.location.href||"";if(l){l=(l.match(/^([^#]+)/)||[])[1]}p=e.extend(true,{url:l,success:e.ajaxSettings.success,type:r||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},p);var v={};this.trigger("form-pre-serialize",[this,p,v]);if(v.veto){d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(p.beforeSerialize&&p.beforeSerialize(this,p)===false){d("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var n=p.traditional;if(n===undefined){n=e.ajaxSettings.traditional}var g=[];var D,E=this.formToArray(p.semantic,g);if(p.data){p.extraData=p.data;D=e.param(p.data,n)}if(p.beforeSubmit&&p.beforeSubmit(E,this,p)===false){d("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[E,this,p,v]);if(v.veto){d("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var w=e.param(E,n);if(D){w=(w?(w+"&"+D):D)}if(p.type.toUpperCase()=="GET"){p.url+=(p.url.indexOf("?")>=0?"&":"?")+w;p.data=null}else{p.data=w}var u=[];if(p.resetForm){u.push(function(){o.resetForm()})}if(p.clearForm){u.push(function(){o.clearForm(p.includeHidden)})}if(!p.dataType&&p.target){var i=p.success||function(){};u.push(function(k){var j=p.replaceTarget?"replaceWith":"html";e(p.target)[j](k).each(i,arguments)})}else{if(p.success){u.push(p.success)}}p.success=function(I,H,J){var q=p.context||this;for(var k=0,j=u.length;k<j;k++){u[k].apply(q,[I,H,J||o,o])}};var B=e("input:file:enabled[value]",this);var x=B.fieldValue();var m=false;for(var A=0;A<x.length;A++){if(x[A]){m=true;break}}var z="multipart/form-data";var G=(o.attr("enctype")==z||o.attr("encoding")==z);var F=b.fileapi&&b.formdata;d("fileAPI :"+F);var f=(m||G)&&!F;if(p.iframe!==false&&(p.iframe||f)){if(p.closeKeepAlive){e.get(p.closeKeepAlive,function(){t(E)})}else{t(E)}}else{if((m||G)&&F){p.jqxhr=s(E)}else{p.jqxhr=e.ajax(p)}}for(var y=0;y<g.length;y++){g[y]=null}this.trigger("form-submit-notify",[this,p]);return this;function h(k){var J=e.param(k).split("&");var j=J.length;var I={};var H,q;for(H=0;H<j;H++){q=J[H].split("=");I[decodeURIComponent(q[0])]=decodeURIComponent(q[1])}return I}function s(k){var j=new FormData();for(var H=0;H<k.length;H++){j.append(k[H].name,k[H].value)}if(p.extraData){var q=h(p.extraData);for(var K in q){if(q.hasOwnProperty(K)){j.append(K,q[K])}}}p.data=null;var J=e.extend(true,{},e.ajaxSettings,p,{contentType:false,processData:false,cache:false,type:r||"POST"});if(p.uploadProgress){J.xhr=function(){var L=jQuery.ajaxSettings.xhr();if(L.upload){L.upload.onprogress=function(P){var N=0;var M=P.loaded||P.position;var O=P.total;if(P.lengthComputable){N=Math.ceil(M/O*100)}p.uploadProgress(P,M,O,N)}}return L}}J.data=null;var I=J.beforeSend;J.beforeSend=function(M,L){L.data=j;if(I){I.call(this,M,L)}};return e.ajax(J)}function t(ae){var I=o[0],J,aa,U,ac,X,M,P,O,N,Y,ab,T;var K=!!e.fn.prop;if(e(":input[name=submit],:input[id=submit]",I).length){alert('Error: Form elements must not have name or id of "submit".');return}if(ae){for(aa=0;aa<g.length;aa++){J=e(g[aa]);if(K){J.prop("disabled",false)}else{J.removeAttr("disabled")}}}U=e.extend(true,{},e.ajaxSettings,p);U.context=U.context||U;X="jqFormIO"+(new Date().getTime());if(U.iframeTarget){M=e(U.iframeTarget);Y=M.attr("name");if(!Y){M.attr("name",X)}else{X=Y}}else{M=e('<iframe name="'+X+'" src="'+U.iframeSrc+'" />');M.css({position:"absolute",top:"-1000px",left:"-1000px"})}P=M[0];O={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(ah){var aj=(ah==="timeout"?"timeout":"aborted");d("aborting upload... "+aj);this.aborted=1;if(P.contentWindow.document.execCommand){try{P.contentWindow.document.execCommand("Stop")}catch(ai){}}M.attr("src",U.iframeSrc);O.error=aj;if(U.error){U.error.call(U.context,O,aj,ah)}if(ac){e.event.trigger("ajaxError",[O,U,aj])}if(U.complete){U.complete.call(U.context,O,aj)}}};ac=U.global;if(ac&&0===e.active++){e.event.trigger("ajaxStart")}if(ac){e.event.trigger("ajaxSend",[O,U])}if(U.beforeSend&&U.beforeSend.call(U.context,O,U)===false){if(U.global){e.active--}return}if(O.aborted){return}N=I.clk;if(N){Y=N.name;if(Y&&!N.disabled){U.extraData=U.extraData||{};U.extraData[Y]=N.value;if(N.type=="image"){U.extraData[Y+".x"]=I.clk_x;U.extraData[Y+".y"]=I.clk_y}}}var j=1;var Q=2;function H(ai){var ah=ai.contentWindow?ai.contentWindow.document:ai.contentDocument?ai.contentDocument:ai.document;return ah}var q=e("meta[name=csrf-token]").attr("content");var k=e("meta[name=csrf-param]").attr("content");if(k&&q){U.extraData=U.extraData||{};U.extraData[k]=q}function Z(){var ak=o.attr("target"),ah=o.attr("action");I.setAttribute("target",X);if(!r){I.setAttribute("method","POST")}if(ah!=U.url){I.setAttribute("action",U.url)}if(!U.skipEncodingOverride&&(!r||/post/i.test(r))){o.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(e.browser.opera&&parseFloat(e.browser.version)>9.799&&!U.timeout){U.timeout=3*60000}if(U.timeout){T=setTimeout(function(){ab=true;W(j)},U.timeout)}function aj(){try{var am=H(P).readyState;d("state = "+am);if(am&&am.toLowerCase()=="uninitialized"){setTimeout(aj,50)}}catch(an){d("Server abort: ",an," (",an.name,")");W(Q);if(T){clearTimeout(T)}T=undefined}}var ai=[];try{if(U.extraData){for(var al in U.extraData){if(U.extraData.hasOwnProperty(al)){if(e.isPlainObject(U.extraData[al])&&U.extraData[al].hasOwnProperty("name")&&U.extraData[al].hasOwnProperty("value")){ai.push(e('<input type="hidden" name="'+U.extraData[al].name+'">').attr("value",U.extraData[al].value).appendTo(I)[0])}else{ai.push(e('<input type="hidden" name="'+al+'">').attr("value",U.extraData[al]).appendTo(I)[0])}}}}if(!U.iframeTarget){M.appendTo("body");if(P.attachEvent){P.attachEvent("onload",W)}else{P.addEventListener("load",W,false)}}setTimeout(aj,15);I.submit()}finally{I.setAttribute("action",ah);if(ak){I.setAttribute("target",ak)}else{o.removeAttr("target")}e(ai).remove()}}if(U.forceSync){Z()}else{setTimeout(Z,10)}var af,ag,ad=50,L;function W(ao){if(O.aborted||L){return}try{ag=H(P)}catch(ap){d("cannot access response document: ",ap);ao=Q}if(ao===j&&O){O.abort("timeout");return}else{if(ao==Q&&O){O.abort("server abort");return}}if(!ag||ag.location.href==U.iframeSrc){if(!ab){return}}if(P.detachEvent){P.detachEvent("onload",W)}else{P.removeEventListener("load",W,false)}var ak="success",ah;try{if(ab){throw"timeout"}var al=U.dataType=="xml"||ag.XMLDocument||e.isXMLDoc(ag);d("isXml="+al);if(!al&&window.opera&&(ag.body===null||!ag.body.innerHTML)){if(--ad){d("requeing onLoad callback, DOM not available");setTimeout(W,250);return}}var aq=ag.body?ag.body:ag.documentElement;O.responseText=aq?aq.innerHTML:null;O.responseXML=ag.XMLDocument?ag.XMLDocument:ag;if(al){U.dataType="xml"}O.getResponseHeader=function(at){var au={"content-type":U.dataType};return au[at]};if(aq){O.status=Number(aq.getAttribute("status"))||O.status;O.statusText=aq.getAttribute("statusText")||O.statusText}var ai=(U.dataType||"").toLowerCase();var an=/(json|script|text)/.test(ai);if(an||U.textarea){var am=ag.getElementsByTagName("textarea")[0];if(am){O.responseText=am.value;O.status=Number(am.getAttribute("status"))||O.status;O.statusText=am.getAttribute("statusText")||O.statusText}else{if(an){var aj=ag.getElementsByTagName("pre")[0];var ar=ag.getElementsByTagName("body")[0];if(aj){O.responseText=aj.textContent?aj.textContent:aj.innerText}else{if(ar){O.responseText=ar.textContent?ar.textContent:ar.innerText}}}}}else{if(ai=="xml"&&!O.responseXML&&O.responseText){O.responseXML=V(O.responseText)}}try{af=R(O,ai,U)}catch(ao){ak="parsererror";O.error=ah=(ao||ak)}}catch(ao){d("error caught: ",ao);ak="error";O.error=ah=(ao||ak)}if(O.aborted){d("upload aborted");ak=null}if(O.status){ak=(O.status>=200&&O.status<300||O.status===304)?"success":"error"}if(ak==="success"){if(U.success){U.success.call(U.context,af,"success",O)}if(ac){e.event.trigger("ajaxSuccess",[O,U])}}else{if(ak){if(ah===undefined){ah=O.statusText}if(U.error){U.error.call(U.context,O,ak,ah)}if(ac){e.event.trigger("ajaxError",[O,U,ah])}}}if(ac){e.event.trigger("ajaxComplete",[O,U])}if(ac&&!--e.active){e.event.trigger("ajaxStop")}if(U.complete){U.complete.call(U.context,O,ak)}L=true;if(U.timeout){clearTimeout(T)}setTimeout(function(){if(!U.iframeTarget){M.remove()}O.responseXML=null},100)}var V=e.parseXML||function(ah,ai){if(window.ActiveXObject){ai=new ActiveXObject("Microsoft.XMLDOM");ai.async="false";ai.loadXML(ah)}else{ai=(new DOMParser()).parseFromString(ah,"text/xml")}return(ai&&ai.documentElement&&ai.documentElement.nodeName!="parsererror")?ai:null};var S=e.parseJSON||function(ah){return window["eval"]("("+ah+")")};var R=function(am,ak,aj){var ai=am.getResponseHeader("content-type")||"",ah=ak==="xml"||!ak&&ai.indexOf("xml")>=0,al=ah?am.responseXML:am.responseText;if(ah&&al.documentElement.nodeName==="parsererror"){if(e.error){e.error("parsererror")}}if(aj&&aj.dataFilter){al=aj.dataFilter(al,ak)}if(typeof al==="string"){if(ak==="json"||!ak&&ai.indexOf("json")>=0){al=S(al)}else{if(ak==="script"||!ak&&ai.indexOf("javascript")>=0){e.globalEval(al)}}}return al}}};e.fn.ajaxForm=function(f){f=f||{};f.delegation=f.delegation&&e.isFunction(e.fn.on);if(!f.delegation&&this.length===0){var g={s:this.selector,c:this.context};if(!e.isReady&&g.s){d("DOM not ready, queuing ajaxForm");e(function(){e(g.s,g.c).ajaxForm(f)});return this}d("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)"));return this}if(f.delegation){e(document).off("submit.form-plugin",this.selector,c).off("click.form-plugin",this.selector,a).on("submit.form-plugin",this.selector,f,c).on("click.form-plugin",this.selector,f,a);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",f,c).bind("click.form-plugin",f,a)};function c(g){var f=g.data;if(!g.isDefaultPrevented()){g.preventDefault();e(this).ajaxSubmit(f)}}function a(i){var k=i.target;var g=e(k);if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");if(f.length===0){return}k=f[0]}var h=this;h.clk=k;if(k.type=="image"){if(i.offsetX!==undefined){h.clk_x=i.offsetX;h.clk_y=i.offsetY}else{if(typeof e.fn.offset=="function"){var j=g.offset();h.clk_x=i.pageX-j.left;h.clk_y=i.pageY-j.top}else{h.clk_x=i.pageX-k.offsetLeft;h.clk_y=i.pageY-k.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)}e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};e.fn.formToArray=function(w,q){var u=[];if(this.length===0){return u}var h=this[0];var o=w?h.getElementsByTagName("*"):h.elements;if(!o){return u}var p,m,l,x,k,s,g;for(p=0,s=o.length;p<s;p++){k=o[p];l=k.name;if(!l){continue}if(w&&h.clk&&k.type=="image"){if(!k.disabled&&h.clk==k){u.push({name:l,value:e(k).val(),type:k.type});u.push({name:l+".x",value:h.clk_x},{name:l+".y",value:h.clk_y})}continue}x=e.fieldValue(k,true);if(x&&x.constructor==Array){if(q){q.push(k)}for(m=0,g=x.length;m<g;m++){u.push({name:l,value:x[m]})}}else{if(b.fileapi&&k.type=="file"&&!k.disabled){if(q){q.push(k)}var f=k.files;if(f.length){for(m=0;m<f.length;m++){u.push({name:l,value:f[m],type:k.type})}}else{u.push({name:l,value:"",type:k.type})}}else{if(x!==null&&typeof x!="undefined"){if(q){q.push(k)}u.push({name:l,value:x,type:k.type,required:k.required})}}}}if(!w&&h.clk){var r=e(h.clk),t=r[0];l=t.name;if(l&&!t.disabled&&t.type=="image"){u.push({name:l,value:r.val()});u.push({name:l+".x",value:h.clk_x},{name:l+".y",value:h.clk_y})}}return u};e.fn.formSerialize=function(f){return e.param(this.formToArray(f))};e.fn.fieldSerialize=function(g){var f=[];this.each(function(){var l=this.name;if(!l){return}var j=e.fieldValue(this,g);if(j&&j.constructor==Array){for(var k=0,h=j.length;k<h;k++){f.push({name:l,value:j[k]})}}else{if(j!==null&&typeof j!="undefined"){f.push({name:this.name,value:j})}}});return e.param(f)};e.fn.fieldValue=function(k){for(var l=[],h=0,f=this.length;h<f;h++){var j=this[h];var g=e.fieldValue(j,k);if(g===null||typeof g=="undefined"||(g.constructor==Array&&!g.length)){continue}if(g.constructor==Array){e.merge(l,g)}else{l.push(g)}}return l};e.fieldValue=function(g,h){var j=g.name,s=g.type,u=g.tagName.toLowerCase();if(h===undefined){h=true}if(h&&(!j||g.disabled||s=="reset"||s=="button"||(s=="checkbox"||s=="radio")&&!g.checked||(s=="submit"||s=="image")&&g.form&&g.form.clk!=g||u=="select"&&g.selectedIndex==-1)){return null}if(u=="select"){var o=g.selectedIndex;if(o<0){return null}var q=[],f=g.options;var l=(s=="select-one");var p=(l?o+1:f.length);for(var k=(l?o:0);k<p;k++){var m=f[k];if(m.selected){var r=m.value;if(!r){r=(m.attributes&&m.attributes.value&&!(m.attributes.value.specified))?m.text:m.value}if(l){return r}q.push(r)}}return q}return e(g).val()};e.fn.clearForm=function(f){return this.each(function(){e("input,select,textarea",this).clearFields(f)})};e.fn.clearFields=e.fn.clearInputs=function(f){var g=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var i=this.type,h=this.tagName.toLowerCase();if(g.test(i)||h=="textarea"){this.value=""}else{if(i=="checkbox"||i=="radio"){this.checked=false}else{if(h=="select"){this.selectedIndex=-1}else{if(f){if((f===true&&/hidden/.test(i))||(typeof f=="string"&&e(this).is(f))){this.value=""}}}}}})};e.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};e.fn.enable=function(f){if(f===undefined){f=true}return this.each(function(){this.disabled=!f})};e.fn.selected=function(f){if(f===undefined){f=true}return this.each(function(){var g=this.type;if(g=="checkbox"||g=="radio"){this.checked=f}else{if(this.tagName.toLowerCase()=="option"){var h=e(this).parent("select");if(f&&h[0]&&h[0].type=="select-one"){h.find("option").selected(false)}this.selected=f}}})};e.fn.ajaxSubmit.debug=false;function d(){if(!e.fn.ajaxSubmit.debug){return}var f="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(f)}else{if(window.opera&&window.opera.postError){window.opera.postError(f)}}}})(jQuery);
/*
 * jQuery.ScrollTo
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 *
 * @projectDescription Easy element scrolling using jQuery.
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 * Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7/8, Opera 9.5/6, Safari 3, Chrome 1 on WinXP.
 *
 * @author Ariel Flesler
 * @version 1.4.2
*/
(function(c){var b=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};b.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};b.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},b.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=a(d.offset);d.over=a(d.over);return this._scrollable().each(function(){var l=this,i=c(l),j=f,h,g={},m=i.is("html,body");switch(typeof j){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(j)){j=a(j);break}j=c(j,this);case"object":if(j.is||j.style){h=(j=c(j)).offset()||{left:0,top:0}}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=b.max(l,r);if(h){g[p]=h[u]+(m?0:o-i.offset()[u]);if(d.margin){g[p]-=parseInt(j.css("margin"+s))||0;g[p]-=parseInt(j.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=j[r=="x"?"width":"height"]()*d.over[u]}}else{var t=j[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){k(d.onAfterFirst)}delete g[p]}});k(d.onAfter);function k(n){i.animate(g,e,d.easing,n&&function(){n.call(this,f,d)})}}).end()};b.max=function(i,h){var g=h=="x"?"Width":"Height",j="scroll"+g;if(!c(i).is("html,body")){return i[j]-c(i)[g.toLowerCase()]()}var f="client"+g,e=i.ownerDocument.documentElement,d=i.ownerDocument.body;return Math.max(e[j],d[j])-Math.min(e[f],d[f])};function a(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);
/*
 * jQuery.Preload
 * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com
 * Dual licensed under MIT and GPL.
 * Date: 3/25/2009
 *
 * @projectDescription Multifunctional preloader
 * @author Ariel Flesler
 * @version 1.0.8
 */
(function(b){var a=b.preload=function(f,h){if(f.split){f=b(f)}h=b.extend({},a.defaults,h);var e=b.map(f,function(k){if(!k){return}if(k.split){return h.base+k+h.ext}var l=k.src||k.href;if(typeof h.placeholder=="string"&&k.src){k.src=h.placeholder}if(l&&h.find){l=l.replace(h.find,h.replace)}return l||null});var i={loaded:0,failed:0,next:0,done:0,total:e.length};if(!i.total){return c()}var j=b(Array(h.threshold+1).join("<img/>")).load(g).error(g).bind("abort",g).each(d);function g(k){i.element=this;i.found=k.type=="load";i.image=this.src;i.index=this.index;var l=i.original=f[this.index];i[i.found?"loaded":"failed"]++;i.done++;if(h.enforceCache){a.cache.push(b("<img/>").attr("src",i.image)[0])}if(h.placeholder&&l.src){l.src=i.found?i.image:h.notFound||l.src}if(h.onComplete){h.onComplete(i)}if(i.done<i.total){d(0,this)}else{if(j&&j.unbind){j.unbind("load").unbind("error").unbind("abort")}j=null;c()}}function d(m,l,k){if(l.attachEvent&&i.next&&i.next%a.gap==0&&!k){setTimeout(function(){d(m,l,true)},0);return false}if(i.next==i.total){return false}l.index=i.next;l.src=e[i.next++];if(h.onRequest){i.index=l.index;i.element=l;i.image=l.src;i.original=f[i.next-1];h.onRequest(i)}}function c(){if(h.onFinish){h.onFinish(i)}}};a.gap=14;a.cache=[];a.defaults={threshold:2,base:"",ext:"",replace:""};b.fn.preload=function(c){a(this,c);return this}})(jQuery);(function(a){
/* jquery.event.wheel.js - rev 1 
// Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
// Liscensed under the MIT License (MIT-LICENSE.txt)
// http://www.opensource.org/licenses/mit-license.php
// Created: 2008-07-01 | Updated: 2008-07-14
*/
a.fn.wheel=function(d){return this[d?"bind":"trigger"]("wheel",d)};a.event.special.wheel={setup:function(){a.event.add(this,c,b,{})},teardown:function(){a.event.remove(this,c,b)}};var c=!a.browser.mozilla?"mousewheel":"DOMMouseScroll"+(a.browser.version<"1.9"?" mousemove":"");function b(d){switch(d.type){case"mousemove":return a.extend(d.data,{clientX:d.clientX,clientY:d.clientY,pageX:d.pageX,pageY:d.pageY});case"DOMMouseScroll":a.extend(d,d.data);d.delta=-d.detail/3;break;case"mousewheel":d.delta=d.wheelDelta/120;if(a.browser.opera){d.delta*=-1}break}d.type="wheel";return a.event.handle.call(this,d,d.delta)}})(jQuery);
/* uWnd library */
function _uFocus(a){if(!a){a={}}this.constructor=_uFocus;this._tp=a.type||0;this._thispar=a.thispar||null;this._param=a.param||null;this._parent=a.parent||null;delete a.type;delete a.thispar;delete a.param;delete a.parent;this.owner=null;$.extend(this,a||{});this.destroyed=0;if(!_uFocus.globalset){_uFocus.globalset=true;$(document).bind("keydown keyup keypress",_uFocus._onkey)}if(this._tp==2){_uFocus.glisteners.push(this)}}_uFocus.current=null;_uFocus.last_fixed=null;_uFocus.glisteners=[];_uFocus.globalset=false;_uFocus.inprocess=0;_uFocus.delayedactivate=null;_uFocus._onkey=function(f){var d="on"+f.type,c;if(f.type=="keypress"){if(((f.keyCode==37||f.keyCode==38||f.keyCode==39||f.keyCode==40||(f.keyCode==0&&$.browser.opera))&&f.target&&f.target.tagName.toLowerCase()!="input"&&f.target.tagName.toLowerCase()!="textarea")||(f.keyCode==32&&f.ctrlKey)){if(_uFocus.current){f.preventDefault()}}}if(f.type=="keydown"&&$.browser.opera&&f.keyCode==0){f.keyCode=93}for(var b=0;b<_uFocus.glisteners.length;b++){c=_uFocus.glisteners[b];if(!c[d]){continue}if(c[d].call(c._thispar,f,c._param,_uFocus.current)){return}}c=_uFocus.current;if(!c){return}var a=[];while(c){a.unshift(c);c=c._parent}for(var b=0;b<a.length;b++){if(!a[b][d]){continue}if(a[b][d].call(a[b]._thispar,f,a[b]._param,_uFocus.current)){return}}};_uFocus.prototype={activate:function(){if(this.destroyed||(this._tp!=0&&this._tp!=1)){return 0}if(_uFocus.inprocess){_uFocus.delayedactivate=this;return -1}var a;_uFocus.inprocess=1;a=this._activate(this,_uFocus.current);_uFocus.inprocess=0;if(_uFocus.delayedactivate){setTimeout("var f=_uFocus.delayedactivate;_uFocus.delayedactivate=null;if(f)f.activate();",0)}return a},deactivate:function(){if(this.destroyed||(this._tp!=0&&this._tp!=1)||_uFocus.inprocess){return}var a;_uFocus.inprocess=1;a=this._deactivate(_uFocus.current,null);_uFocus.inprocess=0;if(_uFocus.delayedactivate){setTimeout("var f=_uFocus.delayedactivate;_uFocus.delayedactivate=null;if(f)f.activate();",0);return}if(a==1&&_uFocus.last_fixed&&(!_uFocus.current||_uFocus.current._tp!=1)){_uFocus.last_fixed.activate()}},isactive:function(a){return this==_uFocus.current||(!a&&this.isparentof(_uFocus.current))},isparentof:function(b){if(!b){return 0}var a=b._parent;while(a){if(a==this){return 1}a=a._parent}return 0},_activate:function(a,f,b){var e,g;if(this.isactive()){e=_uFocus.current;if(!b||e==this){return 1}}if(this._parent){if(!this._parent._activate(this._parent,f)){return 0}}e=_uFocus.current;if(e&&e!=this._parent){while(e._parent&&e._parent!=this._parent){e=e._parent}if(e._deactivate(f,a)==-1){return 0}}for(var d=0;d<_uFocus.glisteners.length;d++){e=_uFocus.glisteners[d];if(!e.canactivate){continue}g=e.canactivate.call(e._thispar,e._param,f,a);if(!g||(g==-1&&_uFocus.delayedactivate)){return 0}}var c=[this];e=this._parent;while(e){c.unshift(e);e=e._parent}for(var d=0;d<c.length;d++){if(!c[d].canactivate){continue}g=c[d].canactivate.call(c[d]._thispar,c[d]._param,f,a);if(!g||(g==-1&&_uFocus.delayedactivate)){return 0}}_uFocus.current=this;if(this._tp==1&&f&&f._tp==0){_uFocus.last_fixed=f}else{if(this._tp==0){_uFocus.last_fixed=null}}for(var d=0;d<_uFocus.glisteners.length;d++){e=_uFocus.glisteners[d];if(e.onactivate){if(e.onactivate.call(e._thispar,e._param,f,a)==-1&&_uFocus.delayedactivate){return 0}}}for(var d=0;d<c.length;d++){if(c[d].onactivate){if(c[d].onactivate.call(c[d]._thispar,c[d]._param,f,a)==-1&&_uFocus.delayedactivate){return 0}}}return 1},_deactivate:function(b,a){if(!this.isactive()){return 0}var e,d;var c=_uFocus.current;while(c){_uFocus.current=c._parent;if(c.ondeactivate){if(c.ondeactivate.call(c._thispar,c._param,b,a)==-1&&_uFocus.delayedactivate){return -1}}if(c._tp!=1){_uFocus.last_fixed=null}for(e=0;e<_uFocus.glisteners.length;e++){d=_uFocus.glisteners[e];if(d.ondeactivate){d.ondeactivate.call(d._thispar,d._param,c,a)}}if(c==this){break}c=c._parent}return 1},destroy:function(){if(this.destroyed){return}this.deactivate();if(this._tp==2){for(var a=0;a<_uFocus.glisteners.length;a++){if(_uFocus.glisteners[a]==this){_uFocus.glisteners.splice(a,1);break}}}this.destroyed=1}};function _uGetOffset(c){if(!c){return{left:0,top:0}}var b=c.offsetLeft;var a=c.offsetTop;if(!b&&!a&&c.offsetParent==null){b=parseInt(c.style.left);a=parseInt(c.style.top)}else{while((c=c.offsetParent)!=null){b+=c.offsetLeft;a+=c.offsetTop}}return{left:b,top:a}}function _uMenu(c,a,b){this.init(c,a,b)}_uMenu.get=function(b){var a=$("#"+b)[0];if(a){return a._umenu}return null};_uMenu.show=function(g,d,f,c,a,b){var e=_uMenu.get(g);if(e){e.show_menu(d,f,c,a,b)}};_uMenu.hide=function(d,b){var a=_uMenu.get(d);if(a){if(!b){a.hide_menu()}else{a.hide_child()}}};_uMenu.hideAll=function(e){var gr;with(_uMenu.prototype){for(gr in have_active){if(have_active[gr]&&!donothide[gr]){for(var i in all_menus[gr]){_uMenu.hide(i)}have_active[gr]=""}donothide[gr]=false}}};_uMenu.showOver=function(id,par,tp,mid,dy,dx){var o=_uMenu.get(id);if(o){var gr=o.group;with(_uMenu.prototype){if(timerid2[gr]){clearTimeout(timerid2[gr])}if(have_active[gr].length>0&&have_active[gr].indexOf(","+id+",")==-1){o.show_menu(par,tp,mid,dy,dx)}}}};_uMenu.schedule_hidechild=function(id){var o=_uMenu.get(id);if(o){var gr=o.group;with(_uMenu.prototype){if(timerid2[gr]){clearTimeout(timerid2[gr])}timerid2[gr]=setTimeout("_uMenu.hide('"+id+"',1);_uMenu.prototype.timerid2['"+gr+"']=0;",800)}}};_uMenu.prototype={donothide:[],all_menus:[],have_active:[],timerid:[],timerid2:[],global_set:false,init:function(c,a,b){this.id=c;this.obj=$("#"+c)[0];if(!this.obj){return}this.obj._umenu=this;if(!a){a=c}this.parentid=a;if(!b){b="def"}this.group=b;this.obj.style.display="none";$(this.obj).bind("click",this,function(d){d.data.donothide[d.data.group]=true});if(this.all_menus[b]==undefined){this.all_menus[b]=[]}if(this.have_active[b]==undefined){this.have_active[b]=""}this.all_menus[b][c]=this;if(!this.global_set){$(document).bind("click",_uMenu.hideAll);$(window).bind("resize",_uMenu.hideAll);_uMenu.prototype.global_set=true}},show_menu:function(par,tp,mid,dy,dx){var ddX=0;var ddY=0;if(this.timerid2[this.group]){clearTimeout(this.timerid2[this.group])}if(this.have_active[this.group].indexOf(","+this.id+",")>=0){this.hide_menu();return}if(!dy){dy=0}if(!dx){dx=0}if(mid){ddX=$("#"+mid)[0].offsetLeft;ddY=$("#"+mid)[0].offsetTop}this.allmenus_hidenp();if(!par){par=this.obj.parentNode}else{par=$("#"+par)[0]}var pos=_uGetOffset(par);pos.left+=dx-ddX;pos.top+=dy-ddY;if(tp=="r"){pos.left+=par.offsetWidth-4}else{pos.top+=par.offsetHeight+1}var ww=$(window).width();with(this.obj.style){left=pos.left+"px";top=pos.top+"px";display="";visibility="visible"}try{if(pos.left+this.obj.offsetWidth>ww){pos.left=ww-this.obj.offsetWidth-5;this.obj.style.left=pos.left+"px"}}catch(e){}if(!this.have_active[this.group]){this.have_active[this.group]=""}this.have_active[this.group]+=","+this.id+",";if(this.timerid[this.group]){clearTimeout(this.timerid[this.group])}this.donothide[this.group]=true;this.timerid[this.group]=setTimeout("with(_uMenu.prototype){donothide['"+this.group+"']=false;timerid['"+this.group+"']=null;};",100)},allmenus_hidenp:function(){var b={};var c=this.id;while(this.all_menus[this.group][c]&&this.all_menus[this.group][c].parentid!=c&&c){b[this.all_menus[this.group][c].parentid]=1;c=this.all_menus[this.group][c].parentid}for(var a in this.all_menus[this.group]){if(b[a]==1){continue}this.all_menus[this.group][a].hide_menu()}},hide_menu:function(){with(this){hide_child();var x=have_active[group].indexOf(","+id+",");if(x>=0){have_active[group]=have_active[group].substring(0,x)}obj.style.display="none";obj.style.visibility="hidden"}},hide_child:function(){with(this){for(var i in all_menus[group]){if(all_menus[group][i].parentid==id&&i!=id){all_menus[group][i].hide_menu()}}}}};function _uMENU(c,i,a,b,h){this.constructor=_uMENU;this.name=c;this.pos=$.extend({pos:null,alignObj:null,align:"d",parent:null,parentfocus:null,dx:0,dy:0,childdy:0,childdx:0},i||{});this.props=$.extend({parentnode:a.wnd?a.wnd.top:null,design:_uMENU.defdesign||"std",hidden:a.statical&&b&&b.length>0?0:1,shadow:1,addclass:"",withmarks:null,highlight:1,statical:a.horiz?1:0,hidetimer:0,horiz:0,noabs:0,width:0,onshow:null,onhide:null,ondestroy:null,onitem:null,onldown:null,onrdown:null,thispar:null,onreadycreate:null,wnd:null,rtl:0},a||{});this.state={visible:false,init:false,destroyed:false};this.design=this.props.design&&_uMENU.designs[this.props.design]?_uMENU.designs[this.props.design]:_uMENU.designs.std;this.idx=_uMENU.nextidx++;_uMENU.all[this.idx]=this;if(!this.pos.parent){this.zpos=_uMENU.defz}else{this.zpos=this.pos.parent.zpos+5}this.xpos=this.ypos=0;this.width=10;this.height=10;this.elems=[];this.add_elems=b&&b.length>0?[b]:[];this.del_elems=[];this.pend_show=null;this.appendtimer=null;this.decor={w:0,h:0};this.frame=null;this.childtimer=null;this.sh=null;this.hidetimer=null;this.hlitem=-1;this.have_active=null;this._focus=new _uFocus({type:1,thispar:this,owner:this,parent:this.pos.parentfocus?this.pos.parentfocus:(this.pos.parent?this.pos.parent._focus:(this.props.wnd?this.props.wnd._focus:null)),onkeydown:this.onkeydown,ondeactivate:this.onfocusdeactivate});var j=document.createElement("div");j.id="_umenu"+this.idx;if(!this.props.parentnode){$($("body")[0]).prepend(j)}else{this.props.parentnode.appendChild(j)}this.top=j;$(j).addClass("x-unselectable").css({visibility:"hidden",display:"block"});var d=document.createElement("div");j.appendChild(d);this.menu=d;this.havefixed=1;if($.browser.msie){this.havefixed=0;if(parseFloat($.browser.version)>=7){try{j.style.position="fixed";if(j.currentStyle.position=="fixed"){this.havefixed=1}j.style.position=""}catch(g){this.havefixed=1}}}if(!this.props.noabs){$(j).css({position:"absolute",zIndex:this.zpos});if($.browser.msie&&parseFloat($.browser.version)<7){var f='<iframe tabindex="-1" style="display:block; position:absolute; filter:Alpha(Opacity=\'0\'); width:'+this.width+"pxheight:"+this.height+'px;border:0"/>';this.frame=document.createElement(f);j.appendChild(this.frame)}if(this.props.shadow&&!this.props.horiz&&(!$.browser.msie||$.browser.version>6)){this.shadow_init();this._resizeSh()}$(d).css({position:"absolute",zIndex:2,left:0})}$(d).css("width","50px").bind("mousedown",this,_uMENU._onmenumousedown);this.parts=this.design.menu_init(d,this.props.horiz?10:50,this.props,this.pos.parent);if(!_uMENU.globalset){_uMENU.globalset=true;$(document).bind("mousedown",_uMENU.hideallmenus);$(window).bind("resize",_uMENU.hideallmenus)}this.toinit=[];this.tocalcsize=[];this.createsubmenus();if(!this.props.hidden){this.show()}if(!h){setTimeout("var m=_uMENU.all["+this.idx+"];if(m)m.init1();",10)}}_uMENU.all=[];_uMENU.nextidx=0;_uMENU.lastz=0;_uMENU.defz=25050;_uMENU.defdesign="std";_uMENU.globalset=false;_uMENU.ignoreclick=null;_uMENU.onclickTabAsMenu=function(b,g,h,d,f){var a=d.tabctrl,c=d.tabid||d.id||b;if(!a){return}a.activateTab(c)};_uMENU._onchangeTabAsMenu=function(c,b,g){var f=c.props._prevtabmenu_onchange?c.props._prevtabmenu_onchange.apply(this,arguments):1;var a=c._tabasmenu,d;if(!a){return f}for(var e=0;e<a.elems.length;e++){if(!a.elems[e][2].tabclass||a.elems[e][2].tabctrl!=c){continue}d=a.elems[e][2].tabid||a.elems[e][2].id;if((d&&d==g)||(!d&&e==b)){$(a.parts.elems[e]).addClass(a.elems[e][2].tabclass)}else{$(a.parts.elems[e]).removeClass(a.elems[e][2].tabclass)}}return f};_uMENU.initTabAsMenu=function(a,c){if(c.constructor==_uWnd){c=c.menu}if(!c){return}a._tabasmenu=c;a.props._prevtabmenu_onchange=a.props.onchange;a.props.onchange=_uMENU._onchangeTabAsMenu;for(var b=0;b<a.data.length;b++){if(!a.data[b].onchange||a.data[b].onchange==a.props._prevtabmenu_onchange){a.data[b].onchange=_uMENU._onchangeTabAsMenu}}};_uMENU.getbyname=function(c){var b=this.all;for(var d=0;d<b.length;d++){if(b[d]&&b[d].name==c){return b[d]}}return null};_uMENU.designs={std:{sh_sz:[4,2],shadow_init:function(c){var b=[];for(var a=0;a<3;a++){b[a]=document.createElement("div");c.appendChild(b[a]);$(b[a]).attr("class","x-sh").css("position","absolute").css("z-index",1)}$(b[0]).addClass("xsl").css({width:(this.sh_sz[0]+this.sh_sz[1])+"px",left:(-this.sh_sz[0])+"px",top:"0px"}).html('<div class="xstl"><div class="xsml"></div></div>');$(b[1]).addClass("xsr").css({width:(this.sh_sz[0]+this.sh_sz[1])+"px",top:"0px"}).html('<div class="xstr"><div class="xsmr"></div></div>');$(b[2]).addClass("xsb").css({height:(this.sh_sz[0]+this.sh_sz[1])+"px",left:(-this.sh_sz[0])+"px"}).html('<div class="xsbl"><div class="xsbr"><div class="xsbc"></div></div></div>');return b},shadow_resize:function(b,a,c){$(b[0]).css({height:(c-this.sh_sz[1])+"px"});$(b[1]).css({height:(c-this.sh_sz[1])+"px",left:(a-this.sh_sz[1])+"px"});$(b[2]).css({width:(a+this.sh_sz[0]*2)+"px",top:(c-this.sh_sz[1])+"px"})},shadow_hide:function(a){$(a[0]).add(a[1]).add(a[2]).hide()},shadow_show:function(a){$(a[0]).add(a[1]).add(a[2]).show()},menu_init:function(e,c,b,a){var d={};if(!b.horiz){$(e).attr("class","u-menu"+(b.addclass?" "+String(b.addclass):"")+(b.withmarks?" u-menumarks":""));if($.browser.msie){$(e).css("overflow","hidden")}$(e).html((a&&a.props.horiz?"":'<div class="xw-tl"><div class="xw-tr"><div class="xw-tc xw-tsps"></div></div></div>')+'<div class="xw-ml"><div class="xw-mr"><div class="xw-mc"><div class="u-menubody"><div class="u-menucont" style="overflow:visible;height:'+c+'px"></div></div></div></div></div><div class="xw-bl"><div class="xw-br"><div class="xw-bc"><div class="xw-footer"></div></div></div></div>')}else{$(e).attr("class","u-menuh"+(b.addclass?" "+String(b.addclass):"")+(b.withmarks?" u-menumarks":"")).css("overflow","hidden");$(e).html('<div class="u-menubody"><div class="u-menucont" style="overflow:hidden;height:'+c+'px"></div></div>')}d.content=$(e).find(".u-menucont")[0];d.elems=[];d.marks=[];$(e).find("div,span").andSelf().attr("unselectable","on");return d},setitemtext:function(c,b,a){if(c.props.withmarks&&c.elems[b][2].mark!=undefined){a='<div class="u-menumark"></div>'+a}$(c.parts.elems[b]).html(a)},append_item:function(e,d,b){var h=e.elems.length,k,g,j=null,f,c,l;j=d[1]?d[1]:(typeof(d[2].action)!="undefined"?d[2].action:e.props.onitem);c=d[2].onldown||e.props.onldown;l=d[2].onrdown||e.props.onrdown;g=d[0];if(d[2].hl!=undefined){b=d[2].hl}if(e.props.withmarks&&g!="sep"&&d[2].mark!=undefined){g='<div class="u-menumark"></div>'+g;f=1}if(j&&(j=="a"||d[2].action=="a")){k=document.createElement("a");$(k).css("display","block")}else{k=document.createElement("div")}if(!e.props.horiz){if(g=="sep"){k.className="u-menuvsep"}else{k.className="u-menuvitem";if(!j||j.constructor!=_uMENU){$(k).html(g);if(b){$(k).bind("mouseover",{hl:b,item:h,obj:e},_uMENU._onitemmouseover).bind("mouseout",{hl:b,item:-1,obj:e},_uMENU._onitemmouseout)}if(j){$(k).bind("click",{act:j,obj:e,item:h,itemobj:d},_uMENU._onitemclick)}if(c||l){$(k).bind("mousedown",{actl:c,actr:l,obj:e,item:h,itemobj:d},_uMENU._onitemmousedown)}}else{$(k).addClass("u-menuvitemparent").html('<div class="u-menuarrow"></div>'+g);$(k).bind("mouseover",{hl:b,item:h,obj:e},_uMENU._onitemmouseover).bind("mouseout",{hl:b,item:h,obj:e},_uMENU._onitemmouseout);$(k).bind("mousedown",{child:j,obj:e,item:h,itemobj:d},_uMENU._onitemclick);if(d[2].action){$(k).bind("click",{act:d[2].action,obj:e,item:h,itemobj:d},_uMENU._onitemclick)}if(c||l){$(k).bind("mousedown",{actl:c,actr:l,obj:e,item:h,itemobj:d},_uMENU._onitemmousedown)}}}}else{$(k).css("float","left");if(g=="sep"){k.className="u-menuhsep"}else{k.className="u-menuhitem";if(!j||j.constructor!=_uMENU){$(k).html(g);if(b){$(k).bind("mouseover",{hl:b,item:h,obj:e},_uMENU._onitemmouseover).bind("mouseout",{hl:b,item:h,obj:e},_uMENU._onitemmouseout)}if(j){$(k).bind("click",{act:j,obj:e,item:h,itemobj:d},_uMENU._onitemclick)}if(c||l){$(k).bind("mousedown",{actl:c,actr:l,obj:e,item:h,itemobj:d},_uMENU._onitemmousedown)}}else{$(k).addClass("u-menuhitemparent").html(g);$(k).bind("mouseover",{hl:b,item:h,obj:e},_uMENU._onitemmouseover).bind("mouseout",{hl:b,item:h,obj:e},_uMENU._onitemmouseout);$(k).bind("mousedown",{child:j,obj:e,item:h,itemobj:d},_uMENU._onitemclick);if(d[2].action){$(k).bind("click",{act:d[2].action,obj:e,item:h,itemobj:d},_uMENU._onitemclick)}if(c||l){$(k).bind("mousedown",{actl:c,actr:l,obj:e,item:h,itemobj:d},_uMENU._onitemmousedown)}}}}if(b){$(k).find("*").andSelf().filter("[nodeType=1]").attr("unselectable","on")}e.elems[h]=d;e.parts.elems[h]=k;if(f){e.parts.marks[h]=$(k).find(".u-menumark")[0]}if(e.props.horiz&&(e.props.rtl||window._rtl)){e.parts.content.insertBefore(k,e.parts.content.firstChild)}else{e.parts.content.appendChild(k)}},calc_size:function(e){var a=0,c=0,f=0,d=0;if(!e.props.horiz){for(var b=0;b<e.parts.elems.length;b++){a=Math.max(a,Math.max(e.parts.elems[b].offsetWidth,e.parts.elems[b].scrollWidth));f+=Math.max(d,parseInt("0"+$(e.parts.elems[b]).css("margin-top")));d=parseInt("0"+$(e.parts.elems[b]).css("margin-bottom"));c+=e.parts.elems[b].offsetHeight}c+=f+d}else{for(var b=0;b<e.parts.elems.length;b++){a+=Math.max(e.parts.elems[b].offsetWidth,e.parts.elems[b].scrollWidth);c=Math.max(c,e.parts.elems[b].offsetHeight)}a+=2}return{w:a,h:c}},_onitemhl:function(b,a){if(a){$(this).addClass("u-menuitemhl")}else{$(this).removeClass("u-menuitemhl")}}}};_uMENU._onitemmouseover=function(a){var b=a.data;b.obj.removehl(b.item);if(b.hl){b.obj.design._onitemhl.apply(this,[a,1])}b.obj.hlitem=b.item;if(b.obj.hidetimer){clearTimeout(b.obj.hidetimer)}b.obj.hidetimer=null;if(b.item>=0){if(!b.obj.props.horiz||b.obj._focus.isactive()){b.obj.schedule_childopen(b.item)}}};_uMENU._onitemmouseout=function(b){var c=b.data,a;if(c.hl){if(c.obj.props.statical&&c.obj._focus.isactive()){return}if(c.item==c.obj.hlitem&&c.item>=0){a=c.obj.elems[c.item];if(a&&a[1]&&a[1].constructor==_uMENU&&a[1].state.visible){return}c.obj.design._onitemhl.apply(this,[b,0]);c.obj.hlitem=-1}}};_uMENU._onitemclick=function(g){var h=g.data,b=h.itemobj[1]||h.itemobj[2].action||h.obj.props.onitem;if(!h.child&&b){if(!h.obj.props.statical){h.obj.hide(true)}else{h.obj.hidechildren()}if(b.constructor==Function){b.apply(h.itemobj[2].thispar||h.obj.props.thispar,[h.item,h.obj,h.itemobj[2].id,h.itemobj[2],g])}else{if(b=="a"){var a=null;if(this==g.target||g.target.tagName.toLowerCase()!="a"){if(this!=g.target){var f=$(this).parents().andSelf(),c=$(g.target).parents().not(f);if(c.filter("A").length==0){a=$(this).find("a")[0]}else{a=null}}else{a=$(this).find("a")[0]}if(a){this.target=a.target;this.href=a.href;if(a.onclick){return a.onclick()}}}if(!a){this.removeAttribute("href")}}}return}if(!h.child){return}h.obj.reset_childopen();h.obj.hidechildren(h.child);if(h.obj.props.statical&&h.child.state.visible){h.child.hide();h.obj._focus.deactivate()}else{if(!h.child.state.visible){if(h.obj.props.statical){h.obj.sethl(h.item)}h.obj.childopen(h.item);_uMENU.ignoreclick=h.child}}};_uMENU._onitemmousedown=function(c){var f=c.data,b=f.actl||f.obj.props.onldown,a=f.actr||f.obj.props.onrdown;if(c.which==1&&c.ctrlKey){c.which=3}if(c.which==1&&b){_uWnd.globalmousedown();b.apply(f.itemobj[2].thispar||f.obj.props.thispar,[f.item,f.obj,f.itemobj[2].id,f.itemobj[2],c]);c.stopPropagation()}else{if(c.which==3&&a){a.apply(f.itemobj[2].thispar||f.obj.props.thispar,[f.item,f.obj,f.itemobj[2].id,f.itemobj[2],c]);c.preventDefault();c.stopPropagation()}}};_uMENU.hideallmenus=function(){var b,a,c;loop:for(b=0;b<_uMENU.all.length;b++){a=_uMENU.all[b];if(!a||!a.state.visible){continue}c=_uMENU.ignoreclick;while(c){if(c==a){continue loop}c=c.pos.parent}if(a.props.statical){a._focus.deactivate();continue}a.hide()}if(_uMENU.ignoreclick){setTimeout("_uMENU.ignoreclick=null;",10)}};_uMENU._onmenumousedown=function(a){if(a.data.props.wnd){a.data.props.wnd.activate(a,1)}if(a.which==1&&a.ctrlKey){a.which=3}if(a.which==3&&a.data.props.horiz){return}if(!_uMENU.ignoreclick){_uMENU.ignoreclick=a.data}_uWnd.globalmousedown(2);a.stopPropagation()};_uMENU.prototype={removehl:function(a){var c=this.hlitem,b;if(c>=0&&(typeof(a)!="number"||c!=a)){b=this.elems[c];if(b&&b[0]!="sep"){if(b[2].hl!=undefined?b[2].hl:this.props.highlight){this.design._onitemhl.apply(this.parts.elems[c],[null,0])}}this.hlitem=-1}},sethl:function(a){var b;if(this.hlitem!=a){this.removehl(a);b=this.elems[a];if(b&&b[0]!="sep"){if(b[2].hl!=undefined?b[2].hl:this.props.highlight){this.design._onitemhl.apply(this.parts.elems[a],[null,1])}}this.hlitem=a}},onfocusdeactivate:function(){if(this.props.statical){this.removehl()}else{this.hide()}},onkeydown:function(m,j,r){var f=m.keyCode,c,p,h,a,d,g,o;if(f==27&&r==this._focus){if(!this.props.statical){this.hide();if(this.pos.parent&&this.pos.parent.props.statical){this.pos.parent._focus.deactivate()}}else{this.hidechildren();this._focus.deactivate()}m.preventDefault();m.stopPropagation();return 1}if((f==17||f==18)&&m.ctrlKey&&m.altKey){this._focus.deactivate();m.preventDefault();m.stopPropagation();return 1}if((f==13||(f==40&&this.props.horiz))&&r==this._focus){m.preventDefault();m.stopPropagation();if(this.hlitem<0){return 1}p=this.hlitem;h=this.elems[p];var l=h[1]||h[2].action||this.props.onitem;var b=h[2].onldown||this.props.onldown;a=0;if(l&&l.constructor==_uMENU){this.reset_childopen();this.hidechildren(p);if(!l.state.visible){this.childopen(p,0)}}else{if(h[2].action){l=h[2].action}else{if(!l||l.constructor!=Function){l=null}}}if(f==40){return 1}if(l&&l.constructor==Function){l.apply(h[2].thispar||this.props.thispar,[p,this,h[2].id,h[2],m]);a=1}if(b&&b.constructor==Function){b.apply(h[2].thispar||this.props.thispar,[p,this,h[2].id,h[2],m]);a=1}if(a){if(!this.props.statical){this.hide(1)}else{this.hidechildren()}}return 1}if(f==93&&r==this._focus){m.preventDefault();m.stopPropagation();if(this.hlitem<0){return 1}p=this.hlitem;h=this.elems[p];var q=h[2].onrdown||this.props.onrdown;if(q&&q.constructor==Function){q.apply(h[2].thispar||this.props.thispar,[p,this,h[2].id,h[2],m])}return 1}if((f==37||f==39)&&r==this._focus&&!this.props.horiz){m.preventDefault();m.stopPropagation();if(f==39&&this.hlitem>=0){p=this.hlitem;h=this.elems[p];if(h&&h[1]&&h[1].constructor==_uMENU){this.childopen(p,0);return 1}}else{if(f==37&&this.pos.parent&&!this.pos.parent.props.horiz){this.hide();return 1}}h=this.pos.parent;while(h&&!h.props.horiz&&h!=this){h=h.pos.parent}if(h&&h.props.horiz){h.onkeydown(m,j,h._focus)}}if((f==40||f==38||((f==37||f==39)&&this.props.horiz))&&r==this._focus){m.preventDefault();m.stopPropagation();if(this.props.horiz&&(f==40||f==38)){return 1}if(f==40||f==39){o=1}else{o=-1}d=p=this.hlitem;c=this.elems.length;for(g=0;g<c;g++){p+=o;if(p>=c||p<0){p=o>0?0:c-1}h=this.elems[p];if(h&&h[0]!="sep"){if(h[2].hl!=undefined?h[2].hl:this.props.highlight){break}}}if(g>=c||d==p){return 1}this.hlitem=p;if(d>=0){h=this.elems[d];if(h&&h[0]!="sep"){if(h[2].hl!=undefined?h[2].hl:this.props.highlight){this.design._onitemhl.apply(this.parts.elems[d],[m,0]);this.reset_childopen()}}}this.design._onitemhl.apply(this.parts.elems[p],[m,1]);if(this.hidetimer){clearTimeout(this.hidetimer)}this.hidetimer=null;if(this.props.horiz){this.childopen(p,0)}return 1}},shadow_init:function(){this.sh=this.design.shadow_init(this.top)},_resizeSh:function(){if(this.sh){this.design.shadow_resize(this.sh,this.width,this.height)}},moveTo:function(x,y){with(this){$(top).css("left",x+"px").css("top",y+"px");xpos=x;ypos=y}},resizeTo:function(w,h){with(this){if(props.width==0){$(menu).css("width",w+"px")}else{if(props.width!="auto"){$(menu).css("width",props.width)}else{$(menu).css("width","auto")}}if(props.horiz){$(menu).css("height",h+"px");$(parts.content).css("width",(w-decor.w)+"px").css("height",(h-decor.h)+"px")}else{$(parts.content).css("width",(w-decor.w)+"px");if($.browser.opera){$(top).css("width",w+"px")}}if(w<0){w=0}if(frame){$(frame).css("width",w+"px").css("height",h+"px")}width=w;height=h;_resizeSh()}},init1:function(nocalcsize){with(this){decor.w=50-parts.content.offsetWidth;if(decor.w<0){decor.w=0}decor.h=menu.offsetHeight-(props.horiz?10:50);if(decor.h<0){decor.h=0}state.init=true;_initsubmenus();if(add_elems){appendItems(null,0,nocalcsize)}else{if(pend_show){show(pend_show)}if(props.onreadycreate){if(props.onreadycreate.call){props.onreadycreate.call(props.thispar,this)}else{props.onreadycreate(this)}}props.onreadycreate=null}}},show:function(e,p){if(this.state.destroyed){return}if(!this.state.init){this.pend_show=e||{};return}this.pend_show=null;this.pos=$.extend(this.pos,e||{});if(this.pos.parent&&!this.pos.parent.state.visible){return}this._focus.deactivate();this._focus._parent=this.pos.parentfocus?this.pos.parentfocus:(this.pos.parent?this.pos.parent._focus:(this.props.wnd?this.props.wnd._focus:null));if(!this.pos.parent){this.zpos=_uMENU.defz}else{this.zpos=this.pos.parent.zpos+5}$(this.top).css("z-index",this.zpos);if(this.pos.pos||this.pos.alignObj){var v,k,g,o;if(this.pos.alignObj){v=this.pos.alignObj;k=$(v).offset();g=v.offsetWidth;o=v.offsetHeight}else{k={left:this.pos.pos.x,top:this.pos.pos.y};g=o=0}var z,n,l,t=_uWnd.getdims(),w=t.clientW,j=t.clientH,f=t.clientLeft,b=t.clientTop,r=this.pos.align||"d";if(this.props.wnd&&this.props.wnd.desktop){t=this.props.wnd.desktop;w=t.calcwidth();j=t.calcheight();f=t.calcexclude(0);b=t.calcexclude(2)}if(this.props.rtl||window._rtl){n=k.left+g+this.pos.dx-this.width}else{n=k.left+this.pos.dx}l=k.top+this.pos.dy;if(r=="r"||r=="R"){n=k.left+g+this.pos.dx}else{if(r=="l"||r=="L"){n=k.left-this.width+this.pos.dx}else{if(r=="d"||r=="D"){l=k.top+o+this.pos.dy}else{if(r=="u"||r=="U"){l=k.top-this.height+this.pos.dy}}}}if(n-f+this.width>w-3-this.design.sh_sz[0]||n-f<1){if(r=="R"||r=="U"){n=k.left-this.width-this.pos.dx}else{if(r=="L"){n=k.left+g-this.pos.dx}}}if(n-f+this.width>w-3){n=w-3-this.design.sh_sz[0]-this.width+f}if(n-f<1){n=1+f}if(l-b+this.height>j-3-this.design.sh_sz[1]||l-b<1){if(r=="D"){l=k.top-this.height-this.pos.dy}else{if(r=="U"){l=k.top+o-this.pos.dy}}}if(l-b+this.height>j-3){l=j-3-this.design.sh_sz[1]-this.height+b}if(l-b<1){l=1+b}if(this.props.parentnode){z=$(this.props.parentnode).offset();z.left+=(parseInt(jQuery.curCSS(this.props.parentnode,"borderLeftWidth",true),10)||0)-$(this.props.parentnode).scrollLeft();z.top+=(parseInt(jQuery.curCSS(this.props.parentnode,"borderTopWidth",true),10)||0)-$(this.props.parentnode).scrollTop();n-=z.left;l-=z.top}this.moveTo(n,l)}if(this.props.onshow){this.props.onshow.apply(this.props.thispar,[this,this.idx])}if(this.props.withmarks){for(var s=0;s<this.elems.length;s++){var u=this.elems[s];if(u&&u[2]&&this.parts.marks[s]){if(!u[2].mark){this.parts.marks[s].style.display="none"}else{var q=u[2].marktext||this.props.withmarks;if(typeof q=="object"&&q.constructr!=String){q=q[u[2].mark]}$(this.parts.marks[s]).html(String(q)).css("display","block")}}}}if(!this.props.statical){this.removehl()}$(this.top).show();this.state.visible=true;if(!this.props.statical){this._focus.activate()}if(typeof p!=undefined&&Number(p)!=NaN){var v=Number(p);if(v>=0&&v<this.elems.length){var h=this.elems[v];if(h&&h[0]!="sep"){if(h[2].hl!=undefined?h[2].hl:this.props.highlight){this.design._onitemhl.apply(this.parts.elems[v],[null,1]);this.hlitem=v}}}}if(this.props.hidetimer>0){this.hidetimer=setTimeout("var m=_uMENU.all["+this.idx+"];if(m)m.hide();",this.props.hidetimer)}},hidechildren:function(a){if(this.state.destroyed){return}var c=this.elems;for(var b=0;b<c.length;b++){if(c[b]&&c[b].constructor==Array&&c[b][1]&&c[b][1].constructor==_uMENU){if(c[b][1]!=a){c[b][1].hide()}}}},hide:function(a){if(this.state.destroyed){return}if(!this.state.visible){return}$(this.top).hide();this.state.visible=false;if(this.hidetimer){clearTimeout(this.hidetimer)}this.hidetimer=null;this.pend_show=null;this.hidechildren();if(this.props.onhide){this.props.onhide.apply(this.props.thispar,[this,this.idx])}this._focus.deactivate();if(a){var b=this.pos.parent;while(b&&!b.props.statical&&b!=this){b.hide(false);b=b.pos.parent}if(b&&b!=this&&b.props.statical){b._focus.deactivate()}}},childopen:function(b,a){if(this.state.destroyed){return}if(this.childtimer){clearTimeout(this.childtimer)}this.childtimer=null;var d=this.parts.elems[b];var e=this.elems[b];if(!e){return}e=e[1];if(!e||e.constructor!=_uMENU){this.hidechildren(e);return}this.hidechildren(e);e.show({dx:(this.props.horiz?0:-3*(this.props.rtl||window._rtl?-1:1)),alignObj:d,align:(this.props.horiz?"D":(this.props.rtl||window._rtl?"L":"R")),parent:this},a)},schedule_childopen:function(a){if(this.state.destroyed){return}if(this.childtimer){clearTimeout(this.childtimer)}var b=this.elems[a];if(b&&b[1]&&b[1].constructor==_uMENU&&b[1].state.visible){this.childtimer=null;return}this.childtimer=setTimeout("var m=_uMENU.all["+this.idx+"];if(m)m.childopen("+a+");",100)},reset_childopen:function(){if(this.childtimer){clearTimeout(this.childtimer)}},_initsubmenus:function(){with(this){for(var i=0;i<toinit.length;i++){toinit[i].init1(true);tocalcsize[tocalcsize.length]=toinit[i]}toinit.length=0}},_calcsizesubmenus:function(){with(this){for(var i=0;i<tocalcsize.length;i++){tocalcsize[i]._setsize()}tocalcsize.length=0}},createsubmenus:function(){var g,b=false;for(g=0;g<this.add_elems.length;g++){var c=this.add_elems[g];var e=c.length;for(var f=0;f<e;f++){if(c[f]&&c[f].constructor==Array&&c[f][1]&&c[f][1].constructor==Array){var d={},h,a,k;if(c[f][2]&&(typeof c[f][2])=="object"){d=c[f][2]}else{if((typeof c[f][2])=="number"){d={hl:c[f][2]}}else{if((typeof c[f][2])=="string"){d={id:c[f][2]}}}}c[f][2]=d;h=$.extend({parent:this,dx:this.props.horiz?this.pos.childdx:0,dy:this.props.horiz?this.pos.childdy:0},d.pos||{});a=$.extend({shadow:this.props.shadow,rtl:this.props.rtl?1:0,parentnode:this.props.wnd?this.props.wnd.top:this.props.parentnode,wnd:this.props.wnd,onitem:this.props.onitem,thispar:this.props.thispar},d.opts||{});k=new _uMENU("",h,a,c[f][1],true);c[f][1]=k;this.toinit[this.toinit.length]=k;b=true}}}return b},indexById:function(b){if(typeof b=="number"){return b>=0&&b<this.elems.length?b:-1}b=String(b);for(var a=0;a<this.elems.length;a++){if(this.elems[a][2].id===b){return a}}return -1},setItemText:function(b,a){b=this.indexById(b);if(b<0){return}this.design.setitemtext(this,b,a)},itemOptions:function(a){a=this.indexById(a);if(a<0){return null}return this.elems[a][2]},removeItems:function(a,f,g){var b,d,c;if(a==undefined||a==null){a=[];for(b=0;b<this.elems.length;b++){a[b]=this.elems.length-1-b}}else{if(a.constructor!=Array){a=[a]}}for(b=0;b<a.length;b++){if(a[b]==undefined||a[b]==null||a[b].constructor!=Number){a[b]=this.indexById(a[b])}}a.sort(function(h,e){return e-h});d=-1;for(b=0;b<a.length;b++){if(a[b]==d||a[b]<0||a[b]>=this.elems.length){continue}c=this.elems[a[b]];if(!f&&c&&c.constructor==Array&&c[1]&&c[1].constructor==_uMENU){c[1].destroy()}this.elems.splice(a[b],1);this.parts.elems[a[b]].parentNode.removeChild(this.parts.elems[a[b]]);this.parts.elems.splice(a[b],1);d=a[b]}if(!g){this.appendItems(null,0)}},appendItems:function(d,a,e){if(this.state.destroyed){return}if(d&&d.constructor==Array&&d.length>0){this.add_elems[this.add_elems.length]=d}if(!this.state.init){return}if(this.createsubmenus()){setTimeout("var m=_uMENU.all["+this.idx+"];if(m){m._initsubmenus();m.appendItems(null,0,"+e+");}",10);return}if(this.appendtimer){clearTimeout(this.appendtimer)}this.appendtimer=null;$(this.top).css("visibility","hidden").css("display","block");if(this.props.horiz){if(!this.props.noabs){$(this.menu).css("width","2100px").css("height","auto")}else{$(this.menu).css("width",this.props.width==0?"auto":this.props.width=="auto"?"auto":this.props.width+"px")}$(this.parts.content).css("width","2000px").css("height","auto")}else{if($.browser.opera){$(this.top).css("width","2000px")}$(this.menu).css("width","auto").css("height","auto");$(this.parts.content).css("width",$.browser.msie&&!this.havefixed?"50px":"auto").css("height","auto")}var c;for(c=0;c<this.add_elems.length;c++){d=this.add_elems[c];var g=d.length;for(var b=0;b<g;b++){if(!d[b]||d[b].constructor!=Array){d[b]=[""+d[b]]}var f={};if(d[b][2]&&(typeof d[b][2])=="object"){f=d[b][2]}else{if((typeof d[b][2])=="number"){f={hl:d[b][2]}}else{if((typeof d[b][2])=="string"){f={id:d[b][2]}}}}d[b][2]=f;this.design.append_item(this,d[b],this.props.highlight)}}this.add_elems.splice(0,c);if(!e){this.appendtimer=setTimeout("var m=_uMENU.all["+this.idx+"];if(m){m.appendtimer=null;m._setsize();}",10)}},_setsize:function(){var e=this.design.calc_size(this);this.resizeTo(e.w+this.decor.w,e.h+this.decor.h);this._calcsizesubmenus();$(this.top).css("display","none").css("visibility","");if(this.pend_show||this.state.visible){this.show(this.pend_show)}var c=this.props.onreadycreate;if(c){this.props.onreadycreate=null;if(c.call){c.call(this.props.thispar,this)}else{c(this)}}if(this.onsetsize){var b=this.onsetsize;this.onsetsize=null;if(this.props.wnd){b.apply(this.props.wnd)}}},destroy:function(){if(this.state.destroyed){return}this.removeItems();this.top.parentNode.removeChild(this.top);_uMENU.all[this.idx]=null;this._focus.destroy();this.state.destroyed=true;if(this.props.ondestroy){this.props.ondestroy.apply(this.props.thispar,[this,this.idx])}}};function _uComboBox(b,k,a,j,h){this.constructor=_uComboBox;this.name=b;this.obj=k&&k.tagName?k:$("#"+k)[0];if(!this.obj){return null}this.obj._ucombobox=this;this.props=$.extend({design:"std",readonly:false,haveicons:-1,deficon:null,listwidth:"auto",maxlistheight:"auto",colwidth:null,filter:0,nomatchtext:"",prompt:"",nodropdown:0,emptyprompt:"",filtertype:0,filtermax:0,haveotherprompt:"",translit:0,filtermarkclass:"",onchange:null,wnd:null,parentnode:a.wnd?a.wnd.top:null,app:a.wnd&&a.wnd.app?a.wnd.app:this,rtl:window._rtl},a||{});if(!this.props.readonly){this.props.nodropdown=0}if(this.props.parentnode){this.parent=this.props.parentnode;if(c=_uTabCtrl.findparentcontent(this.obj)){$(c).bind("scroll",this,function(i){if(!i.data.destroyed){i.data.hidelist()}})}else{if(this.props.wnd){$(this.props.wnd.parts.wndcont).bind("scroll",this,function(i){if(!i.data.destroyed){i.data.hidelist()}})}}}else{var c;if(c=_uTabCtrl.findparentcontent(this.obj)){this.parent=c}else{if(c=_uWnd.findparent(this.obj)){this.parent=c.top;$(c.parts.wndcont).bind("scroll",this,function(i){if(!i.data.destroyed){i.data.hidelist()}})}else{this.parent=this.obj.parentNode}}}this.havemaxheight=0;var d=this.obj.ownerDocument?this.obj.ownerDocument.defaultView:null;if(d&&d.getComputedStyle){if(d.getComputedStyle(this.parent,null).position==="static"){this.parent.style.position="relative"}if(d.getComputedStyle(this.parent,null).maxHeight!=undefined){this.havemaxheight=1}}else{if(this.parent.currentStyle.position==="static"){this.parent.style.position="relative"}if(this.parent.currentStyle.maxHeight!=undefined){this.havemaxheight=1}this.parent.style.zoom=1}this.app=this.props.app;this.tablecols=j<=0?1:j;this.colwidth=this.props.colwidth||[];this.destroyed=false;this.design=this.props.design&&_uComboBox.designs[this.props.design]?_uComboBox.designs[this.props.design]:_uComboBox.designs.std;this.idx=_uComboBox.nextidx++;_uComboBox.all[this.idx]=this;this.tablemode=this.tablecols>1||!this.props.filter?1:0;this.data=[];this.numdata=0;this.dataindex=0;this.prevfilter=-1;this.prevfilteridx=-2;if(!h){h=[]}var g=-1;for(var e=0;e<h.length;e++){if(g<0&&h[e][2]){g=e}}this.isprompt=0;this.prompttxt="";this.userInput=this.prevInput=this.obj.value;if(this.props.readonly){this.prompttxt=this.props.prompt;if(!this.props.filter){this.obj.readOnly=true}else{this.obj.readOnly=false}this.valobj=$('<input type="hidden" name="'+this.obj.name+'" value="">')[0];this.obj.removeAttribute("name");if(g<0||g>=h.length){if(!this.props.filter&&!this.prompttxt){g=0}g=-1}}else{this.obj.readOnly=false;this.valobj=this.obj;if(g<0||g>=h.length){g=-1}}this.selected=this.userIdx=g;this.changetimer=null;this.haveicons=this.props.haveicons>0;if(this.props.haveicons<0){for(var e=0;e<h.length;e++){if(h[e][1]){this.haveicons=true;break}}}this.frame=null;this.opened=false;this.updated=true;this.showtimer=null;this.blurtimer=null;this.cancelblur=false;this.combo=null;var l=document.createElement("div");l.id="_ucombolist"+this.idx;this.toplist=l;$(l).css({position:"absolute",zIndex:5,display:"none"});if($.browser.msie&&parseFloat($.browser.version)<8){var f='<iframe tabindex="-1" style="display:block; position:absolute; filter:Alpha(Opacity=\'0\'); width:1px;height:1px;border:0"/>';this.frame=document.createElement(f);l.appendChild(this.frame)}this.parts=this.design.combo_init(this);this.focused=0;$(this.obj).attr("autocomplete","off").blur().bind("focus",this,_uComboBox._onobjfocus).bind("blur",this,_uComboBox._onobjblur).bind("beforedeactivate",this,_uComboBox._onobjdeact).bind("keydown",this,function(i){return i.data.onkeydown(i)}).bind("keyup",this,function(i){return i.data.onkeyup(i)});$(this.combo).bind("mousedown",this,_uComboBox._oncombomousedown);$(this.toplist).bind("mousedown",this,_uComboBox._onlistmousedown);for(var e=0;e<h.length;e++){this.appendItem(h[e])}if(!_uComboBox.globalset){_uComboBox.globalset=true;$(window).bind("resize",_uComboBox.hideall)}if(this.props.filter&&this.userInput=="_auto_"){if(g<0){this.userInput=this.prevInput=""}else{this.userInput=this.prevInput=this.data[g][2]}}this.updatelist();this.select(g);this.to_unHL=[]}_uComboBox.all=[];_uComboBox.nextidx=0;_uComboBox.defz=20015;_uComboBox.globalset=false;_uComboBox.ignoreclick=null;_uComboBox.getbyname=function(c){var b=this.all;for(var d=0;d<b.length;d++){if(b[d]&&b[d].name==c){return b[d]}}return null};_uComboBox.hideall=function(){var b=_uComboBox.all;for(var c=0;c<b.length;c++){if(b[c]&&!b[c].destroyed&&_uComboBox.ignoreclick!=b[c]){b[c].hidelist()}}if(_uComboBox.ignoreclick){setTimeout("_uComboBox.ignoreclick=null;",10)}};_uComboBox.designs={std:{combo_init:function(b){var a={};b.combo=$('<table id="_ucombo'+b.idx+'" style="position:relative" cellspacing="0" cellpadding="0" border="0" class="x-unselectable u-combo" align="'+(b.props.rtl?"right":"left")+'"><tr><td class="u-comboeditcell"></td>'+(!b.props.filter||!b.props.nodropdown?'<td class="u-combobutcell"><div class="u-combobut"></td>':"")+"</tr></table>")[0];b.obj.parentNode.insertBefore(b.combo,b.obj);if(b.parent!=b.obj.parentNode){b.parent.appendChild(b.toplist)}else{b.parent.insertBefore(b.toplist,b.obj)}a.editcell=$(b.combo).find(".u-comboeditcell")[0];if(!b.props.filter||!b.props.nodropdown){a.button=$(b.combo).find(".u-combobut")[0];a.butcell=$(b.combo).find(".u-combobutcell")[0]}else{a.button=a.butcell=null}a.editcell.appendChild(b.obj);if(b.props.readonly){a.editcell.appendChild(b.valobj)}$(b.obj).attr("class","x-selectable u-comboedit"+(b.haveicons?" u-comboeditimg":"")+" "+$(b.obj).attr("class"));if(b.tablemode){$(b.toplist).append('<div class="u-combolist"><div style="zoom:1"><table border="0" cellspacing="0" class="x-unselectable u-combocont" width="100%"></table></div></div>')}else{$(b.toplist).append('<div class="u-combolist"><div style="zoom:1"></div></div>')}a.list=$(b.toplist).find(".u-combolist")[0];if(b.props.maxlistheight>=50&&b.havemaxheight){$(a.list).css({maxHeight:b.props.maxlistheight+"px",overflow:"auto"})}a.listc=a.list.firstChild;if(b.tablemode){a.content=$(b.toplist).find(".u-combocont")[0]}else{a.content=null}if(!b.props.readonly){if(a.button){$(a.button).bind("mousedown",b,_uComboBox._onbutclick)}}else{if(!b.props.filter){$(b.obj).bind("mousedown",function(c){c.preventDefault();return 0})}}if(a.button){$(a.button).bind("mouseover",b.design._onbutmouseover).bind("mouseout",b.design._onbutmouseout)}a.items=[];if(b.props.filter&&b.props.nodropdown&&b.props.emptyprompt){if(b.tablemode){a.row_prompt=a.content.insertRow(0);$(a.row_prompt).css("display","none");$(a.row_prompt.insertCell(0)).attr("class","u-combocell0").attr("colspan",b.tablecols).html(b.props.emptyprompt)}else{a.row_prompt=document.createElement("DIV");a.row_prompt._attached=0;$(a.row_prompt).addClass("u-combocell0").html(b.props.emptyprompt)}$(a.row_prompt).addClass("u-comborow").addClass("u-comboemptyprompt").bind("mousedown",function(c){return 0})}else{a.row_prompt=null}if(b.props.filter&&b.props.nomatchtext){if(b.tablemode){a.row_nomatch=a.content.insertRow(0);$(a.row_nomatch).css("display","none");$(a.row_nomatch.insertCell(0)).attr("class","u-combocell0").attr("colspan",b.tablecols).html(b.props.nomatchtext)}else{a.row_nomatch=document.createElement("DIV");a.row_nomatch._attached=0;$(a.row_nomatch).addClass("u-combocell0").html(b.props.nomatchtext)}$(a.row_nomatch).addClass("u-comborow").addClass("u-combonomatch").bind("mousedown",function(c){return 0})}else{a.row_nomatch=null}if(b.props.filter&&b.props.haveotherprompt&&b.props.filtermax>0){if(b.tablemode){a.row_haveother=a.content.insertRow(0);$(a.row_haveother).css("display","none");$(a.row_haveother.insertCell(0)).attr("class","u-combocell0").attr("colspan",b.tablecols).html(b.props.haveotherprompt)}else{a.row_haveother=document.createElement("DIV");a.row_haveother._attached=0;$(a.row_haveother).addClass("u-combocell0").html(b.props.haveotherprompt)}$(a.row_haveother).addClass("u-comborow").addClass("u-combonomatch").bind("mousedown",function(c){return 0})}else{a.row_haveother=null}$(b.toplist).find("div,span,table").andSelf().attr("unselectable","on");return a},content_reset:function(a){if(a.tablemode){return}var b=$('<div class="x-unselectable u-combocont"></div>')[0];a.parts.listc.insertBefore(b,a.parts.content);a.parts.content=b;if(a.parts.row_prompt){a.parts.row_prompt._attached=0}if(a.parts.row_nomatch){a.parts.row_nomatch._attached=0}if(a.parts.row_haveother){a.parts.row_haveother._attached=0}},append_item:function(h,f,e){var g,b,d,a;if(!h.tablemode){g=h.parts.items[e]=document.createElement("DIV");if(!h.props.filter){$(g).html((f[1]?'<img class="u-comborowicon" border="0" src="'+f[1]+'">':"")+(f.length>3?f[3]:f[0]).replace(/&/g,"&amp;").replace(/</g,"&lt;"))}$(g).attr("class","u-combocell0")}else{d=h.parts.content;g=h.parts.items[e]=d.insertRow(e);for(var c=0;c<h.tablecols;c++){b=g.insertCell(c);if(!h.props.filter){a=c+3<f.length?f[c+3]:(c==0?f[0]:"");if(c==0&&f[1]){a='<img class="u-comborowicon" border="0" src="'+f[1]+'">'+a.replace(/&/g,"&amp;").replace(/</g,"&lt;")}$(b).attr("class","u-combocell"+c).html(a)}$(b).attr("class","u-combocell"+c);if(h.colwidth[c]){$(b).attr("width",h.colwidth[c])}}}$(g).addClass("u-comborow").bind("mouseover",h,_uComboBox._onitemmouseover).bind("mouseout",h,_uComboBox._onitemmouseout).bind("click",{obj:h,idx:e},_uComboBox._onitemclick);$(g).find("*").andSelf().attr("unselectable","on")},remove_item:function(c,b){if(b<0||b>=c.parts.items.length){return}if(c.tablemode){var a=c.parts.content;if(b>=a.rows.length){return}$(a.rows[b]).unbind();a.deleteRow(b)}else{if(c.parts.items[b].parentNode){c.parts.items[b].parentNode.removeChild(c.parts.items[b])}}c.parts.items.splice(b,1)},_onitemmouseover:function(b,a){if(a){$(this).addClass("u-comborowhl")}else{$(this).removeClass("u-comborowhl")}},_onbutmouseover:function(){$(this).addClass("u-combobuthl")},_onbutmouseout:function(){$(this).removeClass("u-combobuthl")},_onlistopen:function(a){$(a.combo).addClass("u-comboopen")},_onlisthide:function(a){$(a.combo).removeClass("u-comboopen")},_onfocus:function(b,a){$(b.combo).addClass("u-combofocus")},_onblur:function(b,a){$(b.combo).removeClass("u-combofocus")},_select:function(b,a){$(b.parts.items[a]).addClass("u-comborowsel")},_deselect:function(b,a){$(b.parts.items[a]).removeClass("u-comborowsel")},onprompt:function(b,a){if(a){$(b.obj).addClass("u-comboprompt")}else{$(b.obj).removeClass("u-comboprompt")}},seticon:function(b,a){if(a){$(b.obj).css("background-image","url("+a+")")}else{$(b.obj).css("background-image",b.props.deficon?"url("+b.props.deficon+")":"none")}}}};_uComboBox._onitemmouseover=function(a){a.data.design._onitemmouseover.apply(this,[a,1]);a.data.to_unHL.push(this)};_uComboBox._onitemmouseout=function(c){var a=c.data.to_unHL,b;c.data.design._onitemmouseover.apply(this,[c,0]);for(b=0;b<a.length;b++){if(a[b]==this){a.splice(b,1)}}};_uComboBox._onitemclick=function(a){var c=a.data,b=c.obj;b.obj.focus();b.hidelist();b.select(c.idx);a.preventDefault()};_uComboBox._onbutclick=function(a){var b=a.data;_uComboBox.ignoreclick=a.data;if(b.opened){b.hidelist()}else{b.showlist();_uComboBox.ignoreclick=a.data}b.obj.focus();if($.browser.msie&&!a.data.cancelblur){a.data.cancelblur=true;setTimeout("var c=_uComboBox.all["+a.data.idx+"];if(c)c.cancelblur=false;",10)}a.preventDefault()};_uComboBox._onlistmousedown=function(a){_uComboBox.ignoreclick=a.data;a.data.obj.focus();if($.browser.msie&&!a.data.cancelblur){a.data.cancelblur=true;setTimeout("var c=_uComboBox.all["+a.data.idx+"];if(c)c.cancelblur=false;",10)}a.preventDefault()};_uComboBox._oncombomousedown=function(a){_uComboBox.ignoreclick=a.data;if(a.which!=1){return}var b=a.data;if(b.props.readonly){if(b.opened){b.hidelist()}else{b.showlist();_uComboBox.ignoreclick=a.data}}b.obj.focus();if($.browser.msie&&!b.cancelblur){b.cancelblur=true;setTimeout("var c=_uComboBox.all["+b.idx+"];if(c)c.cancelblur=false;",10)}if(a.target!=b.obj){a.preventDefault()}};_uComboBox._onobjfocus=function(a){a.data._onobjfocus(a)};_uComboBox._onobjblur=function(a){var b=a.data;if(!b.cancelblur){a.data._onobjblur()}};_uComboBox._onobjdeact=function(a){var b=a.data;if(b.cancelblur){a.preventDefault()}};_uComboBox.isUpKey=function(a){return a==38||a==63232};_uComboBox.isDownKey=function(a){return a==40||a==63233};_uComboBox.prototype={destroy:function(){if(this.destroyed){return}if(this.props.readonly){$(this.valobj).remove()}if(this.toplist){$(this.toplist).remove();this.toplist=null}if(this.combo){$(this.combo).remove();this.combo=null}if(this.frame){$(this.frame).remove();this.frame=null}this.parts=null;this.obj=this.valobj=null;this.data=null;if(this.changetimer){clearTimeout(this.changetimer)}if(this.blurtimer){clearTimeout(this.blurtimer)}if(this.showtimer){clearTimeout(this.showtimer)}this.changetimer=this.blurtimer=this.showtimer=null;this.to_unHL=[];this.destroyed=1},_unhightlight:function(){var a=this.to_unHL,b;for(b=0;b<a.length;b++){this.design._onitemmouseover.apply(a[b],[null,0])}a.splice(0,a.length)},_setvalue:function(i,soft){with(this){if(i>=0&&i<data.length){if(!soft||!props.readonly){valobj.value=data[i][0]}if(props.readonly){obj.value=prevInput=data[i][2]}else{prevInput=data[i][0]}if(haveicons){design.seticon(this,data[i][1])}}else{if(props.readonly){if(!soft){valobj.value=""}if(prompttxt&&!focused&&!userInput){obj.value=prompttxt;prevInput="";isprompt=1;design.onprompt(this,1)}else{obj.value=prevInput=userInput;isprompt=0;design.onprompt(this,0)}}else{valobj.value=prevInput=userInput}if(haveicons){this.design.seticon(this,null)}}}},_selectitem:function(i){with(this){if(selected>=0&&selected<data.length){design._deselect(this,selected);selected=-1}if(i>=0&&i<data.length){design._select(this,i);selected=i}}},setvalue:function(v){with(this){var ch=false;if(props.readonly){return}if(changetimer){clearTimeout(changetimer)}if(valobj.value!=v){ch=true}valobj.value=prevInput=userInput=v;if(selected!=-1){ch=true}_selectitem(-1);userIdx=-1;if(haveicons){this.design.seticon(this,null)}if(props.onchange&&ch){props.onchange.apply(this.app,[selected,v,this])}}},select:function(i,soft){with(this){var ch=false;if(changetimer){clearTimeout(changetimer)}changetimer=null;_selectitem(i);_setvalue(selected,soft);if(!soft){if(selected!=userIdx){ch=true}userIdx=selected;if(ch){updatelist()}if(props.onchange&&ch){props.onchange.apply(this.app,[selected,valobj.value,this])}}}},_onobjfocus:function(a){if(this.blurtimer){clearTimeout(this.blurtimer)}this.blurtimer=null;this.focused=1;if(this.isprompt){this.isprompt=0;this.obj.value=this.userInput;this.design.onprompt(this,0)}this.design._onfocus(this,a);if(this.props.readonly&&!this.opened){this.showlist();_uComboBox.ignoreclick=this}},_onobjblur:function(a){if(this.blurtimer){clearTimeout(this.blurtimer)}this.focused=0;this.blurtimer=setTimeout("var c=_uComboBox.all["+this.idx+"];if(c)c._onblur2();",10)},_onblur2:function(e){with(this){blurtimer=null;hidelist();design._onblur(this,e);if(props.filter&&selected==-1&&userIdx==-1&&userInput&&numdata>0){for(var k=dataindex;k<data.length;k++){if(data[k][4]&&data[k][2]==userInput){select(dataindex);return}}}select(userIdx,1);if(prompttxt&&userIdx==-1){isprompt=1;obj.value=this.prompttxt;design.onprompt(this,1)}}},focus:function(){this.obj.focus()},blur:function(){this.obj.blur()},onkeydown:function(e){var i;with(this){var c=e.keyCode;if(c==27&&opened){select(userIdx,true);hidelist();return false}if(data.length==0||numdata==0){return}if(c==13){obj.focus();hidelist();select(selected);e.preventDefault();e.stopPropagation();return false}if(c==9){if(changetimer){select(selected)}return}if(_uComboBox.isDownKey(c)||_uComboBox.isUpKey(c)){i=_findnextvalid(selected,(_uComboBox.isDownKey(c)?1:-1));select(i,true);if(!opened){if(props.nodropdown){showlist()}else{changetimer=setTimeout("var c=_uComboBox.all["+this.idx+"];if(c)c.select("+i+");",500)}}return false}}},onkeyup:function(e){with(this){if((!props.filter&&props.readonly)||obj.value==prevInput){return}if(changetimer){clearTimeout(changetimer)}prevInput=userInput=obj.value;var previdx=userIdx;userIdx=-1;updatelist();if(!props.filter||(previdx>=0&&(data[previdx][4]<1||!prevfilter))){_selectitem(-1);if(props.readonly){valobj.value=""}if(props.onchange&&props.readonly&&previdx!=-1){props.onchange.apply(this.app,[-1,obj.value,this])}if(haveicons){this.design.seticon(this,null)}}else{if(previdx>=0){userIdx=previdx}}if(props.filter){showlist()}if(props.onchange&&!props.readonly){props.onchange.apply(this.app,[-1,obj.value,this])}}},appendItem:function(elem){with(this){var i=data.length;data[i]=[elem[0],elem[1],elem.length>3?elem[3]:elem[0]];if(typeof(data[i][2])!="string"){data[i][2]=String(data[i][2])}if(props.filter){if(props.translit){data[i][3]=new _uTransStr(data[i][2])}else{data[i][3]=data[i][2].toLowerCase()}}if(props.tablemode||!props.filter){design.append_item(this,elem,i)}updated=true;if(tablemode){data[i][4]=1;numdata++}else{data[i][4]=0}}},removeItem:function(a){if(a<0||a>=this.data.length){return}this.design.remove_item(this,a);if(this.data[a][4]>0){this.numdata--}this.data.splice(a,1);this.updated=true},removeAll:function(){for(var a=0;a<this.data.length;a++){this.design.remove_item(this,0)}this.data.splice(0,this.data.length);this.updated=true},hidelist:function(){if(!this.opened){return}this.toplist.style.display="none";this.opened=false;this.design._onlisthide(this);this._unhightlight()},_findnextvalid:function(ii,d){var j,k;with(this){if(numdata<=0||data.length==0){return -1}if(d>0){if(ii<0){j=dataindex}else{if(ii>=data.length-1){if(!props.readonly||props.filter){return -1}else{j=0}}else{j=ii+1}}for(k=0;k<data.length;k++){if(data[j][4]>0){return j}j++;if(j>=data.length){if(props.readonly&&!props.filter){j=0}else{return -1}}}}else{if(ii<0||ii>=data.length){j=data.length-1}else{if(ii==0){if(!props.readonly||props.filter){return -1}else{j=data.length-1}}else{j=ii-1}}for(k=0;k<data.length;k++){if(data[j][4]>0){return j}j--;if(j<0){if(props.readonly&&!props.filter){j=data.length-1}else{return -1}}}}}return ii},_marksections:function(d,a){d=d.replace(/&/g,"&amp;").replace(/</g,"&lt;");if(!a||a.length==0){return d}if(a.length>1){a.sort(function(g,f){return g[0]-f[0]})}var c="",e=0;for(var b=0;b<a.length;b++){if(b<a.length-1&&a[b+1][0]==a[b][0]+a[b][1]){a[b+1][0]=a[b][0];a[b+1][1]+=a[b][1];continue}if(a[b][0]>e){c+=d.substring(e,a[b][0])}c+='<span class="'+this.props.filtermarkclass+'">'+d.substr(a[b][0],a[b][1])+"</span>";e=a[b][0]+a[b][1]}if(e<d.length){c+=d.substr(e)}return c},_intersect:function(b,d,a){for(var c=0;c<b.length;c++){if(d>=b[c][0]+b[c][1]||d+a<=b[c][0]){continue}else{return 1}}return 0},updatelist:function(){with(this){var i,ii,tmp,off,vv,sect,keys,subfilter=0,maxshow,showotherprompt=0;if(!props.filter){return}maxshow=props.filtermax>0&&props.filtermax<data.length?props.filtermax:data.length;if(!props.translit){tmp=userInput.toLowerCase().replace(/^ */,"");if(props.filtertype!=2){tmp=tmp.replace(/  +/g," ").replace(/ +$/,"");keys=tmp.split(" ");sect=[]}if(prevfilter==tmp&&prevfilteridx==userIdx){return}if(prevfilter.length>0){if(props.filtertype==0){if(tmp.length>prevfilter.length&&tmp.indexOf(prevfilter)>=0){subfilter=1}}else{if(props.filtertype==1){if(tmp.length>prevfilter.length&&tmp.indexOf(prevfilter)==0){subfilter=1}}}}prevfilter=tmp;prevfilteridx=userIdx}else{tmp=new _uTransStr(userInput);if(prevfilter==tmp.translit&&prevfilteridx==userIdx){return}if(prevfilter.length>0){if(props.filtertype==0){if(tmp.translit.length>prevfilter.length&&tmp.translit.indexOf(prevfilter)>=0){subfilter=1}}else{if(tmp.translit.length>prevfilter.length&&tmp.translit.indexOf(prevfilter)==0){subfilter=1}}}prevfilter=tmp.translit;prevfilteridx=userIdx;keys=tmp.splitsps();sect=[]}updated=1;if(!prevfilter){if(props.nodropdown){if(tablemode&&numdata>0){for(i=dataindex;i<data.length;i++){if(data[i][4]==0){continue}parts.items[i].style.display="none";data[i][4]=0}}else{if(!tablemode){design.content_reset(this);if(numdata>0){for(i=dataindex;i<data.length;i++){data[i][4]=0}}}}numdata=dataindex=0;if(parts.row_prompt){if(tablemode){parts.row_prompt.style.display=userIdx>=0?"none":""}else{if(userIdx<0){parts.content.appendChild(parts.row_prompt);parts.row_prompt._attached=1}}}}else{if(!props.nodropdown&&numdata<data.length){if(tablemode){for(i=0;i<maxshow;i++){parts.items[i].cells[0].innerHTML=data[i][2];if(data[i][4]>0){continue}parts.items[i].style.display="";data[i][4]=1}if(i<data.length){showotherprompt=1}for(;i<data.length;i++){if(data[i][4]<0){continue}parts.items[i].style.display="none";data[i][4]=-1}}else{design.content_reset(this);for(i=0;i<maxshow;i++){if(!parts.items[i]){design.append_item(this,null,i)}parts.items[i].innerHTML=data[i][2];parts.content.appendChild(parts.items[i]);data[i][4]=1}if(i<data.length){showotherprompt=1}for(;i<data.length;i++){data[i][4]=-1}}numdata=maxshow;dataindex=0}}}else{if(!tablemode&&(!subfilter||!parts.content)){design.content_reset(this)}if(parts.row_prompt&&props.nodropdown){if(tablemode){parts.row_prompt.style.display="none"}else{if(parts.row_prompt._attached){parts.content.removeChild(parts.row_prompt);parts.row_prompt._attached=0}}}if(!subfilter){dataindex=-1}numdata=0;if(!props.translit){if(props.filtertype==1){loop1:for(i=(subfilter&&dataindex>=0?dataindex:0),dataindex=-1;i<data.length&&numdata<maxshow;i++){if(subfilter&&data[i][4]==0){continue}sect.length=0;for(ii=0;ii<keys.length;ii++){off=-1;do{off=data[i][3].indexOf(keys[ii],off+1);if(off<0){break}if(off>0&&data[i][3].charAt(off-1)!=" "){continue}if(!this._intersect(sect,off,keys[ii].length)){break}}while(1);if(off<0){if(data[i][4]>0){if(tablemode){parts.items[i].style.display="none"}else{if(subfilter){parts.content.removeChild(parts.items[i])}}}data[i][4]=0;continue loop1}sect[ii]=[off,keys[ii].length]}if(!tablemode&&!parts.items[i]){design.append_item(this,null,i)}if(props.filtermarkclass){if(tablemode){parts.items[i].cells[0].innerHTML=_marksections(data[i][2],sect)}else{parts.items[i].innerHTML=_marksections(data[i][2],sect)}}if(tablemode){if(data[i][4]!=1){parts.items[i].style.display=""}}else{if(!subfilter||data[i][4]!=1){parts.content.appendChild(parts.items[i])}}data[i][4]=1;numdata++;if(dataindex<0){dataindex=i}}}else{if(props.filtertype==2){sect=[[0,tmp.length]];for(i=(subfilter&&dataindex>=0?dataindex:0),dataindex=-1;i<data.length&&numdata<maxshow;i++){if(subfilter&&data[i][4]==0){continue}if(data[i][3].length<tmp.length||data[i][3].substr(0,tmp.length)!=tmp){if(data[i][4]>0){if(tablemode){parts.items[i].style.display="none"}else{if(subfilter){parts.content.removeChild(parts.items[i])}}}data[i][4]=0}else{if(!tablemode&&!parts.items[i]){design.append_item(this,null,i)}if(props.filtermarkclass){if(tablemode){parts.items[i].cells[0].innerHTML=_marksections(data[i][2],sect)}else{parts.items[i].innerHTML=_marksections(data[i][2],sect)}}if(tablemode){if(data[i][4]!=1){parts.items[i].style.display=""}}else{if(!subfilter||data[i][4]!=1){parts.content.appendChild(parts.items[i])}}data[i][4]=1;numdata++;if(dataindex<0){dataindex=i}}}}else{loop2:for(i=(subfilter&&dataindex>=0?dataindex:0),dataindex=-1;i<data.length&&numdata<maxshow;i++){if(subfilter&&data[i][4]==0){continue}sect.length=0;for(ii=0;ii<keys.length;ii++){off=-1;do{off=data[i][3].indexOf(keys[ii],off+1)}while(off>=0&&this._intersect(sect,off,keys[ii].length));if(off<0){if(data[i][4]>0){if(tablemode){parts.items[i].style.display="none"}else{if(subfilter){parts.content.removeChild(parts.items[i])}}}data[i][4]=0;continue loop2}sect[ii]=[off,keys[ii].length]}if(!tablemode&&!parts.items[i]){design.append_item(this,null,i)}if(props.filtermarkclass){if(tablemode){parts.items[i].cells[0].innerHTML=_marksections(data[i][2],sect)}else{parts.items[i].innerHTML=_marksections(data[i][2],sect)}}if(tablemode){if(data[i][4]!=1){parts.items[i].style.display=""}}else{if(!subfilter||data[i][4]!=1){parts.content.appendChild(parts.items[i])}}data[i][4]=1;numdata++;if(dataindex<0){dataindex=i}}}}}else{if(props.filtertype==1){loop3:for(i=(subfilter&&dataindex>=0?dataindex:0),dataindex=-1;i<data.length&&numdata<maxshow;i++){if(subfilter&&data[i][4]==0){continue}sect.length=0;for(ii=0;ii<keys.length;ii++){off=[-1,0,-1];do{off=data[i][3].find(keys[ii],off[0]+1,off[2]);if(!off){break}if(off[2]>0&&data[i][3].translit.charAt(off[2]-1)!=" "){continue}if(!this._intersect(sect,off[0],off[1])){break}}while(1);if(!off){if(data[i][4]>0){if(tablemode){parts.items[i].style.display="none"}else{if(subfilter){parts.content.removeChild(parts.items[i])}}}data[i][4]=0;continue loop3}sect[ii]=off}if(!tablemode&&!parts.items[i]){design.append_item(this,null,i)}if(props.filtermarkclass){if(tablemode){parts.items[i].cells[0].innerHTML=_marksections(data[i][2],sect)}else{parts.items[i].innerHTML=_marksections(data[i][2],sect)}}if(tablemode){if(data[i][4]!=1){parts.items[i].style.display=""}}else{if(!subfilter||data[i][4]!=1){parts.content.appendChild(parts.items[i])}}data[i][4]=1;numdata++;if(dataindex<0){dataindex=i}}}else{loop4:for(i=(subfilter&&dataindex>=0?dataindex:0),dataindex=-1;i<data.length&&numdata<maxshow;i++){if(subfilter&&data[i][4]==0){continue}sect.length=0;for(ii=0;ii<keys.length;ii++){off=[-1,0,-1];do{off=data[i][3].find(keys[ii],off[0]+1,off[2]);if(!off){break}}while(this._intersect(sect,off[0],off[1]));if(!off){if(data[i][4]>0){if(tablemode){parts.items[i].style.display="none"}else{if(subfilter){parts.content.removeChild(parts.items[i])}}}data[i][4]=0;continue loop4}sect[ii]=off}if(!tablemode&&!parts.items[i]){design.append_item(this,null,i)}if(props.filtermarkclass){if(tablemode){parts.items[i].cells[0].innerHTML=_marksections(data[i][2],sect)}else{parts.items[i].innerHTML=_marksections(data[i][2],sect)}}if(tablemode){if(data[i][4]!=1){parts.items[i].style.display=""}}else{if(!subfilter||data[i][4]!=1){parts.content.appendChild(parts.items[i])}}data[i][4]=1;numdata++;if(dataindex<0){dataindex=i}}}}if(i<data.length){showotherprompt=1}for(;i<data.length;i++){if(data[i][4]>0){if(tablemode){parts.items[i].style.display="none"}else{if(subfilter){parts.content.removeChild(parts.items[i])}}}data[i][4]=-1}}if(parts.row_nomatch&&props.readonly){if(tablemode){parts.row_nomatch.style.display=numdata>0||!prevfilter?"none":""}else{if(numdata>0||!prevfilter){if(parts.row_nomatch._attached){parts.content.removeChild(parts.row_nomatch)}parts.row_nomatch._attached=0}else{if(!parts.row_nomatch._attached){parts.content.appendChild(parts.row_nomatch)}parts.row_nomatch._attached=1}}}if(parts.row_haveother){if(tablemode){parts.row_haveother.style.display=showotherprompt?"":"none"}else{if(!showotherprompt){if(parts.row_haveother._attached){parts.content.removeChild(parts.row_haveother)}parts.row_haveother._attached=0}else{parts.content.appendChild(parts.row_haveother);parts.row_haveother._attached=1}}}if(!tablemode&&!subfilter&&parts.listc.childNodes.length>1){parts.listc.removeChild(parts.listc.lastChild)}if(opened){showlist()}}},showlist:function(){var b,a,e;if((this.opened&&!this.updated)||(this.props.nodropdown&&this.props.filter&&!this.userInput&&!this.parts.row_prompt)){return}if(this.opened&&(!this.havemaxheight||this.props.maxlistheight=="auto")){$(this.parts.list).css({height:"auto",overflow:"hidden"});if(this.showtimer){clearTimeout(this.showtimer)}this._showlist();this.updated=false;return}var d=$(this.combo).offset(),c=$(this.parent).offset();c.left+=(parseInt(jQuery.curCSS(this.parent,"borderLeftWidth",true),10)||0)-$(this.parent).scrollLeft();c.top+=(parseInt(jQuery.curCSS(this.parent,"borderTopWidth",true),10)||0)-$(this.parent).scrollTop();a=d.left-c.left;e=d.top-c.top;if(this.props.listwidth=="auto"){b=this.combo.offsetWidth+"px"}else{b=this.props.listwidth}$(this.toplist).css({left:a+"px",top:(e+this.combo.offsetHeight-1)+"px",width:b,minWidth:this.combo.offsetWidth+"px"});if(this.frame){$(this.frame).css({width:b})}if(this.updated&&(!this.havemaxheight||this.props.maxlistheight=="auto")){$(this.parts.list).css({height:"auto",overflow:"hidden"});$(this.toplist).css({visibility:"hidden"}).css({display:"block"});if(this.showtimer){clearTimeout(this.showtimer)}this.showtimer=setTimeout("var c=_uComboBox.all["+this.idx+"];if(c)c._showlist();",10)}else{this.toplist.style.display="block"}this.design._onlistopen(this);this.opened=true;this.updated=false},_showlist:function(){this.showtimer=null;var e=this.parts.list,b,a,f,c=_uWnd.getdims();b=Math.max(e.scrollHeight,e.offsetHeight);f=$(this.toplist).offset();if(this.props.maxlistheight>0){a=Math.max(50,Math.min(this.props.maxlistheight,c.clientH-f.top))}else{a=Math.max(50,c.clientH-f.top)}if(b>a||(!b&&this.numdata>0)){$(this.parts.list).css({height:a+"px",overflow:"auto"});b=a}if(this.frame){$(this.frame).css({height:b+"px"})}$(this.toplist).css({visibility:""})}};function _uSuggestList(c,b,f,g){this.constructor=_uSuggestList;this.name=c;this.obj=typeof b=="string"?$("#"+b)[0]:b;if(!this.obj){return null}this.obj._uSuggestList=this;this.props=$.extend({design:"std",cachegroup:"def",minlen:2,url:null,separator:null,compareFunc:null,preserveonout:0,showalways:0,emptyprompt:"...",dataType:"text",useDataObj:null,haveDataId:0,emptyDataId:0,onchange:null,onselect:null,wnd:null,parentnode:f.wnd?f.wnd.top:null,app:f.wnd&&f.wnd.app?f.wnd.app:null},f||{});this.destroyed=false;this.design=this.props.design&&_uSuggestList.designs[this.props.design]?_uSuggestList.designs[this.props.design]:_uSuggestList.designs.std;this.idx=_uSuggestList.nextidx++;_uSuggestList.all[this.idx]=this;this.cacheGroup=this.props.cachegroup;if(!this.queryCache[this.cacheGroup]){this.queryCache[this.cacheGroup]=[]}if(g){this.queryCache[this.cacheGroup]=g}if(this.props.haveDataId){this.dataobj=typeof this.props.useDataObj=="string"?$("#"+this.props.useDataObj)[0]:this.props.useDataObj}else{this.dataobj=null}this.dataid=this.props.emptyDataId;this.visible=true;this.hlIndex=-1;this.saIndex=-1;this.hlRow=null;this.blockMouseOver=false;this.previousInput=this.obj.value;this.resultInput="";this.requestedInput="";this.ignoreInput="";this.sep_pos=-1;this.userInput=this._getvalue_sep();this.remoteReqTimer=null;this.hideTimer=null;this.AJAXretries=0;this.AJAXTimer=null;this.frame=null;var e=document.createElement("div");e.id="_usuggest"+this.idx;this.top=e;if(this.props.parentnode){this.parent=this.props.parentnode;this.parent.appendChild(e);var a;if(a=_uTabCtrl.findparentcontent(this.obj)){$(a).bind("scroll",this,function(i){if(!i.data.destroyed){i.data.onblur(null)}})}else{if(this.props.wnd){$(this.props.wnd.parts.wndcont).bind("scroll",this,function(i){if(!i.data.destroyed){i.data.onblur(null)}})}}}else{var a;if(a=_uTabCtrl.findparentcontent(this.obj)){this.parent=a;this.parent.appendChild(e)}else{if(a=_uWnd.findparent(this.obj)){this.parent=a.top;this.parent.appendChild(e);$(a.parts.wndcont).bind("scroll",this,function(i){if(!i.data.destroyed){i.data.onblur(null)}})}else{this.parent=this.obj.parentNode;this.parent.insertBefore(e,this.obj)}}}var h=this.obj.ownerDocument?this.obj.ownerDocument.defaultView:null;if(h&&h.getComputedStyle){if(h.getComputedStyle(this.parent,null).position==="static"){this.parent.style.position="relative"}}else{if(this.parent.currentStyle.position==="static"){this.parent.style.position="relative"}}$(e).css({position:"absolute",zIndex:5,display:"none",zoom:1});if(0&&$.browser.msie&&parseFloat($.browser.version)<7){var d='<iframe tabindex="-1" style="display:block; position:absolute;filter:Alpha(Opacity=\'100\'); width:1px;height:20px;border:0"/>';this.frame=document.createElement(d);e.appendChild(this.frame)}this.parts=this.design.suggest_init(this);$(this.obj).attr("autocomplete","off").css("position","relative").bind("focus",this,function(i){return i.data.onfocus(i)}).bind("blur",this,function(i){return i.data.onblur(i)}).bind("keydown",this,function(i){return i.data.onkeydown(i)}).bind("mousedown",this,function(i){_uSuggestList.ignoreclick=i.data}).bind("keyup",this,function(i){return i.data.onkeyup(i)});if(!_uSuggestList.globalset){_uSuggestList.globalset=true;$(window).bind("resize",_uSuggestList.hideall)}this.hide();if(this.obj.form){$(this.obj.form).bind("submit."+this.idx,this,function(i){return i.data.onsubmitform(i)})}}_uSuggestList.all=[];_uSuggestList.nextidx=0;_uSuggestList.defz=20015;_uSuggestList.globalset=false;_uSuggestList.ignoreclick=null;_uSuggestList.getbyname=function(c){var b=this.all;for(var d=0;d<b.length;d++){if(b[d]&&b[d].name==c){return b[d]}}return null};_uSuggestList.hideall=function(){var b=_uSuggestList.all;for(var c=0;c<b.length;c++){if(b[c]&&!b[c].destroyed&&_uSuggestList.ignoreclick!=b[c]){b[c].onblur(null)}}if(_uSuggestList.ignoreclick){setTimeout("_uSuggestList.ignoreclick=null;",10)}};_uSuggestList.casecompare=function(b,a){if(b.toLowerCase()==a.toLowerCase()){return 0}return 1};_uSuggestList.designs={std:{suggest_init:function(b){var a={};$(b.obj).attr("class","x-selectable u-suggedit "+$(b.obj).attr("class"));$(b.top).append('<div class="u-sugglist" style="zoom:1"><div style="zoom:1"><table border="0" cellspacing="0" class="x-unselectable u-suggcont" width="100%"></table></div></div>');a.list=$(b.top).find(".u-sugglist")[0];a.content=$(b.top).find(".u-suggcont")[0];$(b.top).find("div,span,table").andSelf().attr("unselectable","on");return a},append_row:function(a,g,d,f,c){var i=a.parts.content.insertRow(-1),h=a.props.haveDataId?1:0,e;if(c){$(i).bind("mousedown",a._ignoreevent)}else{$(i).bind("mousedown",a,a._onrowmousedown).bind("mousemove",a,a._onrowmousemove).bind("mouseover",a,a._onrowmouseover)}$(i).addClass("u-suggrow").attr("usuggeststr",g[h]);if(a.props.haveDataId){$(i).attr("usuggestid",g[0])}e=String(g[h]);if(e.toLowerCase().substr(0,f.length)==f.toLowerCase()){e='<span class="u-suggmark">'+e.substr(0,f.length)+"</span>"+e.substr(f.length)}for(var b=0;b<d;b++){$(i).append("<td unselectable='on' class='u-suggcell"+b+"'>"+(b==0?e:g[b+h])+"</td>")}},update_row:function(h,g,e,f,d){var a=h.props.haveDataId?1:0,b,c;$(g).attr("usuggeststr",e[a]);if(h.props.haveDataId){$(g).attr("usuggestid",e[0])}b=String(e[a]);if(b.toLowerCase().substr(0,d.length)==d.toLowerCase()){b='<span class="u-suggmark">'+b.substr(0,d.length)+"</span>"+b.substr(d.length)}if(g.cells.length==f){for(c=0;c<f;c++){g.cells[c].innerHTML=c==0?b:e[c+a]}}else{for(c=0;c<cells.length;c++){g.deleteCell(0)}for(c=0;c<f;c++){$(g).append("<td unselectable='on' class='u-suggcell"+c+"'>"+(c==0?b:e[c+a])+"</td>")}}},_select:function(b,a){$(a).addClass("u-suggrowhl")},_deselect:function(b,a){$(a).removeClass("u-suggrowhl")}}};_uSuggestList.prototype={queryCache:[],destroy:function(){with(this){if(destroyed){return}destroyed=1;if(top){$(top).remove()}if(obj){$(obj).unbind()}if(hideTimer){clearTimeout(hideTimer)}if(remoteReqTimer){clearTimeout(remoteReqTimer)}if(AJAXTimer){clearTimeout(AJAXTimer)}try{if(AJAXObj){AJAXObj.abort()}}catch(e){}_uSuggestList.all[idx]=null;for(var i in this){if(i!="destroyed"&&i!="idx"&&typeof i!="function"){this[i]=null}}}},onsubmitform:function(a){if(this.visible){if(this.resultInput!=""){if(!props.preserveonout){_setvalue_sep(userInput);dataid=props.emptyDataId}else{setValue(_getvalue_sep(),dataid)}}this.hide()}},hide:function(){with(this){top.style.display="none";visible=false;if(hlRow){design._deselect(this,hlRow)}hlRow=null;hlIndex=-1}},show:function(){with(this){if(!visible&&numItems()>0){var w=obj.offsetWidth,x,y,off,offp;off=$(obj).offset();offp=$(parent).offset();offp.left+=(parseInt(jQuery.curCSS(parent,"borderLeftWidth",true),10)||0)-$(parent).scrollLeft();offp.top+=(parseInt(jQuery.curCSS(parent,"borderTopWidth",true),10)||0)-$(parent).scrollTop();$(top).css({left:off.left-offp.left+"px",top:off.top-offp.top+obj.offsetHeight+"px",width:w+"px"});if(frame){$(frame).css({width:w+"px"})}top.style.display="block";visible=true;blockMouseOver=true}}},numItems:function(){return this.parts.content?this.parts.content.rows.length:0},onblur:function(e){with(this){if(visible){if(hlIndex>=0){if(!props.preserveonout){_setvalue_sep(userInput);dataid=props.emptyDataId}else{setValue(_getvalue_sep(),dataid)}}hide()}}},onfocus:function(e){with(this){if(props.showalways){procRequest(_getvalue_sep())}}},select:function(){with(this){if(props.onselect){props.onselect.call(props.app,obj.value,dataid,this)}}},onkeydown:function(e){with(this){var c=e.keyCode;if(c==27&&visible){if(resultInput!=""){_setvalue_sep(userInput);dataid=props.emptyDataId}hide();return false}if(resultInput==""&&!props.showalways){return}if(c==13&&hlIndex>=0&&visible){if(dataobj){dataobj.value=dataid}userInput=_getvalue_sep();previousInput=obj.value;resetRequest(userInput);hide();if(userInput!=resultInput){clearResult()}obj.focus();if(props.onchange){props.onchange.call(props.app,obj.value,dataid,this)}if(props.onselect){props.onselect.call(props.app,obj.value,dataid,this)}e.preventDefault();e.stopPropagation();return false}if(isDownKey(c)){moveSelection(hlIndex+1);return false}if(isUpKey(c)){moveSelection(hlIndex-1);return false}}},onkeyup:function(e){with(this){if(ignoreInput!=""&&_getvalue_sep()==ignoreInput){return}if(obj.value==previousInput){return}ignoreInput=resultInput="";previousInput=obj.value;userInput=_getvalue_sep();dataid=props.emptyDataId;if(dataobj){dataobj.value=dataid}if(hideTimer){clearTimeout(hideTimer)}hideTimer=setTimeout("var c=_uSuggestList.all["+idx+"];if(c){var f=0;if(c.visible)f=1;c.clearResult(1);if(c.props.showalways && f)c._appendCurrent();}",200);procRequest(userInput);if(props.onchange){props.onchange.call(props.app,obj.value,props.emptyDataId,this)}}},setValue:function(v,id){with(this){if(typeof id=="undefined"||id==null){id=props.emptyDataId}userInput=previousInput=obj.value=v;ignoreInput=resultInput="";dataid=id;if(dataobj){dataobj.value=id}if(hideTimer){clearTimeout(hideTimer)}hideTimer=null;clearResult();if(props.onchange){props.onchange.call(props.app,obj.value,id,this)}}},_setvalue_sep:function(v){with(this){if(sep_pos>=0){obj.value=obj.value.substr(0,sep_pos)+props.separator+" "+v}else{obj.value=v}}},_getvalue_sep:function(){with(this){if(props.separator){sep_pos=obj.value.lastIndexOf(props.separator)}if(sep_pos>=0){var t=obj.value.substr(sep_pos+props.separator.length);t=t.replace(/^\s+/,"");return t}else{return obj.value}}},moveSelection:function(newi){with(this){if(resultInput==""&&ignoreInput!=""&&_getvalue_sep()==ignoreInput){procRequest(ignoreInput,true);return}if(!visible&&resultInput.length>0&&resultInput==_getvalue_sep()){show();return}if(!visible){return}if(hlRow){design._deselect(this,hlRow)}hlRow=null;var cnt=numItems();if(props.showalways){if(!cnt||userInput.length==0){return}if(newi>=cnt){newi=0}else{if(newi<0){newi=cnt-1}}}else{if(newi>=cnt){newi=-1}else{if(newi<-1){newi=cnt-1}}if(newi==-1){hlIndex=-1;_setvalue_sep(userInput);obj.focus();return}}hlIndex=newi;hlRow=parts.content.rows[newi];design._select(this,hlRow);ignoreInput=$(hlRow).attr("usuggeststr");if(props.haveDataId){dataid=$(hlRow).attr("usuggestid")}_setvalue_sep(ignoreInput)}},isUpKey:function(a){return a==38||a==63232},isDownKey:function(a){return a==40||a==63233},resetRequest:function(txt){with(this){if(remoteReqTimer&&requestedInput==txt){return}clearTimeout(remoteReqTimer);remoteReqTimer=null;clearTimeout(AJAXTimer);AJAXTimer=null;try{if(AJAXObj){AJAXObj.abort()}AJAXObj=null}catch(e){}}},_appendCurrent:function(){with(this){saIndex=parts.content.rows.length;if(hlRow){design._deselect(this,hlRow)}hlRow=null;if(userInput.length==0){if(props.emptyprompt&&props.emptyprompt.length>0){design.append_row(this,props.haveDataId?[props.emptyDataId,props.emptyprompt]:[props.emptyprompt],1,"",1)}else{saIndex=-1}hlIndex=-1}else{design.append_row(this,props.haveDataId?[props.emptyDataId,userInput]:[userInput],1,userInput);hlIndex=saIndex;hlRow=parts.content.rows[saIndex];design._select(this,hlRow)}show()}},procRequest:function(txt,nopause){with(this){resetRequest(txt);if(txt.length<props.minlen){if(props.showalways){clearResult();if(hideTimer){clearTimeout(hideTimer)}hideTimer=null;_appendCurrent()}else{clearResult(true)}return}if(queryCache[cacheGroup][txt]){setResult(txt,queryCache[cacheGroup][txt]);return}if(props.showalways){if(saIndex>=0){if(hlRow!=parts.content.rows[saIndex]){if(hlRow){design._deselect(this,hlRow)}hlIndex=saIndex;hlRow=parts.content.rows[saIndex];design._select(this,hlRow)}design.update_row(this,hlRow,props.haveDataId?[props.emptyDataId,userInput]:[userInput],1,userInput);show()}else{_appendCurrent()}}AJAXretries=0;if(!props.url){return}requestedInput=txt;if(nopause){remoteRequest()}else{remoteReqTimer=setTimeout("var c=_uSuggestList.all["+this.idx+"];if(c)c.remoteRequest();",200)}}},remoteRequest:function(){with(this){clearTimeout(remoteReqTimer);remoteReqTimer=null;try{if(AJAXObj){AJAXObj.abort()}AJAXObj=null}catch(e){}if(AJAXretries>1){return}clearTimeout(AJAXTimer);AJAXTimer=setTimeout("var c=_uSuggestList.all["+this.idx+"];if(c){c.AJAXretries++;c.remoteRequest();}",12000);AJAXObj=$.ajax({type:"GET",dataType:props.dataType,cache:false,url:props.url,data:{tag:requestedInput},success:new Function("resp","status","var c=_uSuggestList.all["+this.idx+"];if(c)c.parseRequest(resp,status);"),timeout:10000})}},parseRequest:function(resp,status){clearTimeout(this.AJAXTimer);this.AJAXTimer=null;this.AJAXretries=0;var res=[];if(this.props.dataType=="text"){try{res=eval("res="+resp)}catch(e){}}else{res=resp}this.AJAXObj=null;if(!res||res.length<2||res[1]<1||res[1]>10){this.clearResult();return}var n=res[1],idx=0;var data=[];if(this.props.haveDataId){n++}for(var i=2;i<res.length;i+=n,idx++){data[idx]=[];for(var j=0;j<n;j++){data[idx][j]=res[i+j]}}this.queryCache[this.cacheGroup][res[0]]=data;if(res[0]==this._getvalue_sep()){this.setResult(res[0],this.queryCache[this.cacheGroup][res[0]])}},_ignoreevent:function(a){a.preventDefault();a.stopPropagation()},_onrowmousemove:function(a){return a.data.onrowmousemove(a)},_onrowmouseover:function(a){return a.data.onrowmouseover(a)},_onrowmousedown:function(a){a.preventDefault();a.stopPropagation();return a.data.onrowmousedown(a)},onrowmousemove:function(a){if(this.blockMouseOver){this.blockMouseOver=false;this.onrowmouseover(a)}},onrowmouseover:function(e){with(this){if(blockMouseOver){return}if(hlRow){design._deselect(this,hlRow)}hlRow=null;hlIndex=-1;for(var i=0;i<parts.content.rows.length;i++){if(parts.content.rows[i]==e.target||jQuery.inArray(e.target,$(parts.content.rows[i]).find("*"))>=0){hlIndex=i;hlRow=parts.content.rows[i];design._select(this,hlRow);break}}}},onrowmousedown:function(e){with(this){if(numItems()<=0||!hlIndex<0||!hlRow){return}ignoreInput=userInput=$(hlRow).attr("usuggeststr");if(props.haveDataId){dataid=$(hlRow).attr("usuggestid");if(dataobj){dataobj.value=dataid}}_setvalue_sep(userInput);previousInput=obj.value;resetRequest(userInput);hide();if(userInput!=resultInput){clearResult()}obj.focus();if(props.onchange){props.onchange.call(props.app,obj.value,dataid,this)}if(props.onselect){props.onselect.call(props.app,obj.value,dataid,this)}}},setResult:function(phrase,table){with(this){if(hideTimer){clearTimeout(hideTimer)}hideTimer=null;clearResult();hlIndex=-1;hlRow=null;resultInput=phrase;var cnt=table.length,cols,havecurrent=-1;if(!props.showalways){if(cnt<=0){hide();return}cols=table[0].length}else{if(cnt>0){cols=table[0].length}}if(props.haveDataId){cols--}for(var i=0;i<cnt;i++){design.append_row(this,table[i],cols,phrase);if(props.compareFunc){if(props.compareFunc==="nocase"){if(!_uSuggestList.casecompare(table[i][props.haveDataId?1:0],userInput)){havecurrent=i}}else{if(!props.compareFunc(table[i][props.haveDataId?1:0],userInput)){havecurrent=i}}}else{if(table[i][props.haveDataId?1:0]==userInput){havecurrent=i}}}if(props.showalways&&havecurrent<0){_appendCurrent()}else{saIndex=-1;hlIndex=havecurrent;if(hlRow){design._deselect(this,hlRow)}hlRow=havecurrent<0?null:parts.content.rows[hlIndex];design._select(this,hlRow);show()}}},clearResult:function(hide){with(this){if(hide){hide()}resultInput="";hlRow=null;saIndex=hlIndex=-1;while(parts.content.rows.length>0){parts.content.deleteRow(0)}}}};function _uDraggable(e,d,c,b,a){this.par=e;this.x=this.y=this.w=this.h=this.m=0;this.moved=false;this.active=false;this.onmove=d||_uDraggable.dummy;this.oninitdrag=c||_uDraggable.dummy;this.onstartdrag=b||_uDraggable.dummy;this.onstopdrag=a||_uDraggable.dummy;if(!_uDraggable.globalset){_uDraggable.globalset=true;$(document).bind("mouseup",_uDraggable.onmouseup);$(document).bind("mousemove",_uDraggable.onmousemove)}}_uDraggable.dummy=function(){};_uDraggable.obj=null;_uDraggable.clkX=0;_uDraggable.clkY=0;_uDraggable.scrL=0;_uDraggable.scrT=0;_uDraggable.globalset=false;_uDraggable.onmousemove=function(e){with(_uDraggable){var o=obj;if(!o){return}o.event=e;if(typeof(e.which)!="undefined"&&e.which!=1){o.stop();obj=null;return}e.stopPropagation();e.preventDefault();var d=_uWnd.getdims();if(!o.moved&&(e.clientX!=clkX||e.clientY!=clkY)){o.onstartdrag.apply(o.par,[o.x,o.y,o.w,o.h,o.m]);o.moved=true}o.onmove.apply(o.par,[e.clientX-clkX-(scrL-d.clientLeft),e.clientY-clkY-(scrT-d.clientTop),o.x,o.y,o.w,o.h,o.m]);o.event=null;return false}};_uDraggable.onmouseup=function(e){if(e.which!=1){return}with(_uDraggable){var o=obj;if(!o){return}if(o.moved){onmousemove(e)}o.event=e;o.stop();o.event=null;obj=null}};_uDraggable.prototype={start:function(i,b,k,c,f,a){var g=_uDraggable;if(g.obj){g.obj.event=i;g.obj.onstopdrag.apply(g.obj.par);g.obj.event=null}this.x=b;this.y=k;this.w=c;this.h=f;this.m=a;this.active=true;this.moved=false;g.obj=this;var j=_uWnd.getdims();g.clkX=i.clientX;g.clkY=i.clientY;g.scrL=j.clientLeft;g.scrT=j.clientTop;this.event=i;this.oninitdrag.apply(this.par,[b,k,c,f,a])},stop:function(){var a=_uDraggable;if(a.obj==this){a.obj=null}if(this.active){this.onstopdrag.apply(this.par,[this.x,this.y,this.w,this.h,this.m]);this.active=false}}};function _uSlider(c,b,a,f,d){if(a==f){return}if(typeof(c)!="object"){this.slider=$("#"+c)[0]}else{this.slider=c}if(!this.slider){return}this.slider._uslider=this;this.type=b.substr(0,1).toLowerCase()=="v"?"v":"h";this.props=$.extend({step:0,initval:(a+f)/2,disabled:0,minpos:0,maxpos:null,hotspot:null,thispar:null,onchange:null,param:null},d||{});this.disabled=!!this.props.disabled;this.min_value=a;this.max_value=f;this.step=Math.abs(this.props.step);this.value=0;this.min_pos=this.props.minpos;if(this.props.maxpos!=null){this.max_pos=this.props.maxpos}else{var e=this.slider.parentNode;if(e){this.max_pos=this.type=="h"?e.offsetWidth-this.slider.offsetWidth:e.offsetHeight-this.slider.offsetHeight}else{this.max_pos=1}}if(this.props.hotspot!=null){this.hotoff=this.props.hotspot}else{this.hotoff=this.type=="h"?Math.floor(this.slider.offsetWidth/2):Math.floor(this.slider.offsetHeight/2)}if(this.min_pos==this.max_pos){this.max_pos=this.min_pos+1}this.pos=0;this.setValue(this.props.initval);this.drag=new _uDraggable(this,this._ondrag,null,null,this._ondragstop);$(this.slider).unbind("onmousemove mousedown").bind("onmousemove",_uSlider._onmousemove).bind("mousedown",this,_uSlider._onmousedown);if(this.slider.parentNode){$(this.slider.parentNode).unbind("mousedown").bind("mousedown",this,_uSlider._onmousedownparent)}}_uSlider._onmousedownparent=function(c){var d=c.data;if(d.disabled){return}var a=d.type=="h"?c.pageX:c.pageY,f=$(this).offset(),b=d.type=="h"?a-f.left:a-f.top;d.setPos(b-d.hotoff);c.preventDefault()};_uSlider._onmousedown=function(a){var b=a.data;if(b.disabled){return}b.drag.start(a,b.pos)};_uSlider._onmousemove=function(a){a.preventDefault()};_uSlider.prototype={setPos:function(c){if(c<this.min_pos){c=this.min_pos}else{if(c>this.max_pos){c=this.max_pos}}var a=this.min_value<this.max_value?1:-1;var b=(c-this.min_pos)/(this.max_pos-this.min_pos)*(this.max_value-this.min_value)+this.min_value;if(this.step>0){b=Math.round((b-this.min_value)/this.step)*this.step+this.min_value;c=(b-this.min_value)/(this.max_value-this.min_value)*(this.max_pos-this.min_pos)+this.min_pos;c=Math.round(c)}if(b*a<this.min_value*a){b=this.min_value}else{if(b*a>this.max_value*a){b=this.max_value}}if(b!=this.value){this.pos=c;if(this.type=="h"){this.slider.style.left=this.pos+"px"}else{this.slider.style.top=this.pos+"px"}this.value=b;if(this.props.onchange){this.props.onchange.call(this.props.thispar,this.value,this.props.param,this)}}},_ondrag:function(b,a,c){if(this.disabled){return}this.setPos(c+b)},setValue:function(b){var a=this.min_value<this.max_value?1:-1;if(b*a<this.min_value*a||b*a>this.max_value*a){return}if(this.step>0){b=Math.round((b-this.min_value)/this.step)*this.step+this.min_value;if(b*a<this.min_value*a){b=this.min_value}else{if(b*a>this.max_value*a){b=this.max_value}}}var c=(b-this.min_value)/(this.max_value-this.min_value)*(this.max_pos-this.min_pos)+this.min_pos;this.pos=Math.round(c);if(this.type=="h"){this.slider.style.left=this.pos+"px"}else{this.slider.style.top=this.pos+"px"}this.value=b;if(!this.disabled&&this.props.onchange){this.props.onchange.call(this.props.thispar,this.value,this.props.param,this)}}};_uSlider.buildH=function(c,a){var b=$.extend({w:124,lw:0,limg:"",limgcss:"",rw:0,rimg:null,rimgcss:"",title:"",ch:20,cw:120,cimg:"/img/d/sldBg.gif",cimgcss:"no-repeat 0 10px",simg:"/img/d/sld.gif",simgcss:"no-repeat 0 0",sh:20,sw:9,st:2},a||{});if(String(b.w).indexOf("%")<0&&String(b.w).toLowerCase().indexOf("px")<0){b.w+="px"}return'<table border="0" cellpadding="1" cellspacing="1" style="width:'+b.w+'"><tr>'+(b.lw>0?'<td width="'+b.lw+'" '+(b.limg||b.limgcss?'style="background:'+(b.limg?"url("+b.limg+") ":"")+b.limgcss+'"':"")+"></td>":"")+"<td><div"+(b.title?' title="'+b.title+'"':"")+' style="height:'+b.ch+"px;width:"+b.cw+"px"+(b.cimg||b.cimgcss?";background:"+(b.cimg?"url("+b.cimg+") ":"")+b.cimgcss:"")+'"><div unselectable="on" id="'+c+'" style="cursor:pointer;-moz-user-select:none;height:'+b.sh+"px; width:"+b.sw+"px; position:relative; top:"+b.st+"px"+(b.simg||b.simgcss?";background:"+(b.simg?"url("+b.simg+") ":"")+b.simgcss:"")+'"></div></div></td>'+(b.rw>0?'<td width="'+b.rw+'" '+(b.rimg||b.rimgcss?'style="background:'+(b.rimg?"url("+b.rimg+") ":"")+b.rimgcss+'"':"")+"></td>":"")+"</tr></table>"};function _uTabCtrl(b,e,a,f,h,j){this.constructor=_uTabCtrl;this.name=b;this.ntabs=e;this.props=$.extend({parentnode:null,wnd:null,app:a&&a.wnd&&a.wnd.app||null,width:"auto",height:"auto",min_height:50,active_tab:-1,align:"left",close:0,design:"std",noinit:false,notabs:false,markload:'<div align="left"><div class="myWinLoad"></div></div>',emptycontent:"",onload:null,onshow:null,onhide:null,onerror:null,onbeforechange:null,onchange:null,onbeforeclose:null,onclose:null,ondestroy:null,onresize:null,rtl:0},a||{});this.app=this.props.app;this.state={init:false,destroyed:false};this.design=this.props.design&&_uTabCtrl.designs[this.props.design]?_uTabCtrl.designs[this.props.design]:_uTabCtrl.designs.std;this.idx=_uTabCtrl.nextidx++;_uTabCtrl.all[this.idx]=this;this.width=parseInt(this.props.width)||0;this.height=parseInt(this.props.height)||0;this.data=[];this.pend_show=null;this.decor={cdw:0,cdh:0,pdw:0,pdh:0,ph:0};this.maxid=0;this.wnd=null;this.scrollpos={tabswidth:0,havewidth:0,pos:null};for(var g=0;g<e;g++){var d=(j&&j[g])||{};var c=d.id||"";if(!c||c.length==0){c="_tc"+this.idx+"tb"+(this.maxid++)}this.data[g]={id:c,title:(f&&f[g])||".",dat:(h&&h[g])||"",footer:d.footerc||null,footerh:d.footerh&&d.footerh>0?d.footerh:0,header:d.headerc||null,headerh:d.headerh&&d.headerh>0?d.headerh:0,footercont:null,headercont:null,cont:null,ismarkload:0,iserrorload:0,markloadcont:null,obj:null,ishidden:d.hidden,clbut:null,link:null,href:d.href,target:d.target,label:null,align:d.align==undefined?this.props.align:d.align,close:d.close==undefined?this.props.close:d.close,icon:d.icon,iconstyle:d.iconstyle,markload:d.markload,firstload:0,firstshow:0,xmlobj:null,xmlobj_ignoreabort:0,onload:d.onload==undefined?this.props.onload:d.onload,onerror:d.onerror==undefined?this.props.onerror:d.onerror,onshow:d.onshow==undefined?this.props.onshow:d.onshow,onhide:d.onhide==undefined?this.props.onhide:d.onhide,onbeforechange:d.onbeforechange==undefined?this.props.onbeforechange:d.onbeforechange,onchange:d.onchange==undefined?this.props.onchange:d.onchange,onbeforeclose:d.onbeforeclose==undefined?this.props.onbeforeclose:d.onbeforeclose,onclose:d.onclose==undefined?this.props.onclose:d.onclose}}this.active_tab=this.props.active_tab=="auto"?"auto":this.idxbyid(this.props.active_tab);this.sesupdate=0;if(!_uTabCtrl.globalset){_uTabCtrl.globalset=true}this.butdown=new _uDraggable(this,null,null,null,function(i,k){this.design._onbuttonup(this,i,k)});if(!this.props.noinit){this.init()}}_uTabCtrl.all=[];_uTabCtrl.nextidx=1;_uTabCtrl.globalset=false;_uTabCtrl.getbyname=function(c){var b=this.all,e=parseInt(c);if(!isNaN(e)&&String(e)==String(c)){return b[e]||null}for(var d=0;d<b.length;d++){if(b[d]&&b[d].name==c){return b[d]}}return null};_uTabCtrl.findparentcontent=function(b){var a=$(b).parents(".u-tabc-content,.u-tabc-header,.u-tabc-footer")[0];return a};_uTabCtrl.closeTab=function(c,a){var b=this.getbyname(c);if(b){b.closeTab(a)}};_uTabCtrl.content=function(d,a,e){var b=this.getbyname(d);if(b){b.content(a,e)}};_uTabCtrl.headerheight=function(c,a,d){var b=this.getbyname(c);if(b){b.headerheight(a,d)}};_uTabCtrl.footerheight=function(c,a,d){var b=this.getbyname(c);if(b){b.footerheight(a,d)}};_uTabCtrl.setTitle=function(c,a,d){var b=this.getbyname(c);if(b){b.setTitle(a,d)}};_uTabCtrl.designs={std:{content_class:"u-tabc-content",header_class:"u-tabc-header",footer_class:"u-tabc-footer",tabctrl_init:function(b){var a={};$(b.top).attr("class","x-unselectable u-tabc").html((b.props.notabs?"":'<div class="u-tabc-p"><div class="u-tabc-listp"><div class="u-tabc-list"></div><div class="u-tabc-pbot"></div></div><div class="u-tabc-scrbut"><div class="u-tabc-tabl"><div class="u-tabc-label"><div class="u-tabc-scrl"></div><div class="u-tabc-scrr"></div></div></div></div></div>')+'<div class="u-tabc-body"><div class="u-tabc-content" style="height:'+b.props.min_height+'px">'+b.props.emptycontent+"</div></div>");if(!b.props.notabs){a.pane=$(b.top).find(".u-tabc-p")[0];a.panebot=$(b.top).find(".u-tabc-pbot")[0];a.listp=$(b.top).find(".u-tabc-listp")[0];a.list=$(b.top).find(".u-tabc-list")[0];a.scrbut=$(b.top).find(".u-tabc-scrbut")[0];a.scrl=$(b.top).find(".u-tabc-scrl")[0];a.scrr=$(b.top).find(".u-tabc-scrr")[0];$(a.scrl).bind("click mousedown mouseover mouseout",{obj:b,but:0},_uTabCtrl._onscrbutevent);$(a.scrr).bind("click mousedown mouseover mouseout",{obj:b,but:1},_uTabCtrl._onscrbutevent)}a.body=$(b.top).find(".u-tabc-body")[0];a.emptycontent=a.content=$(b.top).find(".u-tabc-content")[0];$(b.top).find("div,span").andSelf().attr("unselectable","on");return a},remove_item:function(b,a){if(b.props.notabs){return}b.parts.list.removeChild(b.data[a].obj)},set_title:function(b,a){if(b.props.notabs){return}$(b.data[a].label).html((b.data[a].icon?'<img class="u-tabc-icon" border="0" src="'+b.data[a].icon+'">':($.browser.msie&&$.browser.version<8?'<img class="u-tabc-spacer" src="/img/1px.gif" width="1" height="1" border="0">':""))+b.data[a].title)},insert_item:function(e,c){if(e.props.notabs){return}var d=document.createElement("div"),b;if(e.data[c].icon){b='<img class="u-tabc-icon" border="0" src="'+e.data[c].icon+'">'}else{if(e.data[c].iconstyle){b='<div class="u-tabc-icon" style="background:'+e.data[c].iconstyle+'"></div>'}else{b=$.browser.msie&&$.browser.version<8?'<img class="u-tabc-spacer" src="/img/1px.gif" width="1" height="1" border="0">':""}}$(d).attr("class","u-tabc-tab"+(e.data[c].close?" u-tabc-wcl":"")).html((e.data[c].href?"<a "+(e.data[c].target?'target="'+e.data[c].target+'" ':"")+'href="'+e.data[c].href+'" class="u-tabc-tabl" style="display:block">':'<div class="u-tabc-tabl">')+(e.data[c].close?'<div class="u-tabc-closebut"></div>':"")+'<div class="u-tabc-tabr"><div class="u-tabc-label">'+b+e.data[c].title+"</div></div>"+(e.data[c].href?"</a>":"</div>"));e.data[c].obj=d;e.data[c].label=$(d).find(".u-tabc-label")[0];e.data[c].link=$(d).find(".u-tabc-tabl")[0];if(e.data[c].close){e.data[c].clbut=$(d).find(".u-tabc-closebut")[0];$(e.data[c].clbut).bind("mouseover",this._onclbutmouseover).bind("mouseout",this._onclbutmouseout).bind("click",{obj:e,tab:e.data[c]},_uTabCtrl._onclbutclick).bind("mousedown",{obj:e,tab:e.data[c]},_uTabCtrl._onclbutdown)}$(e.data[c].link).bind("mouseover",this._ontabmouseover).bind("mouseout",this._ontabmouseout).bind("mousedown",{obj:e,tab:e.data[c]},_uTabCtrl._ontabclick);$(d).find("div,span,a,img").andSelf().attr("unselectable","on");if(e.data[c].ishidden){d.style.display="none"}var f=e.parts.list.childNodes.length;e.parts.list.insertBefore(d,c>=f?null:e.parts.list.childNodes[c])},_ontabmouseover:function(a){$(this.parentNode).addClass("u-tabc-tab-over")},_ontabmouseout:function(a){$(this.parentNode).removeClass("u-tabc-tab-over")},_onclbutmouseover:function(a){$(this).addClass("u-tabc-closebut-over")},_onclbutmouseout:function(a){$(this).removeClass("u-tabc-closebut-over")},_onclbutmousedown:function(a,c){if(c){$(a).addClass("u-tabc-closebut-down")}else{$(a).removeClass("u-tabc-closebut-down")}},_ontabactivate:function(b,a){if(b.props.notabs){return}$(b.data[a].obj).addClass("u-tabc-tab-act")},_ontabdeactivate:function(b,a){if(b.props.notabs){return}$(b.data[a].obj).removeClass("u-tabc-tab-act")},_onscrbutactivate:function(c,a,b){if(b){$(!a?c.parts.scrl:c.parts.scrr).removeClass("u-tabc-scr-dis")}else{$(!a?c.parts.scrl:c.parts.scrr).addClass("u-tabc-scr-dis")}},_onscrbutover:function(e,c,d){var a=!c?e.parts.scrl:e.parts.scrr;if(d){$(a).addClass("u-tabc-scr-over")}else{$(a).removeClass("u-tabc-scr-over")}},_onscrbutdown:function(e,c,d){var a=!c?e.parts.scrl:e.parts.scrr;if(d){$(a).addClass("u-tabc-scr-down")}else{$(a).removeClass("u-tabc-scr-down")}},_onbuttonup:function(c,a,b){if(a<2){this._onscrbutdown(c,a,0)}else{this._onclbutmousedown(b.clbut,0)}}}};_uTabCtrl._onclbutdown=function(a){if(a.which==1){a.stopPropagation();a.data.obj.design._onclbutmousedown(a.data.tab.clbut,1);a.data.obj.butdown.start(a,2,a.data.tab)}_uWnd.globalmousedown()};_uTabCtrl._onscrbutevent=function(b){var c=b.data.obj,a=b.data.but;if(b.type=="click"&&b.which==1){c.scrollTabPane(a?40:-40)}else{if(b.type=="mouseover"){c.design._onscrbutover(c,a,1)}else{if(b.type=="mouseout"){c.design._onscrbutover(c,a,0)}else{if(b.type=="mousedown"&&b.which==1){c.design._onscrbutdown(c,a,1);c.butdown.start(b,a)}}}}};_uTabCtrl._onclbutclick=function(b){var f=b.data,c=f.obj;for(var a=0;a<c.data.length;a++){if(c.data[a]==f.tab){if(typeof c.data[a].onbeforeclose=="function"){if(!c.data[a].onbeforeclose.call(c.app,c,a,c.data[a].id)){break}}c.closeTab(a);break}}b.preventDefault();b.stopPropagation()};_uTabCtrl._ontabclick=function(b){var f=b.data,c=f.obj;b.preventDefault();for(var a=0;a<c.data.length;a++){if(c.data[a]==b.data.tab){if(a==c.active_tab){return}if(typeof c.data[a].onbeforechange=="function"){if(!c.data[a].onbeforechange.call(c.app,c,a,c.data[a].id)){break}}c.activateTab(a);break}}};_uTabCtrl.prototype={saveSession:function(){this.sesupdate=0;return{tab:this.active_tab}},init:function(a){var b=document.createElement("div");b.id="_utabctrl"+this.idx;if(this.props.parentnode){this.props.parentnode.appendChild(b)}else{if(this.props.wnd){var c=this.props.wnd.parts.wndcont;while(c.firstChild){c.removeChild(c.firstChild)}c.appendChild(b);this.wnd=this.props.wnd;this.wnd.tabctrl=this;this.wnd.state.loaded=true}else{$($("body")[0]).append(b)}}this.top=b;$(b).css({visibility:"hidden",display:"block"});if(this.width>0){$(b).css("width",this.width+"px")}this.parts=this.design.tabctrl_init(this);this.parts.markloadcont=null;this.parts.headercontent=null;this.parts.footercontent=null;this.show();if(!a){setTimeout("var m=_uTabCtrl.all["+this.idx+"];if(m)m.init1();",10)}},init1:function(g){var a=this.parts,h=this.decor;if(!(this.width>0)){this.width=this.top.offsetWidth}if(!(this.height>0)){this.height=this.top.offsetHeight}h.cdw=this.top.offsetWidth-a.content.offsetWidth;h.cdh=this.top.offsetHeight-a.content.offsetHeight;if(this.props.notabs){h.pdw=0}else{h.pdw=this.top.offsetWidth-a.listp.offsetWidth}h.hh=0;h.fh=0;if(!this.props.wnd&&!g){$(this.top).css("height",this.height+"px");$(a.content).css({width:(this.top.offsetWidth-h.cdw)+"px",height:(this.top.offsetHeight-h.cdh)+"px"});if(!this.props.notabs){$(a.listp).css({width:(this.top.offsetWidth-h.pdw)+"px"})}}if(!this.props.notabs){$(a.listp).css({overflow:"hidden"});$(a.panebot).css("width","4000px");$(a.list).css("width","4000px");for(var f=0;f<this.ntabs;f++){this.design.insert_item(this,f)}}if(this.props.wnd){this.resizeTo(this.props.wnd.width-this.props.wnd.decor.w,this.props.wnd.height-this.props.wnd.decor.h)}this.state.init=true;var b=this.active_tab;this.active_tab=-1;if(b=="auto"){if(this.name&&this.name.length>0&&self.location.hash.length>1){var l=self.location.hash.substr(1).split(";");var m="T_"+this.name+"=";for(var k=0;k<l.length;k++){if(l[k].length>m.length&&l[k].substr(0,m.length)==m){var e=this.idxbyid(l[k].substr(m.length));if(e>=0&&e<this.data.length){b=e;break}}}}else{b=-1}}$(this.top).css("display","block").css("visibility","");if(b==-1&&this.data.length>0){b=0}if(b>=0&&b<this.ntabs){for(var f=0;f<this.ntabs;f++){var c=(b+f)%this.ntabs;if(!this.data[c].ishidden&&(!this.data[c].onbeforechange||!!this.data[c].onbeforechange(this,c,this.data[c].id))){this.activateTab(c,true);break}}}else{this.activateTab(-1,true)}$(this.top).css("display","none").css("visibility","");if(this.pend_show){this.show(this.pend_show[0])}if(this.props.wnd){this.props.wnd.onexternalload()}},scrollTabPane:function(b){if(this.props.notabs){return}var e=this.scrollpos.pos+=b;var a=this.scrollpos.tabswidth,d=this.scrollpos.havewidth;if(a<d){this.design._onscrbutactivate(this,0,0);this.design._onscrbutactivate(this,1,0);if((this.props.rtl||window._rtl)&&this.data.length>0){e=this.data[this.data.length-1].obj.offsetLeft+d-a}else{e=0}this.scrollpos.pos=e;this.parts.listp.scrollLeft=e}else{if(this.props.rtl||window._rtl){var c=this.data[this.data.length-1].obj.offsetLeft;if(e<c){e=c}else{if(e>c+a-d){e=c+a-d}}}else{if(e<0){e=0}else{if(e>a-d){e=a-d}}}this.scrollpos.pos=e;this.parts.listp.scrollLeft=e;if(e>0){this.design._onscrbutactivate(this,0,1)}else{this.design._onscrbutactivate(this,0,0)}if(e<a-d){this.design._onscrbutactivate(this,1,1)}else{this.design._onscrbutactivate(this,1,0)}}},_setscrolls:function(b){if(!this.state.init||this.props.notabs){return}var a=0,e=this.parts.listp.offsetWidth;if(this.parts.listp.clientWidth>0&&this.parts.listp.clientWidth<e){e=this.parts.listp.clientWidth}if(this.data.length>0){var d=this.data[this.data.length-1].obj;if(this.props.rtl||window._rtl){var c=this.data[0].obj;a=c.offsetLeft+c.offsetWidth-d.offsetLeft}else{a=d.offsetLeft+d.offsetWidth}}if(e<a){this.parts.scrbut.style.display="block";e-=this.parts.scrbut.offsetWidth}else{this.parts.scrbut.style.display="none"}if(this.scrollpos.pos==null){if((this.props.rtl||window._rtl)&&this.data.length>0){this.scrollpos.pos=this.data[this.data.length-1].obj.offsetLeft+a-e}else{this.scrollpos.pos=0}}else{if(this.scrollpos.havewidth!=e){if(this.props.rtl||window._rtl){this.scrollpos.pos+=this.scrollpos.havewidth-e}}}this.scrollpos.havewidth=e;this.scrollpos.tabswidth=a;if(e<a&&b&&this.active_tab>=0&&this.active_tab<this.data.length){if(!this.props.rtl&&!window._rtl){d=this.data[this.active_tab].obj;if(d.offsetLeft<this.scrollpos.pos){this.scrollTabPane(d.offsetLeft-this.scrollpos.pos)}else{if(d.offsetLeft+d.offsetWidth>this.scrollpos.pos+e){this.scrollTabPane(d.offsetLeft+d.offsetWidth-(this.scrollpos.pos+e))}}}}this.scrollTabPane(0)},show:function(a){if(!this.state.init){this.pend_show=[a];return}$(this.top).show();this.state.visible=true},resizeTo:function(w,h){var d=this.decor;with(this){width=w;height=h;$(top).width(w).height(h);$(parts.content).css({width:(w-d.cdw)+"px",height:(h-d.cdh-d.fh-d.hh)+"px"});if(parts.headercontent){$(parts.headercontent).css({width:(w-d.cdw)+"px",height:d.hh+"px"})}if(parts.footercontent){$(parts.footercontent).css({width:(w-d.cdw)+"px",height:d.fh+"px"})}if(!props.notabs){$(parts.listp).css({width:(w-d.pdw)+"px"})}if(props.onresize){props.onresize.call(app,w-d.cdw,h-d.cdh,this,name)}_setscrolls()}},addTab:function(g,e,f,a){var c=a!=undefined&&a>=0&&a<this.data.length?a:this.data.length;var b=f||{};var h=b.id||"";if(!h||h.length==0){h="_tc"+this.idx+"tb"+(this.maxid++)}var d={id:h,title:g||".",dat:e||"",footer:b.footerc||null,footerh:b.footerh&&b.footerh>0?b.footerh:0,header:b.headerc||null,headerh:b.headerh&&b.headerh>0?b.headerh:0,footercont:null,headercont:null,cont:null,ismarkload:0,iserrorload:0,markloadcont:null,obj:null,ishidden:b.hidden,clbut:null,link:null,href:b.href,target:b.target,label:null,align:b.align==undefined?this.props.align:b.align,close:b.close==undefined?this.props.close:b.close,icon:b.icon,iconstyle:b.iconstyle,markload:b.markload,firstload:0,firstshow:0,xmlobj:null,xmlobj_ignoreabort:0,onload:b.onload==undefined?this.props.onload:b.onload,onerror:b.onerror==undefined?this.props.onerror:b.onerror,onshow:b.onshow==undefined?this.props.onshow:b.onshow,onhide:b.onhide==undefined?this.props.onhide:b.onhide,onbeforechange:b.onbeforechange==undefined?this.props.onbeforechange:b.onbeforechange,onchange:b.onchange==undefined?this.props.onchange:b.onchange,onbeforeclose:b.onbeforeclose==undefined?this.props.onbeforeclose:b.onbeforeclose,onclose:b.onclose==undefined?this.props.onclose:b.onclose};if(c<this.data.length){this.data.splice(c,0,d)}else{this.data[c]=d}this.design.insert_item(this,c);this._setscrolls();return c},tabHidden:function(b,d){if(this.props.notabs){return}b=this.idxbyid(b);if(b<0||b>=this.data.length){return}var c=this.data[b];c.obj.style.display=d?"none":"";c.ishidden=!!d;this._setscrolls()},activateTab:function(a,b){a=this.idxbyid(a);if(!this.state.init){this.active_tab=a;return 1}if(a<0||a>=this.data.length||this.active_tab==a){if(b&&this.data.length>0){a=0}else{return 0}}this.design._ontabactivate(this,a);if(this.active_tab>=0&&this.active_tab<this.data.length){if(typeof this.data[this.active_tab].onhide=="function"){this.data[this.active_tab].onhide.call(this.app,this,this.active_tab,this.data[this.active_tab].id)}if(document.activeElement&&document.activeElement!=document.body&&document.activeElement.blur&&$(document.activeElement,this.data[this.active_tab].cont)[0]){document.activeElement.blur()}this.design._ontabdeactivate(this,this.active_tab)}this.active_tab=a;this._setscrolls(1);if(!b){this.sesupdate=1}this.data[a].firstshow=1;if(typeof this.data[a].onchange=="function"){if(!this.data[a].onchange.call(this.app,this,a,this.data[a].id)){return 1}}this.load(a);return 1},closeTab:function(a){if(!this.state.init){return}a=this.idxbyid(a);if(a<0||a>=this.data.length){return}if(this.data[a].xmlobj){this.data[a].xmlobj_ignoreabort=1;this.data[a].xmlobj.abort();this.data[a].xmlobj=null}if(a==this.active_tab&&typeof this.data[a].onhide=="function"){this.data[a].onhide.call(this.app,this,a,this.data[a].id)}this.design.remove_item(this,a);var c=this.data[a].id;var b=this.data[a].onclose;this.data.splice(a,1);if(a==this.active_tab){this.active_tab=-1;if(a==this.data.length){if(a==0){this._assign_content(-1)}else{this.activateTab(a-1)}}else{this.activateTab(a)}}else{if(a<this.active_tab){this.active_tab--}}this._setscrolls();if(b){b(this,a,c)}},setTitle:function(a,b){a=this.idxbyid(a);if(a<0||a>=this.data.length){return}this.data[a].title=b;this.design.set_title(this,a);this._setscrolls()},headerheight:function(b,a){b=this.idxbyid(b);if(b<0||b>=this.data.length){return}if(typeof(a)!="number"||isNaN(a)){return}this.data[b].headerh=a},footerheight:function(b,a){b=this.idxbyid(b);if(b<0||b>=this.data.length){return}if(typeof(a)!="number"||isNaN(a)){return}this.data[b].footerh=a},content:function(a,f,d,b,e){a=this.idxbyid(a);if(a<0||a>=this.data.length){return}if(this.data[a].xmlobj){this.data[a].xmlobj_ignoreabort=1;this.data[a].xmlobj.abort();this.data[a].xmlobj=null}if((typeof(d)=="undefined"||d==null)){if(!this.data[a].headercont){if(this.data[a].header){d=this.data[a].header}else{d=""}}else{d=null}}if((typeof(b)=="undefined"||b==null)){if(!this.data[a].footercont){if(this.data[a].footer){b=this.data[a].footer}else{b=""}}else{b=null}}if((typeof(f)=="undefined"||f==null)){if(!this.data[a].cont){f=""}else{f=null}}if(!this.data[a].cont){this.data[a].cont=document.createElement("DIV");$(this.data[a].cont).addClass(this.design.content_class).css("text-align",this.data[a].align)}if(f!=null){$(this.data[a].cont).html(f);this.data[a].firstload=e?0:1;this.data[a].ismarkload=0;this.data[a].iserrorload=e?1:0}if(d||d==null){if(!this.data[a].headercont){this.data[a].headercont=document.createElement("DIV");$(this.data[a].headercont).attr("class",this.design.content_class+" "+this.design.header_class).css("overflow","hidden").css("text-align",this.data[a].align)}if(d){$(this.data[a].headercont).html(d)}}else{if(this.data[a].headercont){$(this.data[a].headercont).html("")}}if(b||b==null){if(!this.data[a].footercont){this.data[a].footercont=document.createElement("DIV");$(this.data[a].footercont).attr("class",this.design.content_class+" "+this.design.footer_class).css("overflow","hidden").css("text-align",this.data[a].align)}if(b){$(this.data[a].footercont).html(b)}}else{if(this.data[a].footercont){$(this.data[a].footercont).html("")}}if(a==this.active_tab){this._assign_content(a)}},_assign_content:function(c){var b=0,f=0,d;if(c<0){this.parts.content=this.parts.emptycontent;this.parts.headercontent=this.parts.footercontent=null}else{if(this.data[c].ismarkload){this.parts.content=this.data[c].markloadcont;this.parts.headercontent=this.parts.footercontent=null}else{this.parts.content=this.data[c].cont;this.parts.headercontent=this.data[c].headercont;f=this.data[c].headerh;this.parts.footercontent=this.data[c].footercont;b=this.data[c].footerh}}d=0;if(this.parts.headercontent){$(this.parts.headercontent).css({width:(this.width-this.decor.cdw)+"px",height:f+"px"});if(this.parts.body.childNodes[d]){this.parts.body.replaceChild(this.parts.headercontent,this.parts.body.childNodes[d])}else{this.parts.body.appendChild(this.parts.headercontent)}this.decor.hh=f;d++}else{this.decor.hh=0}$(this.parts.content).css({width:(this.width-this.decor.cdw)+"px",height:(this.height-this.decor.cdh-b-f)+"px"});if(this.parts.body.childNodes[d]){this.parts.body.replaceChild(this.parts.content,this.parts.body.childNodes[d])}else{this.parts.body.appendChild(this.parts.content)}d++;if(this.parts.footercontent){$(this.parts.footercontent).css({width:(this.width-this.decor.cdw)+"px",height:b+"px"});if(this.parts.body.childNodes[d]){this.parts.body.replaceChild(this.parts.footercontent,this.parts.body.childNodes[d])}else{this.parts.body.appendChild(this.parts.footercontent)}this.decor.fh=b;d++}else{this.decor.fh=0}while(this.parts.body.childNodes[d]){this.parts.body.removeChild(this.parts.body.childNodes[d])}if(c>=0&&!this.data[c].ismarkload){if(typeof this.data[c].onload=="function"&&this.data[c].firstload){var a,h;try{for(a=10,h=arguments.callee.caller;a>=0;a--){if(!h||h.caller==arguments.callee){break}else{h=h.caller}}}catch(g){}if(!h||a<0){this.data[c].onload.call(this.app,this,c,this.data[c].id,this.parts.content,this.parts.headercontent,this.parts.footercontent)}}if(typeof this.data[c].onshow=="function"&&(this.data[c].firstshow||this.data[c].firstload)){this.data[c].onshow.call(this.app,this.data[c].iserrorload,this,c,this.data[c].id,this.parts.content,this.parts.headercontent,this.parts.footercontent)}this.data[c].firstshow=0}if(c>=0){this.data[c].firstload=0}},markload:function(a){a=this.idxbyid(a);if(a<0||a>=this.data.length){return}var b;if(this.data[a].markload){if(!this.data[a].markloadcont){this.data[a].markloadcont=document.createElement("DIV");$(this.data[a].markloadcont).addClass("u-tabc-content").html(this.data[a].markload)}}else{if(!this.parts.markloadcont){this.parts.markloadcont=document.createElement("DIV");$(this.parts.markloadcont).addClass("u-tabc-content").html(this.props.markload)}this.data[a].markloadcont=this.parts.markloadcont}this.data[a].ismarkload=1;this.data[a].iserrorload=0;if(a==this.active_tab){this._assign_content(a)}},idxbyid:function(b){if(this.state.destroyed){return -1}if(typeof b=="string"){for(var a=0;a<this.data.length;a++){if(this.data[a].id==b){return a}}return -1}else{return b}},findintab:function(a,c){a=this.idxbyid(a);if(a<0||a>=this.data.length){return $([])}var b=$(this.data[a].iserrorload?[]:this.data[a].cont);if(this.data[a].headercont){b=b.add(this.data[a].headercont)}if(this.data[a].footercont){b=b.add(this.data[a].footercont)}if(!c){return b}return b.find(c)},load:function(a,b,d){a=this.idxbyid(a);if(a<0||a>=this.data.length){return}if(this.data[a].cont!=null&&!b){if(a==this.active_tab){this._assign_content(a)}return}if(b===-1){this.data[a].cont=null;if(a!=this.active_tab){return}}if(!b&&this.data[a].xmlobj){return}if(this.data[a].xmlobj){this.data[a].xmlobj_ignoreabort=1;this.data[a].xmlobj.abort();this.data[a].xmlobj=null}var g;if(b&&b!==true&&b!==1&&b!==-1){if(!d){this.data[a].dat=b}g=b}else{g=this.data[a].dat}if(typeof(g)=="string"){this.content(a,g,this.data[a].header,this.data[a].footer)}else{if(typeof g=="function"){this.content(a,g(),this.data[a].header,this.data[a].footer)}else{if(typeof g=="object"){this.markload(a);if(this.app&&!("app" in g)){g.app=this.app.pid}if(this.wnd&&!("wnd" in g)){g.wnd=this.wnd.idx}g.tabctrl=this.idx;g.tabid=a;if(!_uTabCtrl._onAjaxComplete){_uTabCtrl._onAjaxComplete=function(h,e){var c=_uTabCtrl.all[this.tabctrl];if(c){c._oncomplete(h,e,this)}}}if(g.complete!=_uTabCtrl._onAjaxComplete){g.prev_complete_utabctrl=g.complete;g.complete=_uTabCtrl._onAjaxComplete}if(!_uTabCtrl._onAjaxBeforeSend){_uTabCtrl._onAjaxBeforeSend=function(h){var e=_uTabCtrl.all[this.tabctrl];if(e){var c=e.idxbyid(this.tabid);if(c>=0&&c<e.data.length){e.data[c].xmlobj=h;e.data[c].xmlobj_ignoreabort=0}if(this.prev_beforeSend_utabctrl){this.prev_beforeSend_utabctrl.call(this,h)}}}}if(g.beforeSend!=_uTabCtrl._onAjaxBeforeSend){g.prev_beforeSend_utabctrl=g.beforeSend;g.beforeSend=_uTabCtrl._onAjaxBeforeSend}if(!g.success&&g.xml===false){g.dataType="text";if(!_uTabCtrl._onAjaxSuccess){_uTabCtrl._onAjaxSuccess=function(h,e){var c=_uTabCtrl.all[this.tabctrl];if(c){c.content(this.tabid,h)}}}g.success=_uTabCtrl._onAjaxSuccess}try{if(g.form&&(g.form.length>0||g.form.nodeType)){_uPostForm(g.form,g)}else{if(g.url){_uAjaxRequest(g.url,g)}}}catch(f){this.data[a].xmlobj=null;this._onerror(this.data[a].id,null,"",f,g)}}}}return true},_oncomplete:function(c,b,d){var a=this.idxbyid(d.tabid);if(a<0||a>=this.data.length){return}this.data[a].xmlobj=null;if(d.prev_complete_utabctrl){d.prev_complete_utabctrl.call(d,c,b)}},_onerror:function(g,c,b,f,d){var a=this.idxbyid(g);if(a<0||a>=this.data.length){return}if((b=="abort"||b=="aborted")&&(!this.data[a].xmlobj||this.data[a].xmlobj_ignoreabort)){return}var e=this.data[a].onerror||this.props.onerror;if(e&&typeof(e)=="function"){e.apply(this.app,[g,c,b,f,d])}else{this.content(a,_txt("ErrorLoadTab",this.idx,a),null,null,1)}},destroy:function(){if(this.state.destroyed){return}this.data.splice(0,this.data.length);this.parts=null;if(this.top.parentNode){this.top.parentNode.removeChild(this.top)}this.top=null;if(this.wnd&&this.wnd.tabctrl==this){this.wnd.tabctrl=null}this.state.destroyed=true;_uTabCtrl.all[this.idx]=null;if(this.props.ondestroy){this.props.ondestroy(this,this.name)}}};function _uWnd(b,g,c,h,a,f,e,d){if(b&&b.length>0){var i=_uWnd.getbyname(b);if(i){if(a&&a.attachobj){i.attachTo(a.attachobj,a.attachtype,a.attachdx,a.attachdy)}if(i.props.reloadonnew){i.reload(f)}else{i.show()}return false}}this.constructor=_uWnd;this.desktop=this.opts&&this.opts.desktop||_uWnd.defdesktop;this.props=$.extend({parent:null,popup:0,alert:0,closeonesc:a.popup?1:0,nohide:0,reloadonnew:a.attachobj?0:1,x:"auto",y:"auto",attachobj:null,attachdx:0,attachdy:0,attachtype:null,initstate:null,headerh:0,headerc:null,hideheader:1,footerh:0,footerc:null,hidefooter:1,contentsizeprio:a.footerh>0||a.headerh>0?1:0,nomove:a.attachobj?1:0,hideonmove:1,center:a.modal?1:0,session:null,hidden:0,modal:0,toolwindow:0,resize:a.toolwindow||a.attachobj?0:1,fixed:_uWnd.defdesktop||a.desktop?0:1,minh:50,minw:0,maxh:0,maxw:0,autosize:a.toolwindow||a.attachobj?0:1,autosizestep:a.autosizestep>=1?a.autosizestep:10,autosizestepmult:a.autosizestepmult>0?a.autosizestepmult:1,autosizestepmultmult:1,autosizewidth:0,autosizeonimages:0,waitimages:0,hideonresize:0,hidehonresize:a.hideonresize,hidefonresize:a.hideonresize,havesysmenu:_uWnd.havesysmenu,attachicon:null,attachicontype:"",attachicondelta:2,attachiconact:"hide",icon:"",incostyle:null,header:g?1:0,min:this.desktop&&!(a.notaskbar||a.parent||a.toolwindow||a.alert||a.modal||a.attachobj)?1:0,max:this.desktop&&!a.modal&&!a.attachobj?1:0,close:1,customButtons:null,notaskbar:a.parent||a.toolwindow||a.alert||a.modal||a.attachobj?1:0,align:"center",shadow:a.toolwindow?0:1,design:"std",topclass:null,gridclass:"myWinGrid",fadetype:a.toolwindow||a.modal||a.attachobj?0:1,fadespeed:800,fadeclosetype:a.toolwindow||a.modal||a.attachobj?0:1,fadeclosespeed:250,havemenu:e?1:0,menuopts:null,trayicon:null,traymenu:null,actlayer:0,markload:'<div align="left"><div class="myWinLoad"></div></div>',havegrid:0,markwaitcont:'<div class="myWinLoad"></div>',markwaitclass:"myWinGrid",oninit:null,oncontent:null,onafterimgload:null,onposchange:null,onactivate:null,ondeactivate:null,onerror:null,onbeforeclose:null,onclose:null,desktop:null,notabdestroy:0},a||{});if(this.props.modal||this.props.toolwindow){this.props.min=0}if(this.props.toolwindow){this.props.max=0}if(this.props.session){this.props.x=this.props.session.x;this.props.y=this.props.session.y}this.modalparent=this.props.parent&&((this.props.parent.props.modal&&!this.props.parent.props.parent)||this.props.parent.modalparent)?1:0;$.extend(this,{name:b,title:g?g:"",letsize:1,width:c&&Math.abs(c)>10?c:-300,height:h&&Math.abs(h)>10?h:-200,headerh:this.props.headerc&&this.props.headerh>=0?this.props.headerh:0,footerh:this.props.footerc&&this.props.footerh>=0?this.props.footerh:0,decor:{w:0,h:0,th:0},_content:f,state:{visible:false,prevvisible:false,minimized:false,maximized:false,loaded:false,init:false,disabled:false,grided:false,noshadow:false,resizing:false,destroyed:false,focused:false},xmlobj:null,xmlobj_ignoreabort:0,grid:null,frame:null,sh:null,sh_sz:[4,2],xpos:0,ypos:0,zpos:this.props.modal||this.props.alert||this.modalparent?_uWnd.getModalTopZ():_uWnd.getTopZ(),_drag:new _uDraggable(this,this._ondragmousemove,null,this.onstartdrag,this.onstopdrag),_resize:new _uDraggable(this,this._onrsmousemove,null,this.onstartrs,this.onstoprs),restRect:null,minheight:this.props.minh,minwidth:this.props.minw,maxheight:this.props.maxh,maxwidth:this.props.maxw,pend_show:null,autosz:{active:false},imgloader:{timer:null,active:false},menu:null,app:d||null,savedfocus:null,childs:[],nchilds:0,tabctrl:null,attachicon:"",sesupdate:0});this.design=this.props.design&&_uWnd.designs[this.props.design]||_uWnd.designs.std;this.idx=_uWnd.nextidx++;_uWnd.all[this.idx]=this;this._focus=new _uFocus({type:0,owner:this,thispar:this,parent:this.props.parent&&this.props.toolwindow?this.props.parent._focus:(this.app&&this.app._focus?this.app._focus:null),onkeydown:this._onkeydown,onkeypress:this._onkeypress,onactivate:this._onactivate,ondeactivate:this._ondeactivate,canactivate:this._canactivate});this.havefixed=1;if(!_uWnd.globalset){_uWnd.globalset=true;$(document).bind("mousedown",_uWnd.closepopup);$(window).bind("scroll",_uWnd._onscroll);$(window).bind("resize",_uWnd._onresize);_uWnd.sysmenu=new _uMENU("",{align:"D"},{hidden:1,withmarks:1,onitem:_uWnd._onsysmenuitem},_uWnd.sysmenuitems)}this.init(e)}_uWnd.all={};_uWnd.nextidx=1;_uWnd.zchilds=[];_uWnd.lastz=0;_uWnd.zstep=2;_uWnd.minz=10000;_uWnd.maxz=20000;_uWnd.lastmodalz=0;_uWnd.minmodalz=21000;_uWnd.maxmodalz=25000;_uWnd.globalset=false;_uWnd.defdesktop=null;_uWnd.ignoreclick=null;_uWnd.findactive=function(){var a=_uFocus.current;while(a){if(a.owner&&a.owner.constructor==_uWnd){return a}a=a._parent}return null};_uWnd.globalmousedown_queue=[];_uWnd.globalmousedown=function(c){c=c||0;if((c&1)==0){_uMENU.hideallmenus()}if((c&4)==0){_uSuggestList.hideall()}if((c&8)==0){_uComboBox.hideall()}if((c&2)==0){_uWnd.closepopup()}for(var b=_uWnd.globalmousedown_queue.length-1;b>=0;b--){var a=_uWnd.globalmousedown_queue[b];a.func.call(a.thispar,a.param)}};_uWnd.addglobalmousedownhandler=function(a,b,c){if(typeof(a)!="function"){return}_uWnd.globalmousedown_queue.push({func:a,thispar:b||null,param:c||null})};_uWnd.removeglobalmousedownhandler=function(c,d,e){if(typeof(c)!="function"){return}d=d||null;e=e||null;for(var b=_uWnd.globalmousedown_queue.length-1;b>=0;b--){var a=_uWnd.globalmousedown_queue[b];if(a.func==c&&a.thispar==d&&a.param==e){_uWnd.globalmousedown_queue.splice(b,1)}}};_uWnd.messageBoxclose=function(b,a){var c=b.props._msgdata;if(!c.retval){c.retval=c.defc}if(c.onsel){c.onsel.call(c.app,c.retval,c.param,b)}};_uWnd.messageBox=function(j,n,m,c,a,f,e){var l=$.extend({w:"auto",h:"auto",name:"",modal:1,closeonesc:1,align:"center",min:0,max:0,close:1,fadetype:0,fadeclosetype:0,resize:0,autosize:0},a||{});var k={onsel:c,app:e,param:f};l._msgdata=k;l.onclose=_uWnd.messageBoxclose;l.oncontent=_uWnd.messageBoxoncont;var h,g,o;g={ok:1,yes:1,no:1,retry:1,cancel:1};k.buts=[];k.def=null;k.defc=null;if(!m||m.constructor!=Array){m=["ok"]}for(h=0;h<m.length;h++){if(typeof m[h]=="string"){k.buts.push({id:m[h],t:(g[m[h]]?_txt(m[h]):m[h])})}else{if(typeof m[h]=="object"&&m[h].id){k.buts.push({id:m[h].id,t:m[h].t||(g[m[h].id]?_txt(m[h].id):m[h].id),def:m[h].def})}}}if(k.buts.length==0){return 0}o=0;for(h=0;h<k.buts.length;h++){o+=60;if(k.buts[h].def){if(k.buts[h].def&1){k.def=k.buts[h].id;if(typeof(k.buts[h].style)=="undefined"){k.buts[h].style=0}}if(k.buts[h].def&2){k.defc=k.buts[h].id}}}if(!k.def){k.def=k.buts[0].id;if(typeof(k.buts[0].style)=="undefined"){k.buts[0].style=0}}if(!k.defc){k.defc=k.buts[k.buts.length-1].id}k.txt=j;return new _uWnd(l.name||"",n,!l.w||l.w=="auto"?-(o+50):l.w,!l.h||l.h=="auto"?-100:l.h,l,_uWnd.messageBoxcont,null,e)};_uWnd.messageBoxoncont=function(a,f){var e=a.props._msgdata,b;b=$(a.parts.wndcont).find("#_uw"+a.idx+"msg"+e.def)[0];if(b){b.focus()}};_uWnd.messageBoxcont=function(b){var a,e,c;e=b.props._msgdata;a="";for(c=0;c<e.buts.length;c++){a+="<td>"+_uButton("","b",{style:typeof(e.buts[c].style)=="undefined"?1:e.buts[c].style,text:e.buts[c].t,content:'onclick="var w=_uWnd.all['+b.idx+"];if(w){w.props._msgdata.retval='"+encodeHtmlVal(e.buts[c].id)+"';w.close()}\"",id:"_uw"+b.idx+"msg"+e.buts[c].id})+"</td>"}return'<div style="padding:20px 10px 10px 10px">'+e.txt+'</div><div style="padding:0px 10px 10px 10px"><table align="center" callpadding="0" cellspacing="10" border="0"><tr>'+a+"</tr></table></div>"};_uWnd.alerts=null;_uWnd.alert=function(e,k,a,c){a=$.extend({w:150,h:100,tm:5000,shadow:0,close:1,align:"center",icon:"",iconstyle:null,name:"",pad:null},a||{});if(a.pad){e='<div style="padding:'+a.pad+'">'+e+"</div>"}var h,j,i,g,b,f;if(!(h=_uWnd.defdesktop)){h=_uWnd.getdims();j=h.clientW-a.w-5;g=h.clientH-a.h-5;b=_uWnd.alerts;f=0;h=null}else{j=h.width-h.calcexclude(1)-a.w-5;g=h.height-h.calcexclude(3)-a.h-5;b=h.alerts;f=h.calcexclude(2)}i=g;if(b){if(b.y-(a.h+5)>=0){i=b.y-(a.h+5)}while(b){if(b.y>f){f=b.y}b=b.prev}if(f>0&&g-f>=a.h+5){i=g}}var l=new _uWnd(a.name,k,a.w,a.h,{close:a.close,min:0,max:0,icon:a.icon,iconstyle:a.iconstyle,align:a.align,x:j,y:i,alert:1,autosize:0,fixed:1,shadow:a.shadow,resize:0,nomove:1,hidden:0,notaskbar:1,fadetype:2,fadespeed:500,fadeclosetype:2,fadeclosespeed:500,onclose:function(m,d){_uWnd.rmalert(m,d)}},e,null,c);if(!h){_uWnd.alerts={prev:_uWnd.alerts,wnd:l,y:i}}else{h.alerts={prev:h.alerts,wnd:l,y:i}}if(a.tm>0){setTimeout("var w=_uWnd.all["+l.idx+"];if(w)w.close();",a.tm)}return l};_uWnd.rmalert=function(d,b){var c=d.desktop?d.desktop.alerts:_uWnd.alerts,e=null;while(c&&c.wnd!==d){e=c;c=c.prev}if(c&&c.wnd===d){if(e){e.prev=c.prev}else{if(d.desktop){d.desktop.alerts=c.prev}else{_uWnd.alerts=c.prev}}}};_uWnd._onscroll=function(f){if(!$.browser.msie){return}var g=_uWnd.getdims(),b=_uWnd.all;for(var c in b){if(b[c]){if((b[c].props.fixed||b[c].grid)&&!b[c].havefixed){b[c].moveTo(b[c].xpos,b[c].ypos)}}}};_uWnd._onresize=function(g,f){var h=_uWnd.getdims(),b=_uWnd.all;for(var c in b){if(b[c]){if((!f&&!b[c].desktop)||b[c].desktop==f){b[c]._onresize(h)}}}};_uWnd.closepopup=function(){var b=_uWnd.all;for(var c in b){if(b[c]&&b[c].props.popup&&_uWnd.ignoreclick!=b[c]){b[c].closeevent()}}if(_uWnd.ignoreclick){setTimeout("_uWnd.ignoreclick=null;",10)}};_uWnd.findparent=function(a){var b=a;while(b&&b!=document.body){if(b.id&&b.id.indexOf&&b.id.indexOf("_uwndTop")==0&&b._uwndobj){return b._uwndobj}b=b.parentNode}return null};_uWnd.getbyname=function(d){var c=this.all,b=parseInt(d);if(!isNaN(b)&&String(b)==String(d)){return c[b]||null}for(var e in c){if(c[e]&&c[e].name==d){return c[e]}}return null};_uWnd.getTopZ=function(nc,ignw){if(!nc){nc=0}with(_uWnd){var z=lastz;if(z<minz){z=minz}else{z+=zstep}if(z+(1+nc)*zstep>maxz){var x=minz;var ar=[];for(var i in all){if(all[i]&&all[i]!=ignw&&all[i].props&&!all[i].props.parent&&!(all[i].props.modal||all[i].props.alert||all[i].modalparent)){ar[ar.length]=all[i]}}for(var i=0;i<zchilds.length;i++){if(zchilds[i]){ar[ar.length]=zchilds[i]}}ar.sort(function(a,b){return a.zpos-b.zpos});for(var i=0;i<ar.length;i++){ar[i].setZ(x);x+=zstep*(1+(ar[i].nchilds?ar[i].nchilds:0))}z=x}lastz=z+(1+nc)*zstep;return z}};_uWnd.getModalTopZ=function(nc,ignw){if(!nc){nc=0}with(_uWnd){var z=lastmodalz;if(z<minmodalz){z=minmodalz}else{z+=zstep}if(z+(1+nc)*zstep>maxmodalz){var x=minmodalz;var ar=[];for(var i in all){if(all[i]&&all[i]!=ignw&&all[i].props&&!all[i].props.parent&&(all[i].props.modal||all[i].props.alert||all[i].modalparent)){ar[ar.length]=all[i]}}ar.sort(function(a,b){return a.zpos-b.zpos});for(var i=0;i<ar.length;i++){ar[i].setZ(x);x+=zstep*(1+(ar[i].nchilds?ar[i].nchilds:0))}z=x}lastmodalz=z+(1+nc)*zstep;return z}};_uWnd.getdims=function(){var b=document;var a="";return{clientW:$(window).width(),clientH:$(window).height(),clientLeft:$(b).scrollLeft(),clientTop:$(b).scrollTop(),docW:$(b).width(),docH:$(b).height()}};_uWnd.csize=function(c,a){if(a!="width"&&a!="height"){return 0}var e,d=a=="width"?["Left","Right"]:["Top","Bottom"];e=a=="width"?c.offsetWidth:c.offsetHeight;var f=0,b=0;jQuery.each(d,function(){f+=parseFloat(jQuery.curCSS(c,"padding"+this,true))||0;b+=parseFloat(jQuery.curCSS(c,"border"+this+"Width",true))||0});e-=Math.round(f+b);return Math.max(0,e)};_uWnd.close=function(b){var a=_uWnd.getbyname(b);if(a){a.close()}};_uWnd.content=function(b,d){var a=_uWnd.getbyname(b);if(a){a.content(d)}};_uWnd.header=function(b,d){var a=_uWnd.getbyname(b);if(a){a.header(d)}};_uWnd.footer=function(b,d){var a=_uWnd.getbyname(b);if(a){a.footer(d)}};_uWnd.headerheight=function(b,c){var a=_uWnd.getbyname(b);if(a){a.headerheight(c)}};_uWnd.footerheight=function(b,c){var a=_uWnd.getbyname(b);if(a){a.footerheight(c)}};_uWnd.reload=function(b,d){var a=_uWnd.getbyname(b);if(a){a.reload(d)}};_uWnd.setTitle=function(b,c){var a=_uWnd.getbyname(b);if(a){a.setTitle(c)}};_uWnd.activatetopwnd=function(e){var d=0,f=null,b=_uWnd.all;for(var c in b){if(!b[c]||(e&&b[c].desktop!=e)||!b[c].state.visible||b[c].state.minimized||b[c].props.alert){continue}if(b[c].zpos>d){d=b[c].zpos;f=b[c]}}if(f){f.activate()}else{if(e){e.activate()}}};_uWnd.havesysmenu=0;_uWnd.sysmenu=null;_uWnd.sysmenuitems=[[_txt("Restore"),null,"rest"],[_txt("Minimize"),null,"min"],[_txt("Maximize"),null,"max"],"sep",[_txt("Close"),null,"close"]];_uWnd._onsysmenuitem=function(b,a,d){var c=a.forwnd;if(!c){return}switch(d){case"rest":if(c.state.minimized&&c.ontaskbar){c.desktop.wndlist.design.animatewndrestore(c.desktop.wndlist,c)}else{c.restore(1)}break;case"min":c.minimize();break;case"max":if(c.state.minimized&&c.ontaskbar){c.desktop.wndlist.design.animatewndmaximize(c.desktop.wndlist,c)}else{c.maximize(1)}break;case"close":c.closeevent();break}};_uWnd.designs={std:{sh_sz:[4,2],altcloseclass:"xt-close2",altmaxiclass:"xt-maxi2",altrestclass:"xt-rest2",shadow_init:function(c){var b=[];for(var a=0;a<3;a++){b[a]=document.createElement("div");c.appendChild(b[a]);$(b[a]).attr("class","x-sh").css({position:"absolute",zIndex:1})}$(b[0]).addClass("xsl").css({width:(this.sh_sz[0]+this.sh_sz[1])+"px",left:(-this.sh_sz[0])+"px",top:"0px"}).html('<div class="xstl"><div class="xsml"></div></div>');$(b[1]).addClass("xsr").css({width:(this.sh_sz[0]+this.sh_sz[1])+"px",top:"0px"}).html('<div class="xstr"><div class="xsmr"></div></div>');$(b[2]).addClass("xsb").css({height:(this.sh_sz[0]+this.sh_sz[1])+"px",left:(-this.sh_sz[0])+"px"}).html('<div class="xsbl"><div class="xsbr"><div class="xsbc"></div></div></div>');return b},shadow_resize:function(b,a,c){$(b[0]).css({height:(c-this.sh_sz[1])+"px"});$(b[1]).css({height:(c-this.sh_sz[1])+"px",left:(a-this.sh_sz[1])+"px"});$(b[2]).css({width:(a+this.sh_sz[0]*2)+"px",top:(c-this.sh_sz[1])+"px"})},shadow_hide:function(a){$(a[0]).add(a[1]).add(a[2]).hide()},shadow_show:function(a){$(a[0]).add(a[1]).add(a[2]).show()},custButMargin:5,wnd_init:function(d,e,q,k,b,l,m,j,c){$(e).addClass("xw-plain").addClass("x-unselectable");if(d.props.alert){$(e).addClass("xw-active")}if(j){$(e).addClass("xw-resize")}var g="";if(d.props.customButtons){for(var f in d.props.customButtons){g+='<div class="xt xt-'+f+'"></div>'}}$(e).html('<div class="xw-disabled" style="display:none;overflow:hidden;position:absolute;z-index:30010"></div>'+(l?'<div class="xw-tl"><div class="xw-tr"><div class="xw-tc"><div class="xw-sps"></div><div class="xw-hdr"><div class="xt xt-close"></div><div class="xt xt-maxi"></div><div class="xt xt-rest"></div><div class="xt xt-mini"></div>'+g+(m?'<img unselectable="on" onmousedown="return false;" class="xw-icon x-unselectable" src="'+m+'">':(d.props.iconstyle?'<div unselectable="on" onmousedown="return false;" class="xw-icon x-unselectable" style="background:'+d.props.iconstyle+'"></div>':""))+'<span class="xw-hdr-text">'+q+"</span></div></div></div></div>":'<div class="xw-tl"><div class="xw-tr"><div class="xw-tc xw-tsps"></div></div></div>')+'<div class="xw-ml"><div class="xw-mr"><div class="xw-mc">'+(c?'<div class="u-wndmenufr"><div class="u-wndmenu" style="position:relative"></div></div>':"")+'<div class="xw-body">'+(d.props.havegrid?'<div class="'+d.props.markwaitclass+'" style="display:none;overflow:hidden;position:absolute;z-index:30000"></div>':"")+(d.props.headerc?'<div class="myWinCont myWinHeader" style="overflow:hidden;height:'+d.headerh+'px"></div>':"")+(d.props.actlayer?'<div class="xw-actlayer" style="overflow:hidden;position:absolute;z-index:30005"></div>':"")+'<div style="overflow:scroll;height:'+b+'px"><div class="myWinCont" style="display:none;overflow:hidden"'+(k?' align="'+k+'"':"")+'></div><div class="myWinCont" style="overflow:hidden"'+(k?' align="'+k+'"':"")+"></div></div>"+(d.props.footerc?'<div class="myWinCont myWinFooter" style="overflow:hidden;height:'+d.footerh+'px"></div>':"")+'</div></div></div></div><div class="xw-bl"><div class="xw-br"><div class="xw-bc"></div></div></div><div class="xw-blank" style="display:none"></div>');var a={},n=0;if(d.props.attachicon){$(d.top).append('<div class="xw-attachicon" style="display:none;position:absolute;z-index:3"></div>');a.attachicon=$(d.top).find(".xw-attachicon")[0]}a.markdis=$(e).find(".xw-disabled")[0];a.actlayer=$(e).find(".xw-actlayer")[0];a.wndmove=$(e).find(".xw-blank")[0];a.upper=$(e).find(".xw-tl")[0];a.center=$(e).find(".xw-ml")[0];a.bottom=$(e).find(".xw-bl")[0];a.bottomc=$(e).find(".xw-bc")[0];$(e).find(".xw-mc").bind("mousedown",d,_uWnd._activateonmousedown);if(d.props.headerc){a.headercont=$(e).find(".myWinCont")[n];$(a.headercont).html(d.props.headerc);n++}a.markload=$(e).find(".myWinCont")[n];$(a.markload).html(d.props.markload);a.wndcont=$(e).find(".myWinCont")[n+1];if(d.props.footerc){a.footercont=$(e).find(".myWinCont")[n+2];$(a.footercont).html(d.props.footerc)}if(d.props.havegrid){a.markwait=$(e).find("."+d.props.markwaitclass)[0];$(a.markwait).html(d.props.markwaitcont)}a.hwndcont=a.wndcont.parentNode;if(l){a.hdr=$(e).find(".xw-hdr")[0];a.htitle=$(e).find(".xw-hdr-text")[0];var h={cbut:"xt-close",mbut:"xt-mini",xbut:"xt-maxi",rbut:"xt-rest",icon:"xw-icon"};for(var f in h){a[f]=$(a.hdr).find("."+h[f])[0]}a.custom={};for(var f in d.props.customButtons){a.custom[f]=$(a.hdr).find(".xt-"+f)[0]}}else{a.hdr=a.htitle=a.cbut=a.mbut=a.xbut=a.rbut=a.icon=null}if(c){a.menu=$(e).find(".u-wndmenu")[0]}else{a.menu=null}$(e).find("div,span").andSelf().attr("unselectable","on");return a},onstartautosz:function(a){a.parts.wndcont.style.overflow="hidden";a.parts.wndcont.style.height="auto"},onstopautosz:function(b,a){if(!a){b.parts.hwndcont.style.visibility="";if(b.parts.headercont&&b.props.hidehonresize){b.parts.headercont.style.visibility=""}if(b.parts.footercont&&b.props.hidefonresize){b.parts.footercont.style.visibility=""}}b.parts.wndcont.style.overflow="auto";b.parts.wndcont.style.height="100%"},get_szbuts:function(c){var a={nw:"xw-tl",n:"xw-sps",ne:"xw-tr",w:"xw-ml",e:"xw-mr",sw:"xw-bl",s:"xw-bc",se:"xw-br"};for(var b in a){a[b]=$(c).find("."+a[b])[0]}if(!a.n){a.n=$(c).find(".xw-tsps")[0]}return a},onbuttonover:function(b){var a=b.data.cls;if(b.data.state){$(this).addClass(a+"-over")}else{$(this).removeClass(a+"-over")}},onstartdrag:function(a){$(a.top).addClass("xw-dragging");if(!a.state.minimized&&a.props.hideonmove){a.hideSh();$(a.parts.center).add(a.parts.bottom).hide();$(a.parts.wndmove).css("width",a.width+"px").css("height",(a.height-a.decor.th)+"px").show()}},onstopdrag:function(a){$(a.top).removeClass("xw-dragging");if(!a.state.minimized&&a.props.hideonmove){a.showSh();$(a.parts.center).add(a.parts.bottom).show();$(a.parts.wndmove).hide()}},ondisable:function(b,a){if(!a){$(b.parts.markdis).hide();if(b.state.focused||b.props.alert){$(b.wnd).addClass("xw-active")}}else{$(b.parts.markdis).css("width",Math.abs(b.width)+"px").css("height",Math.abs(b.height)+"px").show();$(b.wnd).removeClass("xw-active")}},onfocus:function(b,a){if(a&&!b.state.disabled){$(b.wnd).addClass("xw-active")}else{$(b.wnd).removeClass("xw-active")}},onstartresize:function(a){},onstopresize:function(a){},onminimize:function(a){$(a.parts.center).css("display","none");$(a.parts.bottomc).addClass("xw-bcm");a.hideSh()},onrestore:function(a){$(a.parts.bottomc).removeClass("xw-bcm");$(a.parts.center).css("display","block");a.showSh()}}};_uWnd.prototype={showsysmenu:function(b,d){this.activate();var a=_uWnd.sysmenu,c;if(!a){return}if((c=a.indexById("rest"))>=0){if((this.state.minimized&&(this.props.max||this.state.beforemin!="max"))||(this.props.max&&this.state.maximized)){$(a.parts.elems[c]).removeClass("u-graymenuitem");a.elems[c][1]=null}else{$(a.parts.elems[c]).addClass("u-graymenuitem");a.elems[c][1]=1}}if((c=a.indexById("min"))>=0){if(this.props.min&&!this.state.minimized){$(a.parts.elems[c]).removeClass("u-graymenuitem");a.elems[c][1]=null}else{$(a.parts.elems[c]).addClass("u-graymenuitem");a.elems[c][1]=1}}if((c=a.indexById("max"))>=0){if((this.props.max||(this.state.minimized&&this.state.beforemin=="max"))&&!this.state.maximized){$(a.parts.elems[c]).removeClass("u-graymenuitem");a.elems[c][1]=null}else{$(a.parts.elems[c]).addClass("u-graymenuitem");a.elems[c][1]=1}}a.forwnd=this;if(this.props.popup){_uWnd.ignoreclick=this}_uWnd.globalmousedown();a.show({pos:{x:b,y:d},parentfocus:this._focus})},_foreachchild:function(b,d){var e;for(var a=0;a<this.childs.length;a++){e=this.childs[a];if(!e||e.state.destroyed){continue}if(d){e._foreachchild(b,d);b.call(this,e)}else{if(!b.call(this,e)){e._foreachchild(b,d)}}}},showattachicon:function(g){if(this.state.destroyed){return}var f=this.props.attachicon,b,d=this.parts.attachicon,a=this.props.attachicondelta,e={lt:"l",lb:"l",rt:"r",rb:"r",tl:"t",tr:"t",bl:"b",br:"b"},c={lt:"h",lb:"h",rt:"h",rb:"h",tl:"v",tr:"v",bl:"v",br:"v"};if(!this.parts.attachicon){return}if(arguments.length>0){if(g&&f){b=typeof(f)=="object"?f[g]:f;if(!b){b=f[e[g]];if(!b){b=f[c[g]]}}}if(!b||!g){this.parts.attachicon.style.display="none";return}}else{g=this.attachicon;if(!g){return}}if(this.attachicon!=g){$(d).html(b)}if(c[g]=="h"){if(g=="lt"||g=="rt"){$(d).css({top:0,bottom:""})}else{$(d).css({bottom:(-this.height)+"px",top:""})}if(e[g]=="l"){$(d).css({left:"",right:(-a)+"px"})}else{$(d).css({right:"",left:(this.width-a)+"px"})}}else{if(g=="tl"||g=="bl"){$(d).css({right:"",left:0+"px"})}else{$(d).css({left:"",right:(-this.width)+"px"})}if(e[g]=="t"){$(d).css({bottom:(-a)+"px",top:""})}else{$(d).css({top:(this.height-a)+"px",bottom:""})}}if(!this.attachicon){this.parts.attachicon.style.display=""}this.attachicon=g},setZ:function(z){with(this){if(state.destroyed){return}zpos=z;var c;for(var i=0;i<this.childs.length;i++){c=this.childs[i];if(!c||c.state.destroyed){continue}z+=_uWnd.zstep;c.setZ(z);z+=_uWnd.zstep*c.nchilds}$(top).css("z-index",zpos);if(grid){$(grid).css("z-index",zpos-1)}}},saveSession:function(){var a;if(this.state.maximized||this.state.minimized){a=this.restRect}else{a=[this.xpos,this.ypos,this.width,this.height]}return{x:a[0],y:a[1],w:a[2]-this.decor.w,h:a[3]-this.decor.h,bm:this.state.minimized?this.state.beforemin:"",s:this.state.maximized?"max":(this.state.minimized?"min":"")};this.sesupdate=false},attachTo:function(q,t,p,o){if(this.state.destroyed){return}var A,j,g,r,C,n,m,z,B,h,e,b,s,u,f,c,l,v,w,k;if(q&&q.nodeType||(q[0]&&q[0].nodeType)){if(q.nodeType){A=q}else{A=q[0]}j=$(A).offset();g=A.offsetWidth;r=A.offsetHeight}else{if(q&&q.length==2){j={left:q[0],top:q[1]};g=r=0}else{return}}z=_uWnd.getdims();B=z.clientW;h=z.clientH;e=z.clientLeft;b=z.clientTop;t=t||"rt";p=p||0;o=o||0;if(this.desktop){z=this.desktop;B=z.width;h=z.height;e=0;b=0}if(this.props.fixed){e=b=0}if(t.length==1){if(t.toLowerCase()=="u"||t.toLowerCase()=="d"){t+="r"}else{t+="t"}}if(window._rtl){t=t.replace(/[lLrR]/g,function(a){if(a=="l"){return"r"}if(a=="L"){return"R"}if(a=="r"){return"l"}if(a=="R"){return"L"}})}s=t.substr(0,1);c=j.left+g+p;f=j.left-p-this.width;v=j.top+r+o;l=j.top-o-this.height;n=c;w="l";m=j.top-o;k="t";if(s=="l"){n=f;w="r"}else{if(s=="r"){n=c;w="l"}else{if(s=="L"&&f-e<1&&e-f>c-e+this.width-B){n=c;w="l"}else{if(s=="R"&&c-e+this.width>B-3&&e-f<c-e+this.width-B){n=f;w="r"}else{if(s=="u"){m=l;w="b"}else{if(s=="d"){m=v;w="t"}else{if(s=="U"&&l-b<1&&b-l>v-b+this.height-h){m=v;w="t"}else{if(s=="D"&&v-b+this.height>h-3&&b-l<v-b+this.height-h){m=l;w="b"}}}}}}}}s=t.substr(1,1);c=j.left+g-this.width+p;f=j.left-p;v=j.top+r+-this.height+o;l=j.top-o;if(s=="l"){n=f;k="l"}else{if(s=="r"){n=c;k="r"}else{if(s=="L"&&f-e<1&&e-f>c-e+this.width-B){n=c;k="r"}else{if(s=="R"&&c-e+this.width>B-3&&e-f<c-e+this.width-B){n=f;k="l"}else{if(s=="t"){m=l;k="t"}else{if(s=="b"){m=v;k="b"}else{if(s=="T"&&l-b<1&&b-l>v-b+this.height-h){m=v;k="b"}else{if(s=="B"&&v-b+this.height>h-3&&b-l<v-b+this.height-h){m=l;k="t"}}}}}}}}this.showattachicon(w+k);if(n!=this.xpos||m!=this.ypos){this.moveTo(n,m)}},moveTo:function(_x,_y,nopos){if(this.state.destroyed){return}var d=_uWnd.getdims();with(this){if(_x=="auto"&&_y=="auto"&&desktop&&!props.fixed&&!props.autosize&&!props.center){var p=desktop.getwndcoord(width,height);_x=p.x;_y=p.y}else{if(_x=="auto"){if(props.parent){_x=Math.floor((props.parent.width-width)/2)+props.parent.xpos}else{if(desktop&&!props.fixed){_x=Math.floor((desktop.calcwidth()-width)/2)+desktop.calcexclude(0)}else{_x=Math.floor((d.clientW-width)/2)+(props.fixed?0:d.clientLeft)}}if(_x<0){_x=0}}if(_y=="auto"){if(props.parent){_y=Math.floor((props.parent.height-height)/2)+props.parent.ypos}else{if(desktop&&!props.fixed){_y=Math.floor((desktop.calcheight()-height)/2)+desktop.calcexclude(2)}else{_y=Math.floor((d.clientH-height)/2)+(props.fixed?0:d.clientTop)}}if(_y<0){_y=0}}}if(props.fixed&&!havefixed){$(top).css("left",(d.clientLeft+_x)+"px").css("top",(d.clientTop+_y)+"px")}else{$(top).css("left",_x+"px").css("top",_y+"px")}if(grid){if(!havefixed){$(grid).css("left",d.clientLeft+"px").css("top",d.clientTop+"px")}else{$(grid).css("left","0px").css("top","0px")}}xpos=_x;ypos=_y;if(!nopos){sesupdate=1}if(this.props.onposchange){this.props.onposchange.apply(this.app,[this])}}},setTitle:function(t){if(this.state.destroyed){return}if(t!=null){this.title=t}if(!this.title){this.title=""}with(this){if(!props.header){return}var ts=width-decor.w,l;ts-=_countbuttonwidth();l=title.length;if(l*letsize>ts){l=Math.floor(ts/letsize)-2}if(l<title.length){$(parts.htitle).attr("title",title).text(title.substr(0,l)+"...")}else{$(parts.htitle).attr("title","").text(title)}if(ontaskbar){desktop._onsetwindowtitle(this)}}},resizeTo:function(w,h,center,nopos){with(this){if(state.destroyed){return}if(w<0){w=(-w)+decor.w}if(h<0){h=(-h)+decor.h}if(center&&!props.attachobj){var d=_uWnd.getdims();var _x=xpos,_y=ypos;if(props.x=="auto"){if(props.parent){_x=Math.floor((props.parent.width-w)/2)+props.parent.xpos}else{if(desktop&&!props.fixed){_x=Math.floor((desktop.calcwidth()-w)/2)+desktop.calcexclude(0)}else{_x=Math.floor((d.clientW-w)/2)+(props.fixed?0:d.clientLeft)}}if(_x<0){_x=0}}if(props.y=="auto"){if(props.parent){_y=Math.floor((props.parent.height-h)/2)+props.parent.ypos}else{if(desktop&&!props.fixed){_y=Math.floor((desktop.calcheight()-h)/2)+desktop.calcexclude(2)}else{_y=Math.floor((d.clientH-h)/2)+(props.fixed?0:d.clientTop)}}if(_y<0){_y=0}}if(_x!=xpos|_y!=ypos){moveTo(_x,_y,1)}}$(wnd).css("width",w+"px");$(parts.wndcont).css("width",(w-decor.w)+"px");$(parts.hwndcont).css("height",(h-decor.h)+"px");if(parts.markwait){$(parts.markwait).css({height:(h-decor.h+footerh+headerh)+"px",width:(w-decor.w)+"px"})}if(parts.actlayer){$(parts.actlayer).css({height:(h-decor.h)+"px",width:(w-decor.w)+"px"})}if(parts.markdis){$(parts.markdis).css("width",w+"px").css("height",h+"px")}if(menu){$(parts.menu).css("width",(w-decor.w)+"px")}if(tabctrl){tabctrl.resizeTo(w-decor.w,h-decor.h)}if(frame){$(frame).css("width",w+"px").css("height",h+"px")}width=w;height=h;if(props.attachobj){attachTo(props.attachobj,props.attachtype,props.attachdx,props.attachdy)}if(!nopos&&!this.state.maximized&&!this.state.minimized){sesupdate=1}if(this.props.onposchange&&!this.state.maximized&&!this.state.minimized){this.props.onposchange.apply(this.app,[this])}_resizeSh();showattachicon();setTitle()}},_onresize:function(a){if(this.state.maximized){if(this.desktop&&!this.props.fixed){this.moveTo(this.desktop.calcexclude(0),this.desktop.calcexclude(2),1);this.resizeTo(this.desktop.calcwidth(),this.desktop.calcheight(),0,1)}else{this.resizeTo(a.clientW,a.clientH)}}if(this.grid){$(this.grid).css("width",a.clientW+"px").css("height",a.clientH+"px")}},_resizeSh:function(){if(this.sh){this.design.shadow_resize(this.sh,Math.abs(this.width),Math.abs(this.height))}},hideSh:function(){if(this.sh){this.design.shadow_hide(this.sh)}},showSh:function(){if(this.sh&&!this.state.noshadow){this.design.shadow_show(this.sh)}},shadow_init:function(){this.sh=this.design.shadow_init(this.top)},showcustombutton:function(a,b){if(!this.props.customButtons[a]){return}this.props.customButtons[a][0]=b;if(!this.parts.custom[a]){return}if(!b){$(this.parts.custom[a]).css("display","none")}else{$(this.parts.custom[a]).css("display","block")}},init:function(menuitems){var p=this.props,t=document.createElement("div"),w;t.id="_uwndTop"+this.idx;if(p.topclass){t.setAttribute("class",p.topclass)}t._uwndobj=this;if(!this.desktop){$($("body")[0]).prepend(t)}else{this.desktop.dsk.appendChild(t)}this.top=t;if($.browser.msie){this.havefixed=0;if(parseFloat($.browser.version)>=7){try{t.style.position="fixed";if(t.currentStyle.position=="fixed"){this.havefixed=1}t.style.position=""}catch(e){this.havefixed=1}}}if(!p.fixed||!this.havefixed){$(t).css("position","absolute")}else{$(t).css("position","fixed")}$(t).css("visibility","hidden").css({display:"block",zIndex:this.zpos,overflow:"visible"});if(p.modal&&!p.parent){var g=document.createElement("div"),d=_uWnd.getdims();$(g).addClass(p.gridclass).css("width",d.clientW+"px").css("height",d.clientH+"px").css("z-index",this.zpos-1).hide().bind("mousedown",function(e){e.stopPropagation();e.preventDefault();_uWnd.globalmousedown()});if(!this.havefixed){$(g).css("position","absolute")}else{$(g).css("position","fixed")}if(!this.desktop){$($("body")[0]).prepend(g)}else{this.desktop.dsk.appendChild(g)}this.grid=g}if($.browser.msie&&parseFloat($.browser.version)<7){this.frame=document.createElement("iframe");with(this.frame.style){filter="Alpha(Opacity='0')";display="block";position="absolute";borderWidth=0;width=Math.abs(this.width)+"px";height=Math.abs(this.height)+"px"}t.appendChild(this.frame)}if(p.shadow&&!($.browser.msie&&parseFloat($.browser.version)<7)){this.shadow_init();this._resizeSh()}this.moveTo(0,0,1);w=document.createElement("div");w.id="_uwndWnd"+this.idx;t.appendChild(w);this.wnd=w;$(w).css({position:"absolute",width:Math.abs(this.width)+"px",zIndex:2,left:0,overflow:"visible"});if(!_uWnd._activateonmousedown){_uWnd._activateonmousedown=function(e){e.stopPropagation();e.data.activate(e);if(e.data.props.popup){_uWnd.ignoreclick=e.data}_uWnd.globalmousedown()}}this.parts=this.design.wnd_init(this,w,this.title,p.align,60,p.header,p.icon,p.resize,p.havemenu);if(!_uWnd._onbuttonclose){_uWnd._onbuttonclose=function(e){e.data.activate(e);e.data.closeevent()}}if(!_uWnd._onbuttonhide){_uWnd._onbuttonhide=function(e){e.data.hide()}}if(p.header){var bb={cbut:"xt-close",mbut:"xt-mini",xbut:"xt-maxi",rbut:"xt-rest"};if(!_uWnd._retfalse){_uWnd._retfalse=function(e){return false}}if(!_uWnd._onclickcustom){_uWnd._onclickcustom=function(e){var d=e.data;d.wnd.activate(e);d.func.call(d.thispar,d.wnd,d.param)}}if(!_uWnd._onbuttonmin){_uWnd._onbuttonmin=function(e){e.data.activate(e);e.data.minimize()}}if(!_uWnd._onbuttonmax){_uWnd._onbuttonmax=function(e){e.data.activate(e);e.data.maximize()}}if(!_uWnd._onbuttonrest){_uWnd._onbuttonrest=function(e){e.data.activate(e);e.data.restore()}}for(var i in bb){$(this.parts[i]).bind("dblclick",_uWnd._retfalse).bind("mouseover",{cls:bb[i],state:1},this.design.onbuttonover).bind("mouseout",{cls:bb[i],state:0},this.design.onbuttonover).bind("mousedown",this,_uWnd._activateonmousedown)}for(var i in p.customButtons){$(this.parts.custom[i]).bind("dblclick",_uWnd._retfalse).bind("mouseover",{cls:"xt-"+i,state:1},this.design.onbuttonover).bind("mouseout",{cls:"xt-"+i,state:0},this.design.onbuttonover).bind("mousedown",this,_uWnd._activateonmousedown);if(!p.customButtons[i][0]){$(this.parts.custom[i]).css("display","none")}if(p.customButtons[i][1]){$(this.parts.custom[i]).bind("click",{wnd:this,func:p.customButtons[i][1],thispar:p.customButtons[i][2],param:(p.customButtons[i][3]||i)},_uWnd._onclickcustom)}}if(!p.close){$(this.parts.cbut).css("display","none")}$(this.parts.cbut).bind("click",this,_uWnd._onbuttonclose);if(!p.min){$(this.parts.mbut).css("display","none")}$(this.parts.mbut).bind("click",this,_uWnd._onbuttonmin);if(!p.max){$(this.parts.xbut).css("display","none")}$(this.parts.xbut).bind("click",this,_uWnd._onbuttonmax);$(this.parts.rbut).css("display","none").bind("click",this,_uWnd._onbuttonrest);if(p.close&&!p.min&&!p.max&&this.design.altcloseclass){$(this.parts.cbut).addClass(this.design.altcloseclass)}if(p.max&&!p.min){if(this.design.altmaxiclass){$(this.parts.xbut).addClass(this.design.altmaxiclass)}if(this.design.altrestclass){$(this.parts.rbut).addClass(this.design.altrestclass)}}if(!_uWnd._onclicktodrag){_uWnd._onclicktodrag=function(e){e.stopPropagation();e.data.activate(e);if(e.data.props.popup){_uWnd.ignoreclick=e.data}_uWnd.globalmousedown();return e.data._ondragmousedown(e)}}if(!_uWnd._ondclicktomax){_uWnd._ondclicktomax=function(e){var a=e.data;if((a.state.maximized&&a.props.max)||a.state.minimized){a.restore()}else{a.maximize()}}}if(!p.nomove){$(this.parts.hdr).addClass("xw-draggable")}$(this.parts.hdr).add(this.parts.htitle).bind("mousedown",this,_uWnd._onclicktodrag);if(p.max||p.min){$(this.parts.hdr).bind("dblclick",this,_uWnd._ondclicktomax)}}if(this.parts.attachicon&&p.attachiconact){$(this.parts.attachicon).bind("click",this,p.attachiconact=="hide"?_uWnd._onbuttonhide:_uWnd._onbuttonclose)}var rs=this.design.get_szbuts(w);if(!_uWnd._onresizebuttondown){_uWnd._onresizebuttondown=function(e){e.stopPropagation();e.data.w.activate(e);if(e.data.w.props.popup){_uWnd.ignoreclick=e.data.w}_uWnd.globalmousedown();return e.data.w._onrsmousedown(e,e.data.tp)}}for(var i in rs){$(rs[i]).bind("mousedown",{w:this,tp:i},_uWnd._onresizebuttondown)}$(t).bind("mousedown",this,_uWnd._activateonmousedown);if(p.havemenu){var mopts=$.extend({parentnode:this.parts.menu,wnd:this,thispar:this.app,noabs:1,horiz:1,statical:1,width:"auto"},p.menuopts||{});this.menu=new _uMENU("",{},mopts,menuitems,true)}if(typeof this._content=="object"&&this._content.constructor==_uTabCtrl){this.tabctrl=this._content;this.tabctrl.props.parentnode=this.parts.wndcont;this.tabctrl.wnd=this;this.tabctrl.init(true)}else{this.tabctrl=null}if(p.trayicon&&this.desktop){var to={};if(p.trayicon.contructor==String){to.img=p.trayicon}else{if(p.trayicon.contructor!=Object){to.img=p.icon||p.iconstyle}}if(to.img){if(!p.trayicon.thisobj){to.thisobj=this;if(!p.trayicon.ondown){to.ondown=this.ontrayicondown}if(!p.trayicon.onrdown){to.onrdown=this.ontrayiconrdown}to.param=p.trayicon.param}else{$.extend(to,p.trayicon)}if(!to.title){to.title=this.title||""}this.trayicon=this.desktop.addTrayIcon(to.img,to.title,to.thisobj,to.ondown,to.onclick,to.onrdown,to.param);if(p.traymenu){this.traymenu=new _uMENU("",{align:"U"},{hidden:1},p.traymenu)}}}if(!p.hidden){this.show(false)}if(this.desktop&&!p.popup&&!p.alert&&p.header&&!p.notaskbar){this.ontaskbar=true;this.desktop._addwindow(this)}else{this.ontaskbar=false}if(p.modal&&p.parent){p.parent.disable(1)}if(this.props.parent){this.props.parent._onnewchild(this)}this.activate();if(p.header||this.menu){setTimeout("var w=_uWnd.all["+this.idx+"];if(w)w.init1();",10)}else{setTimeout("var w=_uWnd.all["+this.idx+"];if(w)w.init2();",10)}},init1:function(){if(this.props.header){if(!this.title){this.letsize=8}else{with(this){if(title.length==0){letsize=8}else{letsize=parts.htitle.offsetWidth/title.length}parts.htitle.innerHTML="..."}}}if(this.menu){this.menu.init1(true)}setTimeout("var w=_uWnd.all["+this.idx+"];if(w)w.init2();",10)},init2:function(){with(this){decor.sbw=parts.hwndcont.offsetWidth-parts.hwndcont.clientWidth;decor.sbh=parts.hwndcont.offsetHeight-parts.hwndcont.clientHeight;decor.w=Math.abs(width)-_uWnd.csize(parts.wndcont,"width")-decor.sbw;decor.h=wnd.offsetHeight-60;decor.th=parts.upper.offsetHeight;parts.hwndcont.style.overflow="hidden";if(tabctrl){tabctrl.init1(true)}else{if(parts.headercont&&props.hideheader){parts.headercont.style.visibility="hidden"}if(parts.footercont&&props.hidefooter){parts.footercont.style.visibility="hidden"}}showattachicon(props.attachicontype);if(props.session){resizeTo(props.session.w+decor.w,props.session.h+decor.h,0,1)}else{resizeTo(width,height,0,1)}if(!props.attachobj){moveTo(props.x,props.y,1)}if(menu){menu._setsize()}state.init=true;var rel=pend_show?pend_show[0]:false;if(props.oninit){if(!props.oninit.call(app,this,name)){rel=false}}$(top).css("display","none").css("visibility","");var s=props.session;s=(s&&s.s)||props.initstate;if(s=="min"){minimize(1);state.beforemin=(s&&s.bm)||"";if(!props.max&&props.initstate=="max"){state.beforemin="max"}}else{if(s=="max"){maximize(0,1)}else{if(pend_show){show(rel,pend_show[1],pend_show[2])}}}sesupdate=0}},disable:function(a,d){if(this.state.destroyed){return}var e;if(!d){if(a){if(!this.state.disabled){for(var b=0;b<this.childs.length;b++){e=this.childs[b];if(!e||e.state.destroyed||e.props.alert){continue}e.state.prevdisabled=e.state.disabled;e.disable(1)}}this.state.disabled=true}else{if(this.state.disabled){for(var b=0;b<this.childs.length;b++){e=this.childs[b];if(!e||e.state.destroyed||e.props.alert||typeof e.state.prevdisabled=="undefined"){continue}e.disable(e.state.prevdisabled)}}this.state.disabled=false}}this.design.ondisable(this,a)},_onkeypress:function(c,a,b){if(!this.state.disabled&&this.state.visible&&!this.props.toolwindow){if(c.keyCode==115&&c.ctrlKey&&c.shiftKey){c.preventDefault();return}}},_onkeydown:function(c,a,b){if(!this.state.disabled&&this.state.visible&&!this.props.toolwindow){if((c.keyCode==115&&c.ctrlKey&&c.shiftKey)||(c.keyCode==27&&this.props.closeonesc)){if(this.props.close){this.closeevent()}return 1}if(this.menu&&(c.keyCode==17||c.keyCode==18)&&c.ctrlKey&&c.altKey&&b.owner.constructor!=_uMENU){if(this.props.popup){_uWnd.ignoreclick=this}_uWnd.globalmousedown();this.menu.show(null,0);this.menu._focus.activate();c.preventDefault();c.stopPropagation();return 1}if(this.props.havesysmenu&&this.props.header&&this.parts.hdr&&c.keyCode==32&&c.ctrlKey&&!this.state.resizing){var d=$(this.parts.hdr).offset();this.showsysmenu(d.left,d.top+this.parts.hdr.offsetHeight);c.preventDefault();c.stopPropagation();return 1}}},_ondeactivate:function(b,c,f){if(this.props.toolwindow){var h=this.props.parent;while(h&&h.props.toolwindow){h=h.props.parent}if(h&&h._focus.isparentof(f)){return}}this.state.focused=0;this.design.onfocus(this,0);var a=this.props.toolwindow?0:1;if(this.props.ondeactivate){var d=this.props.ondeactivate.apply(this.app,[this]);if(typeof d!="undefined"){a=d?1:0}}this.savedfocus=null;try{if(document.activeElement&&document.activeElement!=document.body&&document.activeElement.blur&&$.inArray(this.wnd,$.makeArray($(document.activeElement).parents()))!=-1){if(a){this.savedfocus=document.activeElement}document.activeElement.blur()}}catch(g){}if(!this.props.toolwindow){this._foreachchild(function(e){if(!e.props.toolwindow){return 1}e.state.focused=0;e.design.onfocus(e,0)},0)}},_canactivate:function(b,a,c){if(this.props.alert||this.state.minimized){return 0}return 1},activate:function(b,a){if(this.state.destroyed){return}if(this.menu&&!a&&this.menu._focus.isactive()){this.menu._focus.deactivate()}if(this.props.alert){return}if(this.props.modal&&this.props.parent){this.props.parent.setforeground()}return this._focus.activate()},_onactivate:function(b,a,e){if(e!=this._focus){return}if(!this.state.disabled){this.state.focused=1;this.design.onfocus(this,1);if(this.savedfocus&&this.savedfocus.focus&&$.inArray(this.wnd,$.makeArray($(this.savedfocus).parents()))!=-1){this.savedfocus.focus()}if(this.props.onactivate){this.props.onactivate.apply(this.app,[this])}this.savedfocus=null;if(!this.props.toolwindow){this._foreachchild(function(g){if(!g.props.toolwindow){return 1}g.state.focused=1;g.design.onfocus(g,1)},0)}}else{var f;for(var d=0;d<this.childs.length;d++){f=this.childs[d];if(!f||f.state.destroyed||f.state.disabled||f.props.alert){continue}this.setforeground();f.activate();return -1}return}this.setforeground()},setforeground:function(){if((this.props.modal&&!this.props.parent)||this.props.alert||this.modalparent){if(this.zpos+this.nchilds*_uWnd.zstep!=_uWnd.lastmodalz){this.setZ(_uWnd.getModalTopZ(this.nchilds))}}else{if(this.zpos+this.nchilds*_uWnd.zstep!=_uWnd.lastz){this.setZ(_uWnd.getTopZ(this.nchilds))}}},ontrayicondown:function(b,a,c){if(!this.state.visible&&!this.state.minimized){if(b){this.show(false)}else{this.show(false,0,0)}}else{if(this.state.minimized){if(this.state.beforemin=="max"){this.maximize(1)}else{this.restore(1)}}else{if(this.props.min&&!this.props.notaskbar){this.minimize()}else{if(b){this.hide()}else{this.hide(0,0)}}}}},ontrayiconrdown:function(a,b,c){if(!this.traymenu){return}this.traymenu.show({pos:{x:c.pageX,y:c.pageY}});_uMENU.ignoreclick=this.traymenu},show:function(rel,fadetp,fadesp){if(this.state.destroyed){return}if(arguments.length<2||fadetp==undefined){fadetp=this.props.fadetype}if(arguments.length<3||fadesp==undefined){fadesp=this.props.fadespeed}if(!_uWnd._onshowanimend){_uWnd._onshowanimend=function(){var w=_uWnd.findparent(this);if(!w){return}w.disable(w.state.disabled,1);w.showSh();if(w.autosz.startonshow){w.delaychecksize()}}}with(this){if(!state.init){pend_show=[rel,fadetp,fadesp];return}if(state.visible){return}state.visible=true;if(grid){$(grid).show()}if(fadetp==1){disable(1,1);if($.browser.safari){hideSh()}if($.browser.msie){hideSh();$(wnd).hide();$(top).show();$(wnd).css("opacity","0").show().animate({opacity:1},{duration:fadesp,complete:_uWnd._onshowanimend})}else{$(top).fadeIn(fadesp,_uWnd._onshowanimend)}}else{if(fadetp==2){disable(1,1);var endy=ypos;$(top).css("top",(endy+(height>100?100:height))+"px");if($.browser.msie){hideSh();$(wnd).hide();$(top).show().animate({top:endy+"px"},{duration:fadesp,complete:_uWnd._onshowanimend});$(wnd).css("opacity","0").show().animate({opacity:1},fadesp)}else{$(top).css("opacity","0").show().animate({top:endy+"px",opacity:1},{duration:fadesp,complete:_uWnd._onshowanimend})}}else{if(props.nohide){$(top).css({visibility:""})}$(top).show();disable(state.disabled);if(autosz.startonshow){delaychecksize()}}}if(!state.loaded||rel){load()}}},hide:function(fadetp,fadesp,doclose){if(this.state.destroyed){return}if(arguments.length<1||fadetp==undefined){fadetp=this.props.fadeclosetype}if(arguments.length<2||fadesp==undefined){fadesp=this.props.fadeclosespeed}if(!_uWnd._onhideanimendcl){_uWnd._onhideanimendcl=function(){var w=_uWnd.findparent(this);if(!w){return}w.close(1)}}with(this){if(!state.visible){return 0}if(autosz.active){finishautosize()}state.visible=false;if(fadetp==1){disable(1,doclose?0:1);if($.browser.msie){hideSh();$(wnd).animate({opacity:0},{duration:fadesp,complete:doclose?_uWnd._onhideanimendcl:null})}else{$(top).animate({opacity:0},{duration:fadesp,complete:doclose?_uWnd._onhideanimendcl:null})}}else{if(fadetp==2){disable(1,doclose?0:1);var endy=ypos+(height>100?100:height);if($.browser.msie){hideSh();$(top).animate({top:endy+"px"},{duration:fadesp,complete:doclose?_uWnd._onhideanimendcl:null});$(wnd).animate({opacity:0},fadesp)}else{$(top).animate({top:endy+"px",opacity:0},{duration:fadesp,complete:doclose?_uWnd._onhideanimendcl:null})}}else{if(props.nohide){$(top).css({visibility:"hidden"})}else{$(top).hide()}doclose=false}}if(grid){$(grid).hide()}if(_focus.isactive()){_focus.deactivate();_uWnd.activatetopwnd(this.desktop)}}if(doclose){return 1}return 0},markload:function(){if(this.state.destroyed){return}with(this){parts.wndcont.style.display="none";parts.markload.style.display="block";if(parts.headercont&&props.hideheader){parts.headercont.style.visibility="hidden"}if(parts.footercont&&props.hidefooter){parts.footercont.style.visibility="hidden"}}},showgrid:function(){if(this.state.destroyed){return}if(this.parts.markwait){this.parts.markwait.style.display="block"}},hidegrid:function(){if(this.state.destroyed){return}if(this.parts.markwait){this.parts.markwait.style.display="none"}},reload:function(d,a){if(this.state.destroyed){return}if(typeof d=="object"&&d.constructor==_uTabCtrl){if(this.tabctrl!=d){if(d.state.init&&d.wnd!=this){return}this.tabctrl=d;d.props.parentnode=this.parts.wndcont;d.wnd=this;var b=this.parts.wndcont;while(b.firstChild){b.removeChild(b.firstChild)}if(!d.state.init){d.init(true);setTimeout("var w=_uWnd.all["+this.idx+"];if(w && w.tabctrl){w.tabctrl.init1(true);w.resizeTo(w.width,w.height,0,1);}",10)}else{b.appendChild(d.top);d.resizeTo(this.width-this.decor.w,this.height-this.decor.h)}}}else{if(this.tabctrl){if(!this.props.notabdestroy){this.tabctrl.destroy()}else{this.parts.wndcont.removeChild(this.tabctrl.top);this.tabctrl.parentnode=null;this.tabctrl.wnd=null}}this.tabctrl=null}this._content=d;this.state.loaded=false;if(!a){this.load()}},load:function(){if(this.state.destroyed||this.tabctrl){return}var b=this._content;this.state.loaded=true;if(this.xmlobj){this.xmlobj_ignoreabort=1;this.xmlobj.abort();this.xmlobj=null}if(typeof(b)=="string"||(typeof b=="object"&&(b.nodeType||b.constructor==jQuery))){this.content(b)}else{if(typeof b=="function"){this.content(b.apply(this.app,[this]))}else{if(typeof b=="object"){this.markload();if(this.app&&!("app" in b)){b.app=this.app.pid}b.wnd=this.idx;if(!_uWnd._onAjaxComplete){_uWnd._onAjaxComplete=function(e,d){var c=_uWnd.all[this.wnd];if(c){c._oncomplete(e,d,this)}}}if(b.complete!=_uWnd._onAjaxComplete){b.prev_complete_uwnd=b.complete;b.complete=_uWnd._onAjaxComplete}if(!_uWnd._onAjaxBeforeSend){_uWnd._onAjaxBeforeSend=function(d){var c=_uWnd.all[this.wnd];if(c){c.xmlobj=d;c.xmlobj_ignoreabort=0}if(this.prev_beforeSend_uwnd){this.prev_beforeSend_uwnd.call(this,d)}}}if(b.beforeSend!=_uWnd._onAjaxBeforeSend){b.prev_beforeSend_uwnd=b.beforeSend;b.beforeSend=_uWnd._onAjaxBeforeSend}if(!b.success&&b.xml===false){b.dataType="text";if(!_uWnd._onAjaxSuccess){_uWnd._onAjaxSuccess=function(e,d){var c=_uWnd.all[this.wnd];if(c){c.content(e)}}}b.success=_uWnd._onAjaxSuccess}try{if(b.form&&b.form.length>0){_uPostForm(b.form,b)}else{if(b.url){_uAjaxRequest(b.url,b)}}}catch(a){this.xmlobj=null;this._onerror(null,"",a,b)}}}}},_oncomplete:function(b,a,c){this.xmlobj=null;if(this.prev_complete_uwnd){this.prev_complete_uwnd.call(c,b,a)}},_onerror:function(b,a,e,c){if(this.state.destroyed||this.state.pendingdestroy){return}if((a=="abort"||a=="aborted")&&(!this.xmlobj||this.xmlobj_ignoreabort)){return}var d=this.props.onerror;if(d&&typeof(d)=="function"){d.call(this.app,this,b,a,e,c)}else{this.close()}},header:function(a){if(this.state.destroyed){return}var b=this.parts.headercont;if(!b){return}if(a){$(b).html(a)}else{$(b).html("")}},footer:function(a){if(this.state.destroyed){return}var b=this.parts.footercont;if(!b){return}if(a){$(b).html(a)}else{$(b).html("")}},headerheight:function(a){if(this.state.destroyed||!this.parts.headercont||typeof(a)!="number"||isNaN(a)){return}var b=this.headerh;if(b==a){return}this.decor.h+=a-b;this.headerh=a;$(this.parts.headercont).css("height",(a)+"px");this.resizeTo(this.width,this.height+(this.props.contentsizeprio?a-b:0))},footerheight:function(a){if(this.state.destroyed||!this.parts.footercont||typeof(a)!="number"||isNaN(a)){return}var b=this.footerh;if(b==a){return}this.decor.h+=a-b;this.footerh=a;$(this.parts.footercont).css("height",(a)+"px");this.resizeTo(this.width,this.height+(this.props.contentsizeprio?a-b:0))},_checkimgload:function(load){var im=this.imgloader;var i;if(!im.active){return}if(load){im.count++}if(im.images){for(i=0;i<im.images.length;i++){if(!im.images[i].complete){break}}}if(i>=im.images.length){this._stopimgload(true);return}if(im.count>=im.images.length){if(im.timer){clearTimeout(im.timer)}im.timer=setTimeout("var w=_uWnd.all["+this.idx+"];if(w){w.imgloader.timer=null;w._checkimgload();}",100)}if($.browser.opera&&im.images2){for(i=0;i<im.images2.length;i++){if(!im.images2[i].complete){return}}$(im.images2).unbind();im.images2=null;with(this){parts.hwndcont.style.visibility="hidden";parts.markload.style.display="none";$(parts.wndcont).css("display","block");if(parts.headercont&&!props.hidehonresize){parts.headercont.style.visibility=""}if(parts.footercont&&!props.hidefonresize){parts.footercont.style.visibility=""}}}},_stopimgload:function(start,wastm){var im=this.imgloader,d;if(im.active){im.active=false;if(im.stoptimer){clearTimeout(im.stoptimer);im.stoptimer=null}if(im.timer){clearTimeout(im.timer);im.timer=null}if(im.images){im.images.unbind();im.images=null}if(im.images2){$(im.images2).unbind();im.images2=null}if(start){with(this){if(props.hideonresize){parts.hwndcont.style.visibility="hidden"}parts.markload.style.display="none";$(parts.wndcont).css("display","block");if(parts.headercont&&!props.hidehonresize){parts.headercont.style.visibility=""}if(parts.footercont&&!props.hidefonresize){parts.footercont.style.visibility=""}autosz.load=true;if(props.onafterimgload){d=_uWnd.getdims();props.onafterimgload.call(app,this,parts.wndcont,{w:d.clientW,h:d.clientH,dw:decor.w,dh:decor.h},wastm)}delaychecksize()}}}},find:function(b){if(this.state.destroyed){return $([])}var a=$(this.parts.wndcont);if(this.parts.headercont){a=a.add(this.parts.headercont)}if(this.parts.footercont){a=a.add(this.parts.footercont)}if(!b){return a}return a.find(b)},getcontent:function(a){if(this.state.destroyed){return null}if(a&&a.substr(0,1)=="h"){return this.parts.headercont}if(a&&a.substr(0,1)=="f"){return this.parts.footercont}return this.parts.wndcont},content:function(m){if(this.state.destroyed){return}if(this.xmlobj){this.xmlobj_ignoreabort=1;this.xmlobj.abort();this.xmlobj=null}this._stopimgload();this.stopautosize();var e=this.autosz,d=this.parts.wndcont,l=this.props,b=this.imgloader,k=this.parts.footercont,j=this.parts.headercont;this.state.loaded=true;if(l.autosize&&l.waitimages>0){this.markload();$(d).html(m);if(this.props.oncontent){this.props.oncontent.apply(this.app,[this,d])}b.active=true;b.stoptimer=setTimeout("var w=_uWnd.all["+this.idx+"];if(w)w._stopimgload(1,1);",l.waitimages);if(!_uWnd.waitimagesfunc){_uWnd.waitimagesfunc=function(c){var a=c.data.imgloader;if(a.timer){clearTimeout(a.timer)}a.timer=setTimeout("var w=_uWnd.all["+c.data.idx+"];if(w){w.imgloader.timer=null;w._checkimgload(1);}",10)}}b.count=0;b.images=$(d).find("img").bind("error",this,_uWnd.waitimagesfunc).bind("load",this,_uWnd.waitimagesfunc);if($.browser.opera&&b.images.length>0){b.images2=[];for(var g=0;g<b.images.length;g++){b.images2[g]=$("<img>").attr("src",b.images[g].src).bind("load",this,_uWnd.waitimagesfunc)[0]}}this._checkimgload()}else{if(l.autosize&&l.hideonresize){this.parts.hwndcont.style.visibility="hidden"}this.parts.markload.style.display="none";$(d).css("display","block").html(m);if(j){j.style.visibility=l.hidehonresize?"hidden":""}if(k){k.style.visibility=l.hidefonresize?"hidden":""}e.load=true;if(l.autosize){if(this.props.oncontent){this.props.oncontent.apply(this.app,[this,d])}this.delaychecksize()}else{this.design.onstopautosz(this);if(this.props.oncontent){this.props.oncontent.apply(this.app,[this,d])}}}},onexternalload:function(){with(this){_stopimgload();stopautosize();state.loaded=true;autosz.load=true;if(parts.headercont&&!props.hidehonresize){parts.headercont.style.visibility=""}if(parts.footercont&&!props.hidefonresize){parts.footercont.style.visibility=""}if(props.autosize){delaychecksize()}}},stopautosize:function(){var b=this.autosz;if(b.inittimer){clearTimeout(b.inittimer);b.inittimer=null}if(b.timer){clearTimeout(b.timer);b.timer=null}if(b.images){$(b.images).unbind();b.images=null}if(b.active){this.design.onstopautosz(this)}b.active=false},finishautosize:function(){var b=this.autosz;if(!b.active){return}this.stopautosize();this.resizeTo(b.tw+this.decor.w,b.th+this.decor.h,true,1)},delaychecksize:function(c){c=c||10;var b=this.autosz;if(!this.state.visible){b.startonshow=1;return}b.startonshow=0;if(b.inittimer){clearTimeout(b.inittimer)}b.inittimer=setTimeout("var w=_uWnd.all["+this.idx+"];if(w)w.checksize();",c)},_countbuttonwidth:function(){var a=0;var b={cbut:1,mbut:1,xbut:1,rbut:1,icon:1};for(var c in b){if(this.parts[c]){a+=this.parts[c].offsetWidth}}for(var c in this.props.customButtons){a+=this.parts.custom[c].offsetWidth+this.design.custButMargin}return a},checksize:function(){var i=this.autosz,j=this.parts.wndcont;i.inittimer=null;if(this.state.maximized||this.state.minimized){return}if(!this.state.visible){i.startonshow=1;return}i.startonshow=0;this.stopdrag();this.stopresize();if(i.load){i.load=false;if(i.images){$(i.images).unbind();i.images=null}if(this.props.autosizeonimages){if(!_uWnd.autosizeonimagesfunc){_uWnd.autosizeonimagesfunc=function(a){a.data.delaychecksize()}}i.images=$(j).find("img").bind("load",this,_uWnd.autosizeonimagesfunc)}}i.active=true;i.speed=1;i.speedmult=this.props.autosizestepmult;this.design.onstartautosz(this);if(i.timer){clearTimeout(i.timer);i.timer=null}var f=_uWnd.getdims(),l=10,e=10,h,c;if(this.props.header){l+=this._countbuttonwidth()}l=Math.max(l,this.minwidth);e=Math.max(e,this.minheight);h=this.maxwidth;if(h==0){h=f.clientW-this.decor.w}c=this.maxheight;if(c==0){c=f.clientH-this.decor.h}var b,k;if(this.props.autosizewidth){$(this.parts.wndcont).css("width","10px");b=j.scrollWidth;$(this.parts.wndcont).css({width:(this.width-this.decor.w)+"px"})}else{b=j.scrollWidth}k=j.scrollHeight+1;i.tw=Math.max(b,l);i.th=Math.max(k,e);var g=false;if(i.tw>h){i.tw=h;i.th+=this.decor.sbh;g=true}if(i.th>c){i.th=c;if(i.tw+this.decor.sbw<=h){i.tw+=this.decor.sbw;g=true}else{i.tw=h}}if(g){this.design.onstopautosz(this,true)}i.timer=setTimeout("try{_uWnd.all["+this.idx+"]._checksize();}catch(e){}",10)},_checksize:function(){this.stopdrag();this.stopresize();var c=this.autosz,d=c.tw-(this.width-this.decor.w),f=c.th-(this.height-this.decor.h),b=this.props.autosizestep*c.speed,e=this.props.autosizestep*c.speed;if(b<=0){b=1}if(e<=0){e=1}c.speed*=c.speedmult;c.speedmult*=this.props.autosizestepmultmult;if(d!=0){if(d>0){b=Math.min(b,d)}else{if(d<0){b=Math.max(-b,d)}}if(this.props.autosizewidth==2&&f!=0){if(f>0){e=Math.min(e,f)}else{if(f<0){e=Math.max(-e,f)}}}else{e=0}this.resizeTo(this.width+b,this.height+e,true,1)}else{if(f!=0){if(f>0){e=Math.min(e,f)}else{if(f<0){e=Math.max(-e,f)}}this.resizeTo(this.width,this.height+e,true,1)}else{c.timer=null;c.active=false;this.design.onstopautosz(this);return}}c.timer=setTimeout("try{_uWnd.all["+this.idx+"]._checksize();}catch(e){}",10)},closeevent:function(){if(this.props.onbeforeclose){if(this.props.onbeforeclose.apply(this.app,[this])){return}}this.close()},close:function(f){if(this.state.destroyed){return}if(this.state.pendingdestroy){f=1}var e=0;for(var d=0;d<this.childs.length;d++){var g=this.childs[d];if(!g){continue}if(g.state.destroyed){delete this.childs[d];continue}if(this.state.pendingdestroy){e=1;break}g.close();if(this.childs[d]){e=1}}this.state.pendingdestroy=true;if(this.xmlobj){this.xmlobj_ignoreabort=1;this.xmlobj.abort();this.xmlobj=null}if(this.props.modal&&this.props.parent){this.props.parent.disable(0)}if(!f&&this.state.visible){var b=this.hide(this.props.fadeclosetype,this.props.fadeclosespeed,true);if(b==1){return}}if(!e){this._destroy()}},_destroy:function(){if(this.state.destroyed){return}this._focus.destroy();if(this.desktop){this.desktop._removewindow(this)}if(this.menu){this.menu.destroy()}if(this.traymenu){this.traymenu.destroy()}if(this.trayicon){this.trayicon.remove()}this.top.parentNode.removeChild(this.top);if(this.grid){this.grid.parentNode.removeChild(this.grid)}if(this.tabctrl&&!this.props.notabdestroy){this.tabctrl.destroy()}_uWnd.all[this.idx]=null;this.state.destroyed=true;this.state.visible=false;if(this.props.onclose){this.props.onclose.apply(this.app,[this,this.idx])}if(this.props.parent){this.props.parent._ondelchild(this)}if(this.app&&this.app._ondestroywnd){this.app._ondestroywnd(this)}},_onnewchild:function(a){if(a){this.childs.push(a)}var b=0;this._foreachchild(function(d){b++});this.nchilds=b;if(this.props.parent){this.props.parent._onnewchild(null)}},_ondelchild:function(a){var c=0;for(var b=0;b<this.childs.length;b++){if(this.childs[b]){if(this.childs[b]==a){delete this.childs[b];a.props.parent=null;if(!this.state.pendingdestroy){break}}else{c++}}}if(this.state.pendingdestroy&&c==0){this._destroy()}else{this._onnewchild(null)}},minimize:function(frominit){with(this){if(state.destroyed||autosz.active||(!props.min&&!(frominit&&props.initstate=="min"))||!props.header||props.modal||props.alert||props.popup){return}state.beforemin=state.maximized?"max":"";stopdrag();stopresize();if(!state.maximized&&!state.minimized){restRect=[xpos,ypos,width,height,props.fixed]}if(!frominit){sesupdate=1}if(props.onposchange&&!state.minimized){props.onposchange.apply(app,[this])}state.maximized=false;state.minimized=true;this._foreachchild(function(w){if(w.props.min){return 1}w.state.prevvisible=w.state.visible;w.hide(0)},0);if(!ontaskbar){if(props.min){$(parts.mbut).css("display","none");$(parts.rbut).css("display","block")}if(props.max){$(parts.xbut).css("display","block")}$(wnd).removeClass("xw-resize");if(!props.fixed&&havefixed){$(top).css("position","fixed")}design.onminimize(this);props.fixed=true;if(desktop){moveTo(desktop.calcexclude(0),desktop.calcexclude(2),1)}else{moveTo(0,0,1)}resizeTo(200,30,0,1);if(_focus.isactive()){_focus.deactivate();if(!frominit){_uWnd.activatetopwnd(desktop)}}}else{if(!frominit){hide(0);if(!props.notaskbar){desktop._onwndminimize(this,xpos,ypos,width,height)}}}}},maximize:function(act,frominit){with(this){if(state.destroyed||autosz.active||(!props.max&&!(frominit&&props.initstate=="max")&&!(state.minimized&&state.beforemin=="max"))||!props.header){return}stopdrag();stopresize();if(!state.maximized&&!state.minimized){restRect=[xpos,ypos,width,height,props.fixed]}if(!frominit){sesupdate=1}if(props.onposchange&&!state.maximized){props.onposchange.apply(app,[this])}$(parts.hdr).removeClass("xw-draggable");$(wnd).removeClass("xw-resize");if(props.max){$(parts.xbut).css("display","none");$(parts.rbut).css("display","block")}if(props.min){$(parts.mbut).css("display","block")}if(!desktop&&!props.fixed&&havefixed){$(top).css("position","fixed")}hideSh();if(desktop&&!props.fixed){moveTo(desktop.calcexclude(0),desktop.calcexclude(2),1);resizeTo(desktop.calcwidth(),desktop.calcheight(),0,1)}else{var d=_uWnd.getdims();props.fixed=true;moveTo(0,0,1);resizeTo(d.clientW,d.clientH,0,1)}if(state.minimized){if(!ontaskbar){this.design.onrestore(this)}else{show(false,0)}}else{if(frominit){show(false,0)}}state.maximized=true;state.minimized=false;_foreachchild(function(w){if(w.props.min){return 1}if(w.state.prevvisible){w.show(0,0)}},0);if(act){activate()}}},restore:function(act){with(this){if(state.destroyed||!props.header){return}stopdrag();stopresize();sesupdate=1;if(this.props.onposchange&&(state.minimized||state.maximized)){props.onposchange.apply(app,[this])}$(parts.rbut).css("display","none");if(props.max){$(parts.xbut).css("display","block")}if(state.minimized&&props.min){$(parts.mbut).css("display","block")}if(!props.nomove){$(parts.hdr).addClass("xw-draggable")}if(props.resize){$(wnd).addClass("xw-resize")}if(state.minimized){if(!ontaskbar){this.design.onrestore(this)}else{show(false,0)}}showSh();state.maximized=state.minimized=false;var r=restRect;if(r){props.fixed=r[4];if(!props.fixed&&havefixed){$(top).css("position","absolute")}moveTo(r[0],r[1],1);resizeTo(r[2],r[3],0,1)}_foreachchild(function(w){if(w.props.min){return 1}if(w.state.prevvisible){w.show(0,0)}},0);if(act){activate()}}},_ondragmousemove:function(c,b,a,f){var e=_uWnd.getdims();a+=c;f+=b;if(a+this.width<30){a=30-this.width}if(f<-5){f=-5}if(this.desktop&&!this.props.fixed){if(a>this.desktop.width-20){a=this.desktop.width-20}if(f>this.desktop.height-20){f=this.desktop.height-20}}else{if(this.props.fixed){if(a>e.clientW-20){a=e.clientW-20}if(f>e.clientH-20){f=e.clientH-20}}else{if(a>e.docW-20){a=e.docW-20}if(f>e.docH-20){f=e.docH-20}}}this.moveTo(a,f)},onstartdrag:function(){this.design.onstartdrag(this)},onstopdrag:function(){this.design.onstopdrag(this)},_ondragmousedown:function(e){with(this){if(e.which==3&&typeof _uDesk=="undefined"){return}if(e.which==1&&e.ctrlKey){e.which=3}if(this.props.havesysmenu&&e.which==3&&!state.resizing&&!state.disabled&&!props.toolwindow){this.showsysmenu(e.pageX,e.pageY);return}if(props.nomove||state.resizing||state.maximized||state.disabled||e.which!=1){return}_drag.start(e,xpos,ypos);props.x=xpos;props.y=ypos}},stopdrag:function(){this._drag.stop()},_onrsmousemove:function(s,r,f,e,i,a,b){var o,n,p,g,k=_uWnd.getdims(),q=10,j=10,l,c;o=f;n=e;p=i;g=a;if(this.props.header){q+=this._countbuttonwidth()}q=Math.max(q,this.minwidth)+this.decor.w;j=Math.max(j,this.minheight)+this.decor.h;l=this.maxwidth;if(l==0){l=k.clientW}else{l+=this.decor.w}c=this.maxheight;if(c==0){c=k.clientH}else{c+=this.decor.h}if(b.indexOf("n")>=0){n=e+r;if(n<0){n=0}g=e+a-n;if(g<j){g=j;n=e+a-g}else{if(g>c){g=c;n=e+a-g}}}if(b.indexOf("s")>=0){g=a+r;if(g<j){g=j}else{if(g>c){g=c}}}if(b.indexOf("w")>=0){o=f+s;if(o<0){o=0}p=f+i-o;if(p<q){p=q;o=f+i-p}else{if(p>l){p=l;o=f+i-p}}}if(b.indexOf("e")>=0){p=i+s;if(p<q){p=q}else{if(p>l){p=l}}}this.moveTo(o,n);this.resizeTo(p,g)},_onrsmousedown:function(e,b){with(this){if(_drag.active||state.disabled||state.maximized||state.minimized||autosz.active||!props.resize||e.which!=1){return}props.x=xpos;props.y=ypos;this.stopautosize();_resize.start(e,xpos,ypos,width,height,b)}},onstartrs:function(){this.design.onstartresize(this)},onstoprs:function(){this.design.onstopresize(this)},stopresize:function(){this._resize.stop()}};function _txt(sign){var lng=window._uDeflang,a,p=arguments;if(!lng){a=sign}else{var db=window._uSigns;if(!db||!db[lng]){a=sign}else{if(sign in db[lng]){a=db[lng][sign]}else{a=sign}}}if(a.substr(0,6)=="%eval:"){try{return eval(a.substr(6))}catch(e){return"ERROR "+e}}function _txtproc(str,param){return p[param]}if(p.length>1){a=a.replace(/%([1-9])/g,_txtproc)}return a}function _uColorBox(v,c,g){var u=new Array("00","33","66","99","CC","FF");var d=new Array("00","33","66","99","CC","FF");var o=new Array("00","33","66","99","CC","FF");var r=new Array("909090","939393","969696","999999","9C9C9C","9F9F9F","C0C0C0","C3C3C3","C6C6C6","C9C9C9","CCCCCC","E0E0E0","F0F0F0","F3F3F3","F6F6F6","F9F9F9","FCFCFC","FFFFFF");var j="00",t="00",f="00",b="00";var h=0,m=0,a=0;var n=0,l=0,k=0;var w=0;var q='<table border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">';var p;while(l<6){q+="<tr>";var n=0;var f=o[a];while(n<6){var k=0;var t=d[m];while(k<6){var j=u[h];var e=""+j+t+f;if(g!=undefined){p=g+"('"+v+"','"+c+"','"+e+"')"}else{p="$('#"+v+"').hide(); $('#"+c+"').val('"+e+"');"}q+='<td style="width:8px;height:8px;cursor:pointer;background-color:#'+e+';" onclick="'+p+'"></td>';k++;h++;if(h==6){h=0}}n++;m++;if(m==6){m=0}w++;if(w==3){q+="</tr>";w=0}}l++;a++;if(a==6){a=0}}for(var s=0;s<r.length;s++){if(g!=undefined){p=g+"('"+v+"','"+c+"','"+r[s]+"')"}else{p="$('#"+v+"').hide(); $('#"+c+"').val('"+r[s]+"');"}q+='<td style="width:8px;height:8px;cursor:pointer;background-color:#'+r[s]+';" onclick="'+p+'"></td>'}q+="</table>";$("#"+v).html(q)}function _uParseXML(xml,wnd,tabid,papp){xml=xml.documentElement;var tabctrl=null,app=null,_uParse_footers={};if(wnd&&wnd.constructor==_uTabCtrl){tabctrl=wnd;wnd=tabctrl.wnd||null;app=papp||tabctrl.app||null}else{if(wnd&&wnd.constructor==_uWnd){app=papp||wnd.app||null}else{app=papp||null;wnd=null}}if(xml==null){alert("Server connection Error. Sorry.")}for(var _uParse_i=0;_uParse_i<xml.childNodes.length;_uParse_i++){if(xml.childNodes[_uParse_i].nodeName=="cmd"){var cmd="",target="",data,height=null;for(var _uParse_j=0;_uParse_j<xml.childNodes[_uParse_i].attributes.length;_uParse_j++){if(xml.childNodes[_uParse_i].attributes[_uParse_j].name=="h"){height=parseInt(xml.childNodes[_uParse_i].attributes[_uParse_j].value)}if(xml.childNodes[_uParse_i].attributes[_uParse_j].name=="p"){cmd=xml.childNodes[_uParse_i].attributes[_uParse_j].value}if(xml.childNodes[_uParse_i].attributes[_uParse_j].name=="t"){target=xml.childNodes[_uParse_i].attributes[_uParse_j].value}}if(xml.childNodes[_uParse_i].firstChild&&xml.childNodes[_uParse_i].firstChild.data){data=xml.childNodes[_uParse_i].firstChild.data}else{data=""}if(cmd=="innerHTML"&&target.match(/^layerContent(.+)/)){_uWnd.content(RegExp.$1,data)}if(cmd=="innerHTML"&&target.match(/^layerTitle(.+)/)){_uWnd.setTitle(RegExp.$1,data)}if(cmd=="innerHTML"){$("#"+target).html(data)}else{if(cmd=="+innerHTML"){$("#"+target).prepend(data)}else{if(cmd=="innerHTML+"){$("#"+target).append(data)}else{if(cmd=="innerHTMLspanAll"){$("span."+target).html(data)}else{if(cmd=="innerHTMLdivAll"){$("div."+target).html(data)}else{if(cmd=="value"){$("#"+target).val(data)}else{if(cmd=="jsa"){includeJSfile(data,target)}else{if(cmd=="js"){eval(data)}else{if(cmd=="content"&&target.length>0){var r=target.match(/^([^:]+):(.+)/);if(r){if(typeof _uParse_footers["_uhh"+r]=="number"&&_uParse_footers["_uhh"+r]!=NaN){_uTabCtrl.headerheight(r[1],r[2],_uParse_footers["_uhh"+r])}if(typeof _uParse_footers["_ufh"+r]=="number"&&_uParse_footers["_ufh"+r]!=NaN){_uTabCtrl.footerheight(r[1],r[2],_uParse_footers["_ufh"+r])}_uTabCtrl.content(r[1],r[2],data,_uParse_footers["_uhc"+r],_uParse_footers["_ufc"+r])}else{_uWnd.content(target,data)}}else{if(cmd=="header"&&target.length>0){var r=target.match(/^([^:]+):(.+)/);if(r){_uParse_footers["_uhc"+r]=data;_uParse_footers["_uhh"+r]=height}else{if(height!=NaN){_uWnd.headerheight(target,height)}_uWnd.header(target,data)}}else{if(cmd=="footer"&&target.length>0){var r=target.match(/^([^:]+):(.+)/);if(r){_uParse_footers["_ufc"+r]=data;_uParse_footers["_ufh"+r]=height}else{if(height!=NaN){_uWnd.footerheight(target,height)}_uWnd.footer(target,data)}}else{if(cmd=="title"&&target.length>0){var r=target.match(/^([^:]+):(.+)/);if(r){_uTabCtrl.setTitle(r[1],r[2],data)}else{_uWnd.setTitle(target,data)}}else{if(cmd=="close"&&target.length>0){var r=target.match(/^([^:]+):(.+)/);if(r){if(!data||isNaN(parseInt(data))){_uTabCtrl.closeTab(r[1],r[2])}else{setTimeout("_uTabCtrl.closeTab('"+r[1]+"','"+r[2]+"');",parseInt(data))}}else{if(!data||isNaN(parseInt(data))){_uWnd.close(target)}else{setTimeout("_uWnd.close('"+target+"');",parseInt(data))}}}else{if(tabctrl&&tabid>=0){if(cmd=="content"){if(typeof _uParse_footers._uhh=="number"&&_uParse_footers._uhh!=NaN){tabctrl.headerheight(tabid,_uParse_footers._uhh)}if(typeof _uParse_footers._ufh=="number"&&_uParse_footers._ufh!=NaN){tabctrl.footerheight(tabid,_uParse_footers._ufh)}tabctrl.content(tabid,data,_uParse_footers._uhc,_uParse_footers._ufc)}else{if(cmd=="header"){_uParse_footers._uhc=data;_uParse_footers._uhh=height}else{if(cmd=="footer"){_uParse_footers._ufc=data;_uParse_footers._ufh=height}else{if(cmd=="title"){tabctrl.setTitle(tabid,data)}else{if(cmd=="close"){if(!data||isNaN(parseInt(data))){tabctrl.closeTab(tabid)}else{setTimeout("var w=_uTabCtrl.all["+tabctrl.idx+"];if(w)w.closeTab('"+tabid+"');",parseInt(data))}}}}}}}else{if(wnd&&!tabctrl){if(cmd=="content"){wnd.content(data)}else{if(cmd=="header"){if(height!=NaN){wnd.headerheight(height)}wnd.header(data)}else{if(cmd=="footer"){if(height!=NaN){wnd.footerheight(height)}wnd.footer(data)}else{if(cmd=="title"){wnd.setTitle(data)}else{if(cmd=="close"){if(!data||isNaN(parseInt(data))){wnd.close()}else{setTimeout("var w=_uWnd.all["+wnd.idx+"];if(w)w.close();",parseInt(data))}}}}}}}}}}}}}}}}}}}}}}}}var _defAjaxError=function(d,b,a){if(this.tabctrl&&_uTabCtrl.all[this.tabctrl]){_uTabCtrl.all[this.tabctrl]._onerror(this.tabid,d,b,a,this)}else{if(this.wnd&&_uWnd.all[this.wnd]){_uWnd.all[this.wnd]._onerror(d,b,a,this)}}if(_uWnd.defdesktop){return}try{_show_log_form();return}catch(c){}if(!this.tabctrl&&!this.wnd){window.location.reload()}};var _hookAjaxError=null;function _uAjaxRequest(a,b){if(!a){return null}var c=$.extend({success:_defAjaxSuccess,error:_defAjaxError,async:1,cache:true,dataType:"xml",type:"GET",timeout:25000},b||{});if(c.app&&c.app.appname&&c.app.pid>0){c.app=c.app.pid}if(c.wnd&&c.wnd.constructor==_uWnd){c.wnd=c.wnd.idx}if(c.tabctrl&&c.tabctrl.constructor==_uTabCtrl){c.tabctrl=c.tabctrl.idx}if(!c.data){c.data={}}c.data._tp_=c.dataType;if(c.app>0){c.data._ai=c.app}if(c.app>0&&_uApp.all[c.app]&&_uApp.all[c.app]._admpasscook){c.data._apc=_uApp.all[c.app]._admpasscook}if(c.wnd>0){c.data._wi=c.wnd}if(c.tabctrl>0&&c.tabid>=0){c.data._tci=c.tabctrl;c.data._ti=c.tabid}if(_hookAjaxError&&!c.noerrorhook){c.prev_error=c.error;c.error=_hookAjaxError}c.url=a;if(c.app>0&&!c.nosuccesshook){c.prev_success=c.success;c.success=_hookAjaxSuccess}return jQuery.ajax(c)}var _hookAjaxSuccess=function(b,a){if(!this.prev_success){return}if(this.app>0&&typeof _uApp!="undefined"&&this.prev_success!=_defAjaxSuccess){if(_uApp.all[this.app]&&!_uApp.all[this.app].exited){this.prev_success.call(_uApp.all[this.app],b,a,this)}}else{this.prev_success.call(this,b,a)}};var _defAjaxSuccess=function(c,b){var a=null,e=null,d=null;if(this.dataType=="xml"){if(this.wnd>0&&_uWnd.all[this.wnd]&&!_uWnd.all[this.wnd].state.destroyed){a=_uWnd.all[this.wnd]}if(this.tabctrl>0&&_uTabCtrl.all[this.tabctrl]&&!_uTabCtrl.all[this.tabctrl].state.destroyed){d=_uTabCtrl.all[this.tabctrl]}if(this.app>0&&typeof _uApp!="undefined"&&_uApp.all[this.app]&&!_uApp.all[this.app].exited){e=_uApp.all[this.app]}if(d){_uParseXML(c,d,this.tabid,e)}else{_uParseXML(c,a,0,e)}}};var _defAjaxFormError=function(g,d,c){if(this.tabctrl&&_uTabCtrl.all[this.tabctrl]){_uTabCtrl.all[this.tabctrl]._onerror(this.tabid,g,d,c,this)}else{if(this.wnd&&_uWnd.all[this.wnd]){_uWnd.all[this.wnd]._onerror(g,d,c,this)}}if(!this._formobj){return}var b=this._formobj.onerror||this._formobj.getAttribute("onerror");if(!b){return}if(typeof b=="string"){try{b=new Function(b)}catch(f){return}}if(typeof b=="function"||typeof b=="object"){try{b.call(this._formobj,g,d,c,this)}catch(f){return}}};var _defAjaxFormComplete=function(f,c){if(!this._formobj){return}var b=this._formobj.oncomplete||this._formobj.getAttribute("oncomplete");if(!b){return}if(typeof b=="string"){try{b=new Function(b)}catch(d){return}}if(typeof b=="function"||typeof b=="object"){try{b.call(this._formobj,f,c)}catch(d){return}}};function _uPostForm(a,b){if(!a&&b&&b.url){_uAjaxRequest(b.url,b);return}var c;if(typeof(a)!="object"){c=$("#"+a)}else{c=$(a)}if(!c.length){return}var d=$.extend({success:_defAjaxSuccess,error:_defAjaxFormError,complete:_defAjaxFormComplete,url:c.attr("action")||window.location.toString(),type:c.attr("method")||"GET",dataType:"xml",semantic:false},b||{});if(d.app&&d.app.appname&&d.app.pid>0){d.app=d.app.pid}if(d.wnd&&d.wnd.constructor==_uWnd){d.wnd=d.wnd.idx}if(d.tabctrl&&d.tabctrl.constructor==_uTabCtrl){d.tabctrl=d.tabctrl.idx}if(!d.data){d.data={}}d.data._tp_=d.dataType;if(d.app>0){d.data._ai=d.app}if(d.app>0&&_uApp.all[d.app]&&_uApp.all[d.app]._admpasscook){d.data._apc=_uApp.all[d.app]._admpasscook}if(d.wnd>0){d.data._wi=d.wnd}if(d.tabctrl>0&&d.tabid>=0){d.data._tci=d.tabctrl;d.data._ti=d.tabid}if(_hookAjaxError&&!d.noerrorhook){d.prev_error=d.error;d.error=_hookAjaxError}d._formobj=c[0];if(d.app>0&&!d.nosuccesshook){d.prev_success=d.success;d.success=_hookAjaxSuccess}c.ajaxSubmit(d)}function _uAjaxQueue(a){this.idx=_uAjaxQueue.nextidx++;_uAjaxQueue.all[this.idx]=this;this.props=$.extend({maxsize:10,replacelast:0,onfirst:null,onbefore:null,onafter:null,onlast:null,param:null,thispar:null},a||{});this.queue=[];this.head=0;this.inprogress=0;this.curXML=null}_uAjaxQueue.all=[];_uAjaxQueue.nextidx=1;_uAjaxQueue.oncomplete=function(b,a){if(this.prev_complete_queue){try{this.prev_complete_queue(b,a)}catch(c){}}setTimeout("var w=_uAjaxQueue.all["+this.uajaxqueue+"];if(w)w._oncomplete(0,'"+a+"');",100)};_uAjaxQueue.prototype={add:function(b,a){if(!b||!b.url){return -1}if(this.queue.length-this.head>=this.props.maxsize){if(!this.props.replacelast||this.props.maxsize<2){return 0}this.queue.splice(this.queue.length-1,1)}var c=$.extend({},b);c.prev_complete_queue=c.complete;c.complete=_uAjaxQueue.oncomplete;c.uajaxqueue=this.idx;this.queue[this.queue.length]=c;if(!a){this.start()}return 1},start:function(){if(this.inprogress||this.head>=this.queue.length){return}this.inprogress=1;if(this.props.onfirst){this.props.onfirst.call(this.props.thispar,this.props.param,this.queue[this.head],this)}this.head--;this._oncomplete(1)},_oncomplete:function(c,a){if(!this.inprogress){return}this.curXML=null;this.head++;if(!c&&this.props.onafter){this.props.onafter.call(this.props.thispar,this.props.param,this.queue[this.head-1],this,a)}if(this.head>=this.queue.length){if(this.props.onlast){this.props.onlast.call(this.props.thispar,this.props.param,this.queue[this.head-1],this,a)}this.stop();return}if(this.props.onbefore){this.props.onbefore.call(this.props.thispar,this.props.param,this.queue[this.head],this)}try{this.curXML=_uAjaxRequest(this.queue[this.head].url,this.queue[this.head]);if(!this.curXML){_uAjaxQueue.oncomplete.call(this.queue[this.head],null,"error")}}catch(b){_uAjaxQueue.oncomplete.call(this.queue[this.head],null,"error")}},stop:function(){if(!this.inprogress){return}if(this.curXML){try{this.curXML.abort()}catch(a){}}this.curXML=null;this.queue.splice(0,this.queue.length);this.head=0;this.inprogress=0},depth:function(){if(!this.inprogress){return 0}return this.queue.length-this.head}};function includeJSfile(b,c){if(c&&document.getElementById(c)){return}var a=document.createElement("script");a.setAttribute("type","text/javascript");if(c){a.setAttribute("id",c)}a.setAttribute("src",b);document.getElementsByTagName("head").item(0).appendChild(a)}var _entrRm={};function _entrRem(c,a,b,d){if(!d){d="Are you sure?"}if(!_entrRm[c]&&confirm(d)){_entrRm[c]=1;document.getElementById(c).src=b+"/img/fr/EmnAjax.gif";_uPostForm("",{url:a})}}function _coloredTDs(d,e){var a="";if(typeof(d)!="object"){d=document.getElementById(d)}if(typeof(document.getElementsByTagName)!="undefined"){a=d.getElementsByTagName("td")}else{if(typeof(d.cells)!="undefined"){a=d.cells}else{return false}}for(var b=0;b<a.length;b++){a[b].className=e}}function openLayerB(d,i,c,m,l,e,g,b,a,k,j){new _uWnd(d,m,l,e,{autosize:g?1:0,modal:a?1:0,align:j?j:"center"},{url:c,form:i,cache:1})}function _showOnTop(c,a){var b=_uWnd.getTopZ();if(a){document.getElementById(c).style.zIndex=b+1}else{document.getElementById("outLayer"+c).style.zIndex=b+1}}function encodeJS(a){return String(a).replace(/\\/g,"\\\\").replace(/\r/g,"").replace(/\n/g,"\\n").replace(/'/g,"\\'").replace(/"/g,'\\"')}function shrinkSpaces(a){return String(a).replace(/\t/g," ").replace(/^(\s+)|(\s+)$/g,"").replace(/\s{2,}/g," ")}function encodeHtmlVal(b,a){if(a){return String(b).replace(/'/g,"&#39;").replace(/"/g,"&quot;")}return String(b).replace(/&/g,"&amp;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Date.fullYearStart="20";(function(){function c(d,e){if(!Date.prototype[d]){Date.prototype[d]=e}}c("isLeapYear",function(){var d=this.getFullYear();return(d%4==0&&d%100!=0)||d%400==0});c("isWeekend",function(){return this.getDay()==0||this.getDay()==6});c("isWeekDay",function(){return !this.isWeekend()});c("getDaysInMonth",function(){return[31,(this.isLeapYear()?29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]});c("getDayName",function(d){return d?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()]});c("getMonthName",function(d){return d&&d!=2?Date.abbrMonthNames[this.getMonth()]:(d==2?Date.rMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()])});c("getDayOfYear",function(){var d=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-d.getTime())/86400000)});c("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7)});c("setDayOfYear",function(d){this.setMonth(0);this.setDate(d);return this});c("addYears",function(d){this.setFullYear(this.getFullYear()+d);return this});c("addMonths",function(d){var e=this.getDate();this.setMonth(this.getMonth()+d);if(e>this.getDate()){this.addDays(-this.getDate())}return this});c("addDays",function(d){this.setDate(this.getDate()+d);return this});c("addHours",function(d){this.setHours(this.getHours()+d);return this});c("addMinutes",function(d){this.setMinutes(this.getMinutes()+d);return this});c("addSeconds",function(d){this.setSeconds(this.getSeconds()+d);return this});c("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this});var b=function(d){if(!d.match(/\$[a-zA-Z]+\$/)){return d.replace(/yyyy/g,"$yyyy$").replace(/yy/g,"$yy$").replace(/mmmm/g,"$MO$").replace(/mmm/g,"$Mo$").replace(/mm/g,"$mo$").replace(/dd/g,"$dd$")}return d};c("asString",function(i,d){var l=null,k=null,g,e="";if(i!==false){l=i||Date.udateformat}if(d){if(d==1||d===true){k=Date.utimeformat}else{k=d}}if(l){l=b(l);g={yyyy:this.getFullYear(),yy:(this.getFullYear()+"").substring(2),MO:this.getMonthName(0),Mo:this.getMonthName(1),MOD:this.getMonthName(2),WD:this.getDayName(0),wd:this.getDayName(1),mo:a(this.getMonth()+1),d:this.getDate(),dd:a(this.getDate())};e+=l.replace(/\$([a-zA-Z]+)\$/g,function(m,h){return g[h]})}if(k){if(e){e+=" "}var j=this.getHours(),f="AM";if(j>12){j-=12;f="PM"}else{if(j==12){f="PM"}}g={H:this.getHours(),HH:a(this.getHours()),h:j,hh:a(j),AP:f,mm:a(this.getMinutes()),ss:a(this.getSeconds())};e+=k.replace(/\$([a-zA-Z]+)\$/g,function(m,h){return g[h]})}return e});Date.fromString=function(n,m,p,l){var x=l||b(Date.udateformat),k=Date.utimeformat,o,z,y,q,v,r,w,t;if(p){if(p!==true&&p!==1){k=p}x+=" "+k}n=n.replace(/[\x00-\x1f]+/g," ");v={yyyy:"(\\d{4}|\\d{2})",yy:"(\\d{2}|\\d{4})",MO:'([^ 0-9@"#$%^&*(){}\\[\\]+=_\\\\|;:/?.>,<~\\-]+)',Mo:'([^ 0-9@"#$%^&*(){}\\[\\]+=_\\\\|;:/?.>,<~\\-]+)',MOD:'([^0-9@"#$%^&*(){}\\[\\]+=_\\\\|;:/?.>,<~\\-]+)',mo:"(\\d{1,2})",dd:"(\\d{1,2})",d:"(\\d{1,2})",HH:"(\\d{1,2})",hh:"(\\d{1,2})",H:"(\\d{1,2})",h:"(\\d{1,2})",AP:"(AM|PM)?",mm:"(\\d{1,2})",ss:"(\\d{1,2})?"};o=new RegExp("\\$([a-zA-Z]+)\\$","g");z=0;q="^";if(!m){q+=" *"}r=[];while(y=o.exec(x)){if(y.index>z){if(m){q+=x.substr(z,y.index-z).replace(/([\\^\$*+?.|()\[\]{}])/g,"\\$1")}else{q+='[ @"#$%^&*(){}\\[\\]+=_\\\\|;:/?.>,<~\\-]+'}}z=y.index+y[0].length;if(v[y[1]]){q+=v[y[1]];r.push(y[1])}else{z=y.index}}if(x.length>z){if(m){q+=x.substr(z,x.length-z).replace(/([\\^\$*+?.|()\[\]{}])/g,"\\$1")}else{q+='[ @"#$%^&*(){}\\[\\]+=_\\\\|;:/?.>,<~\\-]+'}}if(!m){q+=" *"}q+="$";q=new RegExp(q,"i");y=q.exec(n);if(!y){return false}w=new Date();w.zeroTime();var f=w.getDate(),e=w.getMonth(),g=w.getFullYear();for(var u=0;u<r.length;u++){if(r[u]=="yyyy"||r[u]=="yy"){t=parseInt(y[u+1],10);if(isNaN(t)||t<0){return false}if(t<30){t+=2000}else{if(t<100){t+=1900}}g=t}else{if(r[u]=="MO"||r[u]=="MOD"||r[u]=="Mo"){for(t=0;t<12;t++){if(Date.abbrMonthNames[t].indexOf(y[u+1])>=0){e=t;break}}if(t>=12){for(t=0;t<12;t++){if(Date.rMonthNames[t].indexOf(y[u+1])>=0){e=t;break}}}if(t>=12){for(t=0;t<12;t++){if(Date.monthNames[t].indexOf(y[u+1])>=0){e=t;break}}}if(t>=12){return false}}else{if(r[u]=="mo"){t=parseInt(y[u+1],10);if(isNaN(t)||t<=0||t>12){return false}e=t-1}else{if(r[u]=="dd"||r[u]=="d"){t=parseInt(y[u+1],10);if(isNaN(t)||t<=0||t>31){return false}f=t}else{if(r[u]=="HH"||r[u]=="H"){t=parseInt(y[u+1],10);if(isNaN(t)||t<0||t>24){return false}w.setHours(t)}else{if(r[u]=="hh"||r[u]=="h"){t=parseInt(y[u+1],10);if(isNaN(t)||t<0||t>12){return false}w.setHours(t)}else{if(r[u]=="mm"){t=parseInt(y[u+1],10);if(isNaN(t)||t<0||t>59){return false}w.setMinutes(t)}else{if(r[u]=="ss"){t=y[u+1]&&y[u+1].length>0?parseInt(y[u+1],10):0;if(isNaN(t)||t<0||t>61){return false}w.setSeconds(t)}else{if(r[u]=="AP"){if(y[u+1]&&y[u+1].length>0){if(y[u+1].toLowerCase()=="pm"){if(w.getHours()<12){w.addHours(12)}}else{if(y[u+1].toLowerCase()!="am"){return false}}}}}}}}}}}}}w.setFullYear(g);w.setMonth(e,f);return w};var a=function(d){var e="0"+d;return e.substring(e.length-2)}})();function _uLoadJS(c,b,a){if(typeof c!="string"&&typeof c!="number"){return 0}if(typeof b=="function"){b={func:b}}var e=_uLoadJS._loadedJS[c];if(typeof e=="object"){if(e[0]==2){if(a){return 2}if(b){b.func.call(b.thispar,"success",b.param)}return 1}if(e[0]==1){if(b){e[e.length]=b}return 1}if(b){e[e.length]=b}}else{e=[1];if(b){e[1]=b}_uLoadJS._loadedJS[c]=e}var d={url:c,oldurl:c,dataType:"script",cache:1,complete:_uLoadJS._onloadJS};$.ajax(d)}_uLoadJS._loadedJS={};_uLoadJS._onloadJS=function(a,c){var d=_uLoadJS._loadedJS[this.oldurl];if(c!="success"){d[0]=0}else{d[0]=2}for(var b=1;b<d.length;b++){if(d[b]&&d[b].func){d[b].func.call(d[b].thispar,c,d[b].param)}}d.splice(1,d.length-1)};function _uLoadCSS(a){if(!a||!a.length){return}var c="";if(a.constructor==Array){for(var b=a.length-1;b>=0;b--){if(!/^https?:/.test(a[b])){a[b]=location.protocol+"//"+location.host+a[b]}if(a[b] in _uLoadCSS._loadedCSS){continue}c+='<link rel="stylesheet" type="text/css" href="'+a[b]+'" media="all" />';_uLoadCSS._loadedCSS[a[b]]=[0]}}else{if(!/^https?:/.test(a)){a=location.protocol+"//"+location.host+a}if(a in _uLoadCSS._loadedCSS){return}c='<link rel="stylesheet" type="text/css" href="'+a+'" media="all" />';_uLoadCSS._loadedCSS[a]=[0]}if(c.length>0){$("head").append(c)}}_uLoadCSS._loadedCSS={};function _uLoadCSSSync(c,b,a){if(typeof c!="string"&&typeof c!="number"){return 0}if(typeof b=="function"){b={func:b}}var e=_uLoadCSS._loadedCSS[c];if(typeof e=="object"){if(e[0]==2){if(a){return 2}if(b){b.func.call(b.thispar,"success",b.param)}return 1}if(e[0]==1){if(b){e[e.length]=b}return 1}if(b){e[e.length]=b}}else{e=[1];if(b){e[1]=b}_uLoadCSS._loadedCSS[c]=e}var d={url:c,oldurl:c,dataType:"text",cache:1,success:_uLoadCSSSync._onload,error:_uLoadCSSSync._onloaderr};$.ajax(d)}_uLoadCSSSync._onload=function(c,b){$("head").append('<style type="text/css" ufromurl="'+this.oldurl+'">'+c+"</style>");var d=_uLoadCSS._loadedCSS[this.oldurl];if(d[0]==0){$("link[rel=stylesheet][href="+this.oldurl+"]").remove()}d[0]=2;for(var a=1;a<d.length;a++){if(d[a]&&d[a].func){d[a].func.call(d[a].thispar,"success",d[a].param)}}d.splice(1,d.length-1)};_uLoadCSSSync._onloaderr=function(a){var c=_uLoadCSS._loadedCSS[this.oldurl];c[0]=0;for(var b=1;b<c.length;b++){if(c[b]&&c[b].func){c[b].func.call(c[b].thispar,"error",c[b].param)}}c.splice(1,c.length-1)};function _uLoadFiles(e,c,a){if(!e){e=[]}else{if(typeof(e)=="string"){e=[e]}}if(!c){c=[]}else{if(typeof(c)=="string"){c=[c]}}if(e.constructor!=Array||c.constructor!=Array||(e.length==0&&c.length==0)){return 0}if(typeof a=="function"){a={func:a}}var d={numleft:e.length+c.length,notify:a},b;for(b=0;b<e.length;b++){_uLoadJS(e[b],{thispar:d,func:_uLoadFiles._onload})}for(b=0;b<c.length;b++){_uLoadCSSSync(c[b],{thispar:d,func:_uLoadFiles._onload})}return 1}_uLoadFiles._onload=function(a){if(this.numleft<=0){return}if(a!="success"){this.numleft=0}else{this.numleft--}if(this.numleft==0){if(this.notify&&this.notify.func){this.notify.func.call(this.notify.thispar,a,this.notify.param)}}};function dumpObject(j,h,c){var g=typeof j,d;if(arguments.length<2){h=10}function a(m,k){var i,l=[0,1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f"],e="";for(i=0;i<k;i++){e=""+l[m%16]+e;m>>>=4}return e}if(g=="object"){if(!j){g="null"}else{if(j.constructor==String){g="string"}else{if(j.constructor==Number){g="number"}else{if(j.constructor==Boolean){g="boolean"}else{if(j.constructor==Array){g="array"}}}}}}switch(g){case"number":case"boolean":case"null":case"undefined":return String(j);case"string":return'"'+j.replace(/([\\"])/g,"\\$1").replace(/\n/g,"\\n").replace(/([\x00-\x1f])/g,function(e,i){return"\\x"+a(i.charCodeAt(0),2)}).replace(/([\u2028\u2029])/g,function(e,i){return"\\u"+a(i.charCodeAt(0),4)})+'"';case"array":if(h<=0){return"[?]"}d="";for(var b=0;b<j.length;b++){if(b>0){d+=","}d+=dumpObject(j[b])}return"["+d+"]";case"object":if(h<=0){return"{?}"}d="";for(var b in j){if(c&&c[b]){continue}if(d){d+=","}try{d+=dumpObject(b)+":"+dumpObject(j[b],h-1)}catch(f){d+=dumpObject(b)+":?"}}return"{"+d+"}"}}function _uHighlightA(c,e,f){var b=$(c).find("a").get(),g=null,a=0;for(var d in b){if(b[d].href&&e.indexOf(b[d].href)>=0){if(!g||a<b[d].href.length){g=b[d];a=b[d].href.length}}}if(g){$(g).addClass(f)}}function _uBuildMenu(d,b,o,q,a,e){var c,k,h,g,n,r,j,l;c=$(d)[0];if(!c){return}e=e||2000;l=function(f){_uMENU.hideallmenus();this.__umenu.show()};if($.browser.msie){c.style.zoom="1"}h=$(d+">ul").children("li").children("ul");for(k=0;k<h.length;k++){g=_ubuild_submenus(h[k]);n=j=h[k].parentNode;if(!b&&a&&(r=$(n).children("."+a)[0])){n=r}j.__umenu=new _uMENU("",{alignObj:n,align:b?"D":(window._rtl?"L":"R")},{parentnode:c,hidetimer:e},g);$(j).bind("mouseover",l);j.removeChild(h[k])}if(!o||!q){return}setTimeout("_uHighlightA($('"+d+"')[0],'"+o+"','"+q+"');",100)}function _uReplaceMenu(h,d,c,f,b){var e,a,g;e=$(h)[0];if(!e){return}if($.browser.msie){e.style.zoom="1"}g=$(h).children("ul")[0];if(!g){return}if(b){$(g).find("."+b).remove()}a=_ubuild_submenus(g);g.parentNode.__umenu=new _uMENU("",{},{width:"auto",horiz:d,statical:1,parentnode:e,noabs:1},a);g.parentNode.removeChild(g);if(!c||!f){return}setTimeout("_uHighlightA($('"+h+"')[0],'"+c+"','"+f+"');",100)}function _ubuild_submenus(e){var f=$(e).children("li"),d,c=[],g,a,b;for(d=0;d<f.length;d++){g=$(f[d]).children("ul")[0];if(g){a=_ubuild_submenus(g);g.parentNode.removeChild(g);b=$(f[d]).find("a").get();c[c.length]=[$(f[d]).html(),a,b.length>0?{action:"a"}:null]}else{b=$(f[d]).find("a").get();c[c.length]=[$(f[d]).html(),b.length>0?"a":""]}}return c}function uSetCookie(b){var a=encodeURIComponent(b.name);if(b.value){a+="="+encodeURIComponent(b.value)}else{a+="="}if(b.days){var c=new Date();c.setDate(c.getDate()+b.days);a+=";expires="+c.toUTCString()}if(b.path){a+=";path="+b.path}if(b.domain){a+=";domain="+b.domain}document.cookie=a}function _uButtonExt(a){return'<span style="display:none"><input type="image" src="/.s/img/1px.gif" style="width:1px" onclick="if(_uButtonIsDis(\'subbut'+a+"'))return false;_uButtonEn('"+a+'\',0);" id="subm'+a+'" /></span>'}function _uButton(f,d,a){var c=$.extend({ext:0,text:"Ok",content:"",style:0,id:null},a||{});var g={s:"onclick=\"$('#subm"+f+"').click();\"",r:"onclick=\"$('#"+f+"')[0].reset();\""};var i=(g[d]!="undefined")?g[d]:"";var j=(c.style==1)?["myBtnLeft","myBtnCenter","myBtnRight"]:["myBtnLeftA","myBtnCenterA","myBtnRightA"];var e=(d=="s"&&!c.ext)?'<input type="image" src="/.s/img/1px.gif" style="width:1px" onclick="if(_uButtonIsDis(\'subbut'+f+"'))return false;_uButtonEn('"+f+'\',0);" id="subm'+f+'" />':"";var b=(c.style==2)?"myBtnCont x-unselectable myBtnDis":"myBtnCont x-unselectable";var h='<table border="0" cellpadding="0" cellspacing="0" onmousedown="this.className=\'downBtn\'" onmouseover="this.className=\'overBtn\'" onmouseout="this.className=\'outBtn\'"><tr><td class="'+j[0]+'"><img border="0" src="/.s/img/1px.gif"></td><td class="'+j[1]+'"><div class="'+b+'" unselectable="on"'+(f?' id="subbut'+f+'"':"")+" "+i+" "+c.content+"><a "+(c.id?'id="'+c.id+'" ':"")+'href="javascript://" onclick="return false;">'+c.text+'</a></div></td><td class="'+j[2]+'"><img border="0" width="1" src="/.s/img/1px.gif"></td><td style="visibility:hidden;">'+e+"</td></tr></table>";return h}function _uButtonEn(b,c,a){var d;if(typeof(b)=="string"){d=b}else{if(b.tagName&&b.tagName.toLowerCase()=="div"){if(c){$(b).removeClass("myBtnDis")}else{$(b).addClass("myBtnDis")}return}d=$(b).attr("id")}if(!d){return}if(c){$("#subbut"+d,a).removeClass("myBtnDis")}else{$("#subbut"+d,a).addClass("myBtnDis")}}function _uButtonIsDis(a){if(typeof(a)=="string"){a=$("#"+a)}else{a=$(a)}if(a.hasClass("myBtnDis")){return 1}return 0}function uToolTip(){}uToolTip.tooltip=$('<div id="utooltip" class="utooltip"><div class="utooltip-body"><div class="utooltip-content">text</div></div><div class="utooltip-arrow"></div></div>');uToolTip.content=uToolTip.tooltip.find(".utooltip-content");uToolTip.timerID=null;uToolTip.active=false;uToolTip.mouseOver=function(a){if(uToolTip.timerID){window.clearTimeout(uToolTip.timerID);uToolTip.timerID=null;uToolTip.mouseOut(a)}a=$(a);var d=a.offset();var b=d.left;var c=d.top;if(a.attr("left")||b<30){uToolTip.tooltip.addClass("utooltip-left")}else{b+=a[0].offsetWidth/2;uToolTip.tooltip.removeClass("utooltip-left")}if(a.attr("bottom")||c<30){c+=a[0].offsetHeight+4;uToolTip.tooltip.addClass("utooltip-bottom")}else{uToolTip.tooltip.removeClass("utooltip-bottom")}uToolTip.tooltip.css({left:parseInt(b,10)+"px",top:parseInt(c,10)+"px"});uToolTip.title=a.attr("title");uToolTip.el=a;a.attr("title","");uToolTip.active=true;uToolTip.content.html(uToolTip.title);if(uToolTip.title&&!uToolTip.el.attr("noToolTip")){$("body").append(uToolTip.tooltip)}};uToolTip.noToolTip=function(a,b){if(b){$(a).attr("noToolTip",true)}else{$(a).removeAttr("noToolTip")}};uToolTip.hide=function(){if(uToolTip.el){uToolTip.mouseOut()}};uToolTip.show=function(b,a){if(b){uToolTip.mouseOut(null);uToolTip.mouseOver(b);if(a!=-1){a=a||3000;uToolTip.timerID=setTimeout("uToolTip.mouseOut(null);",a)}}};uToolTip.mouseOut=function(a){if(uToolTip.active){uToolTip.el.attr("title",uToolTip.title);uToolTip.tooltip.remove();uToolTip.active=false}};uToolTip.init=function(a){$(document).ready(function(){var b=".utooltip-holder";if(a){b="#"+a+" .utooltip-holder"}$(b).die("mouseover.tooltip").die("mouseout.tooltip").live("mouseover.tooltip",function(){uToolTip.mouseOver(this)}).live("mouseout.tooltip",function(){uToolTip.mouseOut(this)})})};function _uTransStr(i){var f,a=1,d,h,c,b,e,g=_uTransStr._table;if(!g){_uTransStr.append(_uTransStr._deftable);_uTransStr._deftable=null;g=_uTransStr._table;for(f=0;f<128;f++){g[f]=_uTransStr._separators[f]?" ":String.fromCharCode(f)}}if(i==undefined){this.value="";this.length=0;this.translit="";this.transprops=[];return}this.value=typeof(i)=="string"?i:String(i);i=this.value.toLowerCase();h=this.length=i.length;c="";b=[];for(f=0;f<h;f++){d=g[i.charCodeAt(f)];if(d==" "){if(!a){b[c.length]=f<<1;c+=" ";a=1}continue}a=0;if(d==undefined){b[c.length]=f<<1;c+=i.charAt(f)}else{if(d.length==1){b[c.length]=f<<1}else{e=d.length;while(e>0){b[c.length+e-1]=(f<<1)+1;e--}}c+=d}}if(a&&c.length>0){this.translit=c.substr(0,c.length-1);b.length=c.length-1}else{this.translit=c}this.transprops=b}_uTransStr.prototype={toString:function(){return this.value},_offsetprops:function(b){for(var a=this.transprops.length-1;a>=0;a--){this.transprops[a]+=b*2}},splitsps:function(e){if(e==undefined){e=this.translit.length}var b=[],a=0,d,c=0;while(c<e-1&&(d=this.translit.indexOf(" ",a))>=0){if(a==d){a++;continue}b[c]=new _uTransStr();b[c].translit=this.translit.substring(a,d);b[c].transprops=this.transprops.slice(a,d);b[c]._offsetprops(-(this.transprops[a]>>1));b[c].value=this.value.substring(this.transprops[a]>>1,this.transprops[d]>>1);b[c].length=b[c].value.length;c++;a=d+1}d=this.translit.length;if(d>a){b[c]=new _uTransStr();b[c].translit=this.translit.substring(a);b[c].transprops=this.transprops.slice(a);b[c]._offsetprops(-(this.transprops[a]>>1));b[c].value=this.value.substring(this.transprops[a]>>1);b[c].length=b[c].value.length}return b},find:function(b,g,e){if(!b||!b.trasprops||!b.translit){b=new _uTransStr(b)}var c=-1,a,d=b.transprops,f=this.transprops;if(g&&g>0){if(e!=undefined){c=e}while(c+1<f.length&&f[c+1]>>1<g){c++}}mainl:while(1){c=this.translit.indexOf(b.translit,c+1);if(c<0){return null}a=0;if(c>0&&f[c-1]==f[c]){continue}while(a<d.length){if(((f[c+a]&1)|(d[a]&1))==0){a++;continue}if(!(f[c+a]&1)){a++;while(a<d.length&&d[a]==d[a-1]){if(f[c+a]&1){continue mainl}a++}continue}if(!(d[a]&1)){a++;while(a<d.length&&f[c+a]==f[c+a-1]){if(d[a]&1){continue mainl}a++}if(c+a<this.translit.length&&f[c+a]==f[c+a-1]){continue mainl}continue}a++;while(a<d.length&&d[a]==d[a-1]){if(f[c+a]!=f[c+a-1]){continue mainl}a++}if(a<d.length||c+a<this.translit.length){if(f[c+a]==f[c+a-1]){continue mainl}}}break}return[f[c]>>1,(c+a<this.translit.length?(f[c+a]>>1):this.length)-(f[c]>>1),c]}};_uTransStr._table=null;_uTransStr.append=function(b){if(!_uTransStr._table){_uTransStr._table=[]}for(var a=0;a<b.length;a+=2){_uTransStr._table[b[a].charCodeAt(0)]=b[a+1]}};_uTransStr._separators=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1];_uTransStr._deftable=["\u00e0","a","\u00e1","a","\u00e2","a","\u00e3","a","\u00e4","a","\u00e5","a","\u00e6","ae","\u00e7","c","\u00e8","e","\u00e9","e","\u00ea","e","\u00eb","e","\u00ec","i","\u00ed","i","\u00ee","i","\u00ef","i","\u00f0","d","\u00f1","n","\u00f2","o","\u00f3","o","\u00f4","o","\u00f5","o","\u00f6","o","\u00f8","o","\u00f9","u","\u00fa","u","\u00fb","u","\u00fc","u","\u00fd","y","\u00fe","th","\u00ff","y","\u0105","a","\u010d","c","\u0111","d","\u0119","e","\u0142","l","\u014b","ng","\u0153","oe","\u015f","s","\u0161","s","\u017e","z","\u0430","a","\u0431","b","\u0432","v","\u0433","g","\u0434","d","\u0435","e","\u0451","yo","\u0436","zh","\u0437","z","\u0438","i","\u0439","j","\u043a","k","\u043b","l","\u043c","m","\u043d","n","\u043e","o","\u043f","p","\u0440","r","\u0441","s","\u0442","t","\u0443","u","\u0444","f","\u0445","kh","\u0446","ts","\u0447","ch","\u0448","sh","\u0449","shch","\u044a","","\u044b","y","\u044c","'","\u044d","e","\u044e","yu","\u044f","ya","\u0454","e","\u0456","i","\u0457","yi","\u0491","g","\u2116","#"];var typeaheadUtil=(function(){var t=/[ ]+/g,s=/[^ ]+/g,v=/[^\w ]/g,u=/[-~_\u2010\u2011\u2012\u2013\u2014\u2015]+/g;var r=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");var q={"\u0430":"a","\u00e0":"a","\u00e1":"a","\u00e2":"a","\u00e3":"a","\u00e4":"a","\u00e5":"a","\u0431":"b","\u0446":"c","\u00e7":"c","\u0434":"d","\u00f0":"d","\u044d":"e","\u0435":"e","\u0451":"e","\u00e8":"e","\u00e9":"e","\u00ea":"e","\u00eb":"e","\u0444":"f","\u0433":"g","\u0445":"h","\u0438":"i","\u00ec":"i","\u00ed":"i","\u00ee":"i","\u00ef":"i","\u044b":"i","\u0436":"j","\u043a":"k","\u043b":"l","\u043c":"m","\u043d":"n","\u00f1":"n","\u043e":"o","\u00f8":"o","\u00f6":"o","\u00f5":"o","\u00f4":"o","\u00f3":"o","\u00f2":"o","\u043f":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u044e":"u","\u00fc":"u","\u00fb":"u","\u00fa":"u","\u00f9":"u","\u0432":"v","\u0439":"y","\u00ff":"y","\u00fd":"y","\u0437":"z","\u00e6":"ae","\u0153":"oe","\u0447":"ch","\u0448":"sh","\u0449":"sch","\u044f":"ya"};var p=function(a){return a?a.replace(v," "):""};var o=function(a){return a?a.replace(r,"\\$1"):""};var n=function(c){c=(""+c).toLowerCase();var d="",b="";for(var a=c.length;a--;){b=c.charAt(a);d=(q[b]||b)+d}return d.replace(t," ")};var m=function(a){return a?a.replace(u," "):""};var l=function(e){e=e.toLowerCase();var a=n(e),b=p(a),f=m(a);if(e!=a){e+=" "+a}if(e!=b){e+=" "+b}if(e!=f){e+=" "+f}var d=[],c={},g=s.exec(e);while(g){g=g[0];if(!c[g]){d.push(g);c[g]=true}g=s.exec(e)}return d};return{escape:o,flatten:n,tokenize:l}})();function _uOverlay(f,d,b,a,c){var e=$("<div id='"+f+"'></div").css({"z-index":c,left:0,top:0,width:$(document).width()+"px",height:$(document).height()+"px","background-color":b,opacity:d}).hide().bind("mousedown",function(g){g.stopPropagation();g.preventDefault();_uWnd.globalmousedown()}).prependTo("body");if($.browser.msie&&parseFloat($.browser.version)<=8&&document.documentMode!=8){e.css({position:"absolute"})}else{e.css({position:"fixed"})}if($.browser.msie&&parseFloat($.browser.version)<8){e.css({filter:"alpha(opacity="+d*100+")"})}e.fadeIn(a);$(window).resize(function(){e.css({width:$(document).width(),height:$(document).height()})})}function _uStopAllAudioPlayers(){$(".uAudioPlayer").each(function(a,b){b.Stop()})}function _uAudioPlayer(b,e,d){var c=$("#"+e)[0];if(!c){if(typeof d!="number"||isNaN(d)){d=0}if(d>=10){return}setTimeout("_uAudioPlayer("+dumpObject(b)+","+dumpObject(e)+","+(d+1)+");",100);return}var a="";if(b.autoplay&&b.autoplay=="1"){b.autoplay=1}else{b.autoplay=0}if(b.loop&&b.loop=="1"){b.loop=1}else{b.loop=0}if(b.small&&b.small=="1"){a='<object type="application/x-shockwave-flash" class="uAudioPlayer" allowScriptAccess="always" width="35" height="16" data="/.s/flash/audio1.swf?song_url='+b.url+"&autoplay="+b.autoplay+"&loop="+b.loop+'"><param name="movie" value="/.s/flash/audio1.swf?song_url='+b.url+"&autoplay="+b.autoplay+"&loop="+b.loop+'"/><param name="wmode" value="transparent"/><param name="allowScriptAccess" value="always"/></object>'}else{a='<object type="application/x-shockwave-flash" class="uAudioPlayer" allowScriptAccess="always" width="190" height="16" data="/.s/flash/audio.swf?song_url='+b.url+"&background_color=2D548A&show_copyright=0&autoplay="+b.autoplay+"&textoff=0&loop="+b.loop+'"><param name="movie" value="/.s/flash/audio.swf?song_url='+b.url+"&background_color=2D548A&show_copyright=0&autoplay="+b.autoplay+"&textoff=0&loop="+b.loop+'"/><param name="wmode" value="transparent"/><param name="allowScriptAccess" value="always"/></object>'}$(c).html(a)}function _uVideoPlayer(b,j,o){var i=$("#"+j)[0];if(!i){if(typeof o!="number"||isNaN(o)){o=0}if(o>=10){return}setTimeout("_uVideoPlayer("+dumpObject(b)+","+dumpObject(j)+","+(o+1)+");",100);return}var n="",l=0,f=0,g=0;if(b.url.match(/youtube\.com/i)){g=1;var a=/v=([^\s\&\;\?]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://youtube.com/v/"+d[1];l=640;f=385}}if(b.url.match(/youtu\.be/i)){g=1;var a=/be\/([^\s\&\;\?]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://youtube.com/v/"+d[1];l=640;f=385}}else{if(b.url.match(/rutube\.ru/i)){g=1;var a=/v=([^\s\&\;]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://video.rutube.ru/"+d[1];l=640;f=360}}else{if(b.url.match(/dailymotion\.com/i)){g=1;var a=/video\/([^\s]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://www.dailymotion.com/swf/"+d[1];l=620;f=352}}else{if(b.url.match(/smotri\.com/i)){g=1;var a=/id=([^\s\&\;]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://pics.smotri.com/scrubber_custom8.swf?file="+d[1]+"&bufferTime=3&autoStart=false&str_lang=rus&xmlsource=http%3A%2F%2Fpics.smotri.com%2Fcskins%2Fblue%2Fskin_color_lightaqua.xml&xmldatasource=http%3A%2F%2Fpics.smotri.com%2Fskin_ng.xml";l=400;f=330}}else{if(b.url.match(/video\.mail\.ru/i)){g=1;var a=/(.*?)\/(\d+)\.html/;var d=a.exec(b.url);if(d&&d[1]&&d[2]){n="http://img.mail.ru/r/video2/player_v2.swf?par="+d[1]+"/$"+d[2]+"$0$300";l=626;f=367}}else{if(b.url.match(/vision\.rambler\.ru/i)){g=1;var a=/users\/([^\s]+)/;var d=a.exec(b.url);if(d&&d[1]){var p=d[1];p=p.replace(/\/+$/,"");n="http://vision.rambler.ru/i/e.swf?id="+p;l=550;f=400}}else{if(b.url.match(/vimeo\.com/i)){g=1;var a=/\/([\d]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://vimeo.com/moogaloop.swf?clip_id="+d[1]+"&show_title=1&show_byline=0&show_portrait=0&fullscreen=1&autoplay=0";l=640;f=360}}else{if(b.url.match(/metacafe\.com/i)){g=1;var a=/watch\/([\d]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://www.metacafe.com/fplayer/"+d[1]+"/.swf";l=615;f=380}}else{if(b.url.match(/myvideo\.de/i)){g=1;var a=/watch\/([\d]+)/;var d=a.exec(b.url);if(d&&d[1]){n="http://www.myvideo.de/movie/"+d[1];l=613;f=383}}}}}}}}}}var c="";if(n&&n.length>1){var k=b.width?b.width:l;var e=b.height?b.height:f;if(typeof(swfobject)=="object"&&swfobject.embedSWF){swfobject.embedSWF(n,j,k,e,"10","",{},{allowFullScreen:"true",wmode:"transparent",quality:"high"},{align:"middle"});return}c='<object allowfullscreen="true" type="application/x-shockwave-flash" width="'+k+'" height="'+e+'" data="'+n+'"><param name="movie" value="'+n+'" /><param name="wmode" value="transparent"></object>'}else{if(g){c='<span style="border-bottom:1px dashed red;text-align:center;">Incorrect video URL.</span>'}else{c='<span style="border-bottom:1px dashed red;text-align:center;">Not supported video service. Please use YouTube.com for your video files.</span>'}}$(i).html(c)}$.fn.imgload=function(a){var b={container:window,holder:"data-path-holder",targets:this,speed:1500};if(a){$.extend(b,a)}$(b.targets).bind("load",function(){$(this).animate({opacity:1},b.speed)});$(b.container).bind("scroll",function(){$(b.targets).each(function(d,e){var c=$(e),f=$(window);if(c.attr(b.holder)){if((Math.abs((f.scrollTop()+f.height()/2)-Math.round(c.offset().top))<f.height())||(Math.abs(f.scrollTop()-c.offset().top)<(c.height()+10))){c.css("opacity",0).attr("src",c.attr(b.holder)).removeAttr(b.holder)}}})});$(b.container).trigger("scroll")};function _uPageMenu(f,c,g){var b=Math.floor(f/c);if(f%c!=0){b++}if(b<=1){return{pages:[1],start_idx:0,curpage:1,numpages:b}}if(g<=0||g>b){g=1}var a;if(b!=6){a=[1,2];if(g-2>3){a.push(0)}for(var d=(g-2<=3?3:g-2),e=(g+2>=b?b:g+2);d<=e;d++){a.push(d)}if(g+2<b-2){a.push(0)}for(var d=(g+3>=b-1?g+3:b-1);d<=b;d++){a.push(d)}}else{a=[1,2,3,4,5,6]}return{pages:a,start_idx:(g-1)*c,curpage:g,numpages:b}};