Calendar=function(d,c,f,a){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=f||null;this.onClose=a||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof d=="number"?d:Calendar._FD;this.showsOtherMonths=false;this.dateStr=c;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var b=new Array();for(var e=8;e>0;){b[--e]=Calendar._DN[e].substr(0,Calendar._SDN_len)}Calendar._SDN=b;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}b=new Array();for(var e=12;e>0;){b[--e]=Calendar._MN[e].substr(0,Calendar._SMN_len)}Calendar._SMN=b}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(e){var a=0,d=0;var c=/^div$/i.test(e.tagName);if(c&&e.scrollLeft){a=e.scrollLeft}if(c&&e.scrollTop){d=e.scrollTop}var f={x:e.offsetLeft-a,y:e.offsetTop-d};if(e.offsetParent){var b=this.getAbsolutePos(e.offsetParent);f.x+=b.x;f.y+=b.y}return f};Calendar.isRelated=function(d,a){var e=a.relatedTarget;if(!e){var c=a.type;if(c=="mouseover"){e=a.fromElement}else{if(c=="mouseout"){e=a.toElement}}}while(e){if(e==d){return true}try{e=e.parentNode}catch(b){return false}}return false};Calendar.removeClass=function(e,d){if(!(e&&e.className)){return}var a=e.className.split(" ");var b=new Array();for(var c=a.length;c>0;){if(a[--c]!=d){b[b.length]=a[c]}}e.className=b.join(" ")};Calendar.addClass=function(b,a){Calendar.removeClass(b,a);b.className+=" "+a};Calendar.getElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.currentTarget;while(b.nodeType!=1||/^div$/i.test(b.tagName)){b=b.parentNode}return b};Calendar.getTargetElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.target;while(b.nodeType!=1){b=b.parentNode}return b};Calendar.stopEvent=function(a){a||(a=window.event);if(Calendar.is_ie){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}return false};Calendar.addEvent=function(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{if(a.addEventListener){a.addEventListener(c,b,true)}else{a["on"+c]=b}}};Calendar.removeEvent=function(a,c,b){if(a.detachEvent){a.detachEvent("on"+c,b)}else{if(a.removeEventListener){a.removeEventListener(c,b,true)}else{a["on"+c]=null}}};Calendar.createElement=function(c,b){var a=null;if(document.createElementNS){a=document.createElementNS("http://www.w3.org/1999/xhtml",c)}else{a=document.createElement(c)}if(typeof b!="undefined"){b.appendChild(a)}return a};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(a){if(typeof a.month!="undefined"){return a}else{if(typeof a.parentNode.month!="undefined"){return a.parentNode}}return null};Calendar.findYear=function(a){if(typeof a.year!="undefined"){return a}else{if(typeof a.parentNode.year!="undefined"){return a.parentNode}}return null};Calendar.showMonthsCombo=function(){var e=Calendar._C;if(!e){return false}var e=e;var f=e.activeDiv;var d=e.monthsCombo;if(e.hilitedMonth){Calendar.removeClass(e.hilitedMonth,"hilite")}if(e.activeMonth){Calendar.removeClass(e.activeMonth,"active")}var c=e.monthsCombo.getElementsByTagName("div")[e.date.getMonth()];Calendar.addClass(c,"active");e.activeMonth=c;var b=d.style;b.display="block";if(f.navtype<0){b.left=f.offsetLeft+"px"}else{var a=d.offsetWidth;if(typeof a=="undefined"){a=50}b.left=(f.offsetLeft+f.offsetWidth-a)+"px"}b.top=(f.offsetTop+f.offsetHeight)+"px"};Calendar.showYearsCombo=function(d){var a=Calendar._C;if(!a){return false}var a=a;var c=a.activeDiv;var f=a.yearsCombo;if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}if(a.activeYear){Calendar.removeClass(a.activeYear,"active")}a.activeYear=null;var b=a.date.getFullYear()+(d?1:-1);var j=f.firstChild;var h=false;for(var e=12;e>0;--e){if(b>=a.minYear&&b<=a.maxYear){j.innerHTML=b;j.year=b;j.style.display="block";h=true}else{j.style.display="none"}j=j.nextSibling;b+=d?a.yearStep:-a.yearStep}if(h){var k=f.style;k.display="block";if(c.navtype<0){k.left=c.offsetLeft+"px"}else{var g=f.offsetWidth;if(typeof g=="undefined"){g=50}k.left=(c.offsetLeft+c.offsetWidth-g)+"px"}k.top=(c.offsetTop+c.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(n){var a=Calendar._C;if(!a){return}var c=a.activeDiv;var j=Calendar.getTargetElement(n);if(j==c||j.parentNode==c){Calendar.addClass(c,"hilite active");Calendar.addClass(c.parentNode,"rowhilite")}else{if(typeof c.navtype=="undefined"||(c.navtype!=50&&(c.navtype==0||Math.abs(c.navtype)>2))){Calendar.removeClass(c,"active")}Calendar.removeClass(c,"hilite");Calendar.removeClass(c.parentNode,"rowhilite")}n||(n=window.event);if(c.navtype==50&&j!=c){var m=Calendar.getAbsolutePos(c);var p=c.offsetWidth;var o=n.clientX;var q;var l=true;if(o>m.x+p){q=o-m.x-p;l=false}else{q=m.x-o}if(q<0){q=0}var f=c._range;var h=c._current;var g=Math.floor(q/10)%f.length;for(var e=f.length;--e>=0;){if(f[e]==h){break}}while(g-->0){if(l){if(--e<0){e=f.length-1}}else{if(++e>=f.length){e=0}}}var b=f[e];c.innerHTML=b;a.onUpdateTime()}var d=Calendar.findMonth(j);if(d){if(d.month!=a.date.getMonth()){if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}Calendar.addClass(d,"hilite");a.hilitedMonth=d}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}}}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}var k=Calendar.findYear(j);if(k){if(k.year!=a.date.getFullYear()){if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}Calendar.addClass(k,"hilite");a.hilitedYear=k}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}return Calendar.stopEvent(n)};Calendar.tableMouseDown=function(a){if(Calendar.getTargetElement(a)==Calendar.getElement(a)){return Calendar.stopEvent(a)}};Calendar.calDragIt=function(b){var c=Calendar._C;if(!(c&&c.dragging)){return false}var e;var d;if(Calendar.is_ie){d=window.event.clientY+document.body.scrollTop;e=window.event.clientX+document.body.scrollLeft}else{e=b.pageX;d=b.pageY}c.hideShowCovered();var a=c.element.style;a.left=(e-c.xOffs)+"px";a.top=(d-c.yOffs)+"px";return Calendar.stopEvent(b)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(a){Calendar.cellClick(Calendar.getElement(a),a||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(b){var a=Calendar.getElement(b);if(Calendar.isRelated(a,b)||Calendar._C||a.disabled){return false}if(a.ttip){if(a.ttip.substr(0,1)=="_"){a.ttip=a.caldate.print(a.calendar.ttDateFormat)+a.ttip.substr(1)}a.calendar.tooltips.innerHTML=a.ttip}if(a.navtype!=300){Calendar.addClass(a,"hilite");if(a.caldate){Calendar.addClass(a.parentNode,"rowhilite")}}return Calendar.stopEvent(b)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(e,o){var c=e.calendar;var h=false;var l=false;var f=null;if(typeof e.navtype=="undefined"){if(c.currentDateEl){Calendar.removeClass(c.currentDateEl,"selected");Calendar.addClass(e,"selected");h=(c.currentDateEl==e);if(!h){c.currentDateEl=e}}c.date.setDateOnly(e.caldate);f=c.date;var b=!(c.dateClicked=!e.otherMonth);if(!b&&!c.currentDateEl){c._toggleMultipleDate(new Date(f))}else{l=!e.disabled}if(b){c._init(c.firstDayOfWeek,f)}}else{if(e.navtype==200){Calendar.removeClass(e,"hilite");c.callCloseHandler();return}f=new Date(c.date);if(e.navtype==0){f.setDateOnly(new Date())}c.dateClicked=false;var n=f.getFullYear();var g=f.getMonth();function a(q){var r=f.getDate();var i=f.getMonthDays(q);if(r>i){f.setDate(i)}f.setMonth(q)}switch(e.navtype){case 400:Calendar.removeClass(e,"hilite");var p=Calendar._TT.ABOUT;if(typeof p!="undefined"){p+=c.showsTime?Calendar._TT.ABOUT_TIME:""}else{p='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(p);return;case -2:if(n>c.minYear){f.setFullYear(n-1)}break;case -1:if(g>0){a(g-1)}else{if(n-->c.minYear){f.setFullYear(n);a(11)}}break;case 1:if(g<11){a(g+1)}else{if(n<c.maxYear){f.setFullYear(n+1);a(0)}}break;case 2:if(n<c.maxYear){f.setFullYear(n+1)}break;case 100:c.setFirstDayOfWeek(e.fdow);return;case 50:var k=e._range;var m=e.innerHTML;for(var j=k.length;--j>=0;){if(k[j]==m){break}}if(o&&o.shiftKey){if(--j<0){j=k.length-1}}else{if(++j>=k.length){j=0}}var d=k[j];e.innerHTML=d;c.onUpdateTime();return;case 0:if((typeof c.getDateStatus=="function")&&c.getDateStatus(f,f.getFullYear(),f.getMonth(),f.getDate())){return false}break}if(!f.equalsTo(c.date)){c.setDate(f);l=true}else{if(e.navtype==0){l=h=true}}}if(l){o&&c.callHandler()}if(h){Calendar.removeClass(e,"hilite");o&&c.callCloseHandler()}};Calendar.prototype.create=function(n){var m=null;if(!n){m=document.getElementsByTagName("body")[0];this.isPopup=true}else{m=n;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var q=Calendar.createElement("table");this.table=q;q.cellSpacing=0;q.cellPadding=0;q.calendar=this;Calendar.addEvent(q,"mousedown",Calendar.tableMouseDown);var a=Calendar.createElement("div");this.element=a;a.className="calendar";if(this.isPopup){a.style.position="absolute";a.style.display="none"}a.appendChild(q);var k=Calendar.createElement("thead",q);var o=null;var r=null;var b=this;var e=function(s,j,i){o=Calendar.createElement("td",r);o.colSpan=j;o.className="button";if(i!=0&&Math.abs(i)<=2){o.className+=" nav"}Calendar._add_evs(o);o.calendar=b;o.navtype=i;o.innerHTML="<div unselectable='on'>"+s+"</div>";return o};r=Calendar.createElement("tr",k);var c=6;(this.isPopup)&&--c;(this.weekNumbers)&&++c;e("?",1,400).ttip=Calendar._TT.INFO;this.title=e("",c,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";e("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}r=Calendar.createElement("tr",k);r.className="headrow";this._nav_py=e("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=e("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=e(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=e("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=e("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;r=Calendar.createElement("tr",k);r.className="daynames";if(this.weekNumbers){o=Calendar.createElement("td",r);o.className="name wn";o.innerHTML=Calendar._TT.WK}for(var h=7;h>0;--h){o=Calendar.createElement("td",r);if(!h){o.navtype=100;o.calendar=this;Calendar._add_evs(o)}}this.firstdayname=(this.weekNumbers)?r.firstChild.nextSibling:r.firstChild;this._displayWeekdays();var g=Calendar.createElement("tbody",q);this.tbody=g;for(h=6;h>0;--h){r=Calendar.createElement("tr",g);if(this.weekNumbers){o=Calendar.createElement("td",r)}for(var f=7;f>0;--f){o=Calendar.createElement("td",r);o.calendar=this;Calendar._add_evs(o)}}if(this.showsTime){r=Calendar.createElement("tr",g);r.className="time";o=Calendar.createElement("td",r);o.className="time";o.colSpan=2;o.innerHTML=Calendar._TT.TIME||"&nbsp;";o=Calendar.createElement("td",r);o.className="time";o.colSpan=this.weekNumbers?4:3;(function(){function t(C,E,D,F){var A=Calendar.createElement("span",o);A.className=C;A.innerHTML=E;A.calendar=b;A.ttip=Calendar._TT.TIME_PART;A.navtype=50;A._range=[];if(typeof D!="number"){A._range=D}else{for(var B=D;B<=F;++B){var z;if(B<10&&F>=10){z="0"+B}else{z=""+B}A._range[A._range.length]=z}}Calendar._add_evs(A);return A}var x=b.date.getHours();var i=b.date.getMinutes();var y=!b.time24;var j=(x>12);if(y&&j){x-=12}var v=t("hour",x,y?1:0,y?12:23);var u=Calendar.createElement("span",o);u.innerHTML=":";u.className="colon";var s=t("minute",i,0,59);var w=null;o=Calendar.createElement("td",r);o.className="time";o.colSpan=2;if(y){w=t("ampm",j?"pm":"am",["am","pm"])}else{o.innerHTML="&nbsp;"}b.onSetTime=function(){var A,z=this.date.getHours(),B=this.date.getMinutes();if(y){A=(z>=12);if(A){z-=12}if(z==0){z=12}w.innerHTML=A?"pm":"am"}v.innerHTML=(z<10)?("0"+z):z;s.innerHTML=(B<10)?("0"+B):B};b.onUpdateTime=function(){var A=this.date;var B=parseInt(v.innerHTML,10);if(y){if(/pm/i.test(w.innerHTML)&&B<12){B+=12}else{if(/am/i.test(w.innerHTML)&&B==12){B=0}}}var C=A.getDate();var z=A.getMonth();var D=A.getFullYear();A.setHours(B);A.setMinutes(parseInt(s.innerHTML,10));A.setFullYear(D);A.setMonth(z);A.setDate(C);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var l=Calendar.createElement("tfoot",q);r=Calendar.createElement("tr",l);r.className="footrow";o=e(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);o.className="ttip";if(this.isPopup){o.ttip=Calendar._TT.DRAG_TO_MOVE;o.style.cursor="move"}this.tooltips=o;a=Calendar.createElement("div",this.element);this.monthsCombo=a;a.className="combo";for(h=0;h<Calendar._MN.length;++h){var d=Calendar.createElement("div");d.className=Calendar.is_ie?"label-IEfix":"label";d.month=h;d.innerHTML=Calendar._SMN[h];a.appendChild(d)}a=Calendar.createElement("div",this.element);this.yearsCombo=a;a.className="combo";for(h=12;h>0;--h){var p=Calendar.createElement("div");p.className=Calendar.is_ie?"label-IEfix":"label";a.appendChild(p)}this._init(this.firstDayOfWeek,this.date);m.appendChild(this.element)};Calendar._keyEvent=function(k){var a=window._dynarch_popupCalendar;if(!a||a.multiple){return false}(Calendar.is_ie)&&(k=window.event);var i=(Calendar.is_ie||k.type=="keypress"),l=k.keyCode;if(k.ctrlKey){switch(l){case 37:i&&Calendar.cellClick(a._nav_pm);break;case 38:i&&Calendar.cellClick(a._nav_py);break;case 39:i&&Calendar.cellClick(a._nav_nm);break;case 40:i&&Calendar.cellClick(a._nav_ny);break;default:return false}}else{switch(l){case 32:Calendar.cellClick(a._nav_now);break;case 27:i&&a.callCloseHandler();break;case 37:case 38:case 39:case 40:if(i){var e,m,j,g,c,d;e=l==37||l==38;d=(l==37||l==39)?1:7;function b(){c=a.currentDateEl;var n=c.pos;m=n&15;j=n>>4;g=a.ar_days[j][m]}b();function f(){var n=new Date(a.date);n.setDate(n.getDate()-d);a.setDate(n)}function h(){var n=new Date(a.date);n.setDate(n.getDate()+d);a.setDate(n)}while(1){switch(l){case 37:if(--m>=0){g=a.ar_days[j][m]}else{m=6;l=38;continue}break;case 38:if(--j>=0){g=a.ar_days[j][m]}else{f();b()}break;case 39:if(++m<7){g=a.ar_days[j][m]}else{m=0;l=40;continue}break;case 40:if(++j<a.ar_days.length){g=a.ar_days[j][m]}else{h();b()}break}break}if(g){if(!g.disabled){Calendar.cellClick(g)}else{if(e){f()}else{h()}}}}break;case 13:if(i){Calendar.cellClick(a.currentDateEl,k)}break;default:return false}}return Calendar.stopEvent(k)};Calendar.prototype._init=function(n,x){var w=new Date(),r=w.getFullYear(),z=w.getMonth(),b=w.getDate();this.table.style.visibility="hidden";var h=x.getFullYear();if(h<this.minYear){h=this.minYear;x.setFullYear(h)}else{if(h>this.maxYear){h=this.maxYear;x.setFullYear(h)}}this.firstDayOfWeek=n;this.date=new Date(x);var y=x.getMonth();var B=x.getDate();var A=x.getMonthDays();x.setDate(1);var s=(x.getDay()-this.firstDayOfWeek)%7;if(s<0){s+=7}x.setDate(-s);x.setDate(x.getDate()+1);var e=this.tbody.firstChild;var l=Calendar._SMN[y];var p=this.ar_days=new Array();var o=Calendar._TT.WEEKEND;var d=this.multiple?(this.datesCells={}):null;for(var u=0;u<6;++u,e=e.nextSibling){var a=e.firstChild;if(this.weekNumbers){a.className="day wn";a.innerHTML=x.getWeekNumber();a=a.nextSibling}e.className="daysrow";var v=false,f,c=p[u]=[];for(var t=0;t<7;++t,a=a.nextSibling,x.setDate(f+1)){f=x.getDate();var g=x.getDay();a.className="day";a.pos=u<<4|t;c[t]=a;var m=(x.getMonth()==y);if(!m){if(this.showsOtherMonths){a.className+=" othermonth";a.otherMonth=true}else{a.className="emptycell";a.innerHTML="&nbsp;";a.disabled=true;continue}}else{a.otherMonth=false;v=true}a.disabled=false;a.innerHTML=this.getDateText?this.getDateText(x,f):f;if(d){d[x.print("%Y%m%d")]=a}if(this.getDateStatus){var q=this.getDateStatus(x,h,y,f);if(this.getDateToolTip){var k=this.getDateToolTip(x,h,y,f);if(k){a.title=k}}if(q===true){a.className+=" disabled";a.disabled=true}else{if(/disabled/i.test(q)){a.disabled=true}a.className+=" "+q}}if(!a.disabled){a.caldate=new Date(x);a.ttip="_";if(!this.multiple&&m&&f==B&&this.hiliteToday){a.className+=" selected";this.currentDateEl=a}if(x.getFullYear()==r&&x.getMonth()==z&&f==b){a.className+=" today";a.ttip+=Calendar._TT.PART_TODAY}if(o.indexOf(g.toString())!=-1){a.className+=a.otherMonth?" oweekend":" weekend"}}}if(!(v||this.showsOtherMonths)){e.className="emptyrow"}}this.title.innerHTML=Calendar._MN[y]+", "+h;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var b in this.multiple){var a=this.datesCells[b];var c=this.multiple[b];if(!c){continue}if(a){a.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(b){if(this.multiple){var c=b.print("%Y%m%d");var a=this.datesCells[c];if(a){var e=this.multiple[c];if(!e){Calendar.addClass(a,"selected");this.multiple[c]=b}else{Calendar.removeClass(a,"selected");delete this.multiple[c]}}}};Calendar.prototype.setDateToolTipHandler=function(a){this.getDateToolTip=a};Calendar.prototype.setDate=function(a){if(!a.equalsTo(this.date)){this._init(this.firstDayOfWeek,a)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(a){this._init(a,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(a){this.getDateStatus=a};Calendar.prototype.setRange=function(b,c){this.minYear=b;this.maxYear=c};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var a=this.element.parentNode;a.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(b){var a=this.element;a.parentNode.removeChild(a);b.appendChild(a)};Calendar._checkCalendar=function(b){var c=window._dynarch_popupCalendar;if(!c){return false}var a=Calendar.is_ie?Calendar.getElement(b):Calendar.getTargetElement(b);for(;a!=null&&a!=c.element;a=a.parentNode){}if(a==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(b)}};Calendar.prototype.show=function(){var e=this.table.getElementsByTagName("tr");for(var d=e.length;d>0;){var f=e[--d];Calendar.removeClass(f,"rowhilite");var c=f.getElementsByTagName("td");for(var b=c.length;b>0;){var a=c[--b];Calendar.removeClass(a,"hilite");Calendar.removeClass(a,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(a,c){var b=this.element.style;b.left=a+"px";b.top=c+"px";this.show()};Calendar.prototype.showAtElement=function(c,d,e){var a=this;var f=Calendar.getAbsolutePos(c);if(!d||typeof d!="string"){this.showAt(f.x,f.y+c.offsetHeight);return true}function b(j){if(j.x<0){j.x=0}if(j.y<0){j.y=0}var k=document.createElement("div");var i=k.style;i.position="absolute";i.right=i.bottom=i.width=i.height="0px";document.body.appendChild(k);var h=Calendar.getAbsolutePos(k);document.body.removeChild(k);if(Calendar.is_ie){h.y+=document.body.scrollTop;h.x+=document.body.scrollLeft}else{h.y+=window.scrollY;h.x+=window.scrollX}var g=j.x+j.width-h.x;if(g>0){j.x-=g}g=j.y+j.height-h.y;if(g>0){j.y-=g}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var g=a.element.offsetWidth;var j=a.element.offsetHeight;a.element.style.display="none";var i=d.substr(0,1);var k="l";if(d.length>1){k=d.substr(1,1)}switch(i){case"T":f.y-=j;break;case"B":f.y+=c.offsetHeight;break;case"C":f.y+=(c.offsetHeight-j)/2;break;case"t":f.y+=c.offsetHeight-j;break;case"b":break}switch(k){case"L":f.x-=g;break;case"R":f.x+=c.offsetWidth;break;case"C":f.x+=(c.offsetWidth-g)/2;break;case"l":f.x+=c.offsetWidth-g;break;case"r":break}f.width=g;f.height=j+40;a.monthsCombo.style.display="none";if(!e){b(f)}a.showAt(f.x,f.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10)}else{Calendar.continuation_for_the_fucking_khtml_browser()}};Calendar.prototype.setDateFormat=function(a){this.dateFormat=a};Calendar.prototype.setTtDateFormat=function(a){this.ttDateFormat=a};Calendar.prototype.parseDate=function(b,a){if(!a){a=this.dateFormat}this.setDate(Date.parseDate(b,a))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return}function b(k){var i=k.style.visibility;if(!i){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){i=document.defaultView.getComputedStyle(k,"").getPropertyValue("visibility")}else{i=""}}else{if(k.currentStyle){i=k.currentStyle.visibility}else{i=""}}}return i}var s=new Array("applet","iframe","select");var c=this.element;var a=Calendar.getAbsolutePos(c);var f=a.x;var d=c.offsetWidth+f;var r=a.y;var q=c.offsetHeight+r;for(var h=s.length;h>0;){var g=document.getElementsByTagName(s[--h]);var e=null;for(var l=g.length;l>0;){e=g[--l];a=Calendar.getAbsolutePos(e);var o=a.x;var n=e.offsetWidth+o;var m=a.y;var j=e.offsetHeight+m;if(this.hidden||(o>d)||(n<f)||(m>q)||(j<r)){if(!e.__msh_save_visibility){e.__msh_save_visibility=b(e)}e.style.visibility=e.__msh_save_visibility}else{if(!e.__msh_save_visibility){e.__msh_save_visibility=b(e)}e.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var b=this.firstDayOfWeek;var a=this.firstdayname;var d=Calendar._TT.WEEKEND;for(var c=0;c<7;++c){a.className="day name";var e=(c+b)%7;if(c){a.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[e]);a.navtype=100;a.calendar=this;a.fdow=e;Calendar._add_evs(a)}if(d.indexOf(e.toString())!=-1){Calendar.addClass(a,"weekend")}a.innerHTML=Calendar._SDN[(c+b)%7];a=a.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(l,c){var n=new Date();var o=0;var e=-1;var k=0;var q=l.split(/\W+/);var p=c.match(/%./g);var h=0,g=0;var r=0;var f=0;for(h=0;h<q.length;++h){if(!q[h]){continue}switch(p[h]){case"%d":case"%e":k=parseInt(q[h],10);break;case"%m":e=parseInt(q[h],10)-1;break;case"%Y":case"%y":o=parseInt(q[h],10);(o<100)&&(o+=(o>29)?1900:2000);break;case"%b":case"%B":for(g=0;g<12;++g){if(Calendar._MN[g].substr(0,q[h].length).toLowerCase()==q[h].toLowerCase()){e=g;break}}break;case"%H":case"%I":case"%k":case"%l":r=parseInt(q[h],10);break;case"%P":case"%p":if(/pm/i.test(q[h])&&r<12){r+=12}else{if(/am/i.test(q[h])&&r>=12){r-=12}}break;case"%M":f=parseInt(q[h],10);break}}if(isNaN(o)){o=n.getFullYear()}if(isNaN(e)){e=n.getMonth()}if(isNaN(k)){k=n.getDate()}if(isNaN(r)){r=n.getHours()}if(isNaN(f)){f=n.getMinutes()}if(o!=0&&e!=-1&&k!=0){return new Date(o,e,k,r,f,0)}o=0;e=-1;k=0;for(h=0;h<q.length;++h){if(q[h].search(/[a-zA-Z]+/)!=-1){var s=-1;for(g=0;g<12;++g){if(Calendar._MN[g].substr(0,q[h].length).toLowerCase()==q[h].toLowerCase()){s=g;break}}if(s!=-1){if(e!=-1){k=e+1}e=s}}else{if(parseInt(q[h],10)<=12&&e==-1){e=q[h]-1}else{if(parseInt(q[h],10)>31&&o==0){o=parseInt(q[h],10);(o<100)&&(o+=(o>29)?1900:2000)}else{if(k==0){k=q[h]}}}}}if(o==0){o=n.getFullYear()}if(e!=-1&&k!=0){return new Date(o,e,k,r,f,0)}return n};Date.prototype.getMonthDays=function(b){var a=this.getFullYear();if(typeof b=="undefined"){b=this.getMonth()}if(((0==(a%4))&&((0!=(a%100))||(0==(a%400))))&&b==1){return 29}else{return Date._MD[b]}};Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var c=new Date(this.getFullYear(),0,0,0,0,0);var b=a-c;return Math.floor(b/Date.DAY)};Date.prototype.getWeekNumber=function(){var c=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=c.getDay();c.setDate(c.getDate()-(b+6)%7+3);var a=c.valueOf();c.setMonth(0);c.setDate(4);return Math.round((a-c.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(a){return((this.getFullYear()==a.getFullYear())&&(this.getMonth()==a.getMonth())&&(this.getDate()==a.getDate())&&(this.getHours()==a.getHours())&&(this.getMinutes()==a.getMinutes()))};Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1);this.setFullYear(b.getFullYear());this.setMonth(b.getMonth());this.setDate(b.getDate())};Date.prototype.print=function(l){var b=this.getMonth();var k=this.getDate();var n=this.getFullYear();var p=this.getWeekNumber();var q=this.getDay();var v={};var r=this.getHours();var c=(r>=12);var h=(c)?(r-12):r;var u=this.getDayOfYear();if(h==0){h=12}var e=this.getMinutes();var j=this.getSeconds();v["%a"]=Calendar._SDN[q];v["%A"]=Calendar._DN[q];v["%b"]=Calendar._SMN[b];v["%B"]=Calendar._MN[b];v["%C"]=1+Math.floor(n/100);v["%d"]=(k<10)?("0"+k):k;v["%e"]=k;v["%H"]=(r<10)?("0"+r):r;v["%I"]=(h<10)?("0"+h):h;v["%j"]=(u<100)?((u<10)?("00"+u):("0"+u)):u;v["%k"]=r;v["%l"]=h;v["%m"]=(b<9)?("0"+(1+b)):(1+b);v["%M"]=(e<10)?("0"+e):e;v["%n"]="\n";v["%p"]=c?"PM":"AM";v["%P"]=c?"pm":"am";v["%s"]=Math.floor(this.getTime()/1000);v["%S"]=(j<10)?("0"+j):j;v["%t"]="\t";v["%U"]=v["%W"]=v["%V"]=(p<10)?("0"+p):p;v["%u"]=q+1;v["%w"]=q;v["%y"]=(""+n).substr(2,2);v["%Y"]=n;v["%%"]="%";var t=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return l.replace(t,function(a){return v[a]||a})}var o=l.match(t);for(var g=0;g<o.length;g++){var f=v[o[g]];if(f){t=new RegExp(o[g],"g");l=l.replace(t,f)}}return l};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(b){var a=new Date(this);a.__msh_oldSetFullYear(b);if(a.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(b)};window._dynarch_popupCalendar=null;Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.DRAG_TO_MOVE="Drag to move";Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";Calendar.setup=function(g){function f(h,i){if(typeof g[h]=="undefined"){g[h]=i}}f("inputField",null);f("displayArea",null);f("button",null);f("eventName","click");f("ifFormat","%Y/%m/%d");f("daFormat","%Y/%m/%d");f("singleClick",true);f("disableFunc",null);f("dateStatusFunc",g.disableFunc);f("dateText",null);f("firstDay",null);f("align","Br");f("range",[1900,2999]);f("weekNumbers",true);f("flat",null);f("flatCallback",null);f("onSelect",null);f("onClose",null);f("onUpdate",null);f("date",null);f("showsTime",false);f("timeFormat","24");f("electric",true);f("step",2);f("position",null);f("cache",false);f("showOthers",false);f("multiple",null);var c=["inputField","displayArea","button"];for(var b in c){if(typeof g[c[b]]=="string"){g[c[b]]=document.getElementById(g[c[b]])}}if(!(g.flat||g.multiple||g.inputField||g.displayArea||g.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function a(i){var h=i.params;var j=(i.dateClicked||h.electric);if(j&&h.inputField){h.inputField.value=i.date.print(h.ifFormat);if(typeof h.inputField.onchange=="function"){h.inputField.onchange()}}if(j&&h.displayArea){h.displayArea.innerHTML=i.date.print(h.daFormat)}if(j&&typeof h.onUpdate=="function"){h.onUpdate(i)}if(j&&h.flat){if(typeof h.flatCallback=="function"){h.flatCallback(i)}}if(j&&h.singleClick&&i.dateClicked){i.callCloseHandler()}}if(g.flat!=null){if(typeof g.flat=="string"){g.flat=document.getElementById(g.flat)}if(!g.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var e=new Calendar(g.firstDay,g.date,g.onSelect||a);e.showsOtherMonths=g.showOthers;e.showsTime=g.showsTime;e.time24=(g.timeFormat=="24");e.params=g;e.weekNumbers=g.weekNumbers;e.setRange(g.range[0],g.range[1]);e.setDateStatusHandler(g.dateStatusFunc);e.getDateText=g.dateText;if(g.ifFormat){e.setDateFormat(g.ifFormat)}if(g.inputField&&typeof g.inputField.value=="string"){e.parseDate(g.inputField.value)}e.create(g.flat);e.show();return false}var d=g.button||g.displayArea||g.inputField;d["on"+g.eventName]=function(){var h=g.inputField||g.displayArea;var k=g.inputField?g.ifFormat:g.daFormat;var o=false;var m=window.calendar;if(h){g.date=Date.parseDate(h.value||h.innerHTML,k)}if(!(m&&g.cache)){window.calendar=m=new Calendar(g.firstDay,g.date,g.onSelect||a,g.onClose||function(i){i.hide()});m.showsTime=g.showsTime;m.time24=(g.timeFormat=="24");m.weekNumbers=g.weekNumbers;o=true}else{if(g.date){m.setDate(g.date)}m.hide()}if(g.multiple){m.multiple={};for(var j=g.multiple.length;--j>=0;){var n=g.multiple[j];var l=n.print("%Y%m%d");m.multiple[l]=n}}m.showsOtherMonths=g.showOthers;m.yearStep=g.step;m.setRange(g.range[0],g.range[1]);m.params=g;m.setDateStatusHandler(g.dateStatusFunc);m.getDateText=g.dateText;m.setDateFormat(k);if(o){m.create()}m.refresh();if(!g.position){m.showAtElement(g.button||g.displayArea||g.inputField,g.align,g.dontfixPos)}else{m.showAt(g.position[0],g.position[1])}return false};return e};var _gat=new Object({c:"length",lb:"4.2",m:"cookie",b:undefined,cb:function(c,b){this.zb=c;this.Nb=b},r:"__utma=",W:"__utmb=",ma:"__utmc=",Ta:"__utmk=",na:"__utmv=",oa:"__utmx=",Sa:"GASO=",X:"__utmz=",lc:"http://www.google-analytics.com/__utm.gif",mc:"https://ssl.google-analytics.com/__utm.gif",Wa:"utmcid=",Ya:"utmcsr=",$a:"utmgclid=",Ua:"utmccn=",Xa:"utmcmd=",Za:"utmctr=",Va:"utmcct=",Hb:false,_gasoDomain:undefined,_gasoCPath:undefined,e:window,a:document,k:navigator,t:function(h){var b=1,i=0,e,f;if(!_gat.q(h)){b=0;for(e=h[_gat.c]-1;e>=0;e--){f=h.charCodeAt(e);b=(b<<6&268435455)+f+(f<<14);i=b&266338304;b=i!=0?b^i>>21:b}}return b},C:function(l,e,n){var h=_gat,j="-",f,b,i=h.q;if(!i(l)&&!i(e)&&!i(n)){f=h.w(l,e);if(f>-1){b=l.indexOf(n,f);if(b<0){b=l[h.c]}j=h.F(l,f+h.w(e,"=")+1,b)}}return j},Ea:function(h){var b=false,i=0,e,f;if(!_gat.q(h)){b=true;for(e=0;e<h[_gat.c];e++){f=h.charAt(e);i+="."==f?1:0;b=b&&i<=1&&(0==e&&"-"==f||_gat.P(".0123456789",f))}}return b},d:function(e,b){var f=encodeURIComponent;return f instanceof Function?(b?encodeURI(e):f(e)):escape(e)},J:function(h,b){var i=decodeURIComponent,e;h=h.split("+").join(" ");if(i instanceof Function){try{e=b?decodeURI(h):i(h)}catch(f){e=unescape(h)}}else{e=unescape(h)}return e},Db:function(a){return a&&a.hash?_gat.F(a.href,_gat.w(a.href,"#")):""},q:function(a){return _gat.b==a||"-"==a||""==a},Lb:function(a){return a[_gat.c]>0&&_gat.P(" \n\r\t",a)},P:function(c,b){return _gat.w(c,b)>-1},h:function(c,b){c[c[_gat.c]]=b},T:function(a){return a.toLowerCase()},z:function(c,b){return c.split(b)},w:function(c,b){return c.indexOf(b)},F:function(e,b,f){f=_gat.b==f?e[_gat.c]:f;return e.substring(b,f)},uc:function(){var c=_gat.b,b=window;if(b&&b.gaGlobal&&b.gaGlobal.hid){c=b.gaGlobal.hid}else{c=Math.round(Math.random()*2147483647);b.gaGlobal=b.gaGlobal?b.gaGlobal:{};b.gaGlobal.hid=c}return c},wa:function(){return Math.round(Math.random()*2147483647)},Gc:function(){return(_gat.wa()^_gat.vc())*2147483647},vc:function(){var l=_gat.k,e=_gat.a,n=_gat.e,h=e[_gat.m]?e[_gat.m]:"",j=n.history[_gat.c],f,b,i=[l.appName,l.version,l.language?l.language:l.browserLanguage,l.platform,l.userAgent,l.javaEnabled()?1:0].join("");if(n.screen){i+=n.screen.width+"x"+n.screen.height+n.screen.colorDepth}else{if(n.java){b=java.awt.Toolkit.getDefaultToolkit().getScreenSize();i+=b.screen.width+"x"+b.screen.height}}i+=h;i+=e.referrer?e.referrer:"";f=i[_gat.c];while(j>0){i+=j--^f++}return _gat.t(i)}});_gat.hc=function(){var e=this,b=_gat.cb;function f(a,c){return new b(a,c)}e.db="utm_campaign";e.eb="utm_content";e.fb="utm_id";e.gb="utm_medium";e.hb="utm_nooverride";e.ib="utm_source";e.jb="utm_term";e.kb="gclid";e.pa=0;e.I=0;e.wb="15768000";e.Tb="1800";e.ea=[];e.ga=[];e.Ic="cse";e.Gb="q";e.ab="google";e.fa=[f(e.ab,e.Gb),f("yahoo","p"),f("msn","q"),f("aol","query"),f("aol","encquery"),f("lycos","query"),f("ask","q"),f("altavista","q"),f("netscape","query"),f("cnn","query"),f("looksmart","qt"),f("about","terms"),f("mamma","query"),f("alltheweb","q"),f("gigablast","q"),f("voila","rdata"),f("virgilio","qs"),f("live","q"),f("baidu","wd"),f("alice","qs"),f("yandex","text"),f("najdi","q"),f("aol","q"),f("club-internet","query"),f("mama","query"),f("seznam","q"),f("search","q"),f("wp","szukaj"),f("onet","qt"),f("netsprint","q"),f("google.interia","q"),f("szukacz","q"),f("yam","k"),f("pchome","q"),f("kvasir","searchExpr"),f("sesam","q"),f("ozu","q"),f("terra","query"),f("nostrum","query"),f("mynet","q"),f("ekolay","q"),f("search.ilse","search_for")];e.B=undefined;e.Kb=false;e.p="/";e.ha=100;e.Da="/__utm.gif";e.ta=1;e.ua=1;e.G="|";e.sa=1;e.qa=1;e.pb=1;e.g="auto";e.D=1;e.Ga=1000;e.Yc=10;e.nc=10;e.Zc=0.2};_gat.Y=function(N,P){var O,L,F,J,H,C,v,M=this,E=_gat,h=E.q,e=E.c,K,b=P;M.a=N;function D(c){var a=c instanceof Array?c.join("."):"";return h(a)?"-":a}function y(d,a){var f=[],c;if(!h(d)){f=E.z(d,".");if(a){for(c=0;c<f[e];c++){if(!E.Ea(f[c])){f[c]="-"}}}}return f}function G(){return j(63072000000)}function j(c){var a=new Date,d=new Date(a.getTime()+c);return"expires="+d.toGMTString()+"; "}function I(c,a){M.a[E.m]=c+"; path="+b.p+"; "+a+M.Cc()}function t(g,a,i){var d=M.V,f,c;for(f=0;f<d[e];f++){c=d[f][0];c+=h(a)?a:a+d[f][4];d[f][2](E.C(g,c,i))}}M.Jb=function(){return E.b==K||K==M.t()};M.Ba=function(){return H?H:"-"};M.Wb=function(a){H=a};M.Ma=function(a){K=E.Ea(a)?a*1:"-"};M.Aa=function(){return D(C)};M.Na=function(a){C=y(a)};M.Hc=function(){return K?K:"-"};M.Cc=function(){return h(b.g)?"":"domain="+b.g+";"};M.ya=function(){return D(O)};M.Ub=function(a){O=y(a,1)};M.K=function(){return D(L)};M.La=function(a){L=y(a,1)};M.za=function(){return D(F)};M.Vb=function(a){F=y(a,1)};M.Ca=function(){return D(J)};M.Xb=function(c){J=y(c);for(var a=0;a<J[e];a++){if(a<4&&!E.Ea(J[a])){J[a]="-"}}};M.Dc=function(){return v};M.Uc=function(a){v=a};M.pc=function(){O=[];L=[];F=[];J=[];H=E.b;C=[];K=E.b};M.t=function(){var c="",a;for(a=0;a<M.V[e];a++){c+=M.V[a][1]()}return E.t(c)};M.Ha=function(c){var a=M.a[E.m],d=false;if(a){t(a,c,";");M.Ma(M.t());d=true}return d};M.Rc=function(a){t(a,"","&");M.Ma(E.C(a,E.Ta,"&"))};M.Wc=function(){var c=M.V,a=[],d;for(d=0;d<c[e];d++){E.h(a,c[d][0]+c[d][1]())}E.h(a,E.Ta+M.t());return a.join("&")};M.bd=function(f,a){var g=M.V,c=b.p,d;M.Ha(f);b.p=a;for(d=0;d<g[e];d++){if(!h(g[d][1]())){g[d][3]()}}b.p=c};M.dc=function(){I(E.r+M.ya(),G())};M.Pa=function(){I(E.W+M.K(),j(b.Tb*1000))};M.ec=function(){I(E.ma+M.za(),"")};M.Ra=function(){I(E.X+M.Ca(),j(b.wb*1000))};M.fc=function(){I(E.oa+M.Ba(),G())};M.Qa=function(){I(E.na+M.Aa(),G())};M.cd=function(){I(E.Sa+M.Dc(),"")};M.V=[[E.r,M.ya,M.Ub,M.dc,"."],[E.W,M.K,M.La,M.Pa,""],[E.ma,M.za,M.Vb,M.ec,""],[E.oa,M.Ba,M.Wb,M.fc,""],[E.X,M.Ca,M.Xb,M.Ra,"."],[E.na,M.Aa,M.Na,M.Qa,"."]]};_gat.jc=function(j){var e=this,l=_gat,h=j,i,f=function(){},b=function(d){var a=(new Date).getTime(),c;c=(a-d[3])*(h.Zc/1000);if(c>=1){d[2]=Math.min(Math.floor(d[2]*1+c),h.nc);d[3]=a}return d};e.O=function(c,a,t,g,C,y,s){var v,k=h.D,d=t.location;if(!i){i=new l.Y(t,h)}i.Ha(g);v=l.z(i.K(),".");if(v[1]<500||C){if(y){v=b(v)}if(C||!y||v[2]>=1){if(!C&&y){v[2]=v[2]*1-1}v[1]=v[1]*1+1;c="?utmwv="+_gat.lb+"&utmn="+l.wa()+(l.q(d.hostname)?"":"&utmhn="+l.d(d.hostname))+(h.ha==100?"":"&utmsp="+l.d(h.ha))+c;if(0==k||2==k){var m=new Image(1,1);m.src=h.Da+c;var D=2==k?function(){f()}:s||function(){f()};m.onload=D}if(1==k||2==k){var o=new Image(1,1);o.src=("https:"==d.protocol?l.mc:l.lc)+c+"&utmac="+a+"&utmcc="+e.wc(t,g);o.onload=s||function(){f()}}}}i.La(v.join("."));i.Pa()};e.wc=function(m,g){var k=[],n=[l.r,l.X,l.na,l.oa],c,a=m[l.m],d;for(c=0;c<n[l.c];c++){d=l.C(a,n[c]+g,";");if(!l.q(d)){l.h(k,n[c]+d+";")}}return l.d(k.join("+"))}};_gat.i=function(){this.la=[]};_gat.i.bb=function(j,e,l,h,i,f){var b=this;b.cc=j;b.Oa=e;b.L=l;b.sb=h;b.Pb=i;b.Qb=f};_gat.i.bb.prototype.S=function(){var c=this,b=_gat.d;return"&"+["utmt=item","utmtid="+b(c.cc),"utmipc="+b(c.Oa),"utmipn="+b(c.L),"utmiva="+b(c.sb),"utmipr="+b(c.Pb),"utmiqt="+b(c.Qb)].join("&")};_gat.i.$=function(l,p,n,j,f,i,h,e){var b=this;b.v=l;b.ob=p;b.bc=n;b.ac=j;b.Yb=f;b.ub=i;b.$b=h;b.xb=e;b.ca=[]};_gat.i.$.prototype.mb=function(l,p,n,j,f){var i=this,h=i.Eb(l),e=i.v,b=_gat;if(b.b==h){b.h(i.ca,new b.i.bb(e,l,p,n,j,f))}else{h.cc=e;h.Oa=l;h.L=p;h.sb=n;h.Pb=j;h.Qb=f}};_gat.i.$.prototype.Eb=function(f){var b,h=this.ca,e;for(e=0;e<h[_gat.c];e++){b=f==h[e].Oa?h[e]:b}return b};_gat.i.$.prototype.S=function(){var c=this,b=_gat.d;return"&"+["utmt=tran","utmtid="+b(c.v),"utmtst="+b(c.ob),"utmtto="+b(c.bc),"utmttx="+b(c.ac),"utmtsp="+b(c.Yb),"utmtci="+b(c.ub),"utmtrg="+b(c.$b),"utmtco="+b(c.xb)].join("&")};_gat.i.prototype.nb=function(t,v,u,n,i,l,j,e){var b=this,s=_gat,h=b.xa(t);if(s.b==h){h=new s.i.$(t,v,u,n,i,l,j,e);s.h(b.la,h)}else{h.ob=v;h.bc=u;h.ac=n;h.Yb=i;h.ub=l;h.$b=j;h.xb=e}return h};_gat.i.prototype.xa=function(f){var b,h=this.la,e;for(e=0;e<h[_gat.c];e++){b=f==h[e].v?h[e]:b}return b};_gat.gc=function(i){var b=this,j="-",f=_gat,h=i;b.Ja=screen;b.qb=!self.screen&&self.java?java.awt.Toolkit.getDefaultToolkit():f.b;b.a=document;b.e=window;b.k=navigator;b.Ka=j;b.Sb=j;b.tb=j;b.Ob=j;b.Mb=1;b.Bb=j;function e(){var g,c,a,l,d="ShockwaveFlash",s="$version",o=b.k?b.k.plugins:f.b;if(o&&o[f.c]>0){for(g=0;g<o[f.c]&&!a;g++){c=o[g];if(f.P(c.name,"Shockwave Flash")){a=f.z(c.description,"Shockwave Flash ")[1]}}}else{d=d+"."+d;try{l=new ActiveXObject(d+".7");a=l.GetVariable(s)}catch(k){}if(!a){try{l=new ActiveXObject(d+".6");a="WIN 6,0,21,0";l.AllowScriptAccess="always";a=l.GetVariable(s)}catch(n){}}if(!a){try{l=new ActiveXObject(d);a=l.GetVariable(s)}catch(n){}}if(a){a=f.z(f.z(a," ")[1],",");a=a[0]+"."+a[1]+" r"+a[2]}}return a?a:j}b.xc=function(){var a;if(self.screen){b.Ka=b.Ja.width+"x"+b.Ja.height;b.Sb=b.Ja.colorDepth+"-bit"}else{if(b.qb){try{a=b.qb.getScreenSize();b.Ka=a.width+"x"+a.height}catch(c){}}}b.Ob=f.T(b.k&&b.k.language?b.k.language:(b.k&&b.k.browserLanguage?b.k.browserLanguage:j));b.Mb=b.k&&b.k.javaEnabled()?1:0;b.Bb=h?e():j;b.tb=f.d(b.a.characterSet?b.a.characterSet:(b.a.charset?b.a.charset:j))};b.Xc=function(){return"&"+["utmcs="+f.d(b.tb),"utmsr="+b.Ka,"utmsc="+b.Sb,"utmul="+b.Ob,"utmje="+b.Mb,"utmfl="+f.d(b.Bb)].join("&")}};_gat.n=function(C,G,E,v,n){var t=this,s=_gat,e=s.q,b=s.b,y=s.P,j=s.C,H=s.T,F=s.z,u=s.c;t.a=G;t.f=C;t.Rb=E;t.ja=v;t.o=n;function D(a){return e(a)||"0"==a||!y(a,"://")}function l(c){var a="";c=H(F(c,"://")[1]);if(y(c,"/")){c=F(c,"/")[1];if(y(c,"?")){a=F(c,"?")[0]}}return a}function h(c){var a="";a=H(F(c,"://")[1]);if(y(a,"/")){a=F(a,"/")[0]}return a}t.Fc=function(d){var c=t.Fb(),a=t.o;return new s.n.s(j(d,a.fb+"=","&"),j(d,a.ib+"=","&"),j(d,a.kb+"=","&"),t.ba(d,a.db,"(not set)"),t.ba(d,a.gb,"(not set)"),t.ba(d,a.jb,c&&!e(c.R)?s.J(c.R):b),t.ba(d,a.eb,b))};t.Ib=function(d){var c=h(d),a=l(d);if(y(c,t.o.ab)){d=F(d,"?").join("&");if(y(d,"&"+t.o.Gb+"=")){if(a==t.o.Ic){return true}}}return false};t.Fb=function(){var i,d,c=t.Rb,g,f,a=t.o.fa;if(D(c)||t.Ib(c)){return}i=h(c);for(g=0;g<a[u];g++){f=a[g];if(y(i,H(f.zb))){c=F(c,"?").join("&");if(y(c,"&"+f.Nb+"=")){d=F(c,"&"+f.Nb+"=")[1];if(y(d,"&")){d=F(d,"&")[0]}return new s.n.s(b,f.zb,b,"(organic)","organic",d,b)}}}};t.ba=function(g,c,a){var f=j(g,c+"=","&"),d=!e(f)?s.J(f):(!e(a)?a:"-");return d};t.Nc=function(g){var c=t.o.ea,a=false,f,d;if(g&&"organic"==g.da){f=H(s.J(g.R));for(d=0;d<c[u];d++){a=a||H(c[d])==f}}return a};t.Ec=function(){var d="",c="",a=t.Rb;if(D(a)||t.Ib(a)){return}d=H(F(a,"://")[1]);if(y(d,"/")){c=s.F(d,s.w(d,"/"));if(y(c,"?")){c=F(c,"?")[0]}d=F(d,"/")[0]}if(0==s.w(d,"www.")){d=s.F(d,4)}return new s.n.s(b,d,b,"(referral)","referral",b,c)};t.sc=function(c){var a="";if(t.o.pa){a=s.Db(c);a=""!=a?a+"&":a}a+=c.search;return a};t.zc=function(){return new s.n.s(b,"(direct)",b,"(direct)","(none)",b,b)};t.Oc=function(g){var c=false,a,f,d=t.o.ga;if(g&&"referral"==g.da){a=H(s.d(g.ia));for(f=0;f<d[u];f++){c=c||y(a,H(d[f]))}}return c};t.U=function(a){return b!=a&&a.Fa()};t.yc=function(a,q){var c="",z="-",f,k,g=0,d,w,o=t.f;if(!a){return""}w=t.a[s.m]?t.a[s.m]:"";c=t.sc(t.a.location);if(t.o.I&&a.Jb()){z=a.Ca();if(!e(z)&&!y(z,";")){a.Ra();return""}}z=j(w,s.X+o+".",";");f=t.Fc(c);if(t.U(f)){k=j(c,t.o.hb+"=","&");if("1"==k&&!e(z)){return""}}if(!t.U(f)){f=t.Fb();if(!e(z)&&t.Nc(f)){return""}}if(!t.U(f)&&q){f=t.Ec();if(!e(z)&&t.Oc(f)){return""}}if(!t.U(f)){if(e(z)&&q){f=t.zc()}}if(!t.U(f)){return""}if(!e(z)){var i=F(z,"."),x=new s.n.s;x.Cb(i.slice(4).join("."));d=H(x.ka())==H(f.ka());g=i[3]*1}if(!d||q){var r=j(w,s.r+o+".",";"),m=r.lastIndexOf("."),p=m>9?s.F(r,m+1)*1:0;g++;p=0==p?1:p;a.Xb([o,t.ja,p,g,f.ka()].join("."));a.Ra();return"&utmcn=1"}else{return"&utmcr=1"}}};_gat.n.s=function(l,e,n,h,j,f,b){var i=this;i.v=l;i.ia=e;i.ra=n;i.L=h;i.da=j;i.R=f;i.vb=b};_gat.n.s.prototype.ka=function(){var i=this,b=_gat,j=[],f=[[b.Wa,i.v],[b.Ya,i.ia],[b.$a,i.ra],[b.Ua,i.L],[b.Xa,i.da],[b.Za,i.R],[b.Va,i.vb]],h,e;if(i.Fa()){for(h=0;h<f[b.c];h++){if(!b.q(f[h][1])){e=f[h][1].split("+").join("%20");e=e.split(" ").join("%20");b.h(j,f[h][0]+e)}}}return j.join("|")};_gat.n.s.prototype.Fa=function(){var c=this,b=_gat.q;return !(b(c.v)&&b(c.ia)&&b(c.ra))};_gat.n.s.prototype.Cb=function(f){var b=this,h=_gat,e=function(a){return h.J(h.C(f,a,"|"))};b.v=e(h.Wa);b.ia=e(h.Ya);b.ra=e(h.$a);b.L=e(h.Ua);b.da=e(h.Xa);b.R=e(h.Za);b.vb=e(h.Va)};_gat.Z=function(){var J=this,L=_gat,K={},H="k",C="v",F=[H,C],E="(",t=")",l="*",I="!",y="'",h={};h[y]="'0";h[t]="'1";h[l]="'2";h[I]="'3";var e=1;function G(c,f,d,a){if(L.b==K[c]){K[c]={}}if(L.b==K[c][f]){K[c][f]=[]}K[c][f][d]=a}function b(a,d,c){return L.b!=K[a]&&L.b!=K[a][d]?K[a][d][c]:L.b}function v(c,f){if(L.b!=K[c]&&L.b!=K[c][f]){K[c][f]=L.b;var d=true,a;for(a=0;a<F[L.c];a++){if(L.b!=K[c][F[a]]){d=false;break}}if(d){K[c]=L.b}}}function s(c){var f="",d=false,a,g;for(a=0;a<F[L.c];a++){g=c[F[a]];if(L.b!=g){if(d){f+=F[a]}f+=D(g);d=false}else{d=true}}return f}function D(c){var f=[],d,a;for(a=0;a<c[L.c];a++){if(L.b!=c[a]){d="";if(a!=e&&L.b==c[a-1]){d+=a.toString();d+=I}d+=j(c[a]);L.h(f,d)}}return E+f.join(l)+t}function j(c){var f="",d,a,g;for(d=0;d<c[L.c];d++){a=c.charAt(d);g=h[a];f+=L.b!=g?g:a}return f}J.Kc=function(a){return L.b!=K[a]};J.N=function(){var a=[],c;for(c in K){if(L.b!=K[c]){L.h(a,c.toString()+s(K[c]))}}return a.join("")};J.Sc=function(a){if(a==L.b){return J.N()}var d=[a.N()],c;for(c in K){if(L.b!=K[c]&&!a.Kc(c)){L.h(d,c.toString()+s(K[c]))}}return d.join("")};J._setKey=function(a,d,c){if(typeof c!="string"){return false}G(a,H,d,c);return true};J._setValue=function(a,d,c){if(typeof c!="number"&&(L.b==Number||!(c instanceof Number))){return false}if(Math.round(c)!=c||c==NaN||c==Infinity){return false}G(a,C,d,c.toString());return true};J._getKey=function(a,c){return b(a,H,c)};J._getValue=function(a,c){return b(a,C,c)};J._clearKey=function(a){v(a,H)};J._clearValue=function(a){v(a,C)}};_gat.ic=function(e,b){var f=this;f.jd=b;f.Pc=e;f._trackEvent=function(c,d,a){return b._trackEvent(f.Pc,c,d,a)}};_gat.kc=function(P){var R=this,Q=_gat,N=Q.b,G=Q.q,K=Q.w,I=Q.F,D=Q.C,y=Q.P,O=Q.z,F="location",j=Q.c,e=N,L=new Q.hc,b=false;R.a=document;R.e=window;R.ja=Math.round((new Date).getTime()/1000);R.H=P;R.yb=R.a.referrer;R.va=N;R.j=N;R.A=N;R.M=false;R.aa=N;R.rb="";R.l=N;R.Ab=N;R.f=N;R.u=N;function E(){if("auto"==L.g){var a=R.a.domain;if("www."==I(a,0,4)){a=I(a,4)}L.g=a}L.g=Q.T(L.g)}function C(){var a=L.g,c=K(a,"www.google.")*K(a,".google.")*K(a,"google.");return c||"/"!=L.p||K(a,"google.org")>-1}function H(a,g,d){if(G(a)||G(g)||G(d)){return"-"}var f=D(a,Q.r+R.f+".",g),c;if(!G(f)){c=O(f,".");c[5]=c[5]?c[5]*1+1:1;c[3]=c[4];c[4]=d;f=c.join(".")}return f}function t(){return"file:"!=R.a[F].protocol&&C()}function J(a){if(!a||""==a){return""}while(Q.Lb(a.charAt(0))){a=I(a,1)}while(Q.Lb(a.charAt(a[j]-1))){a=I(a,0,a[j]-1)}return a}function v(a,d,c){if(!G(a())){d(Q.J(a()));if(!y(a(),";")){c()}}}function M(a){var d,c=""!=a&&R.a[F].host!=a;if(c){for(d=0;d<L.B[j];d++){c=c&&K(Q.T(a),Q.T(L.B[d]))==-1}}return c}R.Bc=function(){if(!L.g||""==L.g||"none"==L.g){L.g="";return 1}E();return L.pb?Q.t(L.g):1};R.tc=function(a,d){if(G(a)){a="-"}else{d+=L.p&&"/"!=L.p?L.p:"";var c=K(a,d);a=c>=0&&c<=8?"0":("["==a.charAt(0)&&"]"==a.charAt(a[j]-1)?"-":a)}return a};R.Ia=function(a){var d="",c=R.a;d+=R.aa?R.aa.Xc():"";d+=L.qa?R.rb:"";d+=L.ta&&!G(c.title)?"&utmdt="+Q.d(c.title):"";d+="&utmhid="+Q.uc()+"&utmr="+R.va+"&utmp="+R.Tc(a);return d};R.Tc=function(a){var c=R.a[F];a=N!=a&&""!=a?Q.d(a,true):Q.d(c.pathname+unescape(c.search),true);return a};R.$c=function(a){if(R.Q()){var c="";if(R.l!=N&&R.l.N().length>0){c+="&utme="+Q.d(R.l.N())}c+=R.Ia(a);e.O(c,R.H,R.a,R.f)}};R.qc=function(){var a=new Q.Y(R.a,L);return a.Ha(R.f)?a.Wc():N};R._getLinkerUrl=function(a,g){var d=O(a,"#"),f=a,c=R.qc();if(c){if(g&&1>=d[j]){f+="#"+c}else{if(!g||1>=d[j]){if(1>=d[j]){f+=(y(a,"?")?"&":"?")+c}else{f=d[0]+(y(a,"?")?"&":"?")+c+"#"+d[1]}}}}return f};R.Zb=function(){var a;if(R.A&&R.A[j]>=10&&!y(R.A,"=")){R.u.Uc(R.A);R.u.cd();Q._gasoDomain=L.g;Q._gasoCPath=L.p;a=R.a.createElement("script");a.type="text/javascript";a.id="_gasojs";a.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+R.A+"&"+Q.wa();R.a.getElementsByTagName("head")[0].appendChild(a)}};R.Jc=function(){var i=R.a[Q.m],f=R.ja,d=R.u,q=R.f+"",n=R.e,h=n?n.gaGlobal:N,r,p=y(i,Q.r+q+"."),l=y(i,Q.W+q),o=y(i,Q.ma+q),c,a=[],m="",g=false,k;i=G(i)?"":i;if(L.I){r=Q.Db(R.a[F]);if(L.pa&&!G(r)){m=r+"&"}m+=R.a[F].search;if(!G(m)&&y(m,Q.r)){d.Rc(m);if(!d.Jb()){d.pc()}c=d.ya()}v(d.Ba,d.Wb,d.fc);v(d.Aa,d.Na,d.Qa)}if(!G(c)){if(G(d.K())||G(d.za())){c=H(m,"&",f);R.M=true}else{a=O(d.K(),".");q=a[0]}}else{if(p){if(!l||!o){c=H(i,";",f);R.M=true}else{c=D(i,Q.r+q+".",";");a=O(D(i,Q.W+q,";"),".")}}else{c=[q,Q.Gc(),f,f,f,1].join(".");R.M=true;g=true}}c=O(c,".");if(g){if(n&&h&&!h.from_cookie){c[4]=h.sid?h.sid:c[4];c[3]=h.sid?h.sid:c[4];if(h.vid){k=O(h.vid,".");c[1]=k[0];c[2]=k[1]}}}d.Ub(c.join("."));a[0]=q;a[1]=a[1]?a[1]:0;a[2]=undefined!=a[2]?a[2]:L.Yc;a[3]=a[3]?a[3]:c[4];d.La(a.join("."));d.Vb(q);if(!G(d.Hc())){d.Ma(d.t())}d.dc();d.Pa();d.ec()};R.Lc=function(){e=new Q.jc(L)};R._initData=function(){var a;if(!b){R.Lc();R.f=R.Bc();R.u=new Q.Y(R.a,L)}if(t()){R.Jc()}if(!b){if(t()){R.va=R.tc(R.Ac(),R.a.domain);if(L.sa){R.aa=new Q.gc(L.ua);R.aa.xc()}if(L.qa){a=new Q.n(R.f,R.a,R.va,R.ja,L);R.rb=a.yc(R.u,R.M)}}R.l=new Q.Z;R.Ab=new Q.Z;b=true}if(!Q.Hb){R.Mc()}};R._visitCode=function(){R._initData();var a=D(R.a[Q.m],Q.r+R.f+".",";"),c=O(a,".");return c[j]<4?"":c[1]};R._cookiePathCopy=function(a){R._initData();if(R.u){R.u.bd(R.f,a)}};R.Mc=function(){var a=R.a[F].hash,c;c=a&&""!=a&&0==K(a,"#gaso=")?D(a,"gaso=","&"):D(R.a[Q.m],Q.Sa,";");if(c[j]>=10){R.A=c;if(R.e.addEventListener){R.e.addEventListener("load",R.Zb,false)}else{R.e.attachEvent("onload",R.Zb)}}Q.Hb=true};R.Q=function(){return R._visitCode()%10000<L.ha*100};R.Vc=function(){var a,f,c=R.a.links;if(!L.Kb){var d=R.a.domain;if("www."==I(d,0,4)){d=I(d,4)}L.B.push("."+d)}for(a=0;a<c[j]&&(L.Ga==-1||a<L.Ga);a++){f=c[a];if(M(f.host)){if(!f.gatcOnclick){f.gatcOnclick=f.onclick?f.onclick:R.Qc;f.onclick=function(g){var h=!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";h=h&&!R.oc(g);R.ad(g,this,h);return h?false:(this.gatcOnclick?this.gatcOnclick(g):true)}}}}};R.Qc=function(){};R._trackPageview=function(a){if(t()){R._initData();if(L.B){R.Vc()}R.$c(a);R.M=false}};R._trackTrans=function(){var a=R.f,g=[],d,f,c,h;R._initData();if(R.j&&R.Q()){for(d=0;d<R.j.la[j];d++){f=R.j.la[d];Q.h(g,f.S());for(c=0;c<f.ca[j];c++){Q.h(g,f.ca[c].S())}}for(h=0;h<g[j];h++){e.O(g[h],R.H,R.a,a,true)}}};R._setTrans=function(){var a=R.a,g,d,f,c,h=a.getElementById?a.getElementById("utmtrans"):(a.utmform&&a.utmform.utmtrans?a.utmform.utmtrans:N);R._initData();if(h&&h.value){R.j=new Q.i;c=O(h.value,"UTM:");L.G=!L.G||""==L.G?"|":L.G;for(g=0;g<c[j];g++){c[g]=J(c[g]);d=O(c[g],L.G);for(f=0;f<d[j];f++){d[f]=J(d[f])}if("T"==d[0]){R._addTrans(d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8])}else{if("I"==d[0]){R._addItem(d[1],d[2],d[3],d[4],d[5],d[6])}}}}};R._addTrans=function(a,i,d,f,c,k,h,g){R.j=R.j?R.j:new Q.i;return R.j.nb(a,i,d,f,c,k,h,g)};R._addItem=function(a,h,d,f,c,i){var g;R.j=R.j?R.j:new Q.i;g=R.j.xa(a);if(!g){g=R._addTrans(a,"","","","","","","")}g.mb(h,d,f,c,i)};R._setVar=function(a){if(a&&""!=a&&C()){R._initData();var d=new Q.Y(R.a,L),c=R.f;d.Na(c+"."+Q.d(a));d.Qa();if(R.Q()){e.O("&utmt=var",R.H,R.a,R.f)}}};R._link=function(a,c){if(L.I&&a){R._initData();R.a[F].href=R._getLinkerUrl(a,c)}};R._linkByPost=function(a,c){if(L.I&&a&&a.action){R._initData();a.action=R._getLinkerUrl(a.action,c)}};R._setXKey=function(a,d,c){R.l._setKey(a,d,c)};R._setXValue=function(a,d,c){R.l._setValue(a,d,c)};R._getXKey=function(a,c){return R.l._getKey(a,c)};R._getXValue=function(a,c){return R.l.getValue(a,c)};R._clearXKey=function(a){R.l._clearKey(a)};R._clearXValue=function(a){R.l._clearValue(a)};R._createXObj=function(){R._initData();return new Q.Z};R._sendXEvent=function(a){var c="";R._initData();if(R.Q()){c+="&utmt=event&utme="+Q.d(R.l.Sc(a))+R.Ia();e.O(c,R.H,R.a,R.f,false,true)}};R._createEventTracker=function(a){R._initData();return new Q.ic(a,R)};R._trackEvent=function(a,g,d,f){var c=true,h=R.Ab;if(N!=a&&N!=g&&""!=a&&""!=g){h._clearKey(5);h._clearValue(5);c=h._setKey(5,1,a)?c:false;c=h._setKey(5,2,g)?c:false;c=N==d||h._setKey(5,3,d)?c:false;c=N==f||h._setValue(5,1,f)?c:false;if(c){R._sendXEvent(h)}}else{c=false}return c};R.ad=function(a,g,d){R._initData();if(R.Q()){var f=new Q.Z;f._setKey(6,1,g.href);var c=d?function(){R.rc(a,g)}:undefined;e.O("&utmt=event&utme="+Q.d(f.N())+R.Ia(),R.H,R.a,R.f,false,true,c)}};R.rc=function(a,d){if(!a){a=R.e.event}var c=true;if(d.gatcOnclick){c=d.gatcOnclick(a)}if(c||typeof c=="undefined"){if(!d.target||d.target=="_self"){R.e.location=d.href}else{if(d.target=="_top"){R.e.top.document.location=d.href}else{if(d.target=="_parent"){R.e.parent.document.location=d.href}}}}};R.oc=function(a){if(!a){a=R.e.event}var c=a.shiftKey||a.ctrlKey||a.altKey;if(!c){if(a.modifiers&&R.e.Event){c=a.modifiers&R.e.Event.CONTROL_MASK||a.modifiers&R.e.Event.SHIFT_MASK||a.modifiers&R.e.Event.ALT_MASK}}return c};R._setDomainName=function(a){L.g=a};R.dd=function(){return L.g};R._addOrganic=function(a,c){Q.h(L.fa,new Q.cb(a,c))};R._clearOrganic=function(){L.fa=[]};R.hd=function(){return L.fa};R._addIgnoredOrganic=function(a){Q.h(L.ea,a)};R._clearIgnoredOrganic=function(){L.ea=[]};R.ed=function(){return L.ea};R._addIgnoredRef=function(a){Q.h(L.ga,a)};R._clearIgnoredRef=function(){L.ga=[]};R.fd=function(){return L.ga};R._setAllowHash=function(a){L.pb=a?1:0};R._setCampaignTrack=function(a){L.qa=a?1:0};R._setClientInfo=function(a){L.sa=a?1:0};R._getClientInfo=function(){return L.sa};R._setCookiePath=function(a){L.p=a};R._setTransactionDelim=function(a){L.G=a};R._setCookieTimeout=function(a){L.wb=a};R._setDetectFlash=function(a){L.ua=a?1:0};R._getDetectFlash=function(){return L.ua};R._setDetectTitle=function(a){L.ta=a?1:0};R._getDetectTitle=function(){return L.ta};R._setLocalGifPath=function(a){L.Da=a};R._getLocalGifPath=function(){return L.Da};R._setLocalServerMode=function(){L.D=0};R._setRemoteServerMode=function(){L.D=1};R._setLocalRemoteServerMode=function(){L.D=2};R.gd=function(){return L.D};R._getServiceMode=function(){return L.D};R._setSampleRate=function(a){L.ha=a};R._setSessionTimeout=function(a){L.Tb=a};R._setAllowLinker=function(a){L.I=a?1:0};R._setAllowAnchor=function(a){L.pa=a?1:0};R._setCampNameKey=function(a){L.db=a};R._setCampContentKey=function(a){L.eb=a};R._setCampIdKey=function(a){L.fb=a};R._setCampMediumKey=function(a){L.gb=a};R._setCampNOKey=function(a){L.hb=a};R._setCampSourceKey=function(a){L.ib=a};R._setCampTermKey=function(a){L.jb=a};R._setCampCIdKey=function(a){L.kb=a};R._getAccount=function(){return R.H};R._getVersion=function(){return _gat.lb};R.kd=function(a){L.B=[];if(a){L.B=a}};R.md=function(a){L.Kb=a};R.ld=function(a){L.Ga=a};R._setReferrerOverride=function(a){R.yb=a};R.Ac=function(){return R.yb}};_gat._getTracker=function(c){var b=new _gat.kc(c);return b};var activeHint=null;function AjaxTooltip(a,f,d,i){var c=new Element("div",{"class":i?"hint "+i:"hint",html:'<a href="#" class="close"><img src="/img/close.gif"/></a>'}).inject(document.body);var g=new Layer(c);var b=false;function h(){if(!b){b=true;new Request({url:a,method:"get",async:false,onSuccess:function(k){c.innerHTML=c.innerHTML+k;c.getElement("a.close").addEvent("click",function(){e();return false});c.getElement("a.close").addEvent("keypress",function(l){if(l.keyCode==Event.KEY_ESC){e();return false}return false})}}).send()}}function j(){g.show();c.getElement("a.close").focus()}function e(){f.focus();g.hide()}f.onclick=function(){h();g.placeNear(f,{position:d?d:"right"});j();return false}}var Hint=new Class({initialize:function(c,b,a){this.element=new Element("div",{html:c,"class":"hint"});this.element.insertBefore(new Element("a",{title:"закрыть",href:"#","class":"close",html:'<img src="/img/close.gif"/>',events:{click:function(){this.hide();return false}.bind(this),keypress:function(d){if(d.keyCode==Event.KEY_ESC){this.hide();return false}}.bind(this)}}),this.element.firstChild);document.body.appendChild(this.element);this.layer=new Layer(this.element);b.onclick=function(){this.layer.placeNear(b,{position:a?a:"right"});this.show();return false}.bind(this)},show:function(){if(activeHint!=null){activeHint.hide()}activeHint=this;this.layer.show();this.element.getElement("a").focus()},hide:function(){activeHint=null;this.layer.hide()}});var Layer=new Class({options:{zIndex:5,iframeUrl:null},initialize:function(b,a){this.setOptions(a);this.element=$(b);this.element.setStyles({visibility:"hidden",position:"absolute",left:-10000,top:-10000,zIndex:this.options.zIndex})},overlaps:function(d){var c=this.element.getCoordinates();var e=d.getCoordinates();var b=(c.left>=e.left&&c.left<=e.right)||(c.right>=e.left&&c.right<=e.right)||(e.left>=c.left&&e.left<=c.right);var a=(c.top>=e.top&&c.top<=e.bottom)||(c.bottom>=e.top&&c.bottom<=e.bottom)||(e.top>=c.top&&e.top<=c.bottom);return b&&a},placeNear:function(c,b){var d={position:"right",offsets:{x:10,y:10},fitWindow:true};b=$merge(d,b);var e=c.getPosition();var a=b.position;if(a.contains("top")){e.y-=this.element.getCoordinates().height+b.offsets.y}if(a.contains("bottom")){e.y+=c.getCoordinates().height+b.offsets.y}if(a.contains("left")){e.x-=this.element.getCoordinates().width+b.offsets.x}if(a.contains("right")){e.x+=c.getCoordinates().width+b.offsets.x}return this.place(e.x,e.y,b.fitWindow)},place:function(a,e,b){if(b){var d=window.getWidth()+window.getScrollLeft();var c=window.getHeight()+window.getScrollTop();if(a+this.element.getCoordinates().width>d){a=d-this.element.getCoordinates().width}if(e+this.element.getCoordinates().height>c){e=c-this.element.getCoordinates().height}}this.element.setStyles({top:e,left:a});if(window.ie&&this.options.iframeUrl){if(!this.iframe){this.iframe=new Element("iframe",{styles:{visibility:"hidden",position:"absolute",left:-10000,top:-10000,border:"none",zIndex:this.element.getStyle("zIndex")-1}});this.iframe.src=this.options.iframeUrl;this.iframe.scrolling="no";this.iframe.frameBorder="0";this.iframe.injectAfter(this.element)}this.iframe.setStyles(this.element.getCoordinates())}return this},show:function(){this.element.setStyle("visibility","visible");if(this.iframe){this.iframe.setStyle("visibility","visible")}},hide:function(){this.element.setStyle("visibility","hidden");if(this.iframe){this.iframe.setStyle("visibility","hidden")}},isVisible:function(){return this.element.getStyle("visibility").contains("visible")},toggle:function(){if(this.isVisible()){this.hide()}else{this.show()}}});Layer.implement(new Options());function trim(a){return a.replace(/^\s*((?:[\S\s]*\S)?)\s*$/,"$1")}function getElementsByClassName(h,j,g){var b=new RegExp("(^|\\s)"+h+"(\\s|$)");var j=j||"*";var g=g||document;var a=(j=="*"&&g.all)?g.all:g.getElementsByTagName(j);var d=[];var f;var c=a.length;for(var e=0;e<c;e++){f=a[e];if(b.test(f.className)){d.push(f)}}return d}function makeArray(){for(var a=0;a<makeArray.arguments.length;a++){this[a]=makeArray.arguments[a]}}function findPos(a){var b=curtop=0;do{b+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent);return[b,curtop]}function addOnloadListener(b){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",b,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",b)}else{if(window.onload!=null){var a=window.onload;window.onload=function(c){a(c);window[b]()}}else{window.onload=b}}}}function parsePrice(a){var b=function(c){return c.replace(/[.*+?^${}()|[\]\/\\\,]/g,"\\$&")};a=a.replace(/\u00A0/g,"");a=a.replace(new RegExp(b(groupSeparator),"g"),"");a=a.replace(new RegExp(b(decimalSeparator),"g"),".");a=a.replace(/\s/g,"");if(a==""){return 0}if(a.indexOf(".")!=-1){return parseFloat(a)}return parseInt(a)}function isInt(b){var a=/^[0-9]+$/;return b.match(a)!=null}function formatPriceTrend(c,a){var b=formatPrice(c,a);if(c>0){b='<font color="green">'+b+"</font>"}else{if(c<0){b='<font color="red">'+b+"</font>"}}return b}function formatPrice(g,a){var e=""+Math.round(g>0?g:-g);e=e.replace(" ","");var c=3-e.length%3;var f="";for(var b=0;b<e.length;b++){f=f+e.charAt(b);c++;if(b==(e.length-1)||e.charAt(b+1)==decimalSeparator){f=f+e.substring(b+1);break}if(c%3==0){f=f+groupSeparator}}if(g<0){f="-"+f}if(a){if("ru"==locale){f=f+" "+a}else{if(a.length==1){f=a+f}else{f=a+" "+f}}}return f}function formatMonthes(d){var c="";if(d>=12){var b=Math.floor(d/12);var e="лет";if(b<10||b>20){var a=b%10;if(a==1){e="год"}if(a==2||a==3||a==4){e="года"}}c=c+b.toFixed(0)+" "+e}if(d%12>0){c=c+" "+(d%12).toFixed(0)+" мес"}return c}function formatMonth(b){var a=new makeArray("январе","феврале","марте","апреле","мае","июне","июле","августе","сентябре","октябре","ноябре","декабре");return a[b.getMonth()]+" "+b.getFullYear()}function monthesBetween(c,b){if(c>b){return null}var e=c;var a=12*(b.getFullYear()-c.getFullYear());a=a+(b.getMonth()-c.getMonth());return a}function parseDate(d){var a=d.indexOf(".");if(a==-1){return null}var b=d.substring(0,a);if(!isInt(b)){return null}if(b>31){return null}d=d.substring(a+1);a=d.indexOf(".");if(a==-1){return null}var e=d.substring(0,a);if(!isInt(e)){return null}if(e>12){return null}d=d.substring(a+1);var c=d;if(!isInt(c)){return null}return new Date(c,e-1,b)}function formatDate(b){var a="";if(b.getDate()<10){a=a+"0"}a=a+b.getDate();a=a+".";if(b.getMonth()<9){a=a+"0"}a=a+(1+b.getMonth());a=a+".";a=a+b.getFullYear();return a}function toggleVisibility(b,a){var d=document.getElementById(b);if(!d){return false}if(!isElementVisible(d)){showElement(b)}else{hideElement(b)}if(!a){return false}var c=document.getElementById(a);if(!isElementVisible(c)){showElement(a)}else{hideElement(a)}return false}function isElementVisible(a){var b=a.style.display.indexOf("none")==-1;return b}function showElement(b){var a=document.getElementById(b);if(a==null){return false}a.style.display="";return false}function hideElement(b){var a=document.getElementById(b);if(a==null){return false}a.style.display="none";return false}function execJS(d){var b=d.getElementsByTagName("SCRIPT");var a;for(var c=0;c<b.length;c++){if(Browser.Engine.webkit){a=b[c].innerHTML}else{if(Browser.Engine.presto){a=b[c].text}else{if(Browser.Engine.gecko){a=b[c].textContent}else{a=b[c].text}}}try{$exec(a)}catch(f){alert(f)}}}function createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}function changeDatesForPeriod(a){if(a.value=="ONCE"){document.getElementById("nonPeriodDateBlock").style.display="";document.getElementById("periodDateBlock").style.display="none"}else{document.getElementById("nonPeriodDateBlock").style.display="none";document.getElementById("periodDateBlock").style.display=""}}CalendarRestrictions={disableDatesBeforeStartDate:function(a){return a<new Date(startDate)},disableDatesBeforeStartDateRestricted:function(b){var a=new Date();a=new Date(a.getFullYear(),a.getMonth()+2,a.getDate());return b<new Date(startDate)||b>a}};var Forms={highlightButton:function(a,b){a=$(a);if(b){a.addClass("on");a.getPrevious().set("src","/img/form/button_left_xon.gif");a.getNext().set("src","/img/form/button_right_xon.gif")}else{a.removeClass("on");a.getPrevious().set("src","/img/form/button_left.gif");a.getNext().set("src","/img/form/button_right.gif")}},highlightInput:function(a,b){a=$(a);if(b){button.addClass("on");button.getPrevious().set("src","/img/form/button_left_xon.gif");button.getNext().set("src","/img/form/button_right_xon.gif")}else{button.removeClass("on");button.getPrevious().set("src","/img/form/button_left.gif");button.getNext().set("src","/img/form/button_right.gif")}},activeSelectId:null,showOptions:function(a,d,c){var b=$("options"+d);a=$(a);if(b.getStyle("display")=="none"){b.getParent().setStyle("z-index","6");b.setStyle("display","block")}else{Forms.hideOptions()}$("select"+d).addClass("selected");document.addEvent("mousedown",Forms.hideOptionsOnMouseDown);Forms.activeSelectId=d;return false},hideOptions:function(){document.removeEvent("mousedown",Forms.hideOptionsOnMouseDown);var a=$("options"+Forms.activeSelectId);a.getParent().setStyle("z-index","5");a.setStyle("display","none");Forms.activeSelectId=null},selectValue:function(d,c){var a=$("options"+d);a.getChildren().each(function b(e){if(e.get("svalue")==c){Forms.selectOption(d,e)}})},selectOption:function(f,c,d){var a=$("select"+f);var b=$("input"+f);b.set("value",$(c).get("svalue"));a.getElements("a")[0].set("html",$(c).get("slabel"));if(Forms.activeSelectId){Forms.hideOptions()}a.getElements("a")[0].focus();if(b.onchange){Forms.selectedOption=c;b.onchange()}if(d){d.cancelBubble=true}return false},getLabel:function(e,d){var b=$("options"+e);var a=null;b.getChildren().each(function c(f){if(f.get("svalue")==d){a=f.get("slabel")}});return a},hideOptionsOnMouseDown:function(c){if(Forms.activeSelectId==null){return true}var b=$(c.target);var a=$("options"+Forms.activeSelectId);while(b!=null){if(b==a){return true}b=b.getParent()}Forms.hideOptions();return true},selectKeyDown:function(g,h){var d,a,f,b,c;switch(new Event(g).key){case"esc":if(Forms.activeSelectId){Forms.hideOptions()}return false;case"up":d=$("options"+h);a=$("input"+h);d.getElements("a").each(function(e){if(e.get("svalue")==a.get("value")){f=e}else{if(!f){c=e}}});if(c){Forms.selectOption(h,c)}return false;case"down":d=$("options"+h);a=$("input"+h);d.getElements("a").each(function(e){if(b){return}if(f){b=e}if(e.get("svalue")==a.get("value")){f=e}});if(b){Forms.selectOption(h,b)}return false}return true},toggleCheckbox:function(b,d){var a=$(b);var c=$("cb_"+b);if(a.get("value")==""){a.set("value",d);c.set("class","checkedcheckbox")}else{a.set("value","");c.set("class","checkbox")}if(a.onchange){a.onchange()}return false},checkboxKeyPress:function(b,a,c){if(!b){b=window.event}if(b.keyCode==32){Forms.toggleCheckbox(a,c);return false}return true},toggleRadio:function(d,b,c){var a=$$("input[name="+b+"]")[0];$$("div[class~=radio"+b+"]").removeClass("checked");$(d).addClass("checked");a.set("value",c);if(a.onchange){a.onchange()}return false}};function updateCaptcha(){document.getElementById("captchaImg").src=document.getElementById("captchaImg").src+1;return false}function changeAccumulation(a){if(!a){return}var b=a.value;$$(".accBlock").each(function(c){if(c.id=="acc"+b){c.setStyle("display","block")}else{c.setStyle("display","none")}})}function changeIncomeType(b){if(!b){return}var a=b.value;$$(".typeBlock").each(function(c){if(c.id=="type"+a){c.setStyle("display","block")}else{c.setStyle("display","none")}})}function confirmUpdate(c){var a;$("checkUpdates").set("value","true");var b=new Request({url:"save",method:"post",async:false,data:$(c).toQueryString(),onSuccess:function(d){a=d}}).send();$("checkUpdates").set("value","false");if(""==a){return true}return confirm(a+"\n\n"+confirmUpdateMessage)}function exportReport(a){document.getElementById("export").value="true";a.submit();document.getElementById("export").value="false";return false}Request.ScriptSafe=new Class({Extends:Request,processScripts:function(a){return a}});function updateRow(d,c){if(Browser.Engine.trident){var b=new Element("div");b.innerHTML="<table><tbody><tr>"+c+"</tr></tbody></table>";var a=b.getChildren()[0].getChildren()[0].getChildren()[0];d.swapNode(a);d=a}else{d.innerHTML=c}execJS(d)}var PopupEditor={hide:null,editor:null,activator:null,afterUpdate:null,edit:function(d,b,f,a,c){if(this.hide){this.hide()}if(this.activator){return false}this.activator=$(d);this.afterUpdate=c;var e=this.activator.get("html");this.activator.set("html",'<img class="inlineSpinner" src="/img/spinner.gif"/>');new Request.ScriptSafe({url:b,method:"get",async:true,onSuccess:function(i){var g=$$("body")[0];this.editor=new Element("div",{id:f,"class":a,html:i}).inject(g);var h=new Layer(this.editor);this.hide=function(){h.hide();this.activator.set("html",e);this.editor.dispose();this.hide=null;this.editor=null;this.activator=null;this.afterUpdate=null};if(i==""){this.hide();return}h.placeNear(this.activator);h.show();this.initEditor()}.bind(this)}).send();return false},reload:function(a,b){new Element("img",{style:"position: absolute; top: 8px; right: 10px",src:"/img/spinner.gif"}).inject(b);new Request.ScriptSafe({url:a,method:"get",async:true,onSuccess:function(c){this.editor.set("html",c);this.initEditor()}.bind(this)}).send()},initEditor:function(){this.editor.getElement("form").addEvent("keydown",this.key.bindWithEvent(this));this.editor.getElement("input[name=ok]").addEvent("click",this.ok.bindWithEvent(this));this.editor.getElement("input[name=cancel]").addEvent("click",this.cancel.bindWithEvent(this));if(!Browser.Engine.gecko){execJS(this.editor)}var a=this.editor.getElement(".editField");a.focus();if($("defaultValue",this.editor).get("value")!=""){a.select()}},key:function(a){if(a.key=="esc"){this.editor.getElement("input[name=cancel]").click();return false}if(a.key=="enter"){if(this.editor.hasClass("expressionValueEditor")&&a.control||a.shift){this.editor.getElement("input[name=ok]").click();return false}}return true},ok:function(){var editField=this.editor.getElement(".editField");var newValue=editField.value;var spinnerRefEl=this.editor.getElement("input[name=ok]").getNext();var spinnerEl=new Element("img",{"class":"spinner",src:"/img/spinner.gif"});new Request.ScriptSafe({async:true,method:"post",url:this.editor.getElement("form").get("action"),data:this.editor.getElement("form"),onRequest:function(r){spinnerEl.inject(spinnerRefEl,"after");spinnerRefEl.style.marginRight="0px"},onSuccess:function(r){spinnerEl.dispose();spinnerRefEl.style.marginRight="28px";if(r==""){window.location.reload()}else{if(r.indexOf("_error")==0){this.editor.getElement("ul").innerHTML="<li>"+r.substring(6)+"</li>"}else{if(r.indexOf("_update")==0){function getParent(el,tagName){if(el==null||el.tagName==tagName){return el}return getParent(el.parentNode,tagName)}var col=$(getParent(this.activator,"TD"));var colWidth=col.getSize().x-4;var colIdx=col.getParent().getChildren().indexOf(col);var row=getParent(this.activator,"TR");eval(r.substring(7));if(this.afterUpdate){this.afterUpdate()}row.getChildren()[colIdx].set("width",colWidth);this.hide()}else{this.editor.getElement("ul").innerHTML="<li>"+r+"</li>"}}}}.bind(this)}).send();return false},cancel:function(){this.hide();return false},toggleMoreSamples:function(b){var a=$(b).getParent(".popupEditor").getElement(".moreExpressionSamples");if(a.getStyle("display")=="none"){a.setStyle("display","block")}else{a.setStyle("display","none")}$(b).getParent(".popupEditor").getElement(".editField").focus();return false},clearDefaultValue:function(){$("defaultValue",this.editor).set("value","")}};function StoredExpressionEditor(){var c=null;function a(e){e=e.replace(decimalSeparator,".");return parseFloat(e)}function d(g){if(Math.round(g)==g){return""+g}var e;if(Math.round(g*10)==g*10){e=g.toFixed(1)}else{e=g.toFixed(2)}return e.replace(".",decimalSeparator)}this.save=function(){$("expression_"+c).set("value",$("editExpression").get("value"))};this.toggleCurrency=function(){if(!$("expressionCurrency").hasClass("enabled")){return true}var g=$("defaultValue").get("value");var k=$("optionspage.accountId").getElement("a[svalue="+$("inputpage.accountId").get("value")+"]");var e=$("currency_"+$("inputpage.accountId").get("value"));var j=$("targetCurrency");if(e.get("value")==j.get("name")){$("expressionCurrency").set("html",k.get("currency"));e.set("value",k.get("currencyId"));if(g!=""){var i=g;var h=a(g);h=h*parseFloat(k.get("rate"));i=d(h);$("editExpression").set("value",i);$("editExpression").select()}}else{$("expressionCurrency").set("html",j.get("value"));e.set("value",j.get("name"));if(g!=""){$("editExpression").set("value",g);$("editExpression").select()}}return true};function b(i){var e=$("defaultValue").get("value");if(e!=""){var h=e;if(i.get("rate")){var g=a(e);g=g*parseFloat(i.get("rate"));h=d(g)}$("editExpression").set("value",h);(function(){$("editExpression").select()}).delay(10)}}this.changeAccount=function(e){var f=$("defaultValue").get("value");if(f!=""){$("editExpression").set("value","")}if(c){$("expression_"+c).set("value",$("editExpression").get("value"))}c=e.get("value");var g=$("optionspage.accountId").getElement("a[svalue="+c+"]");$("editExpression").set("value",$("expression_"+c).get("value"));b(g);if($("currency_"+c).get("value")==$("targetCurrency").get("name")){$("expressionCurrency").set("html",$("targetCurrency").get("value"))}else{$("expressionCurrency").set("html",g.get("currency"))}if(g.get("rate")){$("expressionCurrency").addClass("enabled")}else{$("expressionCurrency").removeClass("enabled")}(function(){$("editExpression").focus()}).delay(10)};this.changeAccount($("inputpage.accountId"));return this}function Expense(d){var e={};var c;var g=function(){planner.send(new Request({url:"updateExpenseCompensation",method:"post",async:true,data:{expenseId:d.getAttribute("expenseId"),plannedDate:d.getAttribute("plannedDate"),firstEnvelopeIdx:this.first,envelopes:this.envelopes},evalResponse:true}))}.bind(this);var a=function(m){this.first=m;var k=$("expenseInfo");var j=planner.getEnvelope(m);var i=j.element.getElement("pre").innerHTML;var h=planner.getEnvelope(m+this.envelopes-1);var l=h.element.getElement("pre").innerHTML;$("beginDate",k).innerHTML=i.substring(0,i.indexOf("-"));$("endDate",k).innerHTML=l.substring(l.indexOf("-")+1)}.bind(this);var b=function(h){this.envelopes=h;var j=$("expenseInfo");$("perEnvelope",j).innerHTML=formatPrice(f())+" "+currency;var i=planner.getEnvelope(this.first+this.envelopes-1);var k=i.element.getElement("pre").innerHTML;$("endDate",j).innerHTML=k.substring(k.indexOf("-")+1)}.bind(this);var f=function(){return Math.round(this.size/this.envelopes).toInt()}.bind(this);e.startDragRight=function(h){this.select();document.addEvent("mouseup",e.stopDrag);document.addEvent("mousemove",e.dragRight);$("planner").setStyle("cursor","e-resize");d.setStyle("cursor","e-resize");h.stop()}.bindWithEvent(this);e.startDragLeft=function(h){this.select();document.addEvent("mouseup",e.stopDrag);document.addEvent("mousemove",e.dragLeft);$("planner").setStyle("cursor","w-resize");d.setStyle("cursor","w-resize");h.stop()}.bindWithEvent(this);e.startMove=function(h){this.select();document.addEvent("mouseup",e.stopDrag);document.addEvent("mousemove",e.move);$("planner").setStyle("cursor","move");c=planner.getEnvelopeIndex(h)}.bindWithEvent(this);e.stopDrag=function(h){document.removeEvent("mouseup",e.stopDrag);document.removeEvent("mousemove",e.dragRight);document.removeEvent("mousemove",e.dragLeft);document.removeEvent("mousemove",e.move);c=null;planner.alreadyScrolled=false;$("planner").setStyle("cursor","");d.setStyle("cursor","move")}.bindWithEvent(this);e.dragRight=function(j){if(planner.stopMoving||planner.alreadyScrolled){return}var h=planner.getEnvelopeIndex(j);if(h==null){return}var i=h-this.first+1;if(i<1){return}if(this.envelopes!=i){if(this.first+i>(planner.settings.firstVisibleEnvelope+planner.settings.maxVisibleEnvelopes)){planner.scrollRight()}b(i);planner.calculateExpenseLevels();g()}}.bindWithEvent(this);e.dragLeft=function(j){if(planner.stopMoving||planner.alreadyScrolled){return}var h=planner.getEnvelopeIndex(j);if(h==null){return}var i=this.envelopes-(h-this.first);if(i<1){return}if(this.envelopes!=i){if(h<planner.settings.firstVisibleEnvelope){planner.scrollLeft()}b(i);a(h);planner.calculateExpenseLevels();g()}}.bindWithEvent(this);e.move=function(i){if(planner.stopMoving||planner.alreadyScrolled){return}var h=planner.getEnvelopeIndex(i);if(h==null){return}var j=this.first+(h-c);if(this.first!=j){if(j<planner.settings.firstVisibleEnvelope){planner.scrollLeft()}if(j+this.envelopes>(planner.settings.firstVisibleEnvelope+planner.settings.maxVisibleEnvelopes)){planner.scrollRight()}c=h;a(j);planner.calculateExpenseLevels();g()}}.bindWithEvent(this);e.click=function(h){this.select();h.stop()}.bindWithEvent(this);this.getLastEnvelope=function(){return this.first+this.envelopes-1};this.getSelectKey=function(){return d.getAttribute("id")};this.select=function(){if(!planner.select(d)){return}var k=planner.getEnvelope(this.first);var j=k.element.getElement("pre").innerHTML;var h=planner.getEnvelope(this.getLastEnvelope());var l=h.element.getElement("pre").innerHTML;var i="<h3>"+plannerLocale.plannedExpense+'</h3><p class="name"><a href="'+d.getAttribute("editLink")+'" title="'+plannerLocale.editExpenseTitle+'">'+d.getAttribute("name")+'</a></p><p><b class="price">'+d.getAttribute("formattedPrice")+"</b> "+plannerLocale.onDate+' <b id="date">'+d.getAttribute("formattedDate")+"</b></p><br/><p>"+plannerLocale.compensation+' <b id="perEnvelope">'+formatPrice(f())+" "+currency+"</b>/"+plannerLocale.week+'</p><p style="text-align: center;">'+plannerLocale.from+' <b id="beginDate">'+j.substring(0,j.indexOf("-"))+"</b> "+plannerLocale.to+' <b id="endDate">'+l.substring(l.indexOf("-")+1)+"</b></p>";
$("selectedObjectDetails").set("class","block expenseInfo");$("selectedObjectDetails").getElement(".block-m").set("html",i)};this.getHeight=function(){var i=envelopeSize;if(i==0){i=f()*2}var h=Math.round(planner.settings.envelopeBodyHeight*(f()/i)).toInt();if(h==0){h=1}return h};this.position=function(){var i=planner.settings.envelopeWidth*this.envelopes-1;d.setStyle("width",i+"px");d.setStyle("height",this.getHeight()+"px");var h=$("envelope"+this.first);if(!h){d.setStyle("display","none")}else{d.setStyle("left",h.offsetLeft+1+"px");d.setStyle("top",(planner.settings.envelopeHeaderHeight+planner.settings.envelopeTop+planner.settings.envelopeBodyHeight-this.getHeight()-this.level)+"px")}};this.first=d.getAttribute("first").toInt();this.size=d.getAttribute("size").toInt();this.envelopes=d.getAttribute("envelopes").toInt();d.setStyle("background-color",d.getAttribute("color"));d.getElement("b").addEvent("mousedown",e.startDragLeft);d.getElement("i").addEvent("mousedown",e.startDragRight);d.addEvent("mousedown",e.startMove);d.addEvent("click",e.click);d.title=d.getAttribute("name")+" - "+d.getAttribute("formattedPrice")}function Envelope(d){function c(){if(!planner.select(this)){return}planner.send(new Request({url:"getFixed",method:"get",async:true,data:{envelopeIdx:this.envelopeIdx,tagName:this.tagName},onSuccess:function(h){$("selectedObjectDetails").set("class","block fixedExpenseInfo");$("selectedObjectDetails").getElement(".block-m").set("html",h)}}))}function a(){planner.select(this.element);var h=$("selectedObjectDetails");planner.send(new Request.HTML({url:"explainEnvelope",method:"get",async:true,data:{envelopeIdx:this.getIdx()},update:h.getElement(".block-m"),onSuccess:function(i){h.set("class","block explainEnvelope")}}))}this.match=function(h){var i=this.element.getCoordinates([planner.element]);if(Browser.Engine.trident){i.left+=planner.element.scrollLeft;i.right+=planner.element.scrollLeft}if(i.left<=h.x&&i.right>=h.x&&i.top<=h.y&&i.bottom>=h.y){return true}return false};this.getIdx=function(){var h=this.element.id;return h.substring("envelope".length).toInt()};this.element=d;this.element.setStyle("left",planner.settings.firstEnvelopePos.left+planner.settings.envelopeWidth*this.getIdx());this.element.setStyle("top",planner.settings.envelopeTop);var e=d.getElement("b em");if(e){e.envelopeIdx=this.getIdx();e.addEvent("click",c.bind(e));e.title=plannerLocale.regularTitle+" - "+e.getAttribute("price")}var f=d.getElement("b q");f.envelopeIdx=this.getIdx();f.addEvent("click",c.bind(f));f.title=plannerLocale.goalsTitle+" - "+f.getAttribute("price");if(!d.getElement("i").hasClass("before")){var b=d.getElement("i s");b.addEvent("click",a.bind(this))}var g=d.getElement("a");if(g){g.title=plannerLocale.editEnvelope}}function Planner(a){this.calculateExpenseLevels=function(){this.expenses.each(function(d){d.level=null});this.expenses.each(function(e){var f=0;var d=true;while(d){d=false;planner.expenses.each(function(g){if(d){return}if(g.level!=null&&g.getLastEnvelope()>=e.first&&g.first<=e.getLastEnvelope()){if((g.level>=f&&g.level<f+e.getHeight())||(g.level+g.getHeight()>f&&g.level+g.getHeight()<f+e.getHeight())){f=g.level+g.getHeight();d=true}}})}e.level=f;e.position()})},this.getEnvelopeIndex=function(e){var d=null;this.envelopes.each(function(f){if(f.match(e.page)){d=f.getIdx()}});return d};this.getLastEnvelope=function(){var d=null;this.envelopes.each(function(e){if(d==null||e.getIdx()>d.getIdx()){d=e}});return d};this.getEnvelope=function(d){var e=null;this.envelopes.each(function(f){if(f.getIdx()==d){e=f}});return e};this.addEnvelope=function(d){this.envelopes.push(d)};this.updateVip=function(){if(this.settings.firstVisibleEnvelope>=a){$("planner").getElement("h3 small .vip").setStyle("display","inline")}else{$("planner").getElement("h3 small .vip").setStyle("display","none")}};function c(){return $("planner").getElement("h3 small .vip").getStyle("display")!="none"}this.scrollRight=function(){if(this.alreadyScrolled){return}if(c()){return}this.alreadyScrolled=true;var d=this.settings.firstVisibleEnvelope+this.settings.maxVisibleEnvelopes;if(this.getEnvelope(d)==null){return}this.settings.firstVisibleEnvelope++;this.scroll.start(this.settings.firstEnvelopePos.left+this.settings.firstVisibleEnvelope*this.settings.envelopeWidth-1,0);this.updateVip()};this.scrollLeft=function(){if(this.alreadyScrolled){return}this.alreadyScrolled=true;var d=this.settings.firstVisibleEnvelope-1;if(this.getEnvelope(d)==null){return}this.settings.firstVisibleEnvelope--;this.scroll.start(this.settings.firstEnvelopePos.left+this.settings.firstVisibleEnvelope*this.settings.envelopeWidth-1,0);this.updateVip()};this.toggleRemaining=function(d){planner.send(new Request({url:"toggleRemaining",method:"post",async:true,data:{envelopeIdx:d}}));return false};this.selectExpense=function(d){this.expenses.each(function(e){if(e.getSelectKey()==d){e.select()}})};this.select=function(d){$$(".hint").setStyle("visibility","hidden");if(d==this.selectedObject){return false}if(this.selectedObject!=null){this.selectedObject.removeClass("selected")}this.selectedObject=d;this.selectedObject.addClass("selected");$("selectedObjectDetails").setStyle("display","block");return true};var b=new Request.Queue({stopOnFailure:false});this.send=function(d){b.addRequest(Math.random(),d);d.send()};planner=this;this.element=$("field");this.stopMoving=false;this.alreadyScrolled=false;this.settings={envelopeWidth:112,envelopeBodyHeight:224,envelopeTop:0,maxVisibleEnvelopes:5,envelopeHeaderHeight:48+8,firstEnvelopePos:{left:(1+112*envelopeBufferSize),top:0},firstVisibleEnvelope:0};this.envelopes=new Array();document.getElements(".envelope").each(function(d){var e=new Envelope(d);this.addEnvelope(e)}.bind(this));this.element.setStyle("display","");this.expenses=new Array();document.getElements(".expense").each(function(d){var e=new Expense(d);this.expenses.push(e)}.bind(this));this.calculateExpenseLevels();this.scroll=new Fx.Scroll(this.element,{duration:500,transition:Fx.Transitions.Expo.easeInOut,onStart:function(){planner.stopMoving=true},onComplete:function(){planner.stopMoving=false}});this.element.scrollTo(this.settings.firstEnvelopePos.left-1,0);if(window.ActiveXObject){this.element.onselectstart=function(){return false}}else{this.element.style.MozUserSelect="none"}this.element.setStyle("display","");this.updateVip()}afterAjaxUpdate=function(){};function AjaxComponent(a){this.componentName=a;this.element=$(a);this.element.ajaxComponent=this;this.isRunning=false;this.update=function(b){this.element.parentNode.insertBefore(b,this.element);this.element.parentNode.removeChild(this.element);this.element=b;this.element.ajaxComponent=this};this.exec=function(h,c){if(this.isRunning){return}this.isRunning=true;if(!c){c={}}var g;if(c.spinnerRefEl){g=new Element("img",{"class":"spinner",src:"/img/spinner.gif"});c.spinnerRefEl.style.marginRight="0px";g.inject(c.spinnerRefEl,"after")}var e="";if(c.data){var f=$(c.data).toQueryString();if(f!=""){var b=-1;while((b=f.indexOf("&",b))!=-1){f=f.substring(0,b+1)+"component."+f.substring(b+1);b=b+1}e=e+"&component."+f}}var d=new Request({url:"/ajc/"+this.componentName+"/"+h,onComplete:function(){if(c.spinnerRefEl){g.dispose();c.spinnerRefEl.style.marginRight="28px"}this.isRunning=false}.bind(this),onCancel:function(){if(c.spinnerRefEl){g.dispose();c.spinnerRefEl.style.marginRight="28px"}this.isRunning=false}.bind(this),onSuccess:function(j){if("reloadPage"==j){window.location.reload();return}var i=new Element("div",{html:j});i.getChildren().each(function(k){var l=k.id;$(l).ajaxComponent.update(k)});afterAjaxUpdate()}}).send(e)}.bind(this)}MooTools.More={version:"1.2.2.2"};Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(b,a){this.element=this.subject=$(b);this.parent(a);var d=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body)}var c=this.element;if(this.options.wheelStops){this.addEvent("start",function(){c.addEvent("mousewheel",d)},true);this.addEvent("complete",function(){c.removeEvent("mousewheel",d)},true)}},set:function(){var a=Array.flatten(arguments);this.element.scrollTo(a[0],a[1])},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a)})},start:function(c,h){if(!this.check(c,h)){return this}var e=this.element.getSize(),f=this.element.getScrollSize();var b=this.element.getScroll(),d={x:c,y:h};for(var g in d){var a=f[g]-e[g];if($chk(d[g])){d[g]=($type(d[g])=="number")?d[g].limit(0,a):a}else{d[g]=b[g]}d[g]+=this.options.offset[g]}return this.parent([b.x,b.y],[d.x,d.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(b){var a=$(b).getPosition(this.element);return this.start(a.x,a.y)}});Request.Queue=new Class({Implements:[Options,Events],Binds:["attach","request","complete","cancel","success","failure","exception"],options:{stopOnFailure:true,autoAdvance:true,concurrent:1,requests:{}},initialize:function(a){this.setOptions(a);this.requests=new Hash;this.addRequests(this.options.requests);this.queue=[];this.reqBinders={}},addRequest:function(a,b){this.requests.set(a,b);this.attach(a,b);return this},addRequests:function(a){$each(a,function(c,b){this.addRequest(b,c)},this);return this},getName:function(a){return this.requests.keyOf(a)},attach:function(a,b){if(b._groupSend){return this}["request","complete","cancel","success","failure","exception"].each(function(c){if(!this.reqBinders[a]){this.reqBinders[a]={}}this.reqBinders[a][c]=function(){this["on"+c.capitalize()].apply(this,[a,b].extend(arguments))}.bind(this);b.addEvent(c,this.reqBinders[a][c])},this);b._groupSend=b.send;b.send=function(c){this.send(a,c);return b}.bind(this);return this},removeRequest:function(b){var a=$type(b)=="object"?this.getName(b):b;if(!a&&$type(a)!="string"){return this}b=this.requests.get(a);if(!b){return this}["request","complete","cancel","success","failure","exception"].each(function(c){b.removeEvent(c,this.reqBinders[a][c])},this);b.send=b._groupSend;delete b._groupSend;return this},getRunning:function(){return this.requests.filter(function(a){return a.running})},isRunning:function(){return !!this.getRunning().getKeys().length},send:function(b,a){var c=function(){this.requests.get(b)._groupSend(a);this.queue.erase(c)}.bind(this);c.name=b;if(this.getRunning().getKeys().length>=this.options.concurrent||(this.error&&this.options.stopOnFailure)){this.queue.push(c)}else{c()}return this},hasNext:function(a){return(!a)?!!this.queue.length:!!this.queue.filter(function(b){return b.name==a}).length},resume:function(){this.error=false;(this.options.concurrent-this.getRunning().getKeys().length).times(this.runNext,this);return this},runNext:function(a){if(!this.queue.length){return this}if(!a){this.queue[0]()}else{var b;this.queue.each(function(c){if(!b&&c.name==a){b=true;c()}})}return this},runAll:function(){this.queue.each(function(a){a()});return this},clear:function(a){if(!a){this.queue.empty()}else{this.queue=this.queue.map(function(b){if(b.name!=a){return b}else{return false}}).filter(function(b){return b})}return this},cancel:function(a){this.requests.get(a).cancel();return this},onRequest:function(){this.fireEvent("request",arguments)},onComplete:function(){this.fireEvent("complete",arguments)},onCancel:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("cancel",arguments)},onSuccess:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("success",arguments)},onFailure:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("failure",arguments)},onException:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("exception",arguments)}});