function WindowReady(b){_(document).ready(b)}function WindowLoad(b){_(document).load(b)}var Prototype={Version:"1.5.0_rc1",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){},K:function(b){return b}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Abstract=new Object();Object.extend=function(b,c){for(var d in c){b[d]=c[d]}return b};Object.extend(Object,{inspect:function(c){try{if(c==undefined){return"undefined"}if(c==null){return"null"}return c.inspect?c.inspect():c.toString()}catch(b){if(b instanceof RangeError){return"..."}throw b}},keys:function(b){var d=[];for(var c in b){d.push(c)}return d},values:function(b){var d=[];for(var c in b){d.push(b[c])}return d},clone:function(b){return Object.extend({},b)}});Function.prototype.bind=function(){var c=this,d=$A(arguments),b=d.shift();return function(){return c.apply(b,d.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(b){var c=this,d=$A(arguments),b=d.shift();return function(e){return c.apply(b,[(e||window.event)].concat(d).concat($A(arguments)))}};Object.extend(Number.prototype,{toColorPart:function(){var b=this.toString(16);if(this<16){return"0"+b}return b},succ:function(){return this+1},times:function(b){$R(0,this,true).each(b);return this}});var Try={these:function(){var b;for(var c=0;c<arguments.length;c++){var f=arguments[c];try{b=f();break}catch(d){}}return b}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(b,c){this.callback=b;this.frequency=c;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}};Object.extend(String.prototype,{gsub:function(e,f){var c="",d=this,b;f=arguments.callee.prepareReplacement(f);while(d.length>0){if(b=d.match(e)){c+=d.slice(0,b.index);c+=(f(b)||"").toString();d=d.slice(b.index+b[0].length)}else{c+=d,d=""}}return c},sub:function(c,d,b){d=this.gsub.prepareReplacement(d);b=b===undefined?1:b;return this.gsub(c,function(e){if(--b<0){return e[0]}return d(e)})},scan:function(c,b){this.gsub(c,b);return this},truncate:function(b,c){b=b||30;c=c===undefined?"...":c;return this.length>b?this.slice(0,b-c.length)+c:this},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var c=new RegExp(Prototype.ScriptFragment,"img");var b=new RegExp(Prototype.ScriptFragment,"im");return(this.match(c)||[]).map(function(d){return(d.match(b)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var c=document.createElement("div");var b=document.createTextNode(this);c.appendChild(b);return c.innerHTML},unescapeHTML:function(){var b=document.createElement("div");b.innerHTML=this.stripTags();return b.childNodes[0]?b.childNodes[0].nodeValue:""},toQueryParams:function(){var b=this.match(/^\??(.*)$/)[1].split("&");return b.inject({},function(e,f){var c=f.split("=");var d=c[1]?decodeURIComponent(c[1]):undefined;e[decodeURIComponent(c[0])]=d;return e})},toArray:function(){return this.split("")},camelize:function(){var d=this.split("-");if(d.length==1){return d[0]}var f=this.indexOf("-")==0?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1,e=d.length;b<e;b++){var c=d[b];f+=c.charAt(0).toUpperCase()+c.substring(1)}return f},inspect:function(b){var c=this.replace(/\\/g,"\\\\");if(b){return'"'+c.replace(/"/g,'\\"')+'"'}else{return"'"+c.replace(/'/g,"\\'")+"'"}}});String.prototype.gsub.prepareReplacement=function(c){if(typeof c=="function"){return c}var b=new Template(c);return function(d){return b.evaluate(d)}};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(b,c){this.template=b.toString();this.pattern=c||Template.Pattern},evaluate:function(b){return this.template.gsub(this.pattern,function(c){var d=c[1];if(d=="\\"){return c[2]}return d+(b[c[3]]||"").toString()})}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(b){var d=0;try{this._each(function(g){try{b(g,d++)}catch(f){if(f!=$continue){throw f}}})}catch(c){if(c!=$break){throw c}}},all:function(b){var c=true;this.each(function(e,d){c=c&&!!(b||Prototype.K)(e,d);if(!c){throw $break}});return c},any:function(b){var c=false;this.each(function(e,d){if(c=!!(b||Prototype.K)(e,d)){throw $break}});return c},collect:function(b){var c=[];this.each(function(e,d){c.push(b(e,d))});return c},detect:function(b){var c;this.each(function(e,d){if(b(e,d)){c=e;throw $break}});return c},findAll:function(b){var c=[];this.each(function(e,d){if(b(e,d)){c.push(e)}});return c},grep:function(d,b){var c=[];this.each(function(g,f){var e=g.toString();if(e.match(d)){c.push((b||Prototype.K)(g,f))}});return c},include:function(b){var c=false;this.each(function(d){if(d==b){c=true;throw $break}});return c},inject:function(c,b){this.each(function(e,d){c=b(c,e,d)});return c},invoke:function(b){var c=$A(arguments).slice(1);return this.collect(function(d){return d[b].apply(d,c)})},max:function(b){var c;this.each(function(e,d){e=(b||Prototype.K)(e,d);if(c==undefined||e>=c){c=e}});return c},min:function(b){var c;this.each(function(e,d){e=(b||Prototype.K)(e,d);if(c==undefined||e<c){c=e}});return c},partition:function(b){var c=[],d=[];this.each(function(f,e){((b||Prototype.K)(f,e)?c:d).push(f)});return[c,d]},pluck:function(b){var c=[];this.each(function(e,d){c.push(e[b])});return c},reject:function(b){var c=[];this.each(function(e,d){if(!b(e,d)){c.push(e)}});return c},sortBy:function(b){return this.collect(function(d,c){return{value:d,criteria:b(d,c)}}).sort(function(d,c){var f=d.criteria,e=c.criteria;return f<e?-1:f>e?1:0}).pluck("value")},toArray:function(){return this.collect(Prototype.K)},zip:function(){var b=Prototype.K,d=$A(arguments);if(typeof d.last()=="function"){b=d.pop()}var c=[this].concat(d).map($A);return this.map(function(f,e){return b(c.pluck(e))})},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(d){if(!d){return[]}if(d.toArray){return d.toArray()}else{var c=[];for(var b=0;b<d.length;b++){c.push(d[b])}return c}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var c=0;c<this.length;c++){b(this[c])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(b){return b!=undefined||b!=null})},flatten:function(){return this.inject([],function(b,c){return b.concat(c&&c.constructor==Array?c.flatten():[c])})},without:function(){var b=$A(arguments);return this.select(function(c){return !b.include(c)})},indexOf:function(c){for(var b=0;b<this.length;b++){if(this[b]==c){return b}}return -1},reverse:function(b){return(b!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(){return this.inject([],function(b,c){return b.include(c)?b:b.concat([c])})},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"}});var Hash={_each:function(c){for(var b in this){var d=this[b];if(typeof d=="function"){continue}var e=[b,d];e.key=b;e.value=d;c(e)}},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},merge:function(b){return $H(b).inject($H(this),function(c,d){c[d.key]=d.value;return c})},toQueryString:function(){return this.map(function(b){return b.map(encodeURIComponent).join("=")}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(b){return b.map(Object.inspect).join(": ")}).join(", ")+"}>"}};function $H(b){var c=Object.extend({},b||{});Object.extend(c,Enumerable);Object.extend(c,Hash);return c}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(d,c,b){this.start=d;this.end=c;this.exclusive=b},_each:function(b){var c=this.start;while(this.include(c)){b(c);c=c.succ()}},include:function(b){if(b<this.start){return false}if(this.exclusive){return b<this.end}return b<=this.end}});var $R=function(d,c,b){return new ObjectRange(d,c,b)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(b){this.responders._each(b)},register:function(b){if(!this.include(b)){this.responders.push(b)}},unregister:function(b){this.responders=this.responders.without(b)},dispatch:function(b,c,e,d){this.each(function(g){if(g[b]&&typeof g[b]=="function"){try{g[b].apply(g,[c,e,d])}catch(f){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(b){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};Object.extend(this.options,b||{})},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300)},responseIsFailure:function(){return !this.responseIsSuccess()}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(b,c){this.transport=Ajax.getTransport();this.setOptions(c);this.request(b)},request:function(b){var f=this.options.parameters||"";if(f.length>0){f+="&_="}if(this.options.method!="get"&&this.options.method!="post"){f+=(f.length>0?"&":"")+"_method="+this.options.method;this.options.method="post"}try{this.url=b;if(this.options.method=="get"&&f.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+f}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){setTimeout(function(){this.respondToReadyState(1)}.bind(this),10)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var c=this.options.postBody?this.options.postBody:f;this.transport.send(this.options.method=="post"?c:null);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},setRequestHeaders:function(){var c=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version,"Accept","text/javascript, text/html, application/xml, text/xml, */*"];if(this.options.method=="post"){c.push("Content-type",this.options.contentType);if(this.transport.overrideMimeType){c.push("Connection","close")}}if(this.options.requestHeaders){c.push.apply(c,this.options.requestHeaders)}for(var b=0;b<c.length;b+=2){this.transport.setRequestHeader(c[b],c[b+1])}},onStateChange:function(){var b=this.transport.readyState;if(b!=1){this.respondToReadyState(this.transport.readyState)}},header:function(c){try{return this.transport.getResponseHeader(c)}catch(b){}},evalJSON:function(){try{return eval("("+this.header("X-JSON")+")")}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText)}catch(e){this.dispatchException(e)}},respondToReadyState:function(d){var f=Ajax.Request.Events[d];var g=this.transport,c=this.evalJSON();if(f=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(g,c)}catch(b){this.dispatchException(b)}if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse()}}try{(this.options["on"+f]||Prototype.emptyFunction)(g,c);Ajax.Responders.dispatch("on"+f,this,g,c)}catch(b){this.dispatchException(b)}if(f=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},dispatchException:function(b){(this.options.onException||Prototype.emptyFunction)(this,b);Ajax.Responders.dispatch("onException",this,b)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(e,c,d){this.containers={success:e.success?$(e.success):$(e),failure:e.failure?$(e.failure):(e.success?null:$(e))};this.transport=Ajax.getTransport();this.setOptions(d);var b=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(g,f){this.updateContent();b(g,f)}).bind(this);this.request(c)},updateContent:function(){var b=this.responseIsSuccess()?this.containers.success:this.containers.failure;var c=this.transport.responseText;if(!this.options.evalScripts){c=c.stripScripts()}if(b){if(this.options.insertion){new this.options.insertion(b,c)}else{Element.update(b,c)}}if(this.responseIsSuccess()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10)}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(d,b,c){this.setOptions(c);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=d;this.url=b;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(b){if(this.options.decay){this.decay=(b.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=b.responseText}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(){var c=[],d;for(var b=0;b<arguments.length;b++){d=arguments[b];if(typeof d=="string"){d=document.getElementById(d)}c.push(Element.extend(d))}return c.reduce()}document.getElementsByClassName=function(b,c){var d=($(c)||document.body).getElementsByTagName("*");return $A(d).inject([],function(e,f){if(f.className.match(new RegExp("(^|\\s)"+b+"(\\s|$)"))){e.push(Element.extend(f))}return e})};if(!window.Element){var Element=new Object()}Element.extend=function(e){if(!e){return}if(_nativeExtensions||e.nodeType==3){return e}if(!e._extended&&e.tagName&&e!=window){var f=Object.clone(Element.Methods),b=Element.extend.cache;if(e.tagName=="FORM"){Object.extend(f,Form.Methods)}if(["INPUT","TEXTAREA","SELECT"].include(e.tagName)){Object.extend(f,Form.Element.Methods)}for(var c in f){var d=f[c];if(typeof d=="function"){e[c]=b.findOrStore(d)}}}e._extended=true;return e};Element.extend.cache={findOrStore:function(b){return this[b]=this[b]||function(){return b.apply(null,[this].concat($A(arguments)))}}};Element.Methods={visible:function(b){return $(b).style.display!="none"},toggle:function(b){b=$(b);Element[Element.visible(b)?"hide":"show"](b);return b},hide:function(b){$(b).style.display="none";return b},show:function(b){$(b).style.display="";return b},remove:function(b){b=$(b);b.parentNode.removeChild(b);return b},update:function(c,b){$(c).innerHTML=b.stripScripts();setTimeout(function(){b.evalScripts()},10);return c},replace:function(c,b){c=$(c);if(c.outerHTML){c.outerHTML=b.stripScripts()}else{var d=c.ownerDocument.createRange();d.selectNodeContents(c);c.parentNode.replaceChild(d.createContextualFragment(b.stripScripts()),c)}setTimeout(function(){b.evalScripts()},10);return c},inspect:function(c){c=$(c);var b="<"+c.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(d){var f=d.first(),e=d.last();var g=(c[f]||"").toString();if(g){b+=" "+e+"="+g.inspect(true)}});return b+">"},recursivelyCollect:function(d,c){d=$(d);var b=[];while(d=d[c]){if(d.nodeType==1){b.push(Element.extend(d))}}return b},ancestors:function(b){return $(b).recursivelyCollect("parentNode")},descendants:function(b){b=$(b);return $A(b.getElementsByTagName("*"))},previousSiblings:function(b){return $(b).recursivelyCollect("previousSibling")},nextSiblings:function(b){return $(b).recursivelyCollect("nextSibling")},siblings:function(b){b=$(b);return b.previousSiblings().reverse().concat(b.nextSiblings())},match:function(c,b){c=$(c);if(typeof b=="string"){b=new Selector(b)}return b.match(c)},up:function(c,d,b){return Selector.findElement($(c).ancestors(),d,b)},down:function(c,d,b){return Selector.findElement($(c).descendants(),d,b)},previous:function(c,d,b){return Selector.findElement($(c).previousSiblings(),d,b)},next:function(c,d,b){return Selector.findElement($(c).nextSiblings(),d,b)},getElementsBySelector:function(){var c=$A(arguments),b=$(c.shift());return Selector.findChildElements(b,c)},getElementsByClassName:function(c,b){c=$(c);return document.getElementsByClassName(b,c)},getHeight:function(b){b=$(b);return b.offsetHeight},classNames:function(b){return new Element.ClassNames(b)},hasClassName:function(c,b){if(!(c=$(c))){return}return Element.classNames(c).include(b)},addClassName:function(c,b){if(!(c=$(c))){return}Element.classNames(c).add(b);return c},removeClassName:function(c,b){if(!(c=$(c))){return}Element.classNames(c).remove(b);return c},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},cleanWhitespace:function(d){d=$(d);var c=d.firstChild;while(c){var b=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){d.removeChild(c)}c=b}return d},empty:function(b){return $(b).innerHTML.match(/^\s*$/)},childOf:function(c,b){c=$(c),b=$(b);while(c=c.parentNode){if(c==b){return true}}return false},scrollTo:function(d){d=$(d);var b=d.x?d.x:d.offsetLeft,c=d.y?d.y:d.offsetTop;window.scrollTo(b,c);return d},getStyle:function(d,b){d=$(d);var c=d.style[b.camelize()];if(!c){if(document.defaultView&&document.defaultView.getComputedStyle){var e=document.defaultView.getComputedStyle(d,null);c=e?e.getPropertyValue(b):null}else{if(d.currentStyle){c=d.currentStyle[b.camelize()]}}}if(window.opera&&["left","top","right","bottom"].include(b)){if(Element.getStyle(d,"position")=="static"){c="auto"}}return c=="auto"?null:c},setStyle:function(d,b){d=$(d);for(var c in b){d.style[c.camelize()]=b[c]}return d},getDimensions:function(e){e=$(e);if(Element.getStyle(e,"display")!="none"){return{width:e.offsetWidth,height:e.offsetHeight}}var d=e.style;var c=d.visibility;var f=d.position;d.visibility="hidden";d.position="absolute";d.display="";var g=e.clientWidth;var b=e.clientHeight;d.display="none";d.position=f;d.visibility=c;return{width:g,height:b}},makePositioned:function(c){c=$(c);var b=Element.getStyle(c,"position");if(b=="static"||!b){c._madePositioned=true;c.style.position="relative";if(window.opera){c.style.top=0;c.style.left=0}}return c},undoPositioned:function(b){b=$(b);if(b._madePositioned){b._madePositioned=undefined;b.style.position=b.style.top=b.style.left=b.style.bottom=b.style.right=""}return b},makeClipping:function(b){b=$(b);if(b._overflow){return}b._overflow=b.style.overflow||"auto";if((Element.getStyle(b,"overflow")||"visible")!="hidden"){b.style.overflow="hidden"}return b},undoClipping:function(b){b=$(b);if(!b._overflow){return}b.style.overflow=b._overflow=="auto"?"":b._overflow;b._overflow=null;return b}};if(document.all){Element.Methods.update=function(e,b){e=$(e);var c=e.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].indexOf(c)>-1){var d=document.createElement("div");switch(c){case"THEAD":case"TBODY":d.innerHTML="<table><tbody>"+b.stripScripts()+"</tbody></table>";depth=2;break;case"TR":d.innerHTML="<table><tbody><tr>"+b.stripScripts()+"</tr></tbody></table>";depth=3;break;case"TD":d.innerHTML="<table><tbody><tr><td>"+b.stripScripts()+"</td></tr></tbody></table>";depth=4}$A(e.childNodes).each(function(f){e.removeChild(f)});depth.times(function(){d=d.firstChild});$A(d.childNodes).each(function(f){e.appendChild(f)})}else{e.innerHTML=b.stripScripts()}setTimeout(function(){b.evalScripts()},10);return e}}Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(!window.HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){["","Form","Input","TextArea","Select"].each(function(b){var c=window["HTML"+b+"Element"]={};c.prototype=document.createElement(b?b.toLowerCase():"div").__proto__})}Element.addMethods=function(c){Object.extend(Element.Methods,c||{});function b(h,e){var g=Element.extend.cache;for(var f in h){var d=h[f];e[f]=g.findOrStore(d)}}if(typeof HTMLElement!="undefined"){b(Element.Methods,HTMLElement.prototype);b(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(d){b(Form.Element.Methods,d.prototype)});_nativeExtensions=true}};var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(b){this.adjacency=b};Abstract.Insertion.prototype={initialize:function(f,d){this.element=$(f);this.content=d.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(c){var b=this.element.tagName.toLowerCase();if(b=="tbody"||b=="tr"){this.insertContent(this.contentFromAnonymousTable())}else{throw c}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange()}this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){d.evalScripts()},10)},contentFromAnonymousTable:function(){var b=document.createElement("div");b.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(b.childNodes[0].childNodes[0].childNodes)}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(b){b.each((function(c){this.element.parentNode.insertBefore(c,this.element)}).bind(this))}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true)},insertContent:function(b){b.reverse(false).each((function(c){this.element.insertBefore(c,this.element.firstChild)}).bind(this))}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element)},insertContent:function(b){b.each((function(c){this.element.appendChild(c)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(b){b.each((function(c){this.element.parentNode.insertBefore(c,this.element.nextSibling)}).bind(this))}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(b){this.element=$(b)},_each:function(b){this.element.className.split(/\s+/).select(function(c){return c.length>0})._each(b)},set:function(b){this.element.className=b},add:function(b){if(this.include(b)){return}this.set(this.toArray().concat(b).join(" "))},remove:function(b){if(!this.include(b)){return}this.set(this.select(function(c){return c!=b}).join(" "))},toString:function(){return this.toArray().join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(b){this.params={classNames:[]};this.expression=b.toString().strip();this.parseExpression();this.compileMatcher()},parseExpression:function(){function g(j){throw"Parse error in selector: "+j}if(this.expression==""){g("empty expression")}var h=this.params,b=this.expression,c,d,e,f;while(c=b.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){h.attributes=h.attributes||[];h.attributes.push({name:c[2],operator:c[3],value:c[4]||c[5]||""});b=c[1]}if(b=="*"){return this.params.wildcard=true}while(c=b.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){d=c[1],e=c[2],f=c[3];switch(d){case"#":h.id=e;break;case".":h.classNames.push(e);break;case"":case undefined:h.tagName=e.toUpperCase();break;default:g(b.inspect())}b=f}if(b.length>0){g(b.inspect())}},buildMatchExpression:function(){var e=this.params,d=[],c;if(e.wildcard){d.push("true")}if(c=e.id){d.push("element.id == "+c.inspect())}if(c=e.tagName){d.push("element.tagName.toUpperCase() == "+c.inspect())}if((c=e.classNames).length>0){for(var b=0;b<c.length;b++){d.push("Element.hasClassName(element, "+c[b].inspect()+")")}}if(c=e.attributes){c.each(function(f){var h="element.getAttribute("+f.name.inspect()+")";var g=function(j){return h+" && "+h+".split("+j.inspect()+")"};switch(f.operator){case"=":d.push(h+" == "+f.value.inspect());break;case"~=":d.push(g(" ")+".include("+f.value.inspect()+")");break;case"|=":d.push(g("-")+".first().toUpperCase() == "+f.value.toUpperCase().inspect());break;case"!=":d.push(h+" != "+f.value.inspect());break;case"":case undefined:d.push(h+" != null");break;default:throw"Unknown operator "+f.operator+" in selector"}})}return d.join(" && ")},compileMatcher:function(){this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression())},findElements:function(d){var e;if(e=$(this.params.id)){if(this.match(e)){if(!d||Element.childOf(e,d)){return[e]}}}d=(d||document).getElementsByTagName(this.params.tagName||"*");var c=[];for(var b=0;b<d.length;b++){if(this.match(e=d[b])){c.push(Element.extend(e))}}return c},toString:function(){return this.expression}};Object.extend(Selector,{matchElements:function(b,d){var c=new Selector(d);return b.select(c.match.bind(c))},findElement:function(b,d,c){if(typeof d=="number"){c=d,d=false}return Selector.matchElements(b,d||"*")[c||0]},findChildElements:function(c,b){return b.map(function(d){return d.strip().split(/\s+/).inject([null],function(g,e){var f=new Selector(e);return g.inject([],function(h,j){return h.concat(f.findElements(j||c))})})}).flatten()}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(b){$(b).reset();return b}};Form.Methods={serialize:function(c){var e=Form.getElements($(c));var d=new Array();for(var b=0;b<e.length;b++){var f=Form.Element.serialize(e[b]);if(f){d.push(f)}}return d.join("&")},getElements:function(c){c=$(c);var d=new Array();for(var b in Form.Element.Serializers){var e=c.getElementsByTagName(b);for(var f=0;f<e.length;f++){d.push(e[f])}}return d},getInputs:function(e,b,f){e=$(e);var c=e.getElementsByTagName("input");if(!b&&!f){return c}var h=new Array();for(var d=0;d<c.length;d++){var g=c[d];if((b&&g.type!=b)||(f&&g.name!=f)){continue}h.push(g)}return h},disable:function(c){c=$(c);var d=Form.getElements(c);for(var b=0;b<d.length;b++){var e=d[b];e.blur();e.disabled="true"}return c},enable:function(c){c=$(c);var d=Form.getElements(c);for(var b=0;b<d.length;b++){var e=d[b];e.disabled=""}return c},findFirstElement:function(b){return Form.getElements(b).find(function(c){return c.type!="hidden"&&!c.disabled&&["input","select","textarea"].include(c.tagName.toLowerCase())})},focusFirstElement:function(b){b=$(b);Field.activate(Form.findFirstElement(b));return b}};Object.extend(Form,Form.Methods);Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}};Form.Element.Methods={serialize:function(e){e=$(e);var d=e.tagName.toLowerCase();var c=Form.Element.Serializers[d](e);if(c){var b=encodeURIComponent(c[0]);if(b.length==0){return}if(c[1].constructor!=Array){c[1]=[c[1]]}return c[1].map(function(f){return b+"="+encodeURIComponent(f)}).join("&")}},getValue:function(d){d=$(d);var c=d.tagName.toLowerCase();var b=Form.Element.Serializers[c](d);if(b){return b[1]}},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(b){b=$(b);b.focus();if(b.select){b.select()}return b},disable:function(b){b=$(b);b.disabled="";return b},enable:function(b){b=$(b);b.blur();b.disabled="true";return b}};Object.extend(Form.Element,Form.Element.Methods);var Field=Form.Element;Form.Element.Serializers={input:function(b){switch(b.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(b);default:return Form.Element.Serializers.textarea(b)}return false},inputSelector:function(b){if(b.checked){return[b.name,b.value]}},textarea:function(b){return[b.name,b.value]},select:function(b){return Form.Element.Serializers[b.type=="select-one"?"selectOne":"selectMany"](b)},selectOne:function(e){var d="",b,c=e.selectedIndex;if(c>=0){b=e.options[c];d=b.value||b.text}return[e.name,d]},selectMany:function(e){var d=[];for(var b=0;b<e.length;b++){var c=e.options[b];if(c.selected){d.push(c.value||c.text)}}return[e.name,d]}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(c,d,b){this.frequency=d;this.element=$(c);this.callback=b;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var b=this.getValue();if(this.lastValue!=b){this.callback(this.element,b);this.lastValue=b}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(c,b){this.element=$(c);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var b=this.getValue();if(this.lastValue!=b){this.callback(this.element,b);this.lastValue=b}},registerFormCallbacks:function(){var c=Form.getElements(this.element);for(var b=0;b<c.length;b++){this.registerCallback(c[b])}},registerCallback:function(b){if(b.type){switch(b.type.toLowerCase()){case"checkbox":case"radio":Event.observe(b,"click",this.onElementEvent.bind(this));break;default:Event.observe(b,"change",this.onElementEvent.bind(this));break}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(b){return b.target||b.srcElement},isLeftClick:function(b){return(((b.which)&&(b.which==1))||((b.button)&&(b.button==1)))},pointerX:function(b){return b.pageX||(b.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(b){return b.pageY||(b.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(b){if(b.preventDefault){b.preventDefault();b.stopPropagation()}else{b.returnValue=false;b.cancelBubble=true}},findElement:function(c,b){var d=Event.element(c);while(d.parentNode&&(!d.tagName||(d.tagName.toUpperCase()!=b.toUpperCase()))){d=d.parentNode}return d},observers:false,_observeAndCache:function(d,c,e,b){if(!this.observers){this.observers=[]}if(d.addEventListener){this.observers.push([d,c,e,b]);d.addEventListener(c,e,b)}else{if(d.attachEvent){this.observers.push([d,c,e,b]);d.attachEvent("on"+c,e)}}},unloadCache:function(){if(!Event.observers){return}for(var b=0;b<Event.observers.length;b++){Event.stopObserving.apply(this,Event.observers[b]);Event.observers[b][0]=null}Event.observers=false},observe:function(d,c,e,b){d=$(d);b=b||false;if(c=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||d.attachEvent)){c="keydown"}Event._observeAndCache(d,c,e,b)},stopObserving:function(f,d,g,b){f=$(f);b=b||false;if(d=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||f.detachEvent)){d="keydown"}if(f.removeEventListener){f.removeEventListener(d,g,b)}else{if(f.detachEvent){try{f.detachEvent("on"+d,g)}catch(c){}}}}});if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Event.unloadCache,false)}var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(c){var b=0,d=0;do{b+=c.scrollTop||0;d+=c.scrollLeft||0;c=c.parentNode}while(c);return[d,b]},cumulativeOffset:function(c){var b=0,d=0;do{b+=c.offsetTop||0;d+=c.offsetLeft||0;c=c.offsetParent}while(c);return[d,b]},positionedOffset:function(c){var b=0,d=0;do{b+=c.offsetTop||0;d+=c.offsetLeft||0;c=c.offsetParent;if(c){p=Element.getStyle(c,"position");if(p=="relative"||p=="absolute"){break}}}while(c);return[d,b]},offsetParent:function(d){var c=false;try{c=d.offsetParent!=null}catch(b){}if(c){return d.offsetParent}if(d==document.body){return d}while((d=d.parentNode)&&d!=document.body){if(Element.getStyle(d,"position")!="static"){return d}}return document.body},within:function(d,b,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(d,b,c)}this.xcomp=b;this.ycomp=c;this.offset=this.cumulativeOffset(d);return(c>=this.offset[1]&&c<this.offset[1]+d.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+d.offsetWidth)},withinIncludingScrolloffsets:function(e,c,d){var b=this.realOffset(e);this.xcomp=c+b[0]-this.deltaX;this.ycomp=d+b[1]-this.deltaY;this.offset=this.cumulativeOffset(e);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+e.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+e.offsetWidth)},overlap:function(b,c){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+c.offsetHeight)-this.ycomp)/c.offsetHeight}if(b=="horizontal"){return((this.offset[0]+c.offsetWidth)-this.xcomp)/c.offsetWidth}},page:function(b){var c=0,e=0;var d=b;do{c+=d.offsetTop||0;e+=d.offsetLeft||0;if(d.offsetParent==document.body){if(Element.getStyle(d,"position")=="absolute"){break}}}while(d=d.offsetParent);d=b;do{if(!window.opera||d.tagName=="BODY"){c-=d.scrollTop||0;e-=d.scrollLeft||0}}while(d=d.parentNode);return[e,c]},clone:function(c,f){var e=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});c=$(c);var d=Position.page(c);f=$(f);var b=[0,0];var g=null;if(Element.getStyle(f,"position")=="absolute"){g=Position.offsetParent(f);b=Position.page(g)}if(g==document.body){b[0]-=document.body.offsetLeft;b[1]-=document.body.offsetTop}if(e.setLeft){f.style.left=(d[0]-b[0]+e.offsetLeft)+"px"}if(e.setTop){f.style.top=(d[1]-b[1]+e.offsetTop)+"px"}if(e.setWidth){f.style.width=c.offsetWidth+"px"}if(e.setHeight){f.style.height=c.offsetHeight+"px"}},absolutize:function(f){f=$(f);if(f.style.position=="absolute"){return}Position.prepare();var c=Position.positionedOffset(f);var e=c[1];var d=c[0];var g=f.clientWidth;var b=f.clientHeight;f._originalLeft=d-parseFloat(f.style.left||0);f._originalTop=e-parseFloat(f.style.top||0);f._originalWidth=f.style.width;f._originalHeight=f.style.height;f.style.position="absolute";f.style.top=e+"px";f.style.left=d+"px";f.style.width=g+"px";f.style.height=b+"px"},relativize:function(d){d=$(d);if(d.style.position=="relative"){return}Position.prepare();d.style.position="relative";var c=parseFloat(d.style.top||0)-(d._originalTop||0);var b=parseFloat(d.style.left||0)-(d._originalLeft||0);d.style.top=c+"px";d.style.left=b+"px";d.style.height=d._originalHeight;d.style.width=d._originalWidth}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(c){var b=0,d=0;do{b+=c.offsetTop||0;d+=c.offsetLeft||0;if(c.offsetParent==document.body){if(Element.getStyle(c,"position")=="absolute"){break}}c=c.offsetParent}while(c);return[d,b]}}Element.addMethods();var Window=Class.create();Window.keepMultiModalWindow=false;Window.prototype={initialize:function(b){if($(b)){alert("Window "+b+" is already register is the DOM!!, be sure to use setDestroyOnClose()")}this.hasEffectLib=String.prototype.parseColor!=null;this.options=Object.extend({className:"dialog",minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(this.hasEffectLib?Effect.Appear:Element.show),hideEffect:(this.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.getElementsByTagName("body").item(0),title:"&nbsp;",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false},arguments[1]||{});if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions)}if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.destroyOnClose){this.destroy()}}.bind(this)}this.element=this._createWindow(b);this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);if(this.options.draggable){this.bottombar.addClassName("bottom_draggable");this.topbar.addClassName("top_draggable")}if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown)}this.useLeft=null;this.useTop=null;if(arguments[1].left!=null){this.element.setStyle({left:parseFloat(arguments[1].left)+"px"});this.useLeft=true}if(arguments[1].right!=null){this.element.setStyle({right:parseFloat(arguments[1].right)+"px"});this.useLeft=false}if(this.useLeft==null){this.element.setStyle({left:"0px"});this.useLeft=true}if(arguments[1].top!=null){this.element.setStyle({top:parseFloat(arguments[1].top)+"px"});this.useTop=true}if(arguments[1].bottom!=null){this.element.setStyle({bottom:parseFloat(arguments[1].bottom)+"px"});this.useTop=false}if(this.useTop==null){this.element.setStyle({top:"0px"});this.useTop=true}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex)}this.destroyOnClose=false;this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;if(this.width&&this.height){this.setSize(this.options.width,this.options.height)}this.setTitle(this.options.title);Windows.register(this)},destroy:function(){Windows.notify("onDestroy",this);Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var d=this.getContent();var c=null;for(var b=0;b<d.childNodes.length;b++){c=d.childNodes[b];if(c.nodeType==1){break}c=null}if(c){this._oldParent.appendChild(c)}this._oldParent=null}if(this.sizer){Event.stopObserving(this.sizer,"mousedown",this.eventMouseDown)}if(this.options.url){this.content.src=null}if(this.iefix){Element.remove(this.iefix)}Element.remove(this.element);Windows.unregister(this)},setDelegate:function(b){this.delegate=b},getDelegate:function(){return this.delegate},getContent:function(){return this.content},setContent:function(j,b,f){var g=$(j);if(null==g){throw"Unable to find element '"+j+"' in DOM"}this._oldParent=g.parentNode;var c=null;var e=null;if(b){c=Element.getDimensions(g)}if(f){e=Position.cumulativeOffset(g)}var h=this.getContent();h.appendChild(g);g.show();if(b){this.setSize(c.width,c.height)}if(f){this.setLocation(e[1]-this.heightN,e[0]-this.widthW)}},setAjaxContent:function(b,c,e,d){this.showFunction=e?"showCenter":"show";this.showModal=d||false;if(c==null){c={}}this.onComplete=c.onComplete;c.onComplete=this._setAjaxContent.bind(this);new Ajax.Request(b,c)},_setAjaxContent:function(b){Element.update(this.getContent(),b.responseText);if(this.onComplete){this.onComplete(b)}this[this.showFunction](this.showModal)},setCookie:function(c,b,k,j,q){c=c||this.element.id;this.cookie=[c,b,k,j,q];var f=WindowUtilities.getCookie(c);if(f){var l=f.split(",");var m=l[0].split(":");var n=l[1].split(":");var e=parseFloat(l[2]),o=parseFloat(l[3]);var g=l[4];var d=l[5];this.setSize(e,o);if(g=="true"){this.doMinimize=true}else{if(d=="true"){this.doMaximize=true}}this.useLeft=m[0]=="l";this.useTop=n[0]=="t";this.element.setStyle(this.useLeft?{left:m[1]}:{right:m[1]});this.element.setStyle(this.useTop?{top:n[1]}:{bottom:n[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){var c=this.destroy.bind(this);if(this.options.hideEffectOptions.afterFinish){var b=this.options.hideEffectOptions.afterFinish;this.options.hideEffectOptions.afterFinish=function(){b();c()}}else{this.options.hideEffectOptions.afterFinish=function(){c()}}this.destroyOnClose=true},_initDrag:function(b){this.pointer=[Event.pointerX(b),Event.pointerY(b)];if(this.options.wiredDrag){this.currentDrag=this._createWiredElement()}else{this.currentDrag=this.element}if(Event.element(b)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle("bottom"));this.rightOrg=parseFloat(this.element.getStyle("right"));Windows.notify("onStartResize",this)}else{this.doResize=false;var c=$(this.getId()+"_close");if(c&&Position.within(c,this.pointer[0],this.pointer[1])){this.currentDrag=null;return}this.toFront();if(!this.options.draggable){return}Windows.notify("onStartMove",this)}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen("__invisible__","__invisible__");document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};this.currentDrag.show();Event.stop(b)},_updateDrag:function(e){var b=[Event.pointerX(e),Event.pointerY(e)];var d=b[0]-this.pointer[0];var c=b[1]-this.pointer[1];if(this.doResize){this.setSize(this.widthOrg+d,this.heightOrg+c);d=this.width-this.widthOrg;c=this.height-this.heightOrg;if(!this.useLeft){this.currentDrag.setStyle({right:(this.rightOrg-d)+"px"})}if(!this.useTop){this.currentDrag.setStyle({bottom:(this.bottomOrg-c)+"px"})}}else{this.pointer=b;if(this.useLeft){this.currentDrag.setStyle({left:parseFloat(this.currentDrag.getStyle("left"))+d+"px"})}else{this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle("right"))-d+"px"})}if(this.useTop){this.currentDrag.setStyle({top:parseFloat(this.currentDrag.getStyle("top"))+c+"px"})}else{this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle("bottom"))-c+"px"})}}if(this.iefix){this._fixIEOverlapping()}this._removeStoreLocation();Event.stop(e)},_endDrag:function(b){WindowUtilities.enableScreen("__invisible__");if(this.doResize){Windows.notify("onEndResize",this)}else{Windows.notify("onEndMove",this)}Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(b);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null},_createWindow:function(f){var h=this.options.className;var c=document.createElement("div");c.setAttribute("id",f);c.className="dialog";var j;if(this.options.url){j='<iframe frameborder="0" name="'+f+'_content"  id="'+f+'_content" src="'+this.options.url+"\" scrolling='{scroll}'> </iframe>".replace("{scroll}",this.options.scrolling?"yes":"no")}else{j='<div id="'+f+'_content" class="'+h+'_content"> </div>'}var b=this.options.closable?"<div class='"+h+"_close' id='"+f+"_close' onclick='Windows.close(\""+f+"\", event)'> </div>":"";var g=this.options.minimizable?"<div class='"+h+"_minimize' id='"+f+"_minimize' onclick='Windows.minimize(\""+f+"\", event)'> </div>":"";var e=this.options.maximizable?"<div class='"+h+"_maximize' id='"+f+"_maximize' onclick='Windows.maximize(\""+f+"\", event)'> </div>":"";var d=this.options.resizable?"class='"+h+"_sizer' id='"+f+"_sizer'":"class='"+h+"_se'";c.innerHTML=b+g+e+"      <table id='"+f+"_row1' class=\"top table_window\">        <tr>          <td class='"+h+"_nw'>&nbsp;</td>          <td class='"+h+"_n'><div id='"+f+"_top' class='"+h+"_title title_window'>"+this.options.title+"</div></td>          <td class='"+h+"_ne'>&nbsp;</td>        </tr>      </table>      <table id='"+f+"_row2' class=\"mid table_window\">        <tr>          <td class='"+h+"_w'></td>            <td id='"+f+"_table_content' class='"+h+"_content' valign='top'>"+j+"</td>          <td class='"+h+"_e'></td>        </tr>      </table>        <table id='"+f+"_row3' class=\"bot table_window\">        <tr>          <td class='"+h+"_sw'>&nbsp;</td>            <td class='"+h+"_s'><div id='"+f+"_bottom' class='status_bar'>&nbsp;</div></td>            <td "+d+">&nbsp;</td>        </tr>      </table>    ";Element.hide(c);this.options.parent.insertBefore(c,this.options.parent.firstChild);Event.observe($(f+"_content"),"load",this.options.onload);return c},setLocation:function(c,b){if(c<0){c=0}if(b<0){b=0}this.element.setStyle({top:c+"px"});this.element.setStyle({left:b+"px"});this.useLeft=true;this.useTop=true},getLocation:function(){var b={};if(this.useTop){b=Object.extend(b,{top:this.element.getStyle("top")})}else{b=Object.extend(b,{bottom:this.element.getStyle("bottom")})}if(this.useLeft){b=Object.extend(b,{left:this.element.getStyle("left")})}else{b=Object.extend(b,{right:this.element.getStyle("right")})}return b},getSize:function(){return{width:this.width,height:this.height}},setSize:function(f,b){f=parseFloat(f);b=parseFloat(b);if(f<this.options.minWidth){f=this.options.minWidth}if(b<this.options.minHeight){b=this.options.minHeight}if(this.options.maxHeight&&b>this.options.maxHeight){b=this.options.maxHeight}if(this.options.maxWidth&&f>this.options.maxWidth){f=this.options.maxWidth}this.width=f;this.height=b;var c=this.currentDrag?this.currentDrag:this.element;c.setStyle({width:f+this.widthW+this.widthE+"px"});c.setStyle({height:b+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var d=$(this.element.id+"_content");d.setStyle({height:b+"px"});d.setStyle({width:f+"px"})}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height)},toFront:function(){if(Windows.focusedWindow==this){return}this.setZIndex(Windows.maxZIndex+20);Windows.notify("onFocus",this)},show:function(c){if(c){Windows.addModalWindow(this);this.modal=true;this.setZIndex(Windows.maxZIndex+20);Windows.unsetOverflow(this)}if(this.oldStyle){this.getContent().setStyle({overflow:this.oldStyle})}if(!this.width||!this.height){var b=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0);if(this.height){this.width=b+5}else{this.height=b+5}}this.setSize(this.width,this.height);if(this.centered){this._center(this.centerTop,this.centerLeft)}if(this.options.showEffect!=Element.show&&this.options.showEffectOptions){this.options.showEffect(this.element,this.options.showEffectOptions)}else{this.options.showEffect(this.element)}this._checkIEOverlapping();this.visible=true;WindowUtilities.focusedWindow=this;Windows.notify("onShow",this)},showCenter:function(d,c,b){this.centered=true;this.centerTop=c;this.centerLeft=b;this.show(d)},isVisible:function(){return this.visible},_center:function(c,b){var e=WindowUtilities.getWindowScroll();var d=WindowUtilities.getPageSize();if(!c){c=(d.windowHeight-(this.height+this.heightN+this.heightS))/2}c+=e.top;if(!b){b=(d.windowWidth-(this.width+this.widthW+this.widthE))/2}b+=e.left;this.setLocation(c,b);this.toFront()},_recenter:function(c){if(this.modal&&this.centered){var b=WindowUtilities.getPageSize();if(this.pageSize&&this.pageSize.pageWidth==b.windowWidth&&this.pageSize.pageHeight==b.windowHeight){return}this.pageSize=b;if($("overlay_modal")){$("overlay_modal").style.height=(b.pageHeight+"px");$("overlay_modal").style.width=(b.pageWidth+"px")}if(this.options.recenterAuto){this._center(this.centerTop,this.centerLeft)}}},hide:function(){this.visible=false;if(this.modal){Windows.removeModalWindow(this);Windows.resetOverflow()}this.oldStyle=this.getContent().getStyle("overflow")||"auto";this.getContent().setStyle({overflow:"hidden"});var b=document.getElementById(this.getId()+"_table_content");var c=b.getElementsByTagName("iframe");if(c.length>0){b.removeChild(c[0])}this.options.hideEffect(this.element,this.options.hideEffectOptions);if(this.iefix){this.iefix.hide()}Windows.notify("onHide",this)},minimize:function(){var d=$(this.getId()+"_row2");var b=d.getDimensions().height;if(d.visible()){var c=this.element.getHeight()-b;d.hide();this.element.setStyle({height:c+"px"});if(!this.useTop){var e=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:(e+b)+"px"})}}else{var c=this.element.getHeight()+b;this.element.setStyle({height:c+"px"});if(!this.useTop){var e=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:(e-b)+"px"})}d.show();this.toFront()}Windows.notify("onMinimize",this);this._saveCookie()},maximize:function(){if(this.storedLocation!=null){this._restoreLocation();if(this.iefix){this.iefix.hide()}}else{this._storeLocation();Windows.unsetOverflow(this);var c=WindowUtilities.getWindowScroll();var b=WindowUtilities.getPageSize();this.element.setStyle(this.useLeft?{left:c.left}:{right:c.left});this.element.setStyle(this.useTop?{top:c.top}:{bottom:c.top});this.setSize(b.windowWidth-this.widthW-this.widthE,b.windowHeight-this.heightN-this.heightS);this.toFront();if(this.iefix){this._fixIEOverlapping()}}Windows.notify("onMaximize",this);this._saveCookie()},isMinimized:function(){var b=$(this.getId()+"_row2");return !b.visible()},isMaximized:function(){return(this.storedLocation!=null)},setOpacity:function(b){if(Element.setOpacity){Element.setOpacity(this.element,b)}},setZIndex:function(b){this.element.setStyle({zIndex:b});Windows.updateZindex(b,this)},setTitle:function(b){if(!b||b==""){b="&nbsp;"}Element.update(this.element.id+"_top",b)},setStatusBar:function(c){var b=$(this.getId()+"_bottom");if(typeof(c)=="object"){if(this.bottombar.firstChild){this.bottombar.replaceChild(c,this.bottombar.firstChild)}else{this.bottombar.appendChild(c)}}else{this.bottombar.innerHTML=c}},_checkIEOverlapping:function(){if(!this.iefix&&(navigator.appVersion.indexOf("MSIE")>0)&&(navigator.userAgent.indexOf("Opera")<0)&&(this.element.getStyle("position")=="absolute")){new Insertion.After(this.element.id,'<iframe id="'+this.element.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.element.id+"_iefix")}if(this.iefix){setTimeout(this._fixIEOverlapping.bind(this),50)}},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show()},_getWindowBorderSize:function(b){var c=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(c).height;c.parentNode.removeChild(c);var c=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(c).height;c.parentNode.removeChild(c);var c=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(c).width;c.parentNode.removeChild(c);var c=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(c).width;c.parentNode.removeChild(c);if(isIE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height}if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){this.setSize(this.width,this.height)}if(this.doMaximize){this.maximize()}if(this.doMinimize){this.minimize()}},_createHiddenDiv:function(b){var c=document.getElementsByTagName("body").item(0);var d=document.createElement("div");d.setAttribute("id",this.element.id+"_tmp");d.className=b;d.style.display="none";d.innerHTML="";c.insertBefore(d,c.firstChild);return d},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle("top"),bottom:this.element.getStyle("bottom"),left:this.element.getStyle("left"),right:this.element.getStyle("right"),width:this.width,height:this.height}}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height);Windows.resetOverflow();this._removeStoreLocation()}},_removeStoreLocation:function(){this.storedLocation=null},_saveCookie:function(){if(this.cookie){var b="";if(this.useLeft){b+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"))}else{b+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"))}if(this.useTop){b+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"))}else{b+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"))}b+=","+(this.storedLocation?this.storedLocation.width:this.width);b+=","+(this.storedLocation?this.storedLocation.height:this.height);b+=","+this.isMinimized();b+=","+this.isMaximized();WindowUtilities.setCookie(b,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(isIE){this._getWindowBorderSize()}var c=document.createElement("div");c.className="wired_frame "+this.options.className+"_wired_frame";c.style.position="absolute";document.body.insertBefore(c,document.body.firstChild);c=$(c);var b=this.element.getDimensions();c.setStyle({width:b.width+"px",height:b.height+"px"});if(this.useLeft){c.setStyle({left:this.element.getStyle("left")})}else{c.setStyle({right:this.element.getStyle("right")})}if(this.useTop){c.setStyle({top:this.element.getStyle("top")})}else{c.setStyle({bottom:this.element.getStyle("bottom")})}this.wiredElement=c}this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement},_hideWiredElement:function(){if(this.currentDrag==this.element){this.currentDrag=null}else{if(this.useLeft){this.element.setStyle({left:this.currentDrag.getStyle("left")})}else{this.element.setStyle({right:this.currentDrag.getStyle("right")})}if(this.useTop){this.element.setStyle({top:this.currentDrag.getStyle("top")})}else{this.element.setStyle({bottom:this.currentDrag.getStyle("bottom")})}this.currentDrag.hide();this.currentDrag=null;this.setSize(this.width,this.height)}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,addObserver:function(b){this.removeObserver(b);this.observers.push(b)},removeObserver:function(b){this.observers=this.observers.reject(function(c){return c==b})},notify:function(c,b){this.observers.each(function(d){if(d[c]){d[c](c,b)}})},getWindow:function(b){return this.windows.detect(function(c){return c.getId()==b})},getFocusedWindow:function(){return this.focusedWindow},register:function(b){this.windows.push(b)},addModalWindow:function(b){if(this.modalWindows.length==0){WindowUtilities.disableScreen(b.options.className,"overlay_modal",b.getId())}else{if(Window.keepMultiModalWindow){$("overlay_modal").style.zIndex=Windows.maxZIndex+20;Windows.maxZIndex+=20;WindowUtilities._hideSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.hide()}WindowUtilities._showSelect(b.getId())}this.modalWindows.push(b)},removeModalWindow:function(b){this.modalWindows.pop();if(this.modalWindows.length==0){WindowUtilities.enableScreen()}else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.show()}}},register:function(b){this.windows.push(b)},unregister:function(b){this.windows=this.windows.reject(function(c){return c==b})},close:function(d,c){var b=this.getWindow(d);if(b&&b.visible){if(b.getDelegate()&&!b.getDelegate().canClose(b)){return}this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null;this.notify("onClose",b);b.hide()}if(c){Event.stop(c)}},closeAll:function(){this.windows.each(function(b){Windows.close(b.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(b){b.hide()})},minimize:function(d,c){var b=this.getWindow(d);if(b&&b.visible){b.minimize()}Event.stop(c)},maximize:function(d,c){var b=this.getWindow(d);if(b&&b.visible){b.maximize()}Event.stop(c)},unsetOverflow:function(b){this.windows.each(function(c){c.oldOverflow=c.getContent().getStyle("overflow")||"auto";c.getContent().setStyle({overflow:"hidden"})});if(b&&b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}},resetOverflow:function(){this.windows.each(function(b){if(b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}})},updateZindex:function(c,b){if(c>this.maxZIndex){this.maxZIndex=c}this.focusedWindow=b}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(h,c){if(typeof h!="string"){Dialog._runAjaxRequest(h,c,Dialog.confirm);return}c=c||{};var e=c.okLabel?c.okLabel:"Ok";var f=c.cancelLabel?c.cancelLabel:"Cancel";var b=c.windowParameters||{};b.className=b.className||"alert";var d="class ='"+(c.buttonClass?c.buttonClass+" ":"")+" ok_button'";var g="class ='"+(c.buttonClass?c.buttonClass+" ":"")+" cancel_button'";var h="      <div class='"+b.className+"_message'>"+h+"</div>        <div class='"+b.className+"_buttons'>          <input type='button' value='"+e+"' onclick='Dialog.okCallback()'"+d+"/>          <input type='button' value='"+f+"' onclick='Dialog.cancelCallback()' "+g+"/>        </div>    ";return this._openDialog(h,c)},alert:function(f,c){if(typeof f!="string"){Dialog._runAjaxRequest(f,c,Dialog.alert);return}c=c||{};var e=c.okLabel?c.okLabel:"Ok";var b=c.windowParameters||{};b.className=b.className||"alert";var d="class ='"+(c.buttonClass?c.buttonClass+" ":"")+" ok_button'";var f="      <div class='"+b.className+"_message'>"+f+"</div>        <div class='"+b.className+"_buttons'>          <input type='button' value='"+e+"' onclick='Dialog.okCallback()'"+d+"/>        </div>";return this._openDialog(f,c)},info:function(d,b){if(typeof d!="string"){Dialog._runAjaxRequest(d,b,Dialog.info);return}b=b||{};b.windowParameters=b.windowParameters||{};var c=b.windowParameters.className||"alert";var d="<div id='modal_dialog_message' class='"+c+"_message'>"+d+"</div>";if(b.showProgress){d+="<div id='modal_dialog_progress' class='"+c+"_progress'>  </div>"}b.windowParameters.ok=null;b.windowParameters.cancel=null;b.windowParameters.className=c;return this._openDialog(d,b)},setInfoMessage:function(b){$("modal_dialog_message").update(b)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(g,c){if(!c.windowParameters.height&&!c.windowParameters.width){c.windowParameters.width=WindowUtilities.getPageSize().pageWidth/2}if(c.id){this.dialogId=c.id}else{var f=new Date();this.dialogId="modal_dialog_"+f.getTime()}if(!c.windowParameters.height||!c.windowParameters.width){var b=WindowUtilities._computeSize(g,this.dialogId,c.windowParameters.width,c.windowParameters.height);if(c.windowParameters.height){c.windowParameters.width=b+5}else{c.windowParameters.height=b+5}}var d=c&&c.windowParameters?c.windowParameters:{};d.resizable=d.resizable||false;d.effectOptions=d.effectOptions||{duration:1};d.minimizable=false;d.maximizable=false;d.closable=false;var e=new Window(this.dialogId,d);e.getContent().innerHTML=g;e.showCenter(true,c.top,c.left);e.setDestroyOnClose();e.cancelCallback=c.cancel;e.okCallback=c.ok;return e},_getAjaxContent:function(b){Dialog.callFunc(b.responseText,Dialog.parameters)},_runAjaxRequest:function(d,c,b){if(d.options==null){d.options={}}Dialog.onCompleteFunc=d.options.onComplete;Dialog.parameters=c;Dialog.callFunc=b;d.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(d.url,d.options)},okCallback:function(){var b=Windows.focusedWindow;if(!b.okCallback||b.okCallback(b)){$$("#"+b.getId()+" input").each(function(c){c.onclick=null});b.hide()}},cancelCallback:function(){var b=Windows.focusedWindow;$$("#"+b.getId()+" input").each(function(c){c.onclick=null});b.hide();if(b.cancelCallback){b.cancelCallback(b)}}};var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";var WindowUtilities={getWindowScroll:function(){var w=window;var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}},getPageSize:function(){var d,b;if(window.innerHeight&&window.scrollMaxY){d=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){d=document.body.scrollWidth;b=document.body.scrollHeight}else{d=document.body.offsetWidth;b=document.body.offsetHeight}}var f,e;if(self.innerHeight){f=self.innerWidth;e=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){f=document.documentElement.clientWidth;e=document.documentElement.clientHeight}else{if(document.body){f=document.body.clientWidth;e=document.body.clientHeight}}}var c,g;if(b<e){c=e}else{c=b}if(d<f){g=f}else{g=d}return{pageWidth:g,pageHeight:c,windowWidth:f,windowHeight:e}},disableScreen:function(b,g,c){WindowUtilities.initLightbox(g,b);var d=document.getElementsByTagName("body").item(0);var e=$(g);var f=WindowUtilities.getPageSize();if(c&&isIE){WindowUtilities._hideSelect();WindowUtilities._showSelect(c)}e.style.height=(f.pageHeight+"px");e.style.width=(f.windowWidth+"px");e.style.display="block"},enableScreen:function(c){c=c||"overlay_modal";var b=$(c);if(b){b.style.display="none";if(c!="__invisible__"){WindowUtilities._showSelect()}b.parentNode.removeChild(b)}},_hideSelect:function(b){if(isIE){b=b==null?"":"#"+b+" ";$$(b+"select").each(function(c){if(!WindowUtilities.isDefined(c.oldVisibility)){c.oldVisibility=c.style.visibility?c.style.visibility:"visible";c.style.visibility="hidden"}})}},_showSelect:function(b){if(isIE){b=b==null?"":"#"+b+" ";$$(b+"select").each(function(d){if(WindowUtilities.isDefined(d.oldVisibility)){try{d.style.visibility=d.oldVisibility}catch(c){d.style.visibility="visible"}d.oldVisibility=null}else{if(d.style.visibility){d.style.visibility="visible"}}})}},isDefined:function(b){return typeof(b)!="undefined"&&b!=null},initLightbox:function(e,b){if($(e)){Element.setStyle(e,{zIndex:Windows.maxZIndex+10})}else{var c=document.getElementsByTagName("body").item(0);var d=document.createElement("div");d.setAttribute("id",e);d.className="overlay_"+b;d.style.display="none";d.style.position="absolute";d.style.top="0";d.style.left="0";d.style.zIndex=Windows.maxZIndex+10;d.style.width="100%";c.insertBefore(d,c.firstChild)}},setCookie:function(b,c){document.cookie=c[0]+"="+escape(b)+((c[1])?"; expires="+c[1].toGMTString():"")+((c[2])?"; path="+c[2]:"")+((c[3])?"; domain="+c[3]:"")+((c[4])?"; secure":"")},getCookie:function(d){var e=document.cookie;var c=d+"=";var b=e.indexOf("; "+c);if(b==-1){b=e.indexOf(c);if(b!=0){return null}}else{b+=2}var f=document.cookie.indexOf(";",b);if(f==-1){f=e.length}return unescape(e.substring(b+c.length,f))},_computeSize:function(j,h,e,d,g){if(g==null){g=5}var c=document.getElementsByTagName("body").item(0);var b=document.createElement("div");b.setAttribute("id",h);if(d){b.style.height=d+"px"}else{b.style.width=e+"px"}b.style.position="absolute";b.style.top="0";b.style.left="0";b.style.display="none";b.innerHTML=j;c.insertBefore(b,c.firstChild);var f;if(d){f=$(h).getDimensions().width+g}else{f=$(h).getDimensions().height+g}c.removeChild(b);return f}};function getThisWindow(){var b=getThisWindowId();return window.top.$A(window.top.Windows.windows).detect(function(c){return c.getId()==b})}function truncElementText(b,c,d,f){var e=false;while((c.offsetWidth>d||c.offsetHeight>f)&&(!isIE||b.offsetWidth>d||b.offsetHeight>f)&&b.innerHTML.length>0){b.innerHTML=b.innerHTML.substr(0,b.innerHTML.length-1);e=true}if(e){b.innerHTML+="..."}}function calcIncentive(c,b,f){c=parseFloat(c);b=parseFloat(b);f=parseInt(f);if(isNaN(c)||isNaN(b)||isNaN(f)){throw"error"}try{return c-(b/(f-1))}catch(d){return c}}function chkDisableOthers(c){var d=getElementsByClassName(document,"exclude"+c.getAttribute("exclude"));for(var b=0;b<d.length;b++){if(d[b]!=c){d[b].checked=false}}}function fixDisabledAnchors(){var c=document.getElementsByTagName("a");for(var b=0;b<c.length;b++){if(c[b].disabled){c[b].disabled=false;c[b].removeAttribute("href")}}}function getQueryString(d){d=d.substring(1);var b={};var e=d.split("&");for(var c=0;c<e.length;c++){var f=e[c].split("=");b[f[0]]=f[1]}return b}function isValidPhone(c,b,e,d){if(d&&c.trim().length==0&&b.trim().length==0&&e.trim().length==0){return true}else{if(c.trim().length<3||b.trim().length<3||e.trim().length<4){return false}else{if(!isInt(c)||!isInt(b)||!isInt(e)){return false}else{if(b.trim()=="555"){return false}else{return function(f){var h=[];for(var g=0;g<10;g++){h.push(new RegExp("^"+g.toString()+"{10}$"))}h.push(/5551212$/);for(var g=0;g<h.length;g++){if(h[g].test(f)){return false}}return true}(c+b+e)}}}}}function isValidPhone2(b,d){try{var c=b.split("-");return isValidPhone(c[0],c[1],c[2],d)}catch(e){return isValidPhone("   ","   ","    ",d)}return true}function isInt(b){b=b.toString().replace(/^0*([^0]+)/,"$1");return !isNaN(parseInt(b))&&parseInt(b)==b}function sortOption(f,d){var c=f.text.toLowerCase();var e=d.text.toLowerCase();return(c==e?0:c<e?-1:1)}function getKeyCode(b){return window.event?window.event.keyCode:b.which?b.which:b.charCode}function enterPress(c,b){if(getKeyCode(c)==13){document.getElementById(b).click();return false}return true}function getXYElem(b){var d=0,f=0;if(!isNaN(this.x)){return{x:this.x,y:this.y}}var c=b;while(c&&!isNaN(c.offsetLeft)&&!isNaN(c.offsetTop)){d+=c.offsetLeft;f+=c.offsetTop;c=c.offsetParent}return{x:d,y:f}}function keyPressInt(c){if(c.ctrlKey||c.altKey||c.metaKey){return 2}var d=getKeyCode(c);if(d>126||d<32){return 1}var b=String.fromCharCode(d);if(!isInt(b)){return 3}return 0}function keyPressFloat(c){if(c.ctrlKey||c.altKey||c.metaKey){return 2}var d=getKeyCode(c);if(d<32){return 1}var b=String.fromCharCode(d);if(!isInt(b)&&b!="."){return 3}return 0}function getElementsByClassName(e,g){var b=[];var c=new RegExp("\\b"+g+"\\b");var f=e.getElementsByTagName("*");for(var d=0,h=f.length;d<h;d++){if(c.test(f[d].className)){b.push(f[d])}}return b}function getNextSibling(b){endBrother=b.nextSibling;while(endBrother!=null&&endBrother.nodeType!=1){endBrother=endBrother.nextSibling}return endBrother}function getThisWindowId(){var j=document.createElement("div");j.setAttribute("style","display:none");j.id="thisRandom"+Math.random();var c=document.getElementsByTagName("body")[0];c.appendChild(j);var b;for(var d=0;;d++){var h=window.top.frames[d];if(!h){break}try{if(h.document.getElementById(j.id)){b=h.name.replace(/_content$/,"");break}}catch(g){}}c.removeChild(j);return b}function getLastWindowId(){return window.top.frames[window.top.frames.length-1].name.replace(/_content$/,"")}function getFrameForWindow(g){for(var b=0;;b++){var d=window.top.frames[b];if(!d){return null}try{if(d.name==g+"_content"){return d}}catch(c){}}}function openPleaseWait(e,d,b){var c=new Window("pleaseWait"+Math.random(),{className:"alphacube",minimizable:false,maximizable:false,resizable:false,title:e!=null?e:"LeaseTrader.com",draggable:false,closable:false,showEffect:Element.show,hideEffect:Element.hide,width:d!=null?d:200,height:b!=null?b:50});c.getContent().innerHTML="<div align='center' class='txt10Blue'>Please wait...<br><div class='space5'></div><img src='/img/ajax-loader.gif'><br></div>";c.setDestroyOnClose();c.showCenter(true);return c}function openStaticModalWindow(j,f,e,b){var d='Windows.close("{id}");return false;';var g=window.opera||/Konqueror|Safari|KHTML/.test(navigator.userAgent);if(g){d="Windows.closeAll();return false;"}var h="<div class='txt10Red' style='padding-left:10px'>{0}</div><br><table width='99%' cellpadding='0' cellspacing='0' border='0'><tr><td align='right'><input type=image class='cursor' id='btnOKPopup' onkeypress='{close}' onclick='{close}' src='/img/btn_ok_new.gif' style='margin-right:10px;' border='0'><br></td></tr></table>".replace("{0}",j).replace(/\{close\}/g,d);var c=openWindow({modal:true,title:f,content:h,width:e!=null?e:300,height:b!=null?b:100});if(!g){c.getContent().innerHTML=c.getContent().innerHTML.replace(/\{id\}/g,c.getId())}document.getElementById("btnOKPopup").focus();return c}function goToAnchor(d,c){var f;try{f=$A(d.document.getElementsByTagName("a")).find(function(g){return g.name==c})}catch(b){}if(!f){setTimeout(function(){goToAnchor(d,c)},50)}else{d.scrollTo(0,getXYElem(f).y)}}function openWindow(l){var m=WindowUtilities.getWindowScroll();m.width-=10;m.height-=35;var s={className:"alphacube",minimizable:false,maximizable:false,resizable:false,closable:(l.closable!=null?l.closable:true),draggable:!l.modal,width:Math.min(l.width,m.width),height:Math.min(l.height,m.height),title:l.title,scrolling:(l.height>m.height||l.width>m.width?true:l.scrolling),showEffect:Element.show,hideEffect:Element.hide,recenterAuto:false};if(l.url){var k=l.url.split("#")[0];var n=l.url.split("#")[1];if(!n||/safari|khtml/i.test(navigator.userAgent)){s.url=l.url}else{l.url=k;var g=openWindow(l);var q;var j=function(){q=getFrameForWindow(g.getId());if(!q){setTimeout(j,50)}else{_(q.document).ready(function(){goToAnchor(q,n)})}};j();return g}}var e="win"+Math.random();var g=new Window(e,s);if(l.content){g.getContent().innerHTML=l.content}g.setDestroyOnClose();if(!l.parentControl){g.showCenter(l.modal)}else{if(window.currentHelp){Windows.close(window.currentHelp)}var b=getXYElem(l.parentControl);var d=b.x+l.parentControl.offsetWidth;var o=b.y-m.top;var c=m.width-l.width-20;if(d>c){d=c}g.showCenter(l.modal,o,d);g.parentControl=l.parentControl;Windows.addObserver({onClose:function(h,f){if(f==g){window.currentHelp=null}}});window.currentHelp=g.getId()}return g}function FormatNumberBy3(d,b,c){if(arguments.length==2){c=","}if(arguments.length==1){c=",";b="."}d=d.toString();a=d.split(b);x=a[0];y=a[1];z="";if(typeof(x)!="undefined"){for(i=x.length-1;i>=0;i--){z+=x.charAt(i)}z=z.replace(/(\d{3})/g,"$1"+c);if(z.slice(-c.length)==c){z=z.slice(0,-c.length)}x="";for(i=z.length-1;i>=0;i--){x+=z.charAt(i)}if(typeof(y)!="undefined"&&y.length>0){x+=b+y}}return x}var ProtoToolTip={tooltips:[],inOT:false,init:function(){var c=getElementsByClassName(document,"tooltip");for(var b=0;b<c.length;b++){_("#"+c[b].id).hover(ProtoToolTip.ot,ProtoToolTip.ct);c[b].removeAttribute("alt");ProtoToolTip.tooltips.push(c[b])}},closeAllTooltips:function(){for(var b=0;b<ProtoToolTip.tooltips.length;b++){try{ProtoToolTip.ct(null,ProtoToolTip.tooltips[b].id)}catch(c){}}},closeTooltip:function(b){if(window.timerCloseTooltip){clearTimeout(window.timerCloseTooltip)}b.style.display="none"},ot:function(c){while(ProtoToolTip.inOT){}ProtoToolTip.inOT=true;ProtoToolTip.closeAllTooltips();var d=this.className.match(/tooltipFor[^ ]*/);var b=getXYElem(this);window.timerOpenTooltip=window.setTimeout("ProtoToolTip.openTooltip('{id}', '{tt}', {x}, {y})".replace("{id}",this.id).replace("{tt}",d).replace("{x}",b.x).replace("{y}",b.y-16),10);ProtoToolTip.inOT=false},ct:function(b,g){var c=this;if(g){c=document.getElementById(g)}if(window.timerOpenTooltip){clearTimeout(window.timerOpenTooltip)}var d=c.className.match(/tooltipFor[^ ]*/);var f=document.getElementById(d);ProtoToolTip.closeTooltip(f)},getXY:function(c){var b={};if(document.captureEvents){b.x=c.pageX;b.y=c.pageY}else{if(window.event.clientX){b.x=window.event.clientX+document.documentElement.scrollLeft;b.y=window.event.clientY+document.documentElement.scrollTop}}return b},openTooltip:function(f,c,b,d){var e=document.getElementById(c);if(e.style.display=="inline"){return}e.style.left=b;e.style.top=d;e.style.display="inline";e.style.position="absolute";e.style.zIndex=99;window.timerCloseTooltip=window.setTimeout("ProtoToolTip.ct({}, '{id}')".replace("{id}",f),6000)}};var rollovers={};function rollOver_btnOver(){if(!rollovers[this.id]){rollovers[this.id]={};rollovers[this.id].normal=new Image();rollovers[this.id].normal.src=this.src;rollovers[this.id].over=new Image();rollovers[this.id].over.src=this.src.replace(/(\..{3,4})$/,"_over$1")}this.src=rollovers[this.id].over.src}function rollOver_btnNormal(){this.src=rollovers[this.id].normal.src}function rollOver_init(){var c=getElementsByClassName(document,"rollover");for(var b=0;b<c.length;b++){var d=c[b].getElementsByTagName("img")[0];_("#"+d.id).hover(rollOver_btnOver,rollOver_btnNormal)}_("input.rollover2").hover(rollOver_btnOver,rollOver_btnNormal)}function changeFocus(d,c){var b=d.getAttribute("maxlength");if(/(Safari|Gecko)/.test(navigator.userAgent)){b--}if(d.value.length==b){document.getElementById(c).focus()}}function numbersATS2(c,b){if(b==1){return(c.charAt(b)==c.charAt(0))}else{if(b>1){return((c.charAt(b)==c.charAt(b-1))&&numbersATS2(c,b-1))}else{return false}}}function isVIN_OK(b){var d=new Array();if(b.length==0){return d}if(b.length!=17){d[d.length]="VIN must be 17 digits long"}else{if(/[ioq]/i.test(b)){d[d.length]="VIN numbers DO NOT CONTAIN the letters: I, O and Q"}else{if(numbersATS2(b,b.length-1)){d[d.length]="Incorrect VIN number"}else{var c=_.ajax({type:"GET",url:"/stats/IsValidVin.ashx",datatype:"json",success:function(e){return e},data:{vin:b},async:false});if(c.responseText=="false"){d[d.length]="Invalid VIN number"}}}}return d}var ProtoToolTip={tooltips:[],inOT:false,init:function(){var c=getElementsByClassName(document,"tooltip");for(var b=0;b<c.length;b++){_("#"+c[b].id).hover(ProtoToolTip.ot,ProtoToolTip.ct);c[b].removeAttribute("alt");ProtoToolTip.tooltips.push(c[b])}},closeAllTooltips:function(){for(var b=0;b<ProtoToolTip.tooltips.length;b++){try{ProtoToolTip.ct(null,ProtoToolTip.tooltips[b].id)}catch(c){}}},closeTooltip:function(b){if(window.timerCloseTooltip){clearTimeout(window.timerCloseTooltip)}b.style.display="none"},ot:function(c){while(ProtoToolTip.inOT){}ProtoToolTip.inOT=true;ProtoToolTip.closeAllTooltips();var d=this.className.match(/tooltipFor[^ ]*/);var b=getXYElem(this);window.timerOpenTooltip=window.setTimeout("ProtoToolTip.openTooltip('{id}', '{tt}', {x}, {y})".replace("{id}",this.id).replace("{tt}",d).replace("{x}",b.x).replace("{y}",b.y-16),10);ProtoToolTip.inOT=false},ct:function(b,g){var c=this;if(g){c=document.getElementById(g)}if(window.timerOpenTooltip){clearTimeout(window.timerOpenTooltip)}var d=c.className.match(/tooltipFor[^ ]*/);var f=document.getElementById(d);ProtoToolTip.closeTooltip(f)},getXY:function(c){var b={};if(document.captureEvents){b.x=c.pageX;b.y=c.pageY}else{if(window.event.clientX){b.x=window.event.clientX+document.documentElement.scrollLeft;b.y=window.event.clientY+document.documentElement.scrollTop}}return b},openTooltip:function(f,c,b,d){var e=document.getElementById(c);if(e.style.display=="inline"){return}e.style.left=b;e.style.top=d;e.style.display="inline";e.style.position="absolute";e.style.zIndex=99;window.timerCloseTooltip=window.setTimeout("ProtoToolTip.ct({}, '{id}')".replace("{id}",f),6000)}};var rollovers={};function rollOver_btnOver(){if(!rollovers[this.id]){rollovers[this.id]={};rollovers[this.id].normal=new Image();rollovers[this.id].normal.src=this.src;rollovers[this.id].over=new Image();rollovers[this.id].over.src=this.src.replace(/(\..{3,4})$/,"_over$1")}this.src=rollovers[this.id].over.src}function rollOver_btnNormal(){this.src=rollovers[this.id].normal.src}function rollOver_init(){var c=getElementsByClassName(document,"rollover");for(var b=0;b<c.length;b++){var d=c[b].getElementsByTagName("img")[0];_("#"+d.id).hover(rollOver_btnOver,rollOver_btnNormal)}}String.prototype.startsWith=function(b){return !this.indexOf(b)};String.prototype.endsWith=function(b){return this.lastIndexOf(b)==this.length-b.length};var default_replace=String.prototype.replace;String.prototype.replace=function(f,j){if(typeof j!="function"){return default_replace.apply(this,arguments)}var k=""+this;var e=j;if(!(f instanceof RegExp)){var h=k.indexOf(f);return(h==-1?k:default_replace.apply(k,[f,e(f,h,k)]))}var g=f;var d=[];var b=g.lastIndex;var c;while((c=g.exec(k))!=null){var h=c.index;var l=c.concat(h,k);d.push(k.slice(b,h),e.apply(null,l).toString());if(!g.global){b+=RegExp.lastMatch.length;break}else{b=g.lastIndex}}d.push(k.slice(b));return d.join("")};String.prototype.capitalize=function(){return this.replace(/\w+/g,function(b){return b.charAt(0).toUpperCase()+b.substr(1).toLowerCase()})};String.prototype.endsWith=function(b){return(this.length-b.length)==this.lastIndexOf(b)};String.prototype.reverse=function(){var c="";var b=this.length;while(b>0){c+=this.substring(b-1,b);b--}return c};String.prototype.mid=function(b,c){return this.substr(b,c)};String.prototype.toInt=function(){var c=new Array();for(var b=0;b<this.length;b++){c[b]=this.charCodeAt(b)}return c};String.prototype.isValidEmail=function(){var b=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;return b.test(this)};String.prototype.parse=function(f,d){if(!f){f="&"}if(!d){d="="}var e={};var c=this.split(f);for(var b=0;b<c.length;b++){v_arr=c[b].split(d);e[v_arr[0]]=v_arr[1]}return e};var ij;var ir_exs;String.prototype.trim=jf_string_trim;String.prototype.ltrim=jf_string_ltrim;String.prototype.rtrim=jf_string_rtrim;String.prototype.right=jf_string_right;String.prototype.left=jf_string_left;String.prototype.nolf=jf_string_nolf;String.prototype.nocr=jf_string_nocr;String.prototype.nocrlf=jf_string_nocrlf;String.prototype.nolfcr=jf_string_nolfcr;String.prototype.nosp=jf_string_nosp;String.prototype.nosquotes=jf_string_nosqts;String.prototype.crbr=jf_string_crbr;String.prototype.brcr=jf_string_brcr;String.prototype.lpad=jf_string_lpad;String.prototype.rpad=jf_string_rpad;String.prototype.flat=jf_string_flat;String.prototype.degremlin=jf_string_degremlin;String.prototype.upperhtml=jf_string_uhtml;String.prototype.lowerhtml=jf_string_lhtml;String.prototype.htmlattribs=jf_string_htmlattribs;String.prototype.format=jf_string_format;String.prototype.count=jf_string_count;String.prototype.strreverse=jf_string_reverse;String.prototype.isnumber=jf_string_isnumber;String.prototype.isdigit=jf_string_isdigit;function HTMLATTRIBS(d,c,b){return d.htmlattribs(c,b)}function htmlattribs(d,c,b){return d.htmlattribs(c,b)}function Htmlattribs(d,c,b){return d.htmlattribs(c,b)}function HTmlattribs(d,c,b){return d.htmlattribs(c,b)}function FORMAT(c,b){return c.format(b)}function Format(c,b){return c.format(b)}function Format(c,b){return c.format(b)}function FOrmat(c,b){return c.format(b)}function CHR(b){return String.fromCharCode(b)}function chr(b){return String.fromCharCode(b)}function Chr(b){return String.fromCharCode(b)}function CHr(b){return String.fromCharCode(b)}function UHMTL(b){return b.upperhtml()}function uhmtl(b){return b.upperhtml()}function Uhmtl(b){return b.upperhtml()}function UHmtl(b){return b.upperhtml()}function LHMTL(b){return b.lowerhtml()}function lhmtl(b){return b.lowerhtml()}function Lhmtl(b){return b.lowerhtml()}function LHmtl(b){return b.lowerhtml()}function LEN(b){return b.length}function len(b){return b.length}function Len(b){return b.length}function LEn(b){return b.length}function TRIM(b){return b.trim()}function trim(b){return b.trim()}function Trim(b){return b.trim()}function TRim(b){return b.trim()}function LTRIM(b){return b.ltrim()}function ltrim(b){return b.ltrim()}function Ltrim(b){return b.ltrim()}function LTrim(b){return b.ltrim()}function RTRIM(b){return b.rtrim()}function rtrim(b){return b.rtrim()}function Rtrim(b){return b.rtrim()}function RTrim(b){return b.rtrim()}function UCASE(b){return b.toUpperCase()}function ucase(b){return b.toUpperCase()}function Ucase(b){return b.toUpperCase()}function UCase(b){return b.toUpperCase()}function LCASE(b){return b.toLowerCase()}function lcase(b){return b.toLowerCase()}function Lcase(b){return b.toLowerCase()}function LCase(b){return b.toLowerCase()}function LPAD(d,b,c){return d.lpad(b,c)}function lpad(d,b,c){return d.lpad(b,c)}function Lpad(d,b,c){return d.lpad(b,c)}function LPad(d,b,c){return d.lpad(b,c)}function RPAD(d,b,c){return d.rpad(b,c)}function rpad(d,b,c){return d.rpad(b,c)}function Rpad(d,b,c){return d.rpad(b,c)}function RPad(d,b,c){return d.rpad(b,c)}function FLAT(b){return b.flat()}function flat(b){return b.flat()}function Flat(b){return b.flat()}function FLat(b){return b.flat()}function DEGREMLIN(c,b){return c.degremlin(b)}function degremlin(c,b){return c.degremlin(b)}function Degremlin(c,b){return c.degremlin(b)}function DeGremlin(c,b){return c.degremlin(b)}function COUNT(d,c){return d.count(c)}function count(d,c){return d.count(c)}function Count(d,c){return d.count(c)}function COunt(d,c){return d.count(c)}function INSTR(d,c){return d.indexOf(c)+1}function instr(d,c){return d.indexOf(c)+1}function Instr(d,c){return d.indexOf(c)+1}function InStr(d,c){return d.indexOf(c)+1}function INSTR(e,d,c){return e.indexOf(d,c)}function instr(e,d,c){return e.indexOf(d,c)}function Instr(e,d,c){return e.indexOf(d,c)}function InStr(e,d,c){return e.indexOf(d)}function JOIN(b){return b.join("")}function join(b){return b.join("")}function Join(b){return b.join("")}function JOin(b){return b.join("")}function JOIN(b,c){return b.join(c)}function join(b,c){return b.join(c)}function Join(b,c){return b.join(c)}function JOin(b,c){return b.join(c)}function STRREVERSE(b){return b.strreverse()}function strreverse(b){return b.strreverse()}function StrReverse(b){return b.strreverse()}function STrreverse(b){return b.strreverse()}function SPACE(b){return Lpad(" ",b)}function space(b){return Lpad(" ",b)}function Space(b){return Lpad(" ",b)}function SPace(b){return Lpad(" ",b)}function RIGHT(c,b){return c.right(b)}function right(c,b){return c.right(b)}function Right(c,b){return c.right(b)}function RIght(c,b){return c.right(b)}function LEFT(c,b){return c.left(b)}function left(c,b){return c.left(b)}function Left(c,b){return c.left(b)}function LEft(c,b){return c.left(b)}function ISNUMBER(b){return b.isnumber()}function isnumber(b){return b.isnumber()}function isNumber(b){return b.isnumber()}function IsNumber(b){return b.isnumber()}function NOTDIGIT(b){return b.isdigit()}function digit(b){return b.isdigit()}function Digit(b){return b.isdigit()}function Digit(b){return b.isdigit()}function REPLACE(c,d,b){return jf_string_vbreplace(c,d,b)}function replace(c,d,b){return jf_string_vbreplace(c,d,b)}function Replace(c,d,b){return jf_string_vbreplace(c,d,b)}function REplace(c,d,b){return jf_string_vbreplace(c,d,b)}function jf_string_trim(){return this.replace(/(^ +)|( +$)/g,"")}function jf_string_ltrim(){return this.replace(/(^ +)/g,"")}function jf_string_rtrim(){return this.replace(/( +$)/g,"")}function jf_string_right(b){return this.substr(this.length-b)}function jf_string_left(b){return this.substring(0,b)}function jf_string_nolf(){return this.replace(/(\n+)/g,"")}function jf_string_nocr(){return this.replace(/(\r+)/g,"")}function jf_string_nosp(){return this.replace(/ /g,"")}function jf_string_nocrlf(){return this.replace(/(\r+)|(\n+)/g,"")}function jf_string_nolfcr(){return this.replace(/(\n+)|(\r+)/g,"")}function jf_string_nosqts(){return this.replace(/(\'+)|(\"+)/g,"")}function jf_string_brcr(){return this.replace(/(\<BR\>)/gi,"\r")}function jf_string_crbr(){return this.replace(/\r\n|\r|\n\r|\n/gi,"<BR>")}function jf_string_lpad(b,c){var e;var f,d;f="";d=this.replace("","");c*=b.length;for(e=0;e<c;e=(e+b.length)){f+=b}d=f+d;return d}function jf_string_rpad(b,c){var e;var f,d;f="";d=this.replace("","");c*=b.length;for(e=0;e<c;e=(e+b.length)){f+=b}d+=f;return d}function jf_string_flat(){var b;b=this.replace(/\r\n( )+|\n\r( )+/g,"\r");b=b.replace(/( )+\r\n|( )+\n\r/g,"\r");b=b.replace(/\r( )+|\n( )+/g,"\r");b=b.replace(/( )+\r|( )+\n/g,"\r");return b}function jf_string_degremlin(d){var f;var e,c,g;var b;e=this.replace("","");c='(\r\n)+|(\n\r)+|(\r)+|(\n)+|(\t)+|(&)+|(@)+|(~)+|(#)+|(%)+|(")+|(!)+|(\\$)+|(\\*)+|(\\^)+';f=arguments.length;if(f>0){if(arguments[0].trim().length!=-1){b=arguments[0].split(",");for(f=0;f<b.length;f++){b[f]="("+b[f]+")"}c=b.join("+|")}}g=new RegExp(c,"g");return this.replace(g,"")}function jf_string_format(h){var l,d,b,k,g;var f,e,j;var c;l="";g="";d=this.replace(/\,/g,"");d=d.nosp();g=d.charAt(0);if(g!="+"&&g!="-"){g=""}else{d=d.substring(1,d.length)}h=h.toUpperCase();j=h.indexOf(".");if(j>-1||h.indexOf(",")>-1){c=d.split(".");if(h.indexOf(",XXX")>-1){c[0]=jf_string_thousands(c[0])}l=c[0];if(j>-1){l=c[0]}h=h.substring(j+1);e=h.length;if(c.length>1){if(e<=c[1].length){c[1]=c[1].substring(0,e)}else{if(e>c[1].length&&h.indexOf("0")!=-1){c[1]=c[1].rpad("0",e-c[1].length)}}l+="."+c[1]}}else{l=d}return g+l}function jf_string_count(b){return this.split(b).length-1}function jf_string_vbreplace(d,e,b){var c;c=new RegExp(e,"g");d=d.replace(c,b);return d}function jf_string_reverse(){var b;b=this.split("");b=b.reverse();return b.join("")}function jf_string_isnumber(){var c,d,b;d=this.replace("","");c="[^0-9]";lrex=new RegExp(c);return !lrex.test(d)}function jf_string_isdigit(){var c,d,b;d=this.replace("","");return parseInt(d)==d}function jf_string_thousands(b){var e,d;var c,f;f="";c="";d=b.length;if(d<4){c=b}else{for(e=d;e>0;e=e-3){c=b.substring(b.length-3,b.length)+f+c;f=",";b=b.substring(0,b.length-3);if(b.length<4){c=b+f+c;b="";e=0}}}return c}function jf_string_lhtml(){return jf_string_html(this.replace("",""),"lower")}function jf_string_uhtml(){return jf_string_html(this.replace("",""),"upper")}function jf_string_html(c,l){var d,f;var h,b;var e,j,g,k;d=c;l=l.toLowerCase();h=d.split("<");j=h.length;for(e=0;e<j;e++){k=h[e].indexOf(">");if(k>0){g=h[e].indexOf(" ");if(g<1){g=k}f=h[e].substring(0,g);if(l=="lower"){f=f.toLowerCase()}if(l=="upper"){f=f.toUpperCase()}h[e]=f+h[e].substring(g,h[e].length)}}d="";d=h.join("<");return d}function jf_string_htmlattribs(f,g){var d,j;var l,b,h;var q,m,k,c,o,n,e;d=this.replace("","");l=d.split("<");m=l.length;for(q=0;q<m;q++){n=l[q].indexOf(">");if(n>0){ls_row=l[q];li_eq=ls_row.indexOf("=");while(li_eq!=-1){ls_row=ls_row.substring(0,li_eq)+"^^^"+ls_row.substring(li_eq+1,ls_row.length);for(li_tag=li_eq;li_tag>0;li_tag--){if(ls_row.charAt(li_tag)==" "||ls_row.charAt(li_tag)=="<"){ls_row=ls_row.substring(0,li_tag)+"###"+ls_row.substring(li_tag+1,ls_row.length);li_tag=0}}li_eq=ls_row.indexOf("=")}ls_row=ls_row.replace(/^^^/g,"=");b=ls_row.split("###");o=b.length;for(c=0;c<o;c++){h=b[c].split("=");if(h.length==2){if(f=="upper"){h[0]=h[0].toUpperCase()}if(f=="lower"){h[0]=h[0].toLowerCase()}h[1]=h[1].replace(/\'/g,"");h[1]=h[1].replace(/\"/g,"");e=h[1].indexOf(">");if(g=="single"){if(e==-1){h[1]="'"+h[1]+"'"}else{h[1]="'"+h[1].substring(0,e)+"'"+h[1].substring(e,h[1].length)}}if(g=="double"){if(e==-1){h[1]='"'+h[1]+'"'}else{h[1]='"'+h[1].substring(0,e)+'"'+h[1].substring(e,h[1].length)}}if(g=="none"){if(h[1].indexOf(" ")!=-1||h[1].indexOf("%")!=-1){if(e==-1){h[1]='"'+h[1]+'"'}else{h[1]='"'+h[1].substring(0,e)+'"'+h[1].substring(e,h[1].length)}}}b[c]=h.join("=")}}l[q]=b.join(" ")}}d="";d=l.join("<");return d}function f_execute(){var ls_eval;ls_eval=document.forms[0].elements.func.value;if(ls_eval!=""&&ls_eval.indexOf("(")>-1&&ls_eval.indexOf(")")>-1){ls_eval=eval(ls_eval)}document.forms[0].elements.parm1.value=ls_eval}function f_function(){var ls_eval;var lobj;var li;lobj=document.forms[0].elements.sfunc;ls_eval=lobj.options[lobj.selectedIndex].text;ls_eval=ls_eval.toLowerCase();if(ls_eval!=""){for(li=0;li<ir_exs.length;li++){if(ir_exs[li].oper.toLowerCase()==ls_eval){ls_eval=ir_exs[li].jsfunc;ls_eval=eval(ls_eval)+"";ls_eval=ls_eval.replace(/\r/g,"<BR>");ls_eval=ls_eval.replace(/ /g," ");document.all.div1.innerHTML="<U><B>VB function: </B></U>"+ir_exs[li].oper+"(...)<BR><BR><U><B>Javascript function:</B></U><BR>\n"+ls_eval;li=ir_exs.length}}}}function f_clear(){document.forms[0].elements.parm1.value="";document.forms[0].elements.oper.value="";document.all.div1.innerHTML=""}function f_insert(b){if(b!=""){document.forms[0].elements.oper.value=ir_exs[b].oper;document.forms[0].elements.func.value=ir_exs[b].func;document.all.div1.innerHTML=""}else{document.forms[0].elements.func.value="";f_clear()}}function cl_exs(c,d,b,e,f){this.oper=c;this.jsfunc=d;this.test=b;this.parm1=e;this.parm2=f;this.func=c+'("'+b+'"';if(this.parm1!=""){this.func+=', "'+this.parm1+'"'}if(this.parm2!=""){this.func+=', "'+this.parm2+'"'}this.func+=")"}new function(b){b.fn.placeholder=function(d){d=d||{};var l=d.dataKey||"placeholderValue";var f=d.attr||"placeholder";var m=d.className||"placeholder";var k=d.values||[];var h=d.blockSubmit||false;var e=d.blankSubmit||false;var c=d.onSubmit||false;var g=d.value||"";var j=d.cursor_position||0;return this.filter(":input").each(function(n){b.data(this,l,k[n]||b(this).attr(f))}).each(function(){if(b.trim(b(this).val())===""){b(this).addClass(m).val(b.data(this,l))}}).focus(function(){if(b.trim(b(this).val())===b.data(this,l)){b(this).removeClass(m).val(g)}if(b.fn.setCursorPosition){b(this).setCursorPosition(j)}}).blur(function(){if(b.trim(b(this).val())===g){b(this).addClass(m).val(b.data(this,l))}}).each(function(o,n){if(h){new function(q){b(q.form).submit(function(){return b.trim(b(q).val())!=b.data(q,l)})}(n)}else{if(e){new function(q){b(q.form).submit(function(){if(b.trim(b(q).val())==b.data(q,l)){b(q).removeClass(m).val("")}return true})}(n)}else{if(c){new function(q){b(q.form).submit(c)}(n)}}}})}}(jQuery);
