var SITE_URL=(location.protocol||"http:")+"//"+location.hostname;var IMG_BLOCK_SCREEN=new Image();IMG_BLOCK_SCREEN.src="/a/img/0.gif";IMG_BLOCK_SCREEN.width=IMG_BLOCK_SCREEN.height=1;IMG_BLOCK_SCREEN.alt="";var CLEAR_SIGN="clear";function isset(a){return(a||a==0||a==""||a===false)}function valueInLimits(c,b,a){return Math.max((isset(a)?Math.min(c,a):c),b)}var clearNode={tag:"SPAN",className:"clear0"};var BROWSER=(function(){var ua=navigator.userAgent,webkit=/AppleWebKit/.test(ua),safari=webkit&&/Safari\//.test(ua);return{isIE:
/*@cc_on!@*/
false,isIE6:false
/*@cc_on || @_jscript_version < 5.7 @*/
||/msie 6/i.test(navigator.userAgent.toLowerCase()),isOpera:!!(window.opera&&opera.version),isOpera95:!!((window.opera&&opera.version)&&window.scrollX==undefined),isFirefox:(ua.indexOf("Firefox")!=-1),isGecko:!!(!document.attachEvent&&document.addEventListener),isWebkit:webkit,isSafari:safari&&/Version\//.test(ua),isChrome:safari&&/Chrome\//.test(ua)}})();var OPERATING_SYSTEM={isLinux:navigator&&navigator.platform&&navigator.platform.search("Linux")>=0,isBsd:navigator&&navigator.platform&&navigator.platform.search(/Bsd/i)>=0};OPERATING_SYSTEM.isUnix=(OPERATING_SYSTEM.isLinux||OPERATING_SYSTEM.isBsd);function $function(b,c){if(is_function(b)){var a=Array.prototype.slice.call(arguments);return b(a.slice(1))}return false}Function.prototype.inheritsFrom=function(a,b){var c=function(){};c.prototype=a.prototype;this.prototype=new c();this.prototype.constructor=this;this.superClass=a;this.prototype._parent=a.prototype;this.prototype._parentMethod=function(f){var e=Array.prototype.slice.call(arguments);if(is_function(this._parent[f])){var d=e.slice(1);return this._parent[f].call(this,d[0],d[1],d[2])}};if(is_object(b)){$.extend(this.prototype,b)}return this};function refreshWindow(){window.location.reload(false)}function is_function(a){return(a&&typeof(a)=="function")}function is_object(a){return(typeof(a)=="object")}function is_array(a){return(a!=null&&typeof(a)=="object"&&a.unshift!=undefined)}function is_string(a){return(typeof(a)=="string")}function is_numeric(a){return !isNaN(a)}function is_null(a){return a===null}function is_date(a){return(a&&typeof(a)=="object"&&is_function(a.getTime))}function is_valid_date(a){return(is_date(a)&&a.getDay&&!isNaN(a.getDay()))}function method_exists(b,a){return(b&&is_object(b)&&is_function((b)[a]))}function doScript(b,d){var a=document.createElement("SCRIPT"),c="";if(!d.from){d.from="js"}if(!d.resultwrapper){d.resultwrapper="js"}for(p in d){c+=c?"&"+p+"="+d[p]:"?"+p+"="+d[p]}b+=c;a.type="text/javascript";a.src=b;document.body.appendChild(a)}function putAndSendForm(k,j,l,c){var g=setChild(document.body,null,null,"form"),e;if(k){g.action=k}if(j){g.method=j}for(var d in l){e=setChild(g,null,null,"input");e.name=d;e.value=l[d]}if(c){for(var h in c){var b=c[h],a=g.appendChild(b);a.value=b.value}e=setChild(g,null,null,"input");e.name="MAX_FILE_SIZE";e.value=30000;g.enctype="multipart/form-data"}g.submit()}function submitForm(a){document.forms[0].submit()}function getRadioValue(d){var b=null;d=$name(d);if(!d){return""}for(var a=0;a<d.length;a++){var c=d[a];if(c.checked){b=c.value;break}}return b}function getFileName(b){b=b.replace(/^\s|\s$/g,"");if(/\.\w+$/.test(b)){var a=b.match(/([^\/\\]+)\.(\w+)$/);if(a){return a[1]+"."+a[2]}else{return"(file)"}}else{var a=b.match(/([^\/\\]+)$/);if(a){return a[1]}else{return"(file)"}}}function selfBlur(){return this.blur()}function parseLineXML(d){if(!d){return false}var f=[],g=d.firstChild,j={};if(!g){return{}}if(g.nodeType!=1){g=g.nextSibling}for(var c=0;c<g.attributes.length;c++){var b=g.attributes[c];if(b.nodeType!=2){continue}j[b.nodeName]=b.nodeValue}for(var e=0;e<g.childNodes.length;e++){var h=g.childNodes[e];if(h.nodeType!=1){continue}f[e]={value:h.firstChild?h.firstChild.data:"",data:{}};for(var c=0;c<h.attributes.length;c++){var b=h.attributes[c];if(b.nodeType!=2){continue}f[e].data[b.nodeName]=b.nodeValue}}return{head:j,body:f}}if(typeof DOMParser=="undefined"){DOMParser=function(){return false};DOMParser.prototype.parseFromString=function(c,e){if(typeof ActiveXObject!="undefined"){var b=new ActiveXObject("MSXML.DomDocument");b.loadXML(c);return b}else{if(typeof XMLHttpRequest!="undefined"){var a=new XMLHttpRequest;a.open("GET","data:"+(e||"application/xml")+";charset=utf-8,"+encodeURIComponent(c),false);if(a.overrideMimeType){a.overrideMimeType(e)}a.send(null);return a.responseXML}}return false}}function moveCaretToStart(b){if(b.createTextRange){var a=b.createTextRange();a.collapse(true);a.select()}else{if(b.selectionStart){b.setSelectionRange(0,0);b.focus()}}}function moveCaretToEnd(a){setCaretPosition(a,$value(a).length)}function getCaretPosition(c){c=$id(c);var b=0;if(document.selection){c.focus();var a=document.selection.createRange();a.moveStart("character",-$value(c).length);b=a.text.length}else{if(c.selectionStart||c.selectionStart=="0"){b=c.selectionStart}}return b}function setCaretPosition(c,b){c=$id(c);if(c!=null){if(c.createTextRange){var a=c.createTextRange();a.move("character",b);a.select()}else{if(c.selectionStart){c.setSelectionRange(b,b);c.focus();triggerKeyPress(c,0,32);triggerKeyPress(c,8,0)}else{c.focus()}}}}function triggerKeyPress(d,c,b){d=$id(d);var a=document.createEvent("KeyboardEvent");if(typeof a.initKeyboardEvent=="function"){a.initKeyboardEvent("keypress",true,true,null,false,false,false,false,c,b)}else{a.initKeyEvent("keypress",true,true,null,false,false,false,false,c,b)}d.dispatchEvent(a)}function getCaretPos(a){a=$id(a);a.focus();if(a.selectionStart){return a.selectionStart}else{if(document.selection){return getCaretPosition(a)}}return 0}function selectNode(c){c=$id(c);if(!c){return}var b,a,e,d;if((e=c.ownerDocument)&&(d=e.defaultView)&&typeof d.getSelection!="undefined"&&typeof e.createRange!="undefined"&&(b=window.getSelection())&&typeof b.removeAllRanges!="undefined"){a=e.createRange();a.selectNode(c);b.removeAllRanges();b.addRange(a)}else{if(document.body&&typeof document.body.createTextRange!="undefined"&&(a=document.body.createTextRange())){a.moveToElementText(c);a.select()}}}function $id(b){var a;if(!b){return false}a=null;if(typeof(b)!="object"){if(document.getElementById(b)){a=document.getElementById(b)}}else{if(b.length!=undefined&&b.slideDown!=undefined){a=b[0]}else{a=b}}return a}function $name(b){if(!b){return false}var a=new Array();if(typeof(b)!="object"){a=document.getElementsByName(b)}if(a.length!=0){return a}else{return null}}function $tagname(f,e,a){if(!f){return false}var b=[],d=new Array();e=$id(e);if(e&&typeof(e)=="object"){d=e.getElementsByTagName(f)}else{d=document.getElementsByTagName(f)}if(typeof d=="function"){b=d;d=new Array();for(var c=0;c<b.length;c++){d.push(b[c])}}if(d.length>1){return d}else{if(d.length==1){return d[0]}else{return[]}}}function $value(b,c){var a;b=$id(b);if(!b){return""}if(c&&c!=CLEAR_SIGN){b.value=c}else{if(c==""||c==CLEAR_SIGN){b.value=""}}a=b.value?b.value:"";return a}function $clearValue(a){return $value(a,CLEAR_SIGN)}function $checked(a,b){a=$id(a);if(!a){return false}if(isset(b)){a.checked=b}return a.checked}function $innerHTML(a,b){a=$id(a);if(!a){return false}if(b&&b!=CLEAR_SIGN){a.innerHTML=b;return true}else{if(b==""||b==CLEAR_SIGN){a.innerHTML=""}else{return a.innerHTML}}}function $clear(a){return $innerHTML(a,CLEAR_SIGN)}function $focus(a){a=$id(a);if(!a||!a.focus){return false}return a.focus()}function $blur(a){a=$id(a);if(!a||!a.blur){return false}return a.blur()}function $toggleDisable(a,b){a=$id(a);if(!a){return false}toggleClass(a,b?1:0,["field-enabled","field-disabled"]);return a.disabled=!!b}function $disable(a){return $toggleDisable(a,true)}function $enable(a){return $toggleDisable(a,false)}function $displaying(a){a=$id(a);if(!a){return false}return !!(a.offsetHeight)}function $hasClass(d,b){d=$id(d);if(!d||!d.className){return false}var a=d.className.split(" ");for(var c=0;c<a.length;c++){if(a[c]==b){return true}}return false}function setChild(e,b,f,a,c,g){if(!e&&!b){return false}var d=$id(b);if(e&&!d&&a){e=$id(e);d=document.createElement(a);d=e.appendChild(d);if(b){d.id=b}}if(!d){return false}if(f){d.className=f}if(c){d.innerHTML=c}if(g){d=concatObjects(d,g)}return d}function unsetChild(a){a=$id(a);if(!a){return false}if(a.parentNode){return a.parentNode.removeChild(a)}return false}function searchInClass(c,d){c=$id(c);if(c&&c.className){var e=c.className.split(" ");for(var b=0;b<e.length;b++){var a=e[b];if(a.search(d)==0){return a.substr(d.length)}}}return undefined}function setChildExt(e){var d={parent:document.body,setType:"append",tag:"DIV",id:"",baseDocument:document};if(is_string(e)){e={className:e}}e=concatObjects(e,d);var c=$id(e.id);if(c){return c}var b=$id(e.parent);if(e.name&&BROWSER.isIE){c=e.baseDocument.createElement("<"+e.tag+' name="'+e.name+'">')}else{c=e.baseDocument.createElement(e.tag);if(e.name){c.name=e.name}}if(!c){return false}if(e.id){c.id=e.id}if(e.type){c.type=e.type}if(isset(e.value)){c.value=e.value}if(e.className){c.className=e.className}if(e.content){c.innerHTML=e.content}if(isset(e.title)){c.title=e.title}if(e.params&&is_object(e.params)){for(var a in e.params){c[a]=e.params[a]}}if(e.style&&is_object(e.style)){setStyle(c,e.style)}if(e.onclick&&is_function(e.onclick)){c.onclick=e.onclick}if(e.qOnclick&&is_function(e.qOnclick)){EVENTS.append(c,"onclick",e.qOnclick)}if(e.onfocus&&is_function(e.onfocus)){c.onfocus=e.onfocus}if(e.onmouseover&&is_function(e.onmouseover)){c.onmouseover=e.onmouseover}if(e.onmouseout&&is_function(e.onmouseout)){c.onmouseout=e.onmouseout}switch(e.setType){case"insertBefore":c=b.parentNode.insertBefore(c,b);break;case"append":c=b.appendChild(c);break}if(e.child&&is_object(e.child)){setChildExt(concatObjects(e.child,{parent:c}))}if(e.children&&is_object(e.children)){for(var a in e.children){var f=e.children[a];if(!is_object(f)){continue}setChildExt(concatObjects(f,{parent:c}))}}if(isset(e.checked)){c.checked=e.checked}if(isset(e.selected)){c.selected=e.selected}if(isset(e.disabled)){c.disabled=e.disabled}if(e.handlerFunction&&is_function(e.handlerFunction)){e.handlerFunction(c)}return c}function setChildren(d,c){d=$id(d);if(!d){d=document.body}if(!is_object(c)){return false}for(var b=0;b<c.length;b++){var a=c[b];if(is_string(a)){a={className:a}}d=setChildExt(rConcatObjects(a,{parent:d}))}return d}function setStyle(b,a){b=$id(b);if(!b||!a||!b.style||typeof a!="object"){return false}var g=["top","left","width","height"];for(var d in a){var c=a[d];try{if(typeof c!="object"&&typeof c!="function"){b.style[d]=c+((in_array(g,d)&&!isNaN(c))?"px":"")}}catch(f){document.writeln("error "+b+": "+d+"="+c)}}return true}function getElementByTagAndClass(e,a,g){if(!e||!a){return false}e=$id(e);var d,f,c=new Array(),b=null;c=e.getElementsByTagName(a);if(c.length>0){for(f in c){d=c[f];if(d&&d.className&&in_array(d.className.split(" "),g)){b=d}}}return b}function getElementsByTagAndClass(e,a,g){if(!e||!a){return false}e=$id(e);var d,f,c=new Array(),b=new Array();c=e.getElementsByTagName(a);if(c.length>0){for(f in c){d=c[f];if(!d){continue}if(d.className&&in_array(d.className.split(" "),g)){b.push(d)}}}return b}function getElementByTagAndProperty(f,b,h,a){if(!f||!b){return false}f=$id(f);var e,g,d=new Array(),c=null;d=f.getElementsByTagName(b);if(d.length>0){for(g in d){e=d[g];if(e[h]&&e[h]==a){c=e}}}return c}function $where(d){var a=$id(d),c=0,b=0;if(!a){return false}while(d){c+=d.offsetLeft;b+=d.offsetTop;d=d.offsetParent}return{left:c,top:b,right:c+a.offsetWidth,bottom:b+a.offsetHeight}}function getWhereIs(a){return $where(a)}function getWhereIsEvent(a){if(a.pageX){return{left:a.pageX,top:a.pageY}}else{}return{left:a.clientX+document.body.parentElement.scrollLeft,top:a.clientY+document.body.parentElement.scrollTop}}function placeUnderCursor(b,a,c){b=$id(b);if(!b){return false}b.style.position="absolute";b.style.left=(a-b.offsetWidth+10)+"px";b.style.top=(c-5)+"px"}function setPosition(a,b){a=$id(a);if(!a){return false}if(b.left!=null){a.style.left=b.left+"px"}if(b.top!=null){a.style.top=b.top+"px"}return false}function putInScreenCenter(a,i,b,c){a=$id(a);if(!a){return false}a.style.position="absolute";var d=(window.opera)?window.innerHeight:document.documentElement.clientHeight,g=(document.all)?document.documentElement.scrollTop:window.pageYOffset,e=Math.max(0,Math.round(g+d/2-a.clientHeight/2)+(b||0)),h=document.documentElement.offsetWidth,f=i?Math.round(h/2-a.offsetWidth/2):null;if(document.all){e-=30}setPosition(a,{left:f,top:e})}function switchElementVisibility(c,d){var b=new Array("hidden","showed"),e,a=0;c=$id(c);if(c.className.search(b[0])>-1){a=0}else{if(c.className.search(b[1])>-1){a=1}}e=(d==null)?((a==0)?1:0):d;strTempl="/"+b[a]+"/";if(c.className.search(b[a])>-1){c.className=c.className.replace(b[a],b[e])}else{c.className+=" "+b[e]}return e}function toggleClass(d,e,c){c=c?c:["hidden","showed"];d=$id(d);if(!d){return false}var a="/"+c[0]+"/",f=(e==null)?((d.className.search(c[0])>-1)?1:0):e,b=(f==0)?1:0;if(d.className!=null&&d.className.search(c[b])>-1){d.className=d.className.replace(c[b],c[f])}else{if(d.className!=null&&d.className.search(c[f])<0){d.className+=" "+c[f]}}return f}function getOverClone(a){a=$id(a);if(!a){return false}var b=$desc(a),c=setChildExt({style:{position:"absolute",top:b.top,left:b.left,width:b.width,height:b.height},className:"cloneNode"});return c}function $desc(a){a=$id(a);if(!a){return false}var b={width:a.offsetWidth,height:a.offsetHeight,tag:a.nodeName};b=concatObjects(b,getWhereIs(a));return b}function $alpha(b,a){b=$id(b);if(!b){return false}if(!isset(a)){a=1}if(typeof b.style.filter!="undefined"){if(a<=1&&a>0){a*=100}b.style.filter="alpha(opacity="+a+")"}else{b.style.opacity=a}return a}function getScrollBarWidth(){var c=document.createElement("p");c.style.width="100%";c.style.height="200px";var d=document.createElement("div");d.style.position="absolute";d.style.top="0px";d.style.left="0px";d.style.visibility="hidden";d.style.width="200px";d.style.height="150px";d.style.overflow="hidden";d.appendChild(c);document.body.appendChild(d);var b=c.offsetWidth;d.style.overflow="scroll";var a=c.offsetWidth;if(b==a){a=d.clientWidth}document.body.removeChild(d);return(b-a)}var DraggingItem=new Object();function startDrag(f,h,c,e){DraggingItem.This=$id(h);DraggingItem.Target=$id(c);if(!DraggingItem.This||!DraggingItem.Target){alert("error dragging "+DraggingItem.Target);return false}DraggingItem.TargetXY=getWhereIs(DraggingItem.Target);var d={minLeft:1,minTop:1};DraggingItem.settings=concatObjects(e,d);if(isset(DraggingItem.settings.maxXDelta)){var b=Number(DraggingItem.Target.style.left.slice(0,-2));if(!isNaN(b)){DraggingItem.settings.minLeft=b-DraggingItem.settings.maxXDelta;DraggingItem.settings.maxLeft=b+DraggingItem.settings.maxXDelta}else{DraggingItem.settings.minLeft=DraggingItem.TargetXY.left-DraggingItem.settings.maxXDelta;DraggingItem.settings.maxLeft=DraggingItem.TargetXY.left+DraggingItem.settings.maxXDelta}}if(isset(DraggingItem.settings.maxYDelta)){var g=Number(DraggingItem.Target.style.top.slice(0,-2));if(!isNaN(g)){DraggingItem.settings.minTop=g-DraggingItem.settings.maxYDelta;DraggingItem.settings.maxTop=g+DraggingItem.settings.maxYDelta}else{DraggingItem.settings.minTop=DraggingItem.TargetXY.top-DraggingItem.settings.maxYDelta;DraggingItem.settings.maxTop=DraggingItem.TargetXY.left+DraggingItem.settings.maxYDelta}}var a=new Object();if(BROWSER.isIE||BROWSER.isOpera95){a.x=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;a.y=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop}else{if(BROWSER.isGecko||BROWSER.isOpera){a.x=f.clientX+window.scrollX;a.y=f.clientY+window.scrollY}}DraggingItem.cursorStartX=a.x;DraggingItem.cursorStartY=a.y;DraggingItem.StartLeft=parseInt(DraggingItem.Target.style.left);DraggingItem.StartTop=parseInt(DraggingItem.Target.style.top);if(isNaN(DraggingItem.StartLeft)){DraggingItem.StartLeft=DraggingItem.TargetXY.left}if(isNaN(DraggingItem.StartTop)){DraggingItem.StartTop=DraggingItem.TargetXY.top}if(BROWSER.isIE){document.attachEvent("onmousemove",ProceedDrag);document.attachEvent("onmouseup",StopDrag);window.event.cancelBubble=true;window.event.returnValue=false}else{if(BROWSER.isGecko||BROWSER.isOpera){document.addEventListener("mousemove",ProceedDrag,true);document.addEventListener("mouseup",StopDrag,true);f.preventDefault()}}}function $drag(c,d,a,b){startDrag(c,d,a,b)}function ProceedDrag(b){var a=new Object();if(BROWSER.isIE||BROWSER.isOpera95){a.x=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;a.y=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop}else{if(BROWSER.isGecko||BROWSER.isOpera){a.x=b.clientX+window.scrollX;a.y=b.clientY+window.scrollY}}var d=DraggingItem.StartLeft+a.x-DraggingItem.cursorStartX;d=valueInLimits(d,DraggingItem.settings.minLeft,DraggingItem.settings.maxLeft);DraggingItem.Target.style.left=d+"px";var c=DraggingItem.StartTop+a.y-DraggingItem.cursorStartY;c=valueInLimits(c,DraggingItem.settings.minTop,DraggingItem.settings.maxTop);DraggingItem.Target.style.top=c+"px";if(BROWSER.isIE){window.event.cancelBubble=true;window.event.returnValue=false}if(BROWSER.isGecko||BROWSER.isOpera95){b.preventDefault()}if(DraggingItem.settings.onmove&&is_function(DraggingItem.settings.onmove)){DraggingItem.settings.onmove(DraggingItem.Target,d,c)}}function StopDrag(a){if(BROWSER.isIE){document.detachEvent("onmousemove",ProceedDrag);document.detachEvent("onmouseup",StopDrag)}if(BROWSER.isGecko||BROWSER.isOpera){document.removeEventListener("mousemove",ProceedDrag,true);document.removeEventListener("mouseup",StopDrag,true)}if(DraggingItem.settings.oncomplete&&is_function(DraggingItem.settings.oncomplete)){DraggingItem.settings.oncomplete(DraggingItem.Target)}}function in_array(a,c){var b=0;for(var d in a){if(c==a[d]){b++}}return b}function getArgList(c){var a="";for(var b in c){a+=a?",":"";a+='"'+c[b]+'"'}return a}function setArray(c){if(is_array(c)){return c}else{var b=[];isset(c)&&b.push(c);return b}}function array_rearrange(b,a,e){var d=b[a];b.splice(a,1);b.splice(e,0,d);return b}function _prop(d,e){if(!d||!e){return undefined}var c=e.split(".");if(c.length){var b=d;for(var a=0;a<c.length;a++){if(b==undefined){return undefined}b=b[c[a]]}return b}else{return d[e]}}function concatObjects(e,d,c){var b={};for(var a in e){b[a]=e[a]}for(var a in d){if(c&&is_object(d[a])&&is_object(b[a])){b[a]=concatObjects(b[a],d[a])}else{if(!isset(b[a])){b[a]=d[a]}}}return b}function rConcatObjects(b,a){return concatObjects(b,a,"recursive")}function duplicateObject(c){if(is_date(c)){return c}var b=is_array(c)?[]:{};for(var a in c){if(is_object(c[a])){b[a]=duplicateObject(c[a])}else{b[a]=c[a]}}return b}function removeFromObject(c,b){var d={};for(var a in c){if(a!=b){d[a]=c[a]}}return d}function testObject(f,m,a,b){var d="",j=m?"<br/>":"\n";if(!b){b=0}var h="";var l=256;for(var e=0;e<b;e++){h+="  "}if(b>256){return"..too much iterations"}if(is_object(f)){var g=0;for(var c in f){if(++g>l){return"..too much iterations"}var n=f[c];var k=typeof(n);if(n==null){k="Null"}else{if(n.pop){k="Array"}else{if(n.charAt||n==""){k="String"}else{if(!isNaN(Number(n))){k="Number"}}}}if(is_function(n)){continue}d+=j+h+c+"["+k+"]: ";if(is_object(n)){d+=testObject(n,false,true,b+1)}else{d+=n}}}else{d+=h+f}if(m){document.write("<pre>"+d+"</pre>")}else{if(!a){alert(d)}}return d}function dumpObject(f,d,c){var g="",a=d?"<br/>":"\n";for(var e in f){var b=f[e];g+=e+"=>"+b+a}if(d){document.write(g)}else{if(!c){alert(g)}}return g}function MXX_EVENTS(){this.Elements=[];this.Events=[];this.eventObj=this;this.append=function(el,evnt,func,weight){el=$id(el);if(!el){return}if(!in_array(this.Elements,el)){el.eventObj=this;el.elNum=this.Elements.push(el)-1;this.Events[el.elNum]={}}var evnts=setArray(evnt);for(var e=0;e<evnts.length;e++){var cEvnt=evnts[e];if(!this.Events[el.elNum][cEvnt]){this.Events[el.elNum][cEvnt]=[]}var funcs=setArray(func);this.Events[el.elNum][cEvnt]=this.Events[el.elNum][cEvnt].concat(funcs);if(!this["router_"+cEvnt]){eval('this["router_'+cEvnt+'"]=function(eArg){this.eventObj.router(this,"'+cEvnt+'",eArg); }')}eval('el["'+cEvnt+'"]=this["router_'+cEvnt+'"]')}};this.router=function(el,evnt,eArg){var elData=el.eventObj.Events[el.elNum];if(!elData||!elData[evnt]){return}for(var e=0;e<elData[evnt].length;e++){if(elData[evnt][e]&&typeof(elData[evnt][e]=="function")){elData[evnt][e].call(el,eArg)}else{}}}}var EVENTS=new MXX_EVENTS();function getKeyPressed(f){var c=new Array();c[9]="TAB";c[13]="ENTER";c[27]="ESC";c[35]="END";c[36]="HOME";c[37]="ARROWLEFT";c[38]="ARROWUP";c[39]="ARROWRIGHT";c[40]="ARROWDOWN";var a=-1,d;if(window.event){a=event.keyCode;d=event.srcElement}else{a=f.which;d=f.target}var b=(c[a])?c[a]:a;return b}function stopEventBubble(a,b){if(!a){var a=window.event}if(!a){return}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}if(b){preventDefaultEvent(a)}}function preventDefaultEvent(a){if(!a){var a=window.event}if(!a){return}if(a.preventDefault){a.preventDefault()}else{if(window.event){window.event.returnValue=false}}}function toStopEventBubble(a){return EVENTS.append(a,"onclick",stopEventBubble)}function arrestEvent(a){if(!a){var a=window.event}if(!a){return}if(!window.eventArrested){window.eventArrested=[this]}else{window.eventArrested.push(this)}}function toArrestEvent(b,a){b=$id(b);if(!b){return false}if(!b._toArrestEventElements){b._toArrestEventElements=[]}if(a){if(!a.length){b._toArrestEventElements.push(a)}else{b._toArrestEventElements=b._toArrestEventElements.concat(a)}}return EVENTS.append(b,"onclick",arrestEvent)}function blockScreen(b){if($id("blockscreen")){return false}var a=setChildExt({id:"blockscreen",className:b||""});resizeBlockScreen()}function unblockScreen(){if(!$id("blockscreen")){return false}unsetChild("blockscreen")}function resizeBlockScreen(){var a=$id("blockscreen");if(!a){return false}var b=$id("body-wrap")?$id("body-wrap").clientHeight:0;var c={height:Math.max(document.documentElement.clientHeight,document.body.clientHeight,b),width:Math.max(document.documentElement.clientWidth,document.body.clientWidth)};setStyle(a,c);return true}EVENTS.append(window,"onresize",resizeBlockScreen);function showAjaxProgress(){blockScreen();return activateAjaxProgress()}function stopShowAjaxProgress(){unblockScreen();return disActivateAjaxProgress()}function activateAjaxProgress(){toggleClass("pageAjaxLoading",1,["passive","active"]);putInScreenCenter("pageAjaxLoading")}function disActivateAjaxProgress(){toggleClass("pageAjaxLoading",0,["passive","active"])}function paramString(c,d){if(typeof c!="object"){return c}var b="";for(var a in c){b+=(b?"&amp;":"")+a+"="+(d?encodeURIComponent(c[a]):c[a])}return b}function parseParamString(e){var d={};var c=e.split("?").pop().split("&");for(var b=0;b<c.length;b++){var a=c[b].split("=");d[a[0]]=a[1]}return d}function buildFlashExt(d){var c={version:7,width:"100%",height:"100%",name:"flashmovie",wmode:"transparent",isWrite:false};d=concatObjects(d,c);var a=d.params?paramString(d.params,true):"";if(is_function(d.noFlash)&&!FLASH_CHECKING.DetectFlashVer(d.version)){d.noFlash();return false}var b=BROWSER.isIE?'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+d.width+'" height="'+d.height+'" id="'+d.name+'"><param name="movie" value="'+d.src+'"><param name="wmode" value="'+d.wmode+'" /><param name="quality" value="high"><param name="allowScriptAccess" value="always" /><param name="menu" value="false" /><param name="FlashVars" value="'+a+'" /></object>':'<embed src="'+d.src+'" quality="high" wmode="'+d.wmode+'" width="'+d.width+'" height="'+d.height+'" name="'+d.name+'"  id="'+d.name+'" menu="false" allowscriptaccess="always" type="application/x-shockwave-flash" flashvars="'+a+'"/>';d.isWrite&&document.write(b);return b}function $flash(a){return buildFlashExt(a)}function $flashMovie(a){return BROWSER.isIE?window[a]:document[a]}var FLASH_CHECKING={isIE:(navigator.appVersion.indexOf("MSIE")!=-1)?true:false,isWin:(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false,isOpera:(navigator.userAgent.indexOf("Opera")!=-1)?true:false,ControlVersion:function(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a},GetSwfVer:function(){var g=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var f=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+f].description;var e=a.split(" ");var c=e[2].split(".");var h=c[0];var b=c[1];var d=e[3];if(d==""){d=e[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var g=h+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){g=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){g=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){g=2}else{if(this.isIE&&this.isWin&&!this.isOpera){g=this.ControlVersion()}}}}}return g},DetectFlashVer:function(f,d,c){versionStr=this.GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(this.isIE&&this.isWin&&!this.isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var e=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(e>=parseFloat(f)){return true}else{if(e==parseFloat(f)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}};function array_rand(a){var b=a.length;var c=(Math.round(Math.random()*(b-1))).between(0,b-1);return a[c]}function popUp(b){var a={url:"",width:350,height:600,top:200,left:200,menubar:"no",directories:"no",location:"no",resizable:"yes",scrollbars:"no",toolbar:"no"};b=concatObjects(b,a);if(b.width){b.width+=20}if(b.height){b.height+=20}if(b.content){b.url=""}POPUP_WIN=window.open(b.url,"POPUP_WINDOW",(function(){var c=[];for(var d in b){if(d!="url"&&b[d]){c.push(d+"="+b[d])}}return c.join(", ")})());if(b.content){if(!POPUP_WIN.document.body){b.content="<body>"+b.content+"</body>"}POPUP_WIN.document.open();POPUP_WIN.document.write("<head><title>"+(b.title||"")+'</title><style type="text/css">A{cursor:pointer;}</style></head>'+b.content);POPUP_WIN.document.title=(b.title||"");POPUP_WIN.document.close()}return false}function _tmpl(tmpl,ns,actions){if(!tmpl){return""}var fn=function(w,g){g=g.split("|");var cnt=_prop(ns,g[0]);for(var i=1;i<g.length;i++){cnt=eval(g[i])(cnt)}return isset(cnt)?cnt:""};return tmpl.replace(/\%\(([A-Za-z0-9_|.]+)\)/g,fn)}function trimStr(b,a){a=(!a?" \\s\\xA0":a.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,"$1"));return b.replace(new RegExp("^["+a+"]+|["+a+"]+$","g"),"")}function NtoBR(b){var a=new RegExp(/\r?\n/i);while(b.search(a)>=0){b=b.replace(a,"<br>")}return b}function BRtoN(a){a=a.replace(/<br\s*\/?>/i,"\n");return a}function str_quote(a,b){return a?(b||"'")+a+(b||"'"):""}function wrapBreakWord(b,a){if(!a){a=15}if(BROWSER.isIE){return b}b=b.replace(new RegExp("(.{"+a+"})","ig"),'<span class="wrap-quantum">$1</span>');return b}function parseTemplate(c,g){var f=new RegExp(/\{\%\w+\%\}/);var b=0;while(c.search(f)>0&&++b<10){var h=c.search(f)+2;var a=h;var e;var d="";do{d+=c.charAt(a++)}while(c.charAt(a)!="%"&&c.charAt(a+1)!="}"&&a<(c.length-1));c=c.substr(0,h-2)+(g[d]||"")+c.substr(a+2)}return c}function getDomainName(a){if(!a){return""}if(a.search(/http:\/\//i)==0){a=a.slice(7)}else{if(a.search(/https:\/\//i)==0){a=a.slice(8)}}if(a.search(/www\./i)==0){a=a.slice(4)}if(a.substr(-1)=="/"){a=a.slice(0,-1)}return a}function removeUrlSchema(a){return a?a.replace(/^(?:https?:\/\/)/i,""):""}function makeUrl(a){return(/https?:\/\//i.test(a)?"":"http://")+a}function isEmail(b){var a=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;return b?a.test(b):false}function getNumeralEndingType(a){var c=a%10,b=0;if(c>0&&c<=4){b=c}if(a%100>=11&&a%100<=14){b=0}return b}function getPopped(c,a){if(!a){a="_"}var b=c.split(a);b.pop();return b.join(a)}String.prototype.popped=function(a){if(!a){a="_"}var b=this.split(a);b.pop();return b.join(a)};String.prototype.firstCharUpper=function(){return this.substr(0,1).toUpperCase()+this.substr(1)};String.prototype.isNullDate=function(){return(this=="0000-00-00 00:00:00")};String.prototype.html_entity_decode=function(){return this.replace_multiply([[/\&nbsp\;/," "],[/\&mdash\;/,"—"]])};function htmlspecialchars(a){return a?String(a).htmlspecialchars():""}String.prototype.htmlspecialchars=function(){return this.replace_multiply([[/\</,"&lt;"],[/\>/,"&gt;"],[/\"/,"&quot;"],[/«/,"&laquo;"],[/«/,"&raquo;"]])};function htmlspecialquotes(a){return a?a.replace_multiply([[/\"/,"&quot;"],[/«/,"&laquo;"],[/«/,"&raquo;"]]):""}String.prototype.replace_multiply=function(c){var b=this;for(var a in c){var e=c[a];if(!e||!isset(e[0])||!isset(e[1])){continue}while(b.search(e[0])>=0){b=b.replace(e[0],e[1])}}return b};String.prototype.nl2br=function(){return NtoBR(this)};String.prototype.truncate=function(a,b){return this.length<=a?this:this.slice(0,a||30)+(b||"...")};String.prototype.rmnl=function(){var a=new RegExp(/\r?\n/i);return this.replace_multiply([[/\r?\n/i,""],[/\t/,""]])};String.prototype.dateStr=function(){if(this.isNullDate()){return}var a=new Date();return a.getFromDT(this).getReadable()};String.prototype.dateStrFull=function(){if(this.isNullDate()){return}var a=new Date();return a.getFromDT(this).getReadableFull()};String.prototype.dateReadableSimpleStr=function(){if(!this.length||this.isNullDate()){return}var a=new Date();return a.getFromDT(this).getReadableSimple()};String.prototype.dateGetHoursFromDt=function(){if(this.isNullDate()){return}var a=new Date();return String(a.getFromDT(this).getHours()).setDigits()};String.prototype.dateGetMinutesFromDt=function(){if(this.isNullDate()){return}var a=new Date();return String(a.getFromDT(this).getMinutes()).setDigits()};String.prototype.dateFromDt=function(){if(this.isNullDate()){return}return(new Date()).getFromDT(this)};String.prototype.dateFromTs=function(){if(this.isNullDate()){return}return(new Date()).getFromTimeStamp(this)};String.prototype.dateFromTsStr=function(){return(new Date()).getFromTsStr(this)};String.prototype.isTime=function(){return(this.search(/^\d{1,2}\:\d{1,2}(\:\d{1,2})?$/)>=0)};String.prototype.isDate=function(){return this.match(/^\d{4}\-\d{2}\-\d{2}(\s\d{2}:\d{2}:\d{2})?$/)};String.prototype.parseTime=function(){if(!this.isTime()){return{}}var a=this.split(":");return{h:Number(a[0]),m:Number(a[1]),s:Number(a[2])}};String.prototype.setDigits=function(a){if(!a){a=2}if(this.length<a){var d="",c=a-this.length;for(var b=0;b<c;b++){d+="0"}return d+this}return this};String.prototype.twoDigits=function(){if(this.length<2){return"0"+this}return this};Number.prototype.setDigits=function(a){return(String(this)).setDigits(a)};Number.prototype.between=function(d,c){return(Math.min(Math.max(this,Math.min(d,c)),Math.max(d,c)))};Number.prototype.isBetween=function(d,c){return(this>d&&this<c)};Number.prototype.isBetween_s=function(d,c){return(this>=d&&this<=c)};Number.prototype.format=function(){return String(this).numberFormat()};function outputFormat(a){if(is_numeric(a)){a=Number(a).format()}return a}Number.prototype.roundFloat=function(a){a=(a==undefined?2:a);return Math.round(this*Math.pow(10,a))/Math.pow(10,a)};String.prototype.numberFormat=function(c){if(Number(this)==0){return this}var g=c?String(Number(this).roundFloat(c)):this,b=g.split("."),e=b.shift(),d=b.shift(),a="",f=[];while(e.length>2){f.unshift(e.substr(e.length-3,e.length));e=e.substr(0,e.length-3)}if(e.length){f.unshift(e)}if(c){d=(function(){var j="";d==undefined&&(d="");if(d.length<c){for(var h=0;h<(c-d.length);h++,j+="0"){}}return d+j})()}return'<span class="nmf"><span class="nmf-g">'+f.join('</span><span class="nmf-g">')+"</span>"+(d?","+d:"")+"</span>"};var MONTHS=[_("January (gn)"),_("February (gn)"),_("March (gn)"),_("April (gn)"),_("May (gn)"),_("June (gn)"),_("July (gn)"),_("August (gn)"),_("September (gn)"),_("October (gn)"),_("November (gn)"),_("December (gn)")];var MONTHS_SHORT=[_("Jan"),_("Feb"),_("Mar"),_("Apr"),_("May (sh)"),_("Jun"),_("Jul"),_("Aug"),_("Sep"),_("Oct"),_("Nov"),_("Dec")];var MONTHS_NOMINATIVE=[_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December")];var MONTHS_LENGTHS=[31,((new Date).getFullYear()%4?28:29),31,30,31,30,31,31,30,31,30,31];var WEEKDAYS=[_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa"),_("Su")];var WEEKDAYS_FULL=[_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday"),_("Sunday")];function getMonthLength(a,b){return a==1?isLeapYear(b)?29:28:MONTHS_LENGTHS[a]}function isLeapYear(a){if(!a){a=(new Date()).getFullYear()}return(new Date(a,1,29)).getMonth()==1?true:false}Date.prototype.getReadable=function(){return this.getDate()+"&nbsp;"+MONTHS[this.getMonth()]+"&nbsp;"+this.getFullYear()};Date.prototype.getReadableShort=function(){return this.getDate()+"&nbsp;"+MONTHS_SHORT[this.getMonth()]};Date.prototype.getMonthReadable=function(){return MONTHS_NOMINATIVE[this.getMonth()]+"&nbsp;"+this.getFullYear()};Date.prototype.getWeekReadable=function(){var a=this.duplicate().getWeek();var b=a.begin.getFullYear()==a.end.getFullYear()?"":" "+a.begin.getFullYear();return a.begin.getReadableShort()+b+"&nbsp;&mdash; "+a.end.getReadableShort()+" "+a.end.getFullYear()};Date.prototype.getWeekReadableShort=function(){var a=this.duplicate().getWeek();return a.begin.format("d"+(a.begin.getMonth()==a.end.getMonth()?"":" M"))+"&nbsp;&mdash; "+a.end.format("d M")};Date.prototype.getHourReadable=function(){return this.duplicate().offset({hours:-1}).format("H:i")+"&nbsp;&mdash; "+this.format("H:i")};Date.prototype.getReadableFull=function(){var f=this.getDate(),a=MONTHS[this.getMonth()],g=this.getFullYear(),c=this.getHours().setDigits(),b=this.getMinutes().setDigits(),e=_("-dateFullStr",f,a,g,c,b);return e};Date.prototype.getReadableSimple=function(){var c=this.getDate().toString(),a=(this.getMonth()+1).toString(),e=this.getFullYear().toString();if(c.length<2){c="0"+c}if(a.length<2){a="0"+a}var b=c+"."+a+"."+e;return b};Date.prototype.toDT=function(){var g=this.getDate().toString(),a=(this.getMonth()+1).toString(),f=this.getFullYear().toString(),c=this.getHours().toString(),b=this.getMinutes().toString(),e=this.getSeconds().toString();return f.setDigits(4)+"-"+a.setDigits(2)+"-"+g.setDigits(2)+" "+c.setDigits(2)+":"+b.setDigits(2)+":"+e.setDigits(2)};Date.prototype.getDateStr=function(){return this.toDT().split(" ").shift()};Date.prototype.getTimeStr=function(){return this.toDT().split(" ").pop()};Date.prototype.getTimeStamp=function(){var b=this.getDate(),a=this.getMonth()+1,c=this.getFullYear();if(b<10){b="0"+b}if(a<10){a="0"+a}return""+c+a+b+"000000"};Date.prototype.getFullTimeStamp=function(){return this.format("YmdHis")};Date.prototype.getTsShort=function(){return this.getFullYear().toString()+String(this.getMonth()+1).setDigits()+String(this.getDate()).setDigits()};Date.prototype.getFromTimeStamp=function(b){b=b+"";var e=Number(b.substr(0,4)),a=Number(b.substr(4,2))-1,c=Number(b.substr(6,2));this.setFullYear(e);this.setMonth(a);this.setDate(c);this.setHours(0);this.setMinutes(0);this.setSeconds(0);return this};Date.prototype.getFromDT=function(a){a=String(a);this.set({days:a.substr(8,2),months:a.substr(5,2)-1,years:parseInt(a.substr(0,4)),hours:a.substr(11,2)||0,minutes:a.substr(14,2),seconds:a.substr(17,2),milliseconds:0});return this};Date.prototype.getFromTsStr=function(a){var b=a.split(".");this.set({years:Number(b[2]),months:Number(b[1]),days:Number(b[0])});return this};Date.prototype.set=function(b){var a=b.year||this.getFullYear();if(isset(b.days)&&isset(b.months)&&getMonthLength(this.getMonth(),a)<Number(b.days)){this.setMonth(b.months);if(getMonthLength(this.getMonth(),a)<Number(b.days)){this.setDate(getMonthLength(this.getMonth(),a))}else{this.setDate(b.days)}}else{if(isset(b.days)){this.setDate(b.days)}if(isset(b.months)){if(getMonthLength(b.months,a)<this.getDate()){this.setDate(getMonthLength(b.months,a))}this.setMonth(b.months)}}if(isset(b.years)){this.setFullYear(b.years)}if(isset(b.hours)){this.setHours(b.hours)}if(isset(b.minutes)){this.setMinutes(b.minutes)}if(isset(b.seconds)){this.setSeconds(b.seconds)}if(isset(b.milliseconds)){this.setMilliseconds(b.milliseconds)}return this};Date.prototype.offset=function(b){var a={};if(b.days){a.days=this.getDate()+b.days}if(b.months){a.months=this.getMonth()+b.months}if(b.years){a.years=this.getFullYear()+b.years}if(b.hours){a.hours=this.getHours()+b.hours}if(b.minutes){a.minutes=this.getMinutes()+b.minutes}if(b.seconds){a.seconds=this.getSeconds()+b.seconds}this.set(a);return this};Date.prototype.offsetDaysFromDate=function(a,c){var b=new Date();this.setMonth(a.getMonth());this.setFullYear(a.getFullYear());this.setHours(a.getHours());this.setMinutes(a.getMinutes());this.setSeconds(a.getSeconds());this.setDate(a.getDate()+c);return this};Date.prototype.offsetDays=function(a){return this.offsetDaysFromDate(this,a)};Date.prototype.offsetMonthsFromDate=function(b,a){this.setMonth(this.getMonth()+(a||1));return this};Date.prototype.offsetMonths=function(a){return this.offsetMonthsFromDate(this,a)};Date.prototype.getNearestWeekday=function(b,c){var a=0;while(this.getDay()!=b){this.offsetDays(c<0?-1:1);if(++a>6){return false}}return this};Date.prototype.getLastFullWeekBegin=function(){return this.getNearestWeekday(1,-1).offsetDays(-1).getNearestWeekday(1,-1)};Date.prototype.getLastFullWeekEnd=function(){return this.getNearestWeekday(1,-1).offsetDays(-1)};Date.prototype.getLastFullMonthEnd=function(){this.setDate(1);return this.offsetDays(-1)};Date.prototype.getLastFullMonthBegin=function(){this.offsetMonths(-1);this.setDate(1);return this};Date.prototype.getFullMonth=function(){var b=this.duplicate();var a=this.duplicate();b.setDate(1);a.offsetMonths(1).setDate(1);return{begin:b,end:a}};Date.prototype.getFullDay=function(){var b=this.duplicate();var a=this.duplicate();b.setHours(0);b.setMinutes(0);b.setSeconds(0);a.setHours(23);a.setMinutes(59);a.setSeconds(59);return{begin:b,end:a}};Date.prototype.getNextMonthBegin=function(){this.setDate(1);this.offsetMonths(1);return this};Date.prototype.getWeek=function(){return{begin:this.duplicate().getNearestWeekday(1,-1),end:this.duplicate().getNearestWeekday(0,1)}};Date.prototype.getWeekday=function(){var a=this.getDay();return WEEKDAYS[a==0?6:a-1]};Date.prototype.nullHms=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);return this};Date.prototype.equal=function(a){if(!is_date(a)){return false}return(this.getFullYear()==a.getFullYear()&&this.getMonth()==a.getMonth()&&this.getDate()==a.getDate())};Date.prototype.less=function(b,a){return(is_date(b)&&((!a&&this.getTime()<b.getTime())||(a&&this.getTime()<=b.getTime())))};Date.prototype.greater=function(b,a){return(!!(is_date(b)&&((!a&&this.getTime()>b.getTime())||(a&&this.getTime()>=b.getTime()))))};Date.prototype.between=function(b,a){return(is_date(b)&&is_date(a)&&this.getTime()>b.getTime()&&this.getTime()<a.getTime())};Date.prototype.between_s=function(b,a){if(is_date(b)&&is_date(a)){b.setMilliseconds(0);a.setMilliseconds(0);this.setMilliseconds(0);return(this.getTime()>=b.getTime()&&this.getTime()<=a.getTime())}return false};Date.prototype.setBetween=function(b,a){if(this.less(b)){return this.duplicate(b)}else{if(this.greater(a)){this.duplicate(a)}}return this};Date.prototype.getDaysDiff=function(b,a){return Math.round((b.duplicate().set({hours:0,minutes:0,seconds:0,milliseconds:0}).getTime()-a.duplicate().set({hours:0,minutes:0,seconds:0,milliseconds:0}).getTime())/(3600*24*1000))};Date.prototype.getDaysDiffStr=function(b,a){var c=this.getDaysDiff(b,a);switch(c){case 0:return _("today");case 1:return _("tomorrow");case 2:return _("after tomorrow");case -1:return _("yesterday");case -2:return _("before yesterday");default:if(c>0){return _("after (1) days",c)}else{return _("(1) days before",Math.abs(c))}}};Date.prototype.duplicate=function(a){if(a){this.set({days:a.getDate(),months:a.getMonth(),years:a.getFullYear(),hours:a.getHours(),minutes:a.getMinutes(),seconds:a.getSeconds()});return this}else{return new Date(this.getTime())}};Date.prototype.format=function(a){var b=this;return a.replace(/([a-zA-Z]{1})/g,function(c,d){switch(d){case"H":return b.getHours().setDigits();break;case"i":return b.getMinutes().setDigits();break;case"s":return b.getSeconds().setDigits();break;case"d":return b.getDate().setDigits();break;case"m":return(b.getMonth()+1).setDigits();break;case"M":return MONTHS[b.getMonth()];break;case"F":return MONTHS_SHORT[b.getMonth()];break;case"f":return MONTHS_NOMINATIVE[b.getMonth()];break;case"Y":return b.getFullYear().setDigits();break;case"r":return b.getDaysDiffStr(b,new Date());break;case"e":return b.getWeekday().toLowerCase();break;case"w":return b.getWeekReadable();break;case"o":return b.getMonthReadable();break}})};