﻿Calendar=function(c,b,f,e){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=f||null;this.onClose=e||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=false;this.firstDayOfWeek=typeof c=="number"?c:Calendar._FD;this.showsOtherMonths=false;this.dateStr=b;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 a=new Array();for(var d=8;d>0;){a[--d]=Calendar._DN[d].substr(0,Calendar._SDN_len)}Calendar._SDN=a;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}a=new Array();for(var d=12;d>0;){a[--d]=Calendar._MN[d].substr(0,Calendar._SMN_len)}Calendar._SMN=a}};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(a){var d=0,e=0;var b=/^div$/i.test(a.tagName);if(b&&a.scrollLeft){d=a.scrollLeft}if(b&&a.scrollTop){e=a.scrollTop}var c={x:a.offsetLeft-d,y:a.offsetTop-e};if(a.offsetParent){var f=this.getAbsolutePos(a.offsetParent);c.x+=f.x;c.y+=f.y}return c};Calendar.isRelated=function(a,b){var c=b.relatedTarget;if(!c){var d=b.type;if(d=="mouseover"){c=b.fromElement}else{if(d=="mouseout"){c=b.toElement}}}while(c){if(c==a){return true}c=c.parentNode}return false};Calendar.removeClass=function(d,b){if(!(d&&d.className)){return}var c=d.className.split(" ");var a=new Array();for(var e=c.length;e>0;){if(c[--e]!=b){a[a.length]=c[e]}}d.className=a.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,b,c){if(a.attachEvent){a.attachEvent("on"+b,c)}else{if(a.addEventListener){a.addEventListener(b,c,true)}else{a["on"+b]=c}}};Calendar.removeEvent=function(a,b,c){if(a.detachEvent){a.detachEvent("on"+b,c)}else{if(a.removeEventListener){a.removeEventListener(b,c,true)}else{a["on"+b]=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 a=Calendar._C;if(!a){return false}var a=a;var b=a.activeDiv;var c=a.monthsCombo;if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}if(a.activeMonth){Calendar.removeClass(a.activeMonth,"active")}var e=a.monthsCombo.getElementsByTagName("div")[a.date.getMonth()];Calendar.addClass(e,"active");a.activeMonth=e;var f=c.style;f.display="block";if(b.navtype<0){f.left=b.offsetLeft+"px"}else{var d=c.offsetWidth;if(typeof d=="undefined"){d=50}f.left=(b.offsetLeft+b.offsetWidth-d)+"px"}f.top=(b.offsetTop+b.offsetHeight)+"px"};Calendar.showYearsCombo=function(c){var a=Calendar._C;if(!a){return false}var a=a;var b=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 e=a.date.getFullYear()+(c?1:-1);var h=f.firstChild;var k=false;for(var d=12;d>0;--d){if(e>=a.minYear&&e<=a.maxYear){h.innerHTML=e;h.year=e;h.style.display="block";k=true}else{h.style.display="none"}h=h.nextSibling;e+=c?a.yearStep:-a.yearStep}if(k){var j=f.style;j.display="block";if(b.navtype<0){j.left=b.offsetLeft+"px"}else{var g=f.offsetWidth;if(typeof g=="undefined"){g=50}j.left=(b.offsetLeft+b.offsetWidth-g)+"px"}j.top=(b.offsetTop+b.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(g){var a=Calendar._C;if(!a){return}var f=a.activeDiv;var o=Calendar.getTargetElement(g);if(o==f||o.parentNode==f){Calendar.addClass(f,"hilite active");Calendar.addClass(f.parentNode,"rowhilite")}else{if(typeof f.navtype=="undefined"||(f.navtype!=50&&(f.navtype==0||Math.abs(f.navtype)>2))){Calendar.removeClass(f,"active")}Calendar.removeClass(f,"hilite");Calendar.removeClass(f.parentNode,"rowhilite")}g||(g=window.event);if(f.navtype==50&&o!=f){var m=Calendar.getAbsolutePos(f);var p=f.offsetWidth;var q=g.clientX;var e;var d=true;if(q>m.x+p){e=q-m.x-p;d=false}else{e=m.x-q}if(e<0){e=0}var n=f._range;var c=f._current;var b=Math.floor(e/10)%n.length;for(var h=n.length;--h>=0;){if(n[h]==c){break}}while(b-->0){if(d){if(--h<0){h=n.length-1}}else{if(++h>=n.length){h=0}}}var l=n[h];f.innerHTML=l;a.onUpdateTime()}var k=Calendar.findMonth(o);if(k){if(k.month!=a.date.getMonth()){if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}Calendar.addClass(k,"hilite");a.hilitedMonth=k}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}}}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}var j=Calendar.findYear(o);if(j){if(j.year!=a.date.getFullYear()){if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}Calendar.addClass(j,"hilite");a.hilitedYear=j}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}return Calendar.stopEvent(g)};Calendar.tableMouseDown=function(a){if(Calendar.getTargetElement(a)==Calendar.getElement(a)){return Calendar.stopEvent(a)}};Calendar.calDragIt=function(b){var a=Calendar._C;if(!(a&&a.dragging)){return false}var d;var c;if(Calendar.is_ie){c=window.event.clientY+document.body.scrollTop;d=window.event.clientX+document.body.scrollLeft}else{d=b.pageX;c=b.pageY}a.hideShowCovered();var e=a.element.style;e.left=(d-a.xOffs)+"px";e.top=(c-a.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)}}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")}return stopEvent(ev)}};Calendar.cellClick=function(e,f){var a=e.calendar;var b=false;var k=false;var d=null;if(typeof e.navtype=="undefined"){if(a.currentDateEl){Calendar.removeClass(a.currentDateEl,"selected");Calendar.addClass(e,"selected");b=(a.currentDateEl==e);if(!b){a.currentDateEl=e}}a.date.setDateOnly(e.caldate);d=a.date;var m=!(a.dateClicked=!e.otherMonth);if(!m&&!a.currentDateEl){a._toggleMultipleDate(new Date(d))}else{k=!e.disabled}if(m){a._init(a.firstDayOfWeek,d)}}else{if(e.navtype==200){Calendar.removeClass(e,"hilite");a.callCloseHandler();return}d=new Date(a.date);if(e.navtype==0){d.setDateOnly(new Date())}a.dateClicked=false;var h=d.getFullYear();var j=d.getMonth();function o(q){var i=d.getDate();var r=d.getMonthDays(q);if(i>r){d.setDate(r)}d.setMonth(q)}switch(e.navtype){case 400:Calendar.removeClass(e,"hilite");var p=Calendar._TT.ABOUT;if(typeof p!="undefined"){p+=a.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(h>a.minYear){d.setFullYear(h-1)}break;case -1:if(j>0){o(j-1)}else{if(h-->a.minYear){d.setFullYear(h);o(11)}}break;case 1:if(j<11){o(j+1)}else{if(h<a.maxYear){d.setFullYear(h+1);o(0)}}break;case 2:if(h<a.maxYear){d.setFullYear(h+1)}break;case 100:a.setFirstDayOfWeek(e.fdow);return;case 50:var n=e._range;var c=e.innerHTML;for(var g=n.length;--g>=0;){if(n[g]==c){break}}if(f&&f.shiftKey){if(--g<0){g=n.length-1}}else{if(++g>=n.length){g=0}}var l=n[g];e.innerHTML=l;a.onUpdateTime();return;case 0:if((typeof a.getDateStatus=="function")&&a.getDateStatus(d,d.getFullYear(),d.getMonth(),d.getDate())){return false}break}if(!d.equalsTo(a.date)){a.setDate(d);k=true}else{if(e.navtype==0){k=b=true}}}if(k){f&&a.callHandler()}if(b){Calendar.removeClass(e,"hilite");f&&a.callCloseHandler()}};Calendar.prototype.create=function(a){var l=null;if(!a){l=document.getElementsByTagName("body")[0];this.isPopup=true}else{l=a;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var n=Calendar.createElement("table");this.table=n;n.cellSpacing=0;n.cellPadding=0;n.calendar=this;Calendar.addEvent(n,"mousedown",Calendar.tableMouseDown);var d=Calendar.createElement("div");this.element=d;d.className="calendar";if(this.isPopup){d.style.position="absolute";d.style.display="none"}d.appendChild(n);var p=Calendar.createElement("thead",n);var c=null;var m=null;var b=this;var e=function(r,i,j){c=Calendar.createElement("td",m);c.colSpan=i;c.className="button";if(j!=0&&Math.abs(j)<=2){c.className+=" nav"}Calendar._add_evs(c);c.calendar=b;c.navtype=j;c.innerHTML="<div unselectable='on'>"+r+"</div>";return c};m=Calendar.createElement("tr",p);this._nav_pm=e("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;var q=4;(this.isPopup)&&--q;(this.weekNumbers)&&++q;this.title=e("",q+1,300);this.title.className="title";this._nav_nm=e("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";e("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}m=Calendar.createElement("tr",p);m.className="headrow";m=Calendar.createElement("tr",p);m.className="daynames";if(this.weekNumbers){c=Calendar.createElement("td",m);c.className="name wn";c.innerHTML=Calendar._TT.WK}for(var f=7;f>0;--f){c=Calendar.createElement("td",m);if(!f){c.navtype=100;c.calendar=this;Calendar._add_evs(c)}}this.firstdayname=(this.weekNumbers)?m.firstChild.nextSibling:m.firstChild;this._displayWeekdays();var o=Calendar.createElement("tbody",n);this.tbody=o;for(f=6;f>0;--f){m=Calendar.createElement("tr",o);if(this.weekNumbers){c=Calendar.createElement("td",m)}for(var h=7;h>0;--h){c=Calendar.createElement("td",m);c.calendar=this;Calendar._add_evs(c)}}if(this.showsTime){m=Calendar.createElement("tr",o);m.className="time";c=Calendar.createElement("td",m);c.className="time";c.colSpan=2;c.innerHTML=Calendar._TT.TIME||"&nbsp;";c=Calendar.createElement("td",m);c.className="time";c.colSpan=this.weekNumbers?4:3;(function(){function t(y,A,D,C){var B=Calendar.createElement("span",c);B.className=y;B.innerHTML=A;B.calendar=b;B.ttip=Calendar._TT.TIME_PART;B.navtype=50;B._range=[];if(typeof D!="number"){B._range=D}else{for(var z=D;z<=C;++z){var E;if(z<10&&C>=10){E="0"+z}else{E=""+z}B._range[B._range.length]=E}}Calendar._add_evs(B);return B}var r=b.date.getHours();var u=b.date.getMinutes();var x=!b.time24;var v=(r>12);if(x&&v){r-=12}var j=t("hour",r,x?1:0,x?12:23);var w=Calendar.createElement("span",c);w.innerHTML=":";w.className="colon";var s=t("minute",u,0,59);var i=null;c=Calendar.createElement("td",m);c.className="time";c.colSpan=2;if(x){i=t("ampm",v?"pm":"am",["am","pm"])}else{c.innerHTML="&nbsp;"}b.onSetTime=function(){var A,y=this.date.getHours(),z=this.date.getMinutes();if(x){A=(y>=12);if(A){y-=12}if(y==0){y=12}i.innerHTML=A?"pm":"am"}j.innerHTML=(y<10)?("0"+y):y;s.innerHTML=(z<10)?("0"+z):z};b.onUpdateTime=function(){var A=this.date;var B=parseInt(j.innerHTML,10);if(x){if(/pm/i.test(i.innerHTML)&&B<12){B+=12}else{if(/am/i.test(i.innerHTML)&&B==12){B=0}}}var z=A.getDate();var D=A.getMonth();var C=A.getFullYear();A.setHours(B);A.setMinutes(parseInt(s.innerHTML,10));A.setFullYear(C);A.setMonth(D);A.setDate(z);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}d=Calendar.createElement("div",this.element);this.monthsCombo=d;d.className="combo";for(f=0;f<Calendar._MN.length;++f){var k=Calendar.createElement("div");k.className=Calendar.is_ie?"label-IEfix":"label";k.month=f;k.innerHTML=Calendar._SMN[f];d.appendChild(k)}d=Calendar.createElement("div",this.element);this.yearsCombo=d;d.className="combo";for(f=12;f>0;--f){var g=Calendar.createElement("div");g.className=Calendar.is_ie?"label-IEfix":"label";d.appendChild(g)}this._init(this.firstDayOfWeek,this.date);l.appendChild(this.element)};Calendar._keyEvent=function(d){var b=window._dynarch_popupCalendar;if(!b||b.multiple){return false}(Calendar.is_ie)&&(d=window.event);var a=(Calendar.is_ie||d.type=="keypress"),f=d.keyCode;if(d.ctrlKey){switch(f){case 37:a&&Calendar.cellClick(b._nav_pm);break;case 38:a&&Calendar.cellClick(b._nav_py);break;case 39:a&&Calendar.cellClick(b._nav_nm);break;case 40:a&&Calendar.cellClick(b._nav_ny);break;default:return false}}else{switch(f){case 32:Calendar.cellClick(b._nav_now);break;case 27:a&&b.callCloseHandler();break;case 37:case 38:case 39:case 40:if(a){var i,m,e,g,c,l;i=f==37||f==38;l=(f==37||f==39)?1:7;function k(){c=b.currentDateEl;var n=c.pos;m=n&15;e=n>>4;g=b.ar_days[e][m]}k();function j(){var n=new Date(b.date);n.setDate(n.getDate()-l);b.setDate(n)}function h(){var n=new Date(b.date);n.setDate(n.getDate()+l);b.setDate(n)}while(1){switch(f){case 37:if(--m>=0){g=b.ar_days[e][m]}else{m=6;f=38;continue}break;case 38:if(--e>=0){g=b.ar_days[e][m]}else{j();k()}break;case 39:if(++m<7){g=b.ar_days[e][m]}else{m=0;f=40;continue}break;case 40:if(++e<b.ar_days.length){g=b.ar_days[e][m]}else{h();k()}break}break}if(g){if(!g.disabled){Calendar.cellClick(g)}else{if(i){j()}else{h()}}}}break;case 13:if(a){Calendar.cellClick(b.currentDateEl,d)}break;default:return false}}return Calendar.stopEvent(d)};Calendar.prototype._init=function(h,e){var y=new Date(),w=y.getFullYear(),x=y.getMonth(),v=y.getDate();this.table.style.visibility="hidden";var n=e.getFullYear();if(n<this.minYear){n=this.minYear;e.setFullYear(n)}else{if(n>this.maxYear){n=this.maxYear;e.setFullYear(n)}}this.firstDayOfWeek=h;this.date=new Date(e);var r=e.getMonth();var p=e.getDate();var s=e.getMonthDays();e.setDate(1);var d=(e.getDay()-this.firstDayOfWeek)%7;if(d<0){d+=7}e.setDate(-d);e.setDate(e.getDate()+1);var t=this.tbody.firstChild;var q=Calendar._SMN[r];var a=this.ar_days=new Array();var A=Calendar._TT.WEEKEND;var f=this.multiple?(this.datesCells={}):null;for(var l=0;l<6;++l,t=t.nextSibling){var b=t.firstChild;if(this.weekNumbers){b.className="day wn";b.innerHTML=e.getWeekNumber();b=b.nextSibling}t.className="daysrow";var k=false,m,g=a[l]=[];for(var o=0;o<7;++o,b=b.nextSibling,e.setDate(m+1)){m=e.getDate();var z=e.getDay();b.className="day";b.pos=l<<4|o;g[o]=b;var c=(e.getMonth()==r);if(!c){if(this.showsOtherMonths){b.className+=" othermonth";b.otherMonth=true}else{b.className="emptycell";b.innerHTML="&nbsp;";b.disabled=true;continue}}else{b.otherMonth=false;k=true}b.disabled=false;b.innerHTML=this.getDateText?this.getDateText(e,m):m;if(f){f[e.print("%Y%m%d")]=b}if(this.getDateStatus){var u=this.getDateStatus(e,n,r,m);if(u===true){b.className+=" disabled";b.disabled=true}else{if(/disabled/i.test(u)){b.disabled=true}b.className+=" "+u}}if(!b.disabled){b.caldate=new Date(e);b.ttip="_";if(!this.multiple&&c&&m==p&&this.hiliteToday){b.className+=" selected";this.currentDateEl=b}if(e.getFullYear()==w&&e.getMonth()==x&&m==v){b.className+=" today";b.ttip+=Calendar._TT.PART_TODAY}if(A.indexOf(z.toString())!=-1){b.className+=b.otherMonth?" oweekend":" weekend"}}}if(!(k||this.showsOtherMonths)){t.className="emptyrow"}}this.title.innerHTML=Calendar._MN[r]+", "+n;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var c in this.multiple){var a=this.datesCells[c];var b=this.multiple[c];if(!b){continue}if(a){a.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(c){if(this.multiple){var e=c.print("%Y%m%d");var a=this.datesCells[e];if(a){var b=this.multiple[e];if(!b){Calendar.addClass(a,"selected");this.multiple[e]=c}else{Calendar.removeClass(a,"selected");delete this.multiple[e]}}}};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(c){var a=window._dynarch_popupCalendar;if(!a){return false}var b=Calendar.is_ie?Calendar.getElement(c):Calendar.getTargetElement(c);for(;b!=null&&b!=a.element;b=b.parentNode){}if(b==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(c)}};Calendar.prototype.show=function(){var f=this.table.getElementsByTagName("tr");for(var c=f.length;c>0;){var e=f[--c];Calendar.removeClass(e,"rowhilite");var b=e.getElementsByTagName("td");for(var d=b.length;d>0;){var a=b[--d];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(c,a){var b=this.element.style;b.left=c+"px";b.top=a+"px";this.show()};Calendar.prototype.showAtElement=function(a,c){var e=this;var d=Calendar.getAbsolutePos(a);if(!c||typeof c!="string"){this.showAt(d.x,d.y+a.offsetHeight);return true}function b(f){if(f.x<0){f.x=0}if(f.y<0){f.y=0}var h=document.createElement("div");var i=h.style;i.position="absolute";i.right=i.bottom=i.width=i.height="0px";document.body.appendChild(h);var g=Calendar.getAbsolutePos(h);document.body.removeChild(h);if(Calendar.is_ie){g.y+=document.body.scrollTop;g.x+=document.body.scrollLeft}else{g.y+=window.scrollY;g.x+=window.scrollX}var j=f.x+f.width-g.x;if(j>0){f.x-=j}j=f.y+f.height-g.y;if(j>0){f.y-=j}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var j=e.element.offsetWidth;var f=e.element.offsetHeight;e.element.style.display="none";var i=c.substr(0,1);var g="l";if(c.length>1){g=c.substr(1,1)}switch(i){case"T":d.y-=f;break;case"B":d.y+=a.offsetHeight;break;case"C":d.y+=(a.offsetHeight-f)/2;break;case"t":d.y+=a.offsetHeight-f;break;case"b":break}switch(g){case"L":d.x-=j;break;case"R":d.x+=a.offsetWidth;break;case"C":d.x+=(a.offsetWidth-j)/2;break;case"l":d.x+=a.offsetWidth-j;break;case"r":break}d.width=j;d.height=f+40;e.monthsCombo.style.display="none";b(d);e.showAt(d.x,d.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 n(i){var k=i.style.visibility;if(!k){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){k=document.defaultView.getComputedStyle(i,"").getPropertyValue("visibility")}else{k=""}}else{if(i.currentStyle){k=i.currentStyle.visibility}else{k=""}}}return k}var s=new Array("applet","iframe","select");var j=this.element;var r=Calendar.getAbsolutePos(j);var l=r.x;var m=j.offsetWidth+l;var g=r.y;var h=j.offsetHeight+g;for(var q=s.length;q>0;){var a=document.getElementsByTagName(s[--q]);var b=null;for(var o=a.length;o>0;){b=a[--o];r=Calendar.getAbsolutePos(b);var e=r.x;var f=b.offsetWidth+e;var c=r.y;var d=b.offsetHeight+c;if(this.hidden||(e>m)||(f<l)||(c>h)||(d<g)){if(!b.__msh_save_visibility){b.__msh_save_visibility=n(b)}b.style.visibility=b.__msh_save_visibility}else{if(!b.__msh_save_visibility){b.__msh_save_visibility=n(b)}b.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var b=this.firstDayOfWeek;var a=this.firstdayname;var e=Calendar._TT.WEEKEND;for(var c=0;c<7;++c){a.className="day name";var d=(c+b)%7;if(c){a.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[d]);a.navtype=100;a.calendar=this;a.fdow=d;Calendar._add_evs(a)}if(e.indexOf(d.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(q,g){var s=new Date();var l=0;var o=-1;var f=0;var c=q.split(/\W+/);var e=g.match(/%./g);var k=0,n=0;var h=0;var p=0;for(k=0;k<c.length;++k){if(!c[k]){continue}switch(e[k]){case"%d":case"%e":f=parseInt(c[k],10);break;case"%m":o=parseInt(c[k],10)-1;break;case"%Y":case"%y":l=parseInt(c[k],10);(l<100)&&(l+=(l>29)?1900:2000);break;case"%b":case"%B":for(n=0;n<12;++n){if(Calendar._MN[n].substr(0,c[k].length).toLowerCase()==c[k].toLowerCase()){o=n;break}}break;case"%H":case"%I":case"%k":case"%l":h=parseInt(c[k],10);break;case"%P":case"%p":if(/pm/i.test(c[k])&&h<12){h+=12}else{if(/am/i.test(c[k])&&h>=12){h-=12}}break;case"%M":p=parseInt(c[k],10);break}}if(isNaN(l)){l=s.getFullYear()}if(isNaN(o)){o=s.getMonth()}if(isNaN(f)){f=s.getDate()}if(isNaN(h)){h=s.getHours()}if(isNaN(p)){p=s.getMinutes()}if(l!=0&&o!=-1&&f!=0){return new Date(l,o,f,h,p,0)}l=0;o=-1;f=0;for(k=0;k<c.length;++k){if(c[k].search(/[a-zA-Z]+/)!=-1){var r=-1;for(n=0;n<12;++n){if(Calendar._MN[n].substr(0,c[k].length).toLowerCase()==c[k].toLowerCase()){r=n;break}}if(r!=-1){if(o!=-1){f=o+1}o=r}}else{if(parseInt(c[k],10)<=12&&o==-1){o=c[k]-1}else{if(parseInt(c[k],10)>31&&l==0){l=parseInt(c[k],10);(l<100)&&(l+=(l>29)?1900:2000)}else{if(f==0){f=c[k]}}}}}if(l==0){l=s.getFullYear()}if(o!=-1&&f!=0){return new Date(l,o,f,h,p,0)}return s};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 b=new Date(this.getFullYear(),0,0,0,0,0);var c=a-b;return Math.floor(c/Date.DAY)};Date.prototype.getWeekNumber=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=a.getDay();a.setDate(a.getDate()-(b+6)%7+3);var c=a.valueOf();a.setMonth(0);a.setDate(4);return Math.round((c-a.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(r){var k=this.getMonth();var c=this.getDate();var j=this.getFullYear();var v=this.getWeekNumber();var u=this.getDay();var p={};var f=this.getHours();var n=(f>=12);var h=(n)?(f-12):f;var e=this.getDayOfYear();if(h==0){h=12}var l=this.getMinutes();var q=this.getSeconds();p["%a"]=Calendar._SDN[u];p["%A"]=Calendar._DN[u];p["%b"]=Calendar._SMN[k];p["%B"]=Calendar._MN[k];p["%C"]=1+Math.floor(j/100);p["%d"]=(c<10)?("0"+c):c;p["%e"]=c;p["%H"]=(f<10)?("0"+f):f;p["%I"]=(h<10)?("0"+h):h;p["%j"]=(e<100)?((e<10)?("00"+e):("0"+e)):e;p["%k"]=f;p["%l"]=h;p["%m"]=(k<9)?("0"+(1+k)):(1+k);p["%M"]=(l<10)?("0"+l):l;p["%n"]="\n";p["%p"]=n?"PM":"AM";p["%P"]=n?"pm":"am";p["%s"]=Math.floor(this.getTime()/1000);p["%S"]=(q<10)?("0"+q):q;p["%t"]="\t";p["%U"]=p["%W"]=p["%V"]=(v<10)?("0"+v):v;p["%u"]=u+1;p["%w"]=u;p["%y"]=(""+j).substr(2,2);p["%Y"]=j;p["%%"]="%";var o=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return r.replace(o,function(a){return p[a]||a})}var b=r.match(o);for(var g=0;g<b.length;g++){var t=p[b[g]];if(t){o=new RegExp(b[g],"g");r=r.replace(o,t)}}return r};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("Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Pentadienis","Šeštadienis","Sekmadienis");Calendar._SDN=new Array("Sek","Pir","Ant","Tre","Ket","Pen","Šeš","Sek");Calendar._FD=0;Calendar._MN=new Array("Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis");Calendar._SMN=new Array("Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rgp","Rgs","Spa","Lap","Gru");Calendar._TT={};Calendar._TT.INFO="Apie kalendorių";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nNaujausią versiją rasite: http://www.dynarch.com/projects/calendar/\nPlatinamas pagal GNU LGPL licenciją. Aplankykite http://gnu.org/licenses/lgpl.html\n\nDatos pasirinkimas:\n- Metų pasirinkimas: \xab, \xbb\n- Mėnesio pasirinkimas: "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+"\n- Nuspauskite ir laikykite pelės klavišą greitesniam pasirinkimui.";Calendar._TT.ABOUT_TIME="\n\nLaiko pasirinkimas:\n- Spustelkite ant valandų arba minučių - skaičus padidės vienetu.\n- Jei spausite kartu su Shift, skaičius sumažės.\n- Greitam pasirinkimui spustelkite ir pajudinkite pelę.";Calendar._TT.PREV_YEAR="Ankstesni metai (laikykite, jei norite meniu)";Calendar._TT.PREV_MONTH="Ankstesnis mėnuo (laikykite, jei norite meniu)";Calendar._TT.GO_TODAY="Pasirinkti šiandieną";Calendar._TT.NEXT_MONTH="Kitas mėnuo (laikykite, jei norite meniu)";Calendar._TT.NEXT_YEAR="Kiti metai (laikykite, jei norite meniu)";Calendar._TT.SEL_DATE="Pasirinkite datą";Calendar._TT.DRAG_TO_MOVE="Tempkite";Calendar._TT.PART_TODAY=" (šiandien)";Calendar._TT.DAY_FIRST="";Calendar._TT.WEEKEND="0,6";Calendar._TT.MON_FIRST="Pirma savaitės diena - pirmadienis";Calendar._TT.SUN_FIRST="Pirma savaitės diena - sekmadienis";Calendar._TT.CLOSE="Uždaryti";Calendar._TT.TODAY="Šiandien";Calendar._TT.TIME_PART="Spustelkite arba tempkite jei norite pakeisti";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%A, %Y-%m-%d";Calendar._TT.WK="sav";Calendar.setup=function(e){function d(i,h){if(typeof e[i]=="undefined"){e[i]=h}}d("inputField",null);d("displayArea",null);d("button",null);d("eventName","click");d("ifFormat","%Y/%m/%d");d("daFormat","%Y/%m/%d");d("singleClick",true);d("disableFunc",null);d("dateStatusFunc",e.disableFunc);d("dateText",null);d("firstDay",null);d("align","Br");d("range",[1900,2999]);d("weekNumbers",true);d("flat",null);d("flatCallback",null);d("onSelect",null);d("onClose",null);d("onUpdate",null);d("date",null);d("showsTime",false);d("timeFormat","24");d("electric",true);d("step",2);d("position",null);d("cache",false);d("showOthers",false);d("multiple",null);var f=["inputField","displayArea","button"];for(var b in f){if(typeof e[f[b]]=="string"){e[f[b]]=document.getElementById(e[f[b]])}}if(!(e.flat||e.multiple||e.inputField||e.displayArea||e.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function c(h){var i=h.params;var j=(h.dateClicked||i.electric);if(j&&i.inputField){i.inputField.value=h.date.print(i.ifFormat);if(typeof i.inputField.onchange=="function"){if(i.inputField.fireEvent){i.inputField.fireEvent("onchange")}else{i.inputField.onchange()}}}if(j&&i.displayArea){i.displayArea.innerHTML=h.date.print(i.daFormat)}if(j&&typeof i.onUpdate=="function"){i.onUpdate(h)}if(j&&i.flat){if(typeof i.flatCallback=="function"){i.flatCallback(h)}}if(j&&i.singleClick&&h.dateClicked){h.callCloseHandler()}}if(e.flat!=null){if(typeof e.flat=="string"){e.flat=document.getElementById(e.flat)}if(!e.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var a=new Calendar(e.firstDay,e.date,e.onSelect||c);a.showsOtherMonths=e.showOthers;a.showsTime=e.showsTime;a.time24=(e.timeFormat=="24");a.params=e;a.weekNumbers=e.weekNumbers;a.setRange(e.range[0],e.range[1]);a.setDateStatusHandler(e.dateStatusFunc);a.getDateText=e.dateText;if(e.ifFormat){a.setDateFormat(e.ifFormat)}if(e.inputField&&typeof e.inputField.value=="string"){a.parseDate(e.inputField.value)}a.create(e.flat);a.show();return false}var g=e.button||e.displayArea||e.inputField;g["on"+e.eventName]=function(){var k=e.inputField||e.displayArea;var l=e.inputField?e.ifFormat:e.daFormat;var o=false;var h=window.calendar;if(k){e.date=Date.parseDate(k.value||k.innerHTML,l)}if(!(h&&e.cache)){window.calendar=h=new Calendar(e.firstDay,e.date,e.onSelect||c,e.onClose||function(i){i.hide()});h.showsTime=e.showsTime;h.time24=(e.timeFormat=="24");h.weekNumbers=e.weekNumbers;o=true}else{if(e.date){h.setDate(e.date)}h.hide()}if(e.multiple){h.multiple={};for(var n=e.multiple.length;--n>=0;){var j=e.multiple[n];var m=j.print("%Y%m%d");h.multiple[m]=j}}h.showsOtherMonths=e.showOthers;h.yearStep=e.step;h.setRange(e.range[0],e.range[1]);h.params=e;h.setDateStatusHandler(e.dateStatusFunc);h.getDateText=e.dateText;h.setDateFormat(l);if(o){h.create()}if(Calendar.is_ie&&/msie 7\.0/i.test(navigator.userAgent)){var r=e.button;var q=Calendar.getAbsolutePos(r);h.showAt(q.x,q.y+r.offsetHeight)}else{h.refresh();if(!e.position){h.showAtElement(e.button||e.displayArea||e.inputField,e.align)}else{h.showAt(e.position[0],e.position[1])}}return false};return a};var Prototype={Version:"1.7",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var a=document.createElement("div"),b=document.createElement("form"),c=false;if(a.__proto__&&(a.__proto__!==b.__proto__)){c=true}a=b=null;return c})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)</script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var f;for(var b=0,d=arguments.length;b<d;b++){var c=arguments[b];try{f=c();break}catch(a){}}return f}};var Class=(function(){var c=(function(){for(var e in {toString:1}){if(e==="toString"){return false}}return true})();function d(){}function b(){var h=null,j=$A(arguments);if(Object.isFunction(j[0])){h=j.shift()}function f(){this.initialize.apply(this,arguments)}Object.extend(f,Class.Methods);f.superclass=h;f.subclasses=[];if(h){d.prototype=h.prototype;f.prototype=new d;h.subclasses.push(f)}for(var e=0,g=j.length;e<g;e++){f.addMethods(j[e])}if(!f.prototype.initialize){f.prototype.initialize=Prototype.emptyFunction}f.prototype.constructor=f;return f}function a(l){var e=this.superclass&&this.superclass.prototype,j=Object.keys(l);if(c){if(l.toString!=Object.prototype.toString){j.push("toString")}if(l.valueOf!=Object.prototype.valueOf){j.push("valueOf")}}for(var f=0,g=j.length;f<g;f++){var k=j[f],m=l[k];if(e&&Object.isFunction(m)&&m.argumentNames()[0]=="$super"){var h=m;m=(function(i){return function(){return e[i].apply(this,arguments)}})(k).wrap(h);m.valueOf=h.valueOf.bind(h);m.toString=h.toString.bind(h)}this.prototype[k]=m}return this}return{create:b,Methods:{addMethods:a}}})();(function(){var a=Object.prototype.toString,u="Null",G="Undefined",d="Boolean",w="Number",A="String",x="Object",h="[object Function]",c="[object Boolean]",v="[object Number]",z="[object String]",b="[object Array]",f="[object Date]",t=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function C(I){switch(I){case null:return u;case (void 0):return G}var J=typeof I;switch(J){case"boolean":return d;case"number":return w;case"string":return A}return x}function g(I,K){for(var J in K){I[J]=K[J]}return I}function j(J){try{if(r(J)){return"undefined"}if(J===null){return"null"}return J.inspect?J.inspect():String(J)}catch(I){if(I instanceof RangeError){return"..."}throw I}}function E(I){return y("",{"":I},[])}function y(L,J,P){var S=J[L],R=typeof S;if(C(S)===x&&typeof S.toJSON==="function"){S=S.toJSON(L)}var I=a.call(S);switch(I){case v:case c:case z:S=S.valueOf()}switch(S){case null:return"null";case true:return"true";case false:return"false"}R=typeof S;switch(R){case"string":return S.inspect(true);case"number":return isFinite(S)?String(S):"null";case"object":for(var K=0,N=P.length;K<N;K++){if(P[K]===S){throw new TypeError()}}P.push(S);var O=[];if(I===b){for(var K=0,N=S.length;K<N;K++){var Q=y(K,S,P);O.push(typeof Q==="undefined"?"null":Q)}O="["+O.join(",")+"]"}else{var M=Object.keys(S);for(var K=0,N=M.length;K<N;K++){var L=M[K],Q=y(L,S,P);if(typeof Q!=="undefined"){O.push(L.inspect(true)+":"+Q)}}O="{"+O.join(",")+"}"}P.pop();return O}}function B(I){return JSON.stringify(I)}function F(I){return $H(I).toQueryString()}function D(I){return I&&I.toHTML?I.toHTML():String.interpret(I)}function s(I){if(C(I)!==x){throw new TypeError()}var K=[];for(var J in I){if(I.hasOwnProperty(J)){K.push(J)}}return K}function H(I){var K=[];for(var J in I){K.push(I[J])}return K}function e(I){return g({},I)}function m(I){return !!(I&&I.nodeType==1)}function k(I){return a.call(I)===b}var i=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(i){k=Array.isArray}function o(I){return I instanceof Hash}function n(I){return a.call(I)===h}function q(I){return a.call(I)===z}function p(I){return a.call(I)===v}function l(I){return a.call(I)===f}function r(I){return typeof I==="undefined"}g(Object,{extend:g,inspect:j,toJSON:t?B:E,toQueryString:F,toHTML:D,keys:Object.keys||s,values:H,clone:e,isElement:m,isArray:k,isHash:o,isFunction:n,isString:q,isNumber:p,isDate:l,isUndefined:r})})();Object.extend(Function.prototype,(function(){var i=Array.prototype.slice;function j(m,l){var n=m.length,o=l.length;while(o--){m[n+o]=l[o]}return m}function g(m,l){m=i.call(m,0);return j(m,l)}function a(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return l.length==1&&!l[0]?[]:l}function b(n){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var l=this,m=i.call(arguments,1);return function(){var o=g(m,arguments);return l.apply(n,o)}}function c(n){var l=this,m=i.call(arguments,1);return function(p){var o=j([p||window.event],m);return l.apply(n,o)}}function d(){if(!arguments.length){return this}var l=this,m=i.call(arguments,0);return function(){var n=g(m,arguments);return l.apply(this,n)}}function f(n){var l=this,m=i.call(arguments,1);n=n*1000;return window.setTimeout(function(){return l.apply(l,m)},n)}function e(){var l=j([0.01],arguments);return this.delay.apply(this,l)}function k(m){var l=this;return function(){var n=j([l.bind(this)],arguments);return m.apply(this,n)}}function h(){if(this._methodized){return this._methodized}var l=this;return this._methodized=function(){var m=j([this],arguments);return l.apply(null,m)}}return{argumentNames:a,bind:b,bindAsEventListener:c,curry:d,delay:f,defer:e,wrap:k,methodize:h}})());(function(a){function b(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z"}function c(){return this.toISOString()}if(!a.toISOString){a.toISOString=b}if(!a.toJSON){a.toJSON=c}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(b,a){this.template=b.toString();this.pattern=a||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(f){if(a==null){return(f[1]+"")}var b=f[1]||"";if(b=="\\"){return f[2]}var d=a,e=f[3],g=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;f=g.exec(e);if(f==null){return b}while(f!=null){var c=f[1].startsWith("[")?f[2].replace(/\\\\]/g,"]"):f[1];d=d[c];if(null==d||""==f[3]){break}e=e.substring("["==f[3]?f[1].length:f[0].length);f=g.exec(e)}return b+String.interpret(d)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function e(z,w){var y=0;try{this._each(function(A){z.call(w,A,y++)})}catch(x){if(x!=$break){throw x}}return this}function f(A,z,x){var y=-A,B=[],w=this.toArray();if(A<1){return w}while((y+=A)<w.length){B.push(w.slice(y,y+A))}return B.collect(z,x)}function a(x,w){x=x||Prototype.K;var y=true;this.each(function(A,z){y=y&&!!x.call(w,A,z);if(!y){throw $break}});return y}function b(x,w){x=x||Prototype.K;var y=false;this.each(function(A,z){if(y=!!x.call(w,A,z)){throw $break}});return y}function c(x,w){x=x||Prototype.K;var y=[];this.each(function(A,z){y.push(x.call(w,A,z))});return y}function d(x,w){var y;this.each(function(A,z){if(x.call(w,A,z)){y=A;throw $break}});return y}function g(x,w){var y=[];this.each(function(A,z){if(x.call(w,A,z)){y.push(A)}});return y}function h(x,y,w){y=y||Prototype.K;var z=[];if(Object.isString(x)){x=new RegExp(RegExp.escape(x))}this.each(function(B,A){if(x.match(B)){z.push(y.call(w,B,A))}});return z}function i(x){if(Object.isFunction(this.indexOf)){if(this.indexOf(x)!=-1){return true}}var w=false;this.each(function(y){if(y==x){w=true;throw $break}});return w}function j(x,w){w=Object.isUndefined(w)?null:w;return this.eachSlice(x,function(y){while(y.length<x){y.push(w)}return y})}function k(y,x,w){this.each(function(A,z){y=x.call(w,y,A,z)});return y}function m(x){var w=$A(arguments).slice(1);return this.map(function(y){return y[x].apply(y,w)})}function n(x,w){x=x||Prototype.K;var y;this.each(function(A,z){A=x.call(w,A,z);if(y==null||A>=y){y=A}});return y}function o(x,w){x=x||Prototype.K;var y;this.each(function(A,z){A=x.call(w,A,z);if(y==null||A<y){y=A}});return y}function p(y,w){y=y||Prototype.K;var z=[],x=[];this.each(function(B,A){(y.call(w,B,A)?z:x).push(B)});return[z,x]}function q(w){var x=[];this.each(function(y){x.push(y[w])});return x}function r(x,w){var y=[];this.each(function(A,z){if(!x.call(w,A,z)){y.push(A)}});return y}function t(x,w){return this.map(function(z,y){return{value:z,criteria:x.call(w,z,y)}}).sort(function(A,B){var y=A.criteria,z=B.criteria;return y<z?-1:y>z?1:0}).pluck("value")}function u(){return this.map()}function v(){var y=Prototype.K,w=$A(arguments);if(Object.isFunction(w.last())){y=w.pop()}var x=[this].concat(w).map($A);return this.map(function(A,z){return y(x.pluck(z))})}function s(){return this.toArray().length}function l(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:e,eachSlice:f,all:a,every:a,any:b,some:b,collect:c,map:c,detect:d,findAll:g,select:g,filter:g,grep:h,include:i,member:i,inGroupsOf:j,inject:k,invoke:m,max:n,min:o,partition:p,pluck:q,reject:r,sortBy:t,toArray:u,entries:u,zip:v,size:s,inspect:l,find:d}})();function $A(a){if(!a){return[]}if("toArray" in Object(a)){return a.toArray()}var b=a.length||0,c=new Array(b);while(b--){c[b]=a[b]}return c}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var b=Array.prototype,r=b.slice,a=b.forEach;function h(w,u){for(var v=0,x=this.length>>>0;v<x;v++){if(v in this){w.call(u,this[v],v,this)}}}if(!a){a=h}function c(){this.length=0;return this}function i(){return this[0]}function n(){return this[this.length-1]}function e(){return this.select(function(u){return u!=null})}function j(){return this.inject([],function(u,v){if(Object.isArray(v)){return u.concat(v.flatten())}u.push(v);return u})}function t(){var u=r.call(arguments,0);return this.select(function(v){return !u.include(v)})}function p(u){return(u===false?this.toArray():this)._reverse()}function s(u){return this.inject([],function(v,x,w){if(0==w||(u?v.last()!=x:!v.include(x))){v.push(x)}return v})}function m(u){return this.uniq().findAll(function(v){return u.detect(function(w){return v===w})})}function d(){return r.call(this,0)}function q(){return this.length}function l(){return"["+this.map(Object.inspect).join(", ")+"]"}function k(v,u){u||(u=0);var w=this.length;if(u<0){u=w+u}for(;u<w;u++){if(this[u]===v){return u}}return -1}function o(v,u){u=isNaN(u)?this.length:(u<0?this.length+u:u)+1;var w=this.slice(0,u).reverse().indexOf(v);return(w<0)?w:u-w-1}function f(){var u=r.call(this,0),x;for(var w=0,z=arguments.length;w<z;w++){x=arguments[w];if(Object.isArray(x)&&!("callee" in x)){for(var y=0,v=x.length;y<v;y++){u.push(x[y])}}else{u.push(x)}}return u}Object.extend(b,Enumerable);if(!b._reverse){b._reverse=b.reverse}Object.extend(b,{_each:a,clear:c,first:i,last:n,compact:e,flatten:j,without:t,reverse:p,uniq:s,intersect:m,clone:d,toArray:d,size:q,inspect:l});var g=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(g){b.concat=f}if(!b.indexOf){b.indexOf=k}if(!b.lastIndexOf){b.lastIndexOf=o}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function e(p){this._object=Object.isHash(p)?p.toObject():Object.clone(p)}function a(p){for(var q in this._object){var s=this._object[q],r=[q,s];r.key=q;r.value=s;p(r)}}function i(p,q){return this._object[p]=q}function c(p){if(this._object[p]!==Object.prototype[p]){return this._object[p]}}function m(p){var q=this._object[p];delete this._object[p];return q}function j(){return Object.clone(this._object)}function g(){return this.pluck("key")}function o(){return this.pluck("value")}function d(q){var p=this.detect(function(r){return r.value===q});return p&&p.key}function h(p){return this.clone().update(p)}function n(p){return new Hash(p).inject(this,function(r,q){r.set(q.key,q.value);return r})}function k(p,q){if(Object.isUndefined(q)){return p}return p+"="+encodeURIComponent(String.interpret(q))}function l(){return this.inject([],function(u,s){var q=encodeURIComponent(s.key),w=s.value;if(w&&typeof w=="object"){if(Object.isArray(w)){var t=[];for(var p=0,r=w.length,v;p<r;p++){v=w[p];t.push(k(q,v))}return u.concat(t)}}else{u.push(k(q,w))}return u}).join("&")}function f(){return"#<Hash:{"+this.map(function(p){return p.map(Object.inspect).join(": ")}).join(", ")+"}>"}function b(){return new Hash(this)}return{initialize:e,_each:a,set:i,get:c,unset:m,toObject:j,toTemplateReplacements:j,keys:g,values:o,index:d,merge:h,update:n,toQueryString:l,inspect:f,toJSON:j,clone:b}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function g(){return this.toPaddedString(2,16)}function e(){return this+1}function f(j,i){$R(0,this,true).each(j,i);return this}function h(i,j){var k=this.toString(j||10);return"0".times(i-k.length)+k}function a(){return Math.abs(this)}function d(){return Math.round(this)}function b(){return Math.ceil(this)}function c(){return Math.floor(this)}return{toColorPart:g,succ:e,times:f,toPaddedString:h,abs:a,round:d,ceil:b,floor:c}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function c(f,d,e){this.start=f;this.end=d;this.exclusive=e}function a(d){var e=this.start;while(this.include(e)){d(e);e=e.succ()}}function b(d){if(d<this.start){return false}if(this.exclusive){return d<this.end}return d<=this.end}return{initialize:c,_each:a,include:b}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(a,c,d,b){this.each(function(g){if(Object.isFunction(g[a])){try{g[a].apply(g,[c,d,b])}catch(f){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(d){this.url=d;this.method=this.options.method;var b=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){b+=(b?"&":"")+"_method="+this.method;this.method="post"}if(b&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+b}this.parameters=b.toQueryParams();try{var c=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(c)}Ajax.Responders.dispatch("onCreate",this,c);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||b):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(a){this.dispatchException(a)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var b={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){b["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){b.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var a=this.options.requestHeaders;if(Object.isFunction(a.push)){for(var c=0,d=a.length;c<d;c+=2){b[a[c]]=a[c+1]}}else{$H(a).each(function(f){b[f.key]=f.value})}}for(var e in b){this.transport.setRequestHeader(e,b[e])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(c){var f=Ajax.Request.Events[c],d=new Ajax.Response(this);if(f=="Complete"){try{this._complete=true;(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(d,d.headerJSON)}catch(b){this.dispatchException(b)}var a=d.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&a&&a.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+f]||Prototype.emptyFunction)(d,d.headerJSON);Ajax.Responders.dispatch("on"+f,this,d,d.headerJSON)}catch(b){this.dispatchException(b)}if(f=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(b){try{return this.transport.getResponseHeader(b)||null}catch(a){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(b){this.request=b;var c=this.transport=b.transport,a=this.readyState=c.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(c.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var d=c.responseXML;this.responseXML=Object.isUndefined(d)?null:d;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var b=this.getHeader("X-JSON");if(!b){return null}b=decodeURIComponent(escape(b));try{return b.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(a){this.request.dispatchException(a)}},_getResponseJSON:function(){var b=this.request.options;if(!b.evalJSON||(b.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(b.sanitizeJSON||!this.request.isSameOrigin())}catch(a){this.request.dispatchException(a)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,d,c){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};c=Object.clone(c);var b=c.onComplete;c.onComplete=(function(f,e){this.updateContent(f.responseText);if(Object.isFunction(b)){b(f,e)}}).bind(this);$super(d,c)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],b=this.options;if(!b.evalScripts){d=d.stripScripts()}if(c=$(c)){if(b.insertion){if(Object.isString(b.insertion)){var a={};a[b.insertion]=d;c.insert(a)}else{b.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(a){if(arguments.length>1){for(var c=0,b=[],d=arguments.length;c<d;c++){b.push($(arguments[c]))}return b}if(Object.isString(a)){a=document.getElementById(a)}return Element.extend(a)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(a,d){var f=[];var e=document.evaluate(a,$(d)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,c=e.snapshotLength;b<c;b++){f.push(Element.extend(e.snapshotItem(b)))}return f}}if(!Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(b){function d(f,e){if(f==="select"){return false}if("type" in e){return false}return true}var c=(function(){try{var e=document.createElement('<input name="x">');return e.tagName.toLowerCase()==="input"&&e.name==="x"}catch(f){return false}})();var a=b.Element;b.Element=function(h,e){e=e||{};h=h.toLowerCase();var f=Element.cache;if(c&&e.name){h="<"+h+' name="'+e.name+'">';delete e.name;return Element.writeAttribute(document.createElement(h),e)}if(!f[h]){f[h]=Element.extend(document.createElement(h))}var g=d(h,e)?f[h].cloneNode(false):document.createElement(h);return Element.writeAttribute(g,e)};Object.extend(b.Element,a||{});if(a){b.Element.prototype=a.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(a){var b=a._prototypeUID;if(b){Element.stopObserving(a);a._prototypeUID=void 0;delete Element.Storage[b]}};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var d=(function(){var g=document.createElement("select"),h=true;g.innerHTML='<option value="test">test</option>';if(g.options&&g.options[0]){h=g.options[0].nodeName.toUpperCase()!=="OPTION"}g=null;return h})();var e=(function(){try{var h=document.createElement("table");if(h&&h.tBodies){h.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var i=typeof h.tBodies[0]=="undefined";h=null;return i}}catch(g){return true}})();var b=(function(){try{var h=document.createElement("div");h.innerHTML="<link>";var i=(h.childNodes.length===0);h=null;return i}catch(g){return true}})();var a=d||e||b;var c=(function(){var i=document.createElement("script"),h=false;try{i.appendChild(document.createTextNode(""));h=!i.firstChild||i.firstChild&&i.firstChild.nodeType!==3}catch(g){h=true}i=null;return h})();function f(j,g){j=$(j);var m=Element._purgeElement;var h=j.getElementsByTagName("*"),k=h.length;while(k--){m(h[k])}if(g&&g.toElement){g=g.toElement()}if(Object.isElement(g)){return j.update().insert(g)}g=Object.toHTML(g);var n=j.tagName.toUpperCase();if(n==="SCRIPT"&&c){j.text=g;return j}if(a){if(n in Element._insertionTranslations.tags){while(j.firstChild){j.removeChild(j.firstChild)}Element._getContentFromAnonymousElement(n,g.stripScripts()).each(function(i){j.appendChild(i)})}else{if(b&&Object.isString(g)&&g.indexOf("<link")>-1){while(j.firstChild){j.removeChild(j.firstChild)}var l=Element._getContentFromAnonymousElement(n,g.stripScripts(),true);l.each(function(i){j.appendChild(i)})}else{j.innerHTML=g.stripScripts()}}}else{j.innerHTML=g.stripScripts()}g.evalScripts.bind(g).defer();return j}return f})(),replace:function(b,a){b=$(b);if(a&&a.toElement){a=a.toElement()}else{if(!Object.isElement(a)){a=Object.toHTML(a);var c=b.ownerDocument.createRange();c.selectNode(b);a.evalScripts.bind(a).defer();a=c.createContextualFragment(a.stripScripts())}}b.parentNode.replaceChild(a,b);return b},insert:function(c,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&&(e.toElement||e.toHTML))){e={bottom:e}}var b,d,g,a;for(var f in e){b=e[f];f=f.toLowerCase();d=Element._insertionTranslations[f];if(b&&b.toElement){b=b.toElement()}if(Object.isElement(b)){d(c,b);continue}b=Object.toHTML(b);g=((f=="before"||f=="after")?c.parentNode:c).tagName.toUpperCase();a=Element._getContentFromAnonymousElement(g,b.stripScripts());if(f=="top"||f=="after"){a.reverse()}a.each(d.curry(c));b.evalScripts.bind(b).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(a){a=$(a);var b="<"+a.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(d){var e=d.first(),c=d.last(),f=(a[e]||"").toString();if(f){b+=" "+c+"="+f.inspect(true)}});return b+">"},recursivelyCollect:function(a,d,c){a=$(a);c=c||-1;var b=[];while(a=a[d]){if(a.nodeType==1){b.push(Element.extend(a))}if(b.length==c){break}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(b){var c=[],a=$(b).firstChild;while(a){if(a.nodeType===1){c.push(Element.extend(a))}a=a.nextSibling}return c},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(a,b){a=$(a);if(Object.isString(b)){return Prototype.Selector.match(a,b)}return b.match(a)},up:function(b,c,d){b=$(b);if(arguments.length==1){return $(b.parentNode)}var a=Element.ancestors(b);return Object.isNumber(c)?a[c]:Prototype.Selector.find(a,c,d)},down:function(a,b,c){a=$(a);if(arguments.length==1){return Element.firstDescendant(a)}return Object.isNumber(b)?Element.descendants(a)[b]:Element.select(a,b)[c||0]},previous:function(a,b,c){a=$(a);if(Object.isNumber(b)){c=b,b=false}if(!Object.isNumber(c)){c=0}if(b){return Prototype.Selector.find(a.previousSiblings(),b,c)}else{return a.recursivelyCollect("previousSibling",c+1)[c]}},next:function(a,b,c){a=$(a);if(Object.isNumber(b)){c=b,b=false}if(!Object.isNumber(c)){c=0}if(b){return Prototype.Selector.find(a.nextSiblings(),b,c)}else{var d=Object.isNumber(c)?c+1:1;return a.recursivelyCollect("nextSibling",c+1)[c]}},select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(a,b){a=$(a);if(Prototype.Browser.IE){var c=Element._attributeTranslations.read;if(c.values[b]){return c.values[b](a,b)}if(c.names[b]){b=c.names[b]}if(b.include(":")){return(!a.attributes||!a.attributes[b])?null:a.attributes[b].value}}return a.getAttribute(b)},writeAttribute:function(c,d,f){c=$(c);var b={},e=Element._attributeTranslations.write;if(typeof d=="object"){b=d}else{b[d]=Object.isUndefined(f)?true:f}for(var a in b){d=e.names[a]||a;f=b[a];if(e.values[a]){d=e.values[a](c,f)}if(f===false||f===null){c.removeAttribute(d)}else{if(f===true){c.setAttribute(d,d)}else{c.setAttribute(d,f)}}}return c},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(b,a){if(!(b=$(b))){return}var c=b.className;return(c.length>0&&(c==a||new RegExp("(^|\\s)"+a+"(\\s|$)").test(c)))},addClassName:function(b,a){if(!(b=$(b))){return}if(!Element.hasClassName(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClassName:function(b,a){if(!(b=$(b))){return}b.className=b.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ").strip();return b},toggleClassName:function(b,a){if(!(b=$(b))){return}return Element[Element.hasClassName(b,a)?"removeClassName":"addClassName"](b,a)},cleanWhitespace:function(a){a=$(a);var c=a.firstChild;while(c){var b=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){a.removeChild(c)}c=b}return a},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(a,e){a=$(a);var b=a.style,c;if(Object.isString(e)){a.style.cssText+=";"+e;return e.include("opacity")?a.setOpacity(e.match(/opacity:\s*(\d?\.?\d*)/)[1]):a}for(var d in e){if(d=="opacity"){a.setOpacity(e[d])}else{b[(d=="float"||d=="cssFloat")?(Object.isUndefined(b.styleFloat)?"cssFloat":"styleFloat"):d]=e[d]}}return a},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<1e-05)?0:b;return a},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(b,f){var c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});f=$(f);var d=Element.viewportOffset(f),a=[0,0],e=null;b=$(b);if(Element.getStyle(b,"position")=="absolute"){e=Element.getOffsetParent(b);a=Element.viewportOffset(e)}if(e==document.body){a[0]-=document.body.offsetLeft;a[1]-=document.body.offsetTop}if(c.setLeft){b.style.left=(d[0]-a[0]+c.offsetLeft)+"px"}if(c.setTop){b.style.top=(d[1]-a[1]+c.offsetTop)+"px"}if(c.setWidth){b.style.width=f.offsetWidth+"px"}if(c.setHeight){b.style.height=f.offsetHeight+"px"}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(c,b,e){switch(e){case"height":case"width":if(!Element.visible(b)){return null}var a=parseInt(c(b,e),10);if(a!==b["offset"+e.capitalize()]){return a+"px"}var d;if(e==="height"){d=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{d=["border-left-width","padding-left","padding-right","border-right-width"]}return d.inject(a,function(f,g){var h=c(b,g);return h===null?f:f-parseInt(h,10)})+"px";default:return c(b,e)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,b,a){if(a==="title"){return b.title}return c(b,a)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(b,f){function e(g){return g.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var c=b.getStyle("filter"),d=b.style;if(f==1||f===""){(c=e(c))?d.filter=c:d.removeAttribute("filter");return b}else{if(f<1e-05){f=0}}d.filter=e(c)+"alpha(opacity="+(f*100)+")";return b};Element._attributeTranslations=(function(){var a="className",c="for",b=document.createElement("div");b.setAttribute(a,"x");if(b.className!=="x"){b.setAttribute("class","x");if(b.className==="x"){a="class"}}b=null;b=document.createElement("label");b.setAttribute(c,"x");if(b.htmlFor!=="x"){b.setAttribute("htmlFor","x");if(b.htmlFor==="x"){c="htmlFor"}}b=null;return{read:{names:{"class":a,className:a,"for":c,htmlFor:c},values:{_getAttr:function(e,d){return e.getAttribute(d)},_getAttr2:function(e,d){return e.getAttribute(d,2)},_getAttrNode:function(e,d){var f=e.getAttributeNode(d);return f?f.value:""},_getEv:(function(){var d=document.createElement("div"),e;d.onclick=Prototype.emptyFunction;var g=d.getAttribute("onclick");if(String(g).indexOf("{")>-1){e=function(h,f){f=h.getAttribute(f);if(!f){return null}f=f.toString();f=f.split("{")[1];f=f.split("}")[0];return f.strip()}}else{if(g===""){e=function(h,f){f=h.getAttribute(f);if(!f){return null}return f.strip()}}}d=null;return e})(),_flag:function(e,d){return $(e).hasAttribute(d)?d:null},style:function(d){return d.style.cssText.toLowerCase()},title:function(d){return d.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(b){var e=b.getElementsByTagName("*"),f=[];for(var c=0,d;d=e[c];c++){if(d.tagName!=="!"){f.push(d)}}return f}Element.Methods.down=function(b,c,d){b=$(b);if(arguments.length==1){return b.firstDescendant()}return Object.isNumber(c)?a(b)[c]:Element.select(b,c)[d||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<1e-05)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(b,d){b=$(b);b.style.opacity=(d==1||d==="")?"":(d<1e-05)?0:d;if(d==1){if(b.tagName.toUpperCase()=="IMG"&&b.width){b.width++;b.width--}else{try{var c=document.createTextNode(" ");b.appendChild(c);b.removeChild(c)}catch(a){}}}return b}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(b,a){b=$(b);if(a&&a.toElement){a=a.toElement()}if(Object.isElement(a)){b.parentNode.replaceChild(a,b);return b}a=Object.toHTML(a);var e=b.parentNode,f=e.tagName.toUpperCase();if(Element._insertionTranslations.tags[f]){var d=b.next(),c=Element._getContentFromAnonymousElement(f,a.stripScripts());e.removeChild(b);if(d){c.each(function(g){e.insertBefore(g,d)})}else{c.each(function(g){e.appendChild(g)})}}else{b.outerHTML=a.stripScripts()}a.evalScripts.bind(a).defer();return b}}Element._returnOffset=function(a,c){var b=[a,c];b.left=a;b.top=c;return b};Element._getContentFromAnonymousElement=function(f,c,b){var a=new Element("div"),e=Element._insertionTranslations.tags[f];var g=false;if(e){g=true}else{if(b){g=true;e=["","",0]}}if(g){a.innerHTML="&nbsp;"+e[0]+c+e[1];a.removeChild(a.firstChild);for(var d=e[2];d--;){a=a.firstChild}}else{a.innerHTML=c}return $A(a.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(b,a){a=Element._attributeTranslations.has[a]||a;var c=$(b).getAttributeNode(a);return !!(c&&c.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function b(k){if(typeof window.Element!="undefined"){var j=window.Element.prototype;if(j){var h="_"+(Math.random()+"").slice(2),g=document.createElement(k);j[h]="x";var i=(g[h]!=="x");delete j[h];g=null;return i}}return false}function d(g,h){for(var i in h){var j=h[i];if(Object.isFunction(j)&&!(i in g)){g[i]=j.methodize()}}}var e=b("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(e){return function(g){if(g&&typeof g._extendedByPrototype=="undefined"){var h=g.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){d(g,Element.Methods);d(g,Element.Methods.Simulated);d(g,Element.Methods.ByTag[h.toUpperCase()])}}return g}}return Prototype.K}var f={},a=Element.Methods.ByTag;var c=Object.extend(function(g){if(!g||typeof g._extendedByPrototype!="undefined"||g.nodeType!=1||g==window){return g}var h=Object.clone(f),i=g.tagName.toUpperCase();if(a[i]){Object.extend(h,a[i])}d(g,h);g._extendedByPrototype=Prototype.emptyFunction;return g},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(f,Element.Methods);Object.extend(f,Element.Methods.Simulated)}}});c.refresh();return c})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(b,a){return b.hasAttribute(a)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(g){var d=Prototype.BrowserFeatures,h=Element.Methods.ByTag;if(!g){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var j=g;g=arguments[1]}if(!j){Object.extend(Element.Methods,g||{})}else{if(Object.isArray(j)){j.each(c)}else{c(j)}}function c(k){k=k.toUpperCase();if(!Element.Methods.ByTag[k]){Element.Methods.ByTag[k]={}}Object.extend(Element.Methods.ByTag[k],g)}function a(l,k,m){m=m||false;for(var n in l){var o=l[n];if(!Object.isFunction(o)){continue}if(!m||!(n in k)){k[n]=o.methodize()}}}function e(n){var l;var o={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(o[n]){l="HTML"+o[n]+"Element"}if(window[l]){return window[l]}l="HTML"+n+"Element";if(window[l]){return window[l]}l="HTML"+n.capitalize()+"Element";if(window[l]){return window[l]}var k=document.createElement(n),m=k.__proto__||k.constructor.prototype;k=null;return m}var b=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(d.ElementExtensions){a(Element.Methods,b);a(Element.Methods.Simulated,b,true)}if(d.SpecificElementExtensions){for(var i in Element.Methods.ByTag){var f=e(i);if(Object.isUndefined(f)){continue}a(h[i],f.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(g){var a=Prototype.Browser,c=document,d,f={};function e(){if(a.WebKit&&!c.evaluate){return document}if(a.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function b(h){if(!d){d=e()}f[h]="client"+h;g["get"+h]=function(){return d[f[h]]};return g["get"+h]()}g.getWidth=b.curry("Width");g.getHeight=b.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(a){if(!(a=$(a))){return}var b;if(a===window){b=0}else{if(typeof a._prototypeUID==="undefined"){a._prototypeUID=Element.Storage.UID++}b=a._prototypeUID}if(!Element.Storage[b]){Element.Storage[b]=$H()}return Element.Storage[b]},store:function(a,b,c){if(!(a=$(a))){return}if(arguments.length===2){Element.getStorage(a).update(b)}else{Element.getStorage(a).set(b,c)}return a},retrieve:function(b,d,a){if(!(b=$(b))){return}var c=Element.getStorage(b),e=c.get(d);if(Object.isUndefined(e)){c.set(d,a);e=a}return e},clone:function(d,b){if(!(d=$(d))){return}var a=d.cloneNode(b);a._prototypeUID=void 0;if(b){var c=Element.select(a,"*"),e=c.length;while(e--){c[e]._prototypeUID=void 0}}return Element.extend(a)},purge:function(b){if(!(b=$(b))){return}var d=Element._purgeElement;d(b);var a=b.getElementsByTagName("*"),c=a.length;while(c--){d(a[c])}return null}});(function(){function s(v){var u=v.match(/^(\d+)%?$/i);if(!u){return null}return(Number(u[1])/100)}function h(F,C,u){var w=null;if(Object.isElement(F)){w=F;F=w.getStyle(C)}if(F===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(F)){return window.parseFloat(F)}var y=F.include("%"),A=(u===document.viewport);if(/\d/.test(F)&&w&&w.runtimeStyle&&!(y&&A)){var E=w.style.left,D=w.runtimeStyle.left;w.runtimeStyle.left=w.currentStyle.left;w.style.left=F||0;F=w.style.pixelLeft;w.style.left=E;w.runtimeStyle.left=D;return F}if(w&&y){u=u||w.parentNode;var v=s(F);var G=null;var B=w.getStyle("position");var x=C.include("left")||C.include("right")||C.include("width");var z=C.include("top")||C.include("bottom")||C.include("height");if(u===document.viewport){if(x){G=document.viewport.getWidth()}else{if(z){G=document.viewport.getHeight()}}}else{if(x){G=$(u).measure("width")}else{if(z){G=$(u).measure("height")}}}return(G===null)?0:G*v}return 0}function r(u){if(Object.isString(u)&&u.endsWith("px")){return u}return u+"px"}function l(v){var w=v;while(v&&v.parentNode){var u=v.getStyle("display");if(u==="none"){return false}v=$(v.parentNode)}return true}var i=Prototype.K;if("currentStyle" in document.documentElement){i=function(u){if(!u.currentStyle.hasLayout){u.style.zoom=1}return u}}function b(u){if(u.include("border")){u=u+"-width"}return u.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,u,v){$super();this.element=$(u);Element.Layout.PROPERTIES.each(function(w){this._set(w,null)},this);if(v){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(u,v){return Hash.prototype.set.call(this,u,v)},set:function(u,v){throw"Properties of Element.Layout are read-only."},get:function($super,u){var v=$super(u);return v===null?this._compute(u):v},_begin:function(){if(this._prepared){return}var v=this.element;if(l(v)){this._prepared=true;return}var x={position:v.style.position||"",width:v.style.width||"",visibility:v.style.visibility||"",display:v.style.display||""};v.store("prototype_original_styles",x);var A=v.getStyle("position"),C=v.getStyle("width");if(C==="0px"||C===null){v.style.display="block";C=v.getStyle("width")}var u=(A==="fixed")?document.viewport:v.parentNode;v.setStyle({position:"absolute",visibility:"hidden",display:"block"});var B=v.getStyle("width");var w;if(C&&(B===C)){w=h(v,"width",u)}else{if(A==="absolute"||A==="fixed"){w=h(v,"width",u)}else{var y=v.parentNode,z=$(y).getLayout();w=z.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}v.setStyle({width:w+"px"});this._prepared=true},_end:function(){var u=this.element;var v=u.retrieve("prototype_original_styles");u.store("prototype_original_styles",null);u.setStyle(v);this._prepared=false},_compute:function(v){var u=Element.Layout.COMPUTATIONS;if(!(v in u)){throw"Property not found."}return this._set(v,u[v].call(this,this.element))},toObject:function(){var u=$A(arguments);var v=(u.length===0)?Element.Layout.PROPERTIES:u.join(" ").split(" ");var w={};v.each(function(x){if(!Element.Layout.PROPERTIES.include(x)){return}var y=this.get(x);if(y!=null){w[x]=y}},this);return w},toHash:function(){var u=this.toObject.apply(this,arguments);return new Hash(u)},toCSS:function(){var u=$A(arguments);var w=(u.length===0)?Element.Layout.PROPERTIES:u.join(" ").split(" ");var v={};w.each(function(x){if(!Element.Layout.PROPERTIES.include(x)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(x)){return}var y=this.get(x);if(y!=null){v[b(x)]=y+"px"}},this);return v},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(x){if(!this._preComputing){this._begin()}var v=this.get("border-box-height");if(v<=0){if(!this._preComputing){this._end()}return 0}var w=this.get("border-top"),u=this.get("border-bottom");var z=this.get("padding-top"),y=this.get("padding-bottom");if(!this._preComputing){this._end()}return v-w-u-z-y},width:function(x){if(!this._preComputing){this._begin()}var w=this.get("border-box-width");if(w<=0){if(!this._preComputing){this._end()}return 0}var u=this.get("border-left"),v=this.get("border-right");var y=this.get("padding-left"),z=this.get("padding-right");if(!this._preComputing){this._end()}return w-u-v-y-z},"padding-box-height":function(u){var v=this.get("height"),x=this.get("padding-top"),w=this.get("padding-bottom");return v+x+w},"padding-box-width":function(u){var x=this.get("width"),v=this.get("padding-left"),w=this.get("padding-right");return x+v+w},"border-box-height":function(u){if(!this._preComputing){this._begin()}var v=u.offsetHeight;if(!this._preComputing){this._end()}return v},"border-box-width":function(u){if(!this._preComputing){this._begin()}var v=u.offsetWidth;if(!this._preComputing){this._end()}return v},"margin-box-height":function(v){var u=this.get("border-box-height"),x=this.get("margin-top"),w=this.get("margin-bottom");if(u<=0){return 0}return u+x+w},"margin-box-width":function(v){var u=this.get("border-box-width"),w=this.get("margin-left"),x=this.get("margin-right");if(u<=0){return 0}return u+w+x},top:function(u){var v=u.positionedOffset();return v.top},bottom:function(u){var w=u.positionedOffset(),x=u.getOffsetParent(),y=x.measure("height");var v=this.get("border-box-height");return y-v-w.top},left:function(u){var v=u.positionedOffset();return v.left},right:function(u){var w=u.positionedOffset(),x=u.getOffsetParent(),y=x.measure("width");var v=this.get("border-box-width");return y-v-w.left},"padding-top":function(u){return h(u,"paddingTop")},"padding-bottom":function(u){return h(u,"paddingBottom")},"padding-left":function(u){return h(u,"paddingLeft")},"padding-right":function(u){return h(u,"paddingRight")},"border-top":function(u){return h(u,"borderTopWidth")},"border-bottom":function(u){return h(u,"borderBottomWidth")},"border-left":function(u){return h(u,"borderLeftWidth")},"border-right":function(u){return h(u,"borderRightWidth")},"margin-top":function(u){return h(u,"marginTop")},"margin-bottom":function(u){return h(u,"marginBottom")},"margin-left":function(u){return h(u,"marginLeft")},"margin-right":function(u){return h(u,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(u){var v=i(u.getOffsetParent());var x=u.getBoundingClientRect(),w=v.getBoundingClientRect();return(w.right-x.right).round()},bottom:function(u){var v=i(u.getOffsetParent());var x=u.getBoundingClientRect(),w=v.getBoundingClientRect();return(w.bottom-x.bottom).round()}})}Element.Offset=Class.create({initialize:function(u,v){this.left=u.round();this.top=v.round();this[0]=this.left;this[1]=this.top},relativeTo:function(u){return new Element.Offset(this.left-u.left,this.top-u.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function f(u,v){return new Element.Layout(u,v)}function o(u,v){return $(u).getLayout().get(v)}function e(w){w=$(w);var v=Element.getStyle(w,"display");if(v&&v!=="none"){return{width:w.offsetWidth,height:w.offsetHeight}}var z=w.style;var y={visibility:z.visibility,position:z.position,display:z.display};var x={visibility:"hidden",display:"block"};if(y.position!=="fixed"){x.position="absolute"}Element.setStyle(w,x);var u={width:w.offsetWidth,height:w.offsetHeight};Element.setStyle(w,y);return u}function g(u){u=$(u);if(m(u)||k(u)||j(u)||n(u)){return $(document.body)}var v=(Element.getStyle(u,"display")==="inline");if(!v&&u.offsetParent){return $(u.offsetParent)}while((u=u.parentNode)&&u!==document.body){if(Element.getStyle(u,"position")!=="static"){return n(u)?$(document.body):$(u)}}return $(document.body)}function c(u){u=$(u);var w=0,v=0;if(u.parentNode){do{w+=u.offsetTop||0;v+=u.offsetLeft||0;u=u.offsetParent}while(u)}return new Element.Offset(v,w)}function p(u){u=$(u);var v=u.getLayout();var y=0,x=0;do{y+=u.offsetTop||0;x+=u.offsetLeft||0;u=u.offsetParent;if(u){if(j(u)){break}var w=Element.getStyle(u,"position");if(w!=="static"){break}}}while(u);x-=v.get("margin-top");y-=v.get("margin-left");return new Element.Offset(x,y)}function d(u){var w=0,v=0;do{w+=u.scrollTop||0;v+=u.scrollLeft||0;u=u.parentNode}while(u);return new Element.Offset(v,w)}function t(w){v=$(v);var y=0,x=0,u=document.body;var v=w;do{y+=v.offsetTop||0;x+=v.offsetLeft||0;if(v.offsetParent==u&&Element.getStyle(v,"position")=="absolute"){break}}while(v=v.offsetParent);v=w;do{if(v!=u){y-=v.scrollTop||0;x-=v.scrollLeft||0}}while(v=v.parentNode);return new Element.Offset(x,y)}function a(u){u=$(u);if(Element.getStyle(u,"position")==="absolute"){return u}var y=g(u);var v=u.viewportOffset(),z=y.viewportOffset();var x=v.relativeTo(z);var w=u.getLayout();u.store("prototype_absolutize_original_styles",{left:u.getStyle("left"),top:u.getStyle("top"),width:u.getStyle("width"),height:u.getStyle("height")});u.setStyle({position:"absolute",top:x.top+"px",left:x.left+"px",width:w.get("width")+"px",height:w.get("height")+"px"});return u}function q(u){u=$(u);if(Element.getStyle(u,"position")==="relative"){return u}var v=u.retrieve("prototype_absolutize_original_styles");if(v){u.setStyle(v)}return u}if(Prototype.Browser.IE){g=g.wrap(function(w,u){u=$(u);if(m(u)||k(u)||j(u)||n(u)){return $(document.body)}var v=u.getStyle("position");if(v!=="static"){return w(u)}u.setStyle({position:"relative"});var x=w(u);u.setStyle({position:v});return x});p=p.wrap(function(x,u){u=$(u);if(!u.parentNode){return new Element.Offset(0,0)}var w=u.getStyle("position");if(w!=="static"){return x(u)}var v=u.getOffsetParent();if(v&&v.getStyle("position")==="fixed"){i(v)}u.setStyle({position:"relative"});var y=x(u);u.setStyle({position:w});return y})}else{if(Prototype.Browser.Webkit){c=function(u){u=$(u);var w=0,v=0;do{w+=u.offsetTop||0;v+=u.offsetLeft||0;if(u.offsetParent==document.body){if(Element.getStyle(u,"position")=="absolute"){break}}u=u.offsetParent}while(u);return new Element.Offset(v,w)}}}Element.addMethods({getLayout:f,measure:o,getDimensions:e,getOffsetParent:g,cumulativeOffset:c,positionedOffset:p,cumulativeScrollOffset:d,viewportOffset:t,absolutize:a,relativize:q});function j(u){return u.nodeName.toUpperCase()==="BODY"}function n(u){return u.nodeName.toUpperCase()==="HTML"}function m(u){return u.nodeType===Node.DOCUMENT_NODE}function k(u){return u!==document.body&&!Element.descendantOf(u,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(v){v=$(v);if(k(v)){return new Element.Offset(0,0)}var w=v.getBoundingClientRect(),u=document.documentElement;return new Element.Offset(w.left-u.clientLeft,w.top-u.clientTop)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function e(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function d(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function b(f,g,j){j=j||0;var l=Prototype.Selector.match,k=f.length,m=0,h;for(h=0;h<k;h++){if(l(f[h],g)&&j==m++){return Element.extend(f[h])}}}function a(f){for(var g=0,h=f.length;g<h;g++){Element.extend(f[g])}return f}var c=Prototype.K;return{select:e,match:d,find:b,extendElements:(Element.extend===c)?c:a,extendElement:Element.extend}})();Prototype._original_property=window.Sizzle;
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,g=0,r=Object.prototype.toString,j=false,a=true;[0,0].sort(function(){a=false;return 0});var o=function(H,t,E,G){E=E||[];var A=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!H||typeof H!=="string"){return E}var B=[],y,I,s,e,z,w,D=true,u=k(t),J=H;while((b.exec(""),y=b.exec(J))!==null){J=y[3];B.push(y[1]);if(y[2]){w=y[3];break}}if(B.length>1&&m.exec(H)){if(B.length===2&&i.relative[B[0]]){I=n(B[0]+B[1],t)}else{I=i.relative[B[0]]?[t]:o(B.shift(),t);while(B.length){H=B.shift();if(i.relative[H]){H+=B.shift()}I=n(H,I)}}}else{if(!G&&B.length>1&&t.nodeType===9&&!u&&i.match.ID.test(B[0])&&!i.match.ID.test(B[B.length-1])){var F=o.find(B.shift(),t,u);t=F.expr?o.filter(F.expr,F.set)[0]:F.set[0]}if(t){var F=G?{expr:B.pop(),set:l(G)}:o.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,u);I=F.expr?o.filter(F.expr,F.set):F.set;if(B.length>0){s=l(I)}else{D=false}while(B.length){var v=B.pop(),C=v;if(!i.relative[v]){v=""}else{C=B.pop()}if(C==null){C=t}i.relative[v](s,C,u)}}else{s=B=[]}}if(!s){s=I}if(!s){throw"Syntax error, unrecognized expression: "+(v||H)}if(r.call(s)==="[object Array]"){if(!D){E.push.apply(E,s)}else{if(t&&t.nodeType===1){for(var x=0;s[x]!=null;x++){if(s[x]&&(s[x]===true||s[x].nodeType===1&&c(t,s[x]))){E.push(I[x])}}}else{for(var x=0;s[x]!=null;x++){if(s[x]&&s[x].nodeType===1){E.push(I[x])}}}}}else{l(s,E)}if(w){o(w,A,E,G);o.uniqueSort(E)}return E};o.uniqueSort=function(s){if(p){j=a;s.sort(p);if(j){for(var e=1;e<s.length;e++){if(s[e]===s[e-1]){s.splice(e--,1)}}}}return s};o.matches=function(e,s){return o(e,null,null,s)};o.find=function(s,e,u){var y,x;if(!s){return[]}for(var t=0,v=i.order.length;t<v;t++){var z=i.order[t],x;if((x=i.leftMatch[z].exec(s))){var w=x[1];x.splice(1,1);if(w.substr(w.length-1)!=="\\"){x[1]=(x[1]||"").replace(/\\/g,"");y=i.find[z](x,e,u);if(y!=null){s=s.replace(i.match[z],"");break}}}}if(!y){y=e.getElementsByTagName("*")}return{set:y,expr:s}};o.filter=function(t,F,x,B){var C=t,E=[],s=F,A,e,y=F&&F[0]&&k(F[0]);while(t&&F.length){for(var G in i.filter){if((A=i.match[G].exec(t))!=null){var u=i.filter[G],v,z;e=false;if(s==E){E=[]}if(i.preFilter[G]){A=i.preFilter[G](A,s,x,E,B,y);if(!A){e=v=true}else{if(A===true){continue}}}if(A){for(var w=0;(z=s[w])!=null;w++){if(z){v=u(z,A,w,s);var D=B^!!v;if(x&&v!=null){if(D){e=true}else{s[w]=false}}else{if(D){E.push(z);e=true}}}}}if(v!==undefined){if(!x){s=E}t=t.replace(i.match[G],"");if(!e){return[]}break}}}if(t==C){if(e==null){throw"Syntax error, unrecognized expression: "+t}else{break}}C=t}return s};var i=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(e,z,x){var u=typeof z==="string",w=u&&!/\W/.test(z),v=u&&!w;if(w&&!x){z=z.toUpperCase()}for(var t=0,y=e.length,s;t<y;t++){if((s=e[t])){while((s=s.previousSibling)&&s.nodeType!==1){}e[t]=v||s&&s.nodeName===z?s||false:s===z}}if(v){o.filter(z,e,true)}},">":function(e,y,v){var u=typeof y==="string";if(u&&!/\W/.test(y)){y=v?y:y.toUpperCase();for(var t=0,w=e.length;t<w;t++){var s=e[t];if(s){var x=s.parentNode;e[t]=x.nodeName===y?x:false}}}else{for(var t=0,w=e.length;t<w;t++){var s=e[t];if(s){e[t]=u?s.parentNode:s.parentNode===y}}if(u){o.filter(y,e,true)}}},"":function(s,w,u){var t=g++,e=d;if(!/\W/.test(w)){var v=w=u?w:w.toUpperCase();e=f}e("parentNode",w,t,s,v,u)},"~":function(s,w,u){var t=g++,e=d;if(typeof w==="string"&&!/\W/.test(w)){var v=w=u?w:w.toUpperCase();e=f}e("previousSibling",w,t,s,v,u)}},find:{ID:function(u,e,s){if(typeof e.getElementById!=="undefined"&&!s){var t=e.getElementById(u[1]);return t?[t]:[]}},NAME:function(v,e,t){if(typeof e.getElementsByName!=="undefined"){var x=[],w=e.getElementsByName(v[1]);for(var s=0,u=w.length;s<u;s++){if(w[s].getAttribute("name")===v[1]){x.push(w[s])}}return x.length===0?null:x}},TAG:function(s,e){return e.getElementsByTagName(s[1])}},preFilter:{CLASS:function(w,e,u,y,x,v){w=" "+w[1].replace(/\\/g,"")+" ";if(v){return w}for(var t=0,s;(s=e[t])!=null;t++){if(s){if(x^(s.className&&(" "+s.className+" ").indexOf(w)>=0)){if(!u){y.push(s)}}else{if(u){e[t]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(t,e){for(var s=0;e[s]===false;s++){}return e[s]&&k(e[s])?t[1]:t[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(s[1]+(s[2]||1))-0;e[3]=s[3]-0}e[0]=g++;return e},ATTR:function(u,e,s,x,w,t){var v=u[1].replace(/\\/g,"");if(!t&&i.attrMap[v]){u[1]=i.attrMap[v]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(t,e,s,v,u){if(t[1]==="not"){if((b.exec(t[3])||"").length>1||/^\w/.test(t[3])){t[3]=o(t[3],null,null,e)}else{var w=o.filter(t[3],e,s,true^u);if(!s){v.push.apply(v,w)}return false}}else{if(i.match.POS.test(t[0])||i.match.CHILD.test(t[0])){return true}}return t},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(e,s,t){return !!o(t[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(e,s){return s===0},last:function(s,t,u,e){return t===e.length-1},even:function(e,s){return s%2===0},odd:function(e,s){return s%2===1},lt:function(e,s,t){return s<t[3]-0},gt:function(e,s,t){return s>t[3]-0},nth:function(e,s,t){return t[3]-0==s},eq:function(e,s,t){return t[3]-0==s}},filter:{PSEUDO:function(s,w,u,e){var x=w[1],t=i.filters[x];if(t){return t(s,u,w,e)}else{if(x==="contains"){return(s.textContent||s.innerText||"").indexOf(w[3])>=0}else{if(x==="not"){var y=w[3];for(var u=0,v=y.length;u<v;u++){if(y[u]===s){return false}}return true}}}},CHILD:function(u,x){var A=x[1],y=u;switch(A){case"only":case"first":while((y=y.previousSibling)){if(y.nodeType===1){return false}}if(A=="first"){return true}y=u;case"last":while((y=y.nextSibling)){if(y.nodeType===1){return false}}return true;case"nth":var v=x[2],w=x[3];if(v==1&&w==0){return true}var t=x[0],z=u.parentNode;if(z&&(z.sizcache!==t||!u.nodeIndex)){var e=0;for(y=z.firstChild;y;y=y.nextSibling){if(y.nodeType===1){y.nodeIndex=++e}}z.sizcache=t}var s=u.nodeIndex-w;if(v==0){return s==0}else{return(s%v==0&&s/v>=0)}}},ID:function(e,s){return e.nodeType===1&&e.getAttribute("id")===s},TAG:function(e,s){return(s==="*"&&e.nodeType===1)||e.nodeName===s},CLASS:function(e,s){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(s)>-1},ATTR:function(s,t){var u=t[1],v=i.attrHandle[u]?i.attrHandle[u](s):s[u]!=null?s[u]:s.getAttribute(u),x=v+"",w=t[2],e=t[4];return v==null?w==="!=":w==="="?x===e:w==="*="?x.indexOf(e)>=0:w==="~="?(" "+x+" ").indexOf(e)>=0:!e?x&&v!==false:w==="!="?x!=e:w==="^="?x.indexOf(e)===0:w==="$="?x.substr(x.length-e.length)===e:w==="|="?x===e||x.substr(0,e.length+1)===e+"-":false},POS:function(s,v,u,e){var w=v[2],t=i.setFilters[w];if(t){return t(s,u,v,e)}}}};var m=i.match.POS;for(var q in i.match){i.match[q]=new RegExp(i.match[q].source+/(?![^\[]*\])(?![^\(]*\))/.source);i.leftMatch[q]=new RegExp(/(^(?:.|\r|\n)*?)/.source+i.match[q].source)}var l=function(e,s){e=Array.prototype.slice.call(e,0);if(s){s.push.apply(s,e);return s}return e};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(h){l=function(e,u){var v=u||[];if(r.call(e)==="[object Array]"){Array.prototype.push.apply(v,e)}else{if(typeof e.length==="number"){for(var s=0,t=e.length;s<t;s++){v.push(e[s])}}else{for(var s=0;e[s];s++){v.push(e[s])}}}return v}}var p;if(document.documentElement.compareDocumentPosition){p=function(e,s){if(!e.compareDocumentPosition||!s.compareDocumentPosition){if(e==s){j=true}return 0}var t=e.compareDocumentPosition(s)&4?-1:e===s?0:1;if(t===0){j=true}return t}}else{if("sourceIndex" in document.documentElement){p=function(e,s){if(!e.sourceIndex||!s.sourceIndex){if(e==s){j=true}return 0}var t=e.sourceIndex-s.sourceIndex;if(t===0){j=true}return t}}else{if(document.createRange){p=function(e,t){if(!e.ownerDocument||!t.ownerDocument){if(e==t){j=true}return 0}var s=e.ownerDocument.createRange(),u=t.ownerDocument.createRange();s.setStart(e,0);s.setEnd(e,0);u.setStart(t,0);u.setEnd(t,0);var v=s.compareBoundaryPoints(Range.START_TO_END,u);if(v===0){j=true}return v}}}}(function(){var e=document.createElement("div"),s="script"+(new Date).getTime();e.innerHTML="<a name='"+s+"'/>";var t=document.documentElement;t.insertBefore(e,t.firstChild);if(!!document.getElementById(s)){i.find.ID=function(x,u,v){if(typeof u.getElementById!=="undefined"&&!v){var w=u.getElementById(x[1]);return w?w.id===x[1]||typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id").nodeValue===x[1]?[w]:undefined:[]}};i.filter.ID=function(u,v){var w=typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id");return u.nodeType===1&&w&&w.nodeValue===v}}t.removeChild(e);t=e=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){i.find.TAG=function(u,s){var v=s.getElementsByTagName(u[1]);if(u[1]==="*"){var w=[];for(var t=0;v[t];t++){if(v[t].nodeType===1){w.push(v[t])}}v=w}return v}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){i.attrHandle.href=function(s){return s.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var s=o,e=document.createElement("div");e.innerHTML="<p class='TEST'></p>";if(e.querySelectorAll&&e.querySelectorAll(".TEST").length===0){return}o=function(x,u,w,y){u=u||document;if(!y&&u.nodeType===9&&!k(u)){try{return l(u.querySelectorAll(x),w)}catch(v){}}return s(x,u,w,y)};for(var t in s){o[t]=s[t]}e=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}i.order.splice(1,0,"CLASS");i.find.CLASS=function(u,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(u[1])}};e=null})()}function f(t,s,u,e,A,x){var B=t=="previousSibling"&&!x;for(var w=0,y=e.length;w<y;w++){var v=e[w];if(v){if(B&&v.nodeType===1){v.sizcache=u;v.sizset=w}v=v[t];var z=false;while(v){if(v.sizcache===u){z=e[v.sizset];break}if(v.nodeType===1&&!x){v.sizcache=u;v.sizset=w}if(v.nodeName===s){z=v;break}v=v[t]}e[w]=z}}}function d(t,s,u,e,A,x){var B=t=="previousSibling"&&!x;for(var w=0,y=e.length;w<y;w++){var v=e[w];if(v){if(B&&v.nodeType===1){v.sizcache=u;v.sizset=w}v=v[t];var z=false;while(v){if(v.sizcache===u){z=e[v.sizset];break}if(v.nodeType===1){if(!x){v.sizcache=u;v.sizset=w}if(typeof s!=="string"){if(v===s){z=true;break}}else{if(o.filter(s,[v]).length>0){z=v;break}}}v=v[t]}e[w]=z}}}var c=document.compareDocumentPosition?function(e,s){return e.compareDocumentPosition(s)&16}:function(e,s){return e!==s&&(e.contains?e.contains(s):true)};var k=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var n=function(x,e){var y=[],u="",v,w=e.nodeType?[e]:e;while((v=i.match.PSEUDO.exec(x))){u+=v[0];x=x.replace(i.match.PSEUDO,"")}x=i.relative[x]?x+"*":x;for(var s=0,t=w.length;s<t;s++){o(x,w[s],y)}return o.filter(u,y)};window.Sizzle=o})();(function(a){var b=Prototype.Selector.extendElements;function d(f,e){return b(a(f,e||document))}function c(e,f){return a.matches(f,[e]).length==1}Prototype.Selector.engine=a;Prototype.Selector.select=d;Prototype.Selector.match=c})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(b,e){if(typeof e!="object"){e={hash:!!e}}else{if(Object.isUndefined(e.hash)){e.hash=true}}var d,h,g=false,f=e.submit,a,c;if(e.hash){c={};a=function(j,i,k){if(i in j){if(!Object.isArray(j[i])){j[i]=[j[i]]}j[i].push(k)}else{j[i]=k}return j}}else{c="";a=function(j,i,k){return j+(j?"&":"")+encodeURIComponent(i)+"="+encodeURIComponent(k)}}return b.inject(c,function(j,i){if(!i.disabled&&i.name){d=i.name;h=$(i).getValue();if(h!=null&&i.type!="file"&&(i.type!="submit"||(!g&&f!==false&&(!f||d==f)&&(g=true)))){j=a(j,d,h)}}return j})}};Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(d){var c=$(d).getElementsByTagName("*"),b,a=[],f=Form.Element.Serializers;for(var e=0;b=c[e];e++){a.push(b)}return a.inject([],function(h,g){if(f[g.tagName.toLowerCase()]){h.push(Element.extend(g))}return h})},getInputs:function(a,h,g){a=$(a);var d=a.getElementsByTagName("input");if(!h&&!g){return $A(d).map(Element.extend)}for(var b=0,f=[],e=d.length;b<e;b++){var c=d[b];if((h&&c.type!=h)||(g&&c.name!=g)){continue}f.push(Element.extend(c))}return f},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(c){var a=$(c).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var b=a.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return b?b:a.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(b){b=$(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(b,c){b=$(b),c=Object.clone(c||{});var d=c.parameters,a=b.readAttribute("action")||"";if(a.blank()){a=window.location.href}c.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(c.parameters,d)}if(b.hasAttribute("method")&&!c.method){c.method=b.method}return new Ajax.Request(a,c)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var c=a.getValue();if(c!=undefined){var b={};b[a.name]=c;return Object.toQueryString(b)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,c){a=$(a);var b=a.tagName.toLowerCase();Form.Element.Serializers[b](a,c);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(b){b=$(b);try{b.focus();if(b.select&&(b.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(b.type)))){b.select()}}catch(a){}return b},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function a(h,i){switch(h.type.toLowerCase()){case"checkbox":case"radio":return b(h,i);default:return g(h,i)}}function b(h,i){if(Object.isUndefined(i)){return h.checked?h.value:null}else{h.checked=!!i}}function g(h,i){if(Object.isUndefined(i)){return h.value}else{h.value=i}}function d(j,o){if(Object.isUndefined(o)){return(j.type==="select-one"?f:e)(j)}var m,h,n=!Object.isArray(o);for(var k=0,l=j.length;k<l;k++){m=j.options[k];h=this.optionValue(m);if(n){if(h==o){m.selected=true;return}}else{m.selected=o.include(h)}}}function f(h){var i=h.selectedIndex;return i>=0?c(h.options[i]):null}function e(h){var m,k=h.length;if(!k){return null}for(var j=0,m=[];j<k;j++){var l=h.options[j];if(l.selected){m.push(c(l))}}return m}function c(h){return Element.hasAttribute(h,"value")?h.value:h.text}return{input:a,inputSelector:b,textarea:g,select:d,selectOne:f,selectMany:e,optionValue:c,button:g}})();Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,a){$super(a,c);this.element=$(b);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(b,a){this.element=$(b);this.callback=a;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var m={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var k=document.documentElement;var v="onmouseenter" in k&&"onmouseleave" in k;var p=function(E){return false};if(window.attachEvent){if(window.addEventListener){p=function(E){return !(E instanceof window.Event)}}else{p=function(E){return true}}}var d;function e(F,E){return F.which?(F.which===E+1):(F.button===E)}var t={0:1,1:4,2:2};function f(F,E){return F.button===t[E]}function g(F,E){switch(E){case 0:return F.which==1&&!F.metaKey;case 1:return F.which==2||(F.which==1&&F.metaKey);case 2:return F.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){d=f}else{d=function(F,E){return p(F)?f(F,E):e(F,E)}}}else{if(Prototype.Browser.WebKit){d=g}else{d=e}}function q(E){return d(E,0)}function r(E){return d(E,1)}function s(E){return d(E,2)}function l(F){F=m.extend(F);var G=F.target,H=F.type,E=F.currentTarget;if(E&&E.tagName){if(H==="load"||H==="error"||(H==="click"&&E.tagName.toLowerCase()==="input"&&E.type==="radio")){G=E}}if(G.nodeType==Node.TEXT_NODE){G=G.parentNode}return Element.extend(G)}function n(F,G){var E=m.element(F);if(!G){return E}while(E){if(Object.isElement(E)&&Prototype.Selector.match(E,G)){return Element.extend(E)}E=E.parentNode}}function y(E){return{x:A(E),y:z(E)}}function A(G){var F=document.documentElement,E=document.body||{scrollLeft:0};return G.pageX||(G.clientX+(F.scrollLeft||E.scrollLeft)-(F.clientLeft||0))}function z(G){var F=document.documentElement,E=document.body||{scrollTop:0};return G.pageY||(G.clientY+(F.scrollTop||E.scrollTop)-(F.clientTop||0))}function B(E){m.extend(E);E.preventDefault();E.stopPropagation();E.stopped=true}m.Methods={isLeftClick:q,isMiddleClick:r,isRightClick:s,element:l,findElement:n,pointer:y,pointerX:A,pointerY:z,stop:B};var u=Object.keys(m.Methods).inject({},function(E,F){E[F]=m.Methods[F].methodize();return E});if(window.attachEvent){function h(F){var E;switch(F.type){case"mouseover":case"mouseenter":E=F.fromElement;break;case"mouseout":case"mouseleave":E=F.toElement;break;default:return null}return Element.extend(E)}var i={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};m.extend=function(F,E){if(!F){return false}if(!p(F)){return F}if(F._extendedByPrototype){return F}F._extendedByPrototype=Prototype.emptyFunction;var G=m.pointer(F);Object.extend(F,{target:F.srcElement||E,relatedTarget:h(F),pageX:G.x,pageY:G.y});Object.extend(F,u);Object.extend(F,i);return F}}else{m.extend=Prototype.K}if(window.addEventListener){m.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(m.prototype,u)}function a(E,F,G){var H=Element.retrieve(E,"prototype_event_registry");if(Object.isUndefined(H)){j.push(E);H=Element.retrieve(E,"prototype_event_registry",$H())}var J=H.get(F);if(Object.isUndefined(J)){J=[];H.set(F,J)}if(J.pluck("handler").include(G)){return false}var I;if(F.include(":")){I=function(K){if(Object.isUndefined(K.eventName)){return false}if(K.eventName!==F){return false}m.extend(K,E);G.call(E,K)}}else{if(!v&&(F==="mouseenter"||F==="mouseleave")){if(F==="mouseenter"||F==="mouseleave"){I=function(L){m.extend(L,E);var M=L.relatedTarget;while(M&&M!==E){try{M=M.parentNode}catch(K){M=E}}if(M===E){return}G.call(E,L)}}}else{I=function(K){m.extend(K,E);G.call(E,K)}}}I.handler=G;J.push(I);return I}function b(){for(var E=0,F=j.length;E<F;E++){m.stopObserving(j[E]);j[E]=null}}var j=[];if(Prototype.Browser.IE){window.attachEvent("onunload",b)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var c=Prototype.K,D={mouseenter:"mouseover",mouseleave:"mouseout"};if(!v){c=function(E){return(D[E]||E)}}function w(F,G,H){F=$(F);var I=a(F,G,H);if(!I){return F}if(G.include(":")){if(F.addEventListener){F.addEventListener("dataavailable",I,false)}else{F.attachEvent("ondataavailable",I);F.attachEvent("onlosecapture",I)}}else{var E=c(G);if(F.addEventListener){F.addEventListener(E,I,false)}else{F.attachEvent("on"+E,I)}}return F}function C(F,G,H){F=$(F);var J=Element.retrieve(F,"prototype_event_registry");if(!J){return F}if(!G){J.each(function(N){var M=N.key;C(F,M)});return F}var L=J.get(G);if(!L){return F}if(!H){L.each(function(M){C(F,G,M.handler)});return F}var I=L.length,K;while(I--){if(L[I].handler===H){K=L[I];break}}if(!K){return F}if(G.include(":")){if(F.removeEventListener){F.removeEventListener("dataavailable",K,false)}else{F.detachEvent("ondataavailable",K);F.detachEvent("onlosecapture",K)}}else{var E=c(G);if(F.removeEventListener){F.removeEventListener(E,K,false)}else{F.detachEvent("on"+E,K)}}J.set(G,L.without(K));return F}function o(F,H,I,E){F=$(F);if(Object.isUndefined(E)){E=true}if(F==document&&document.createEvent&&!F.dispatchEvent){F=document.documentElement}var G;if(document.createEvent){G=document.createEvent("HTMLEvents");G.initEvent("dataavailable",E,true)}else{G=document.createEventObject();G.eventType=E?"ondataavailable":"onlosecapture"}G.eventName=H;G.memo=I||{};if(document.createEvent){F.dispatchEvent(G)}else{F.fireEvent(G.eventType,G)}return m.extend(G)}m.Handler=Class.create({initialize:function(F,G,H,E){this.element=$(F);this.eventName=G;this.selector=H;this.callback=E;this.handler=this.handleEvent.bind(this)},start:function(){m.observe(this.element,this.eventName,this.handler);return this},stop:function(){m.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(F){var E=m.findElement(F,this.selector);if(E){this.callback.call(this.element,F,E)}}});function x(F,G,H,E){F=$(F);if(Object.isFunction(H)&&Object.isUndefined(E)){E=H,H=null}return new m.Handler(F,G,H,E).start()}Object.extend(m,m.Methods);Object.extend(m,{fire:o,observe:w,stopObserving:C,on:x});Element.addMethods({fire:o,observe:w,stopObserving:C,on:x});Object.extend(document,{fire:o.methodize(),observe:w.methodize(),stopObserving:C.methodize(),on:x.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,m)}else{window.Event=m}})();(function(){var d;function b(){if(document.loaded){return}if(d){window.clearTimeout(d)}document.loaded=true;document.fire("dom:loaded")}function a(){if(document.readyState==="complete"){document.stopObserving("readystatechange",a);b()}}function c(){try{document.documentElement.doScroll("left")}catch(f){d=c.defer();return}b()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",b,false)}else{document.observe("readystatechange",a);if(window==top){d=c.defer()}}Event.observe(window,"load",b)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(b,a){return Element.insert(b,{before:a})},Top:function(b,a){return Element.insert(b,{top:a})},Bottom:function(b,a){return Element.insert(b,{bottom:a})},After:function(b,a){return Element.insert(b,{after:a})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(a,c,b){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(a,c,b)}this.xcomp=c;this.ycomp=b;this.offset=Element.cumulativeOffset(a);return(b>=this.offset[1]&&b<this.offset[1]+a.offsetHeight&&c>=this.offset[0]&&c<this.offset[0]+a.offsetWidth)},withinIncludingScrolloffsets:function(a,d,b){var c=Element.cumulativeScrollOffset(a);this.xcomp=d+c[0]-this.deltaX;this.ycomp=b+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(a);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(a){function b(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}a.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(e,c){c=c.toString().strip();var d=/\s/.test(c)?$w(c).map(b).join(""):b(c);return d?document._getElementsByXPath(".//*"+d,e):[]}:function(g,d){d=d.toString().strip();var h=[],e=(/\s/.test(d)?$w(d):null);if(!e&&!d){return h}var k=$(g).getElementsByTagName("*");d=" "+d+" ";for(var j=0,c,f;c=k[j];j++){if(c.className&&(f=" "+c.className+" ")&&(f.include(d)||(e&&e.all(function(i){return !i.toString().blank()&&f.include(" "+i+" ")})))){h.push(Element.extend(c))}}return h};return function(c,d){return $(d||document.body).getElementsByClassName(c)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(b,c){var f=Prototype.Selector.match,g=[];for(var d=0,e=b.length;d<e;d++){var a=b[d];if(f(a,c)){g.push(Element.extend(a))}}return g},findElement:function(b,c,e){e=e||0;var g=0,a;for(var d=0,f=b.length;d<f;d++){a=b[d];if(Prototype.Selector.match(a,c)&&e===g++){return Element.extend(a)}}},findChildElements:function(a,b){var c=b.toArray().join(", ");return Prototype.Selector.select(c,a||document)}})})();/*
 * jQuery JavaScript Library v1.5.2
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Mar 31 15:28:23 2011 -0400
 */
(function(a8,a7){var v=a8.document;var N=(function(){var bm=function(bJ,bI){return new bm.fn.init(bJ,bI,bu)},bf=a8.jQuery,e=a8.$,bu,bo=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,bt=/\S/,bF=/^\s+/,bG=/\s+$/,bp=/\d/,bw=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,by=/^[\],:{}\s]*$/,bz=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bA=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bx=/(?:^|:|,)(?:\s*\[)+/g,bB=/(webkit)[ \/]([\w.]+)/,bv=/(opera)(?:.*version)?[ \/]([\w.]+)/,bs=/(msie) ([\w.]+)/,br=/(mozilla)(?:.*? rv:([\w.]+))?/,bH=navigator.userAgent,bg,bq,bi,bD=Object.prototype.toString,bk=Object.prototype.hasOwnProperty,bn=Array.prototype.push,bC=Array.prototype.slice,bE=String.prototype.trim,bl=Array.prototype.indexOf,bh={};bm.fn=bm.prototype={constructor:bm,init:function(bO,bI,bN){var bL,bK,bM,bJ;if(!bO){return this}if(bO.nodeType){this.context=this[0]=bO;this.length=1;return this}if(bO==="body"&&!bI&&v.body){this.context=v;this[0]=v.body;this.selector="body";this.length=1;return this}if(typeof bO==="string"){bL=bo.exec(bO);if(bL&&(bL[1]||!bI)){if(bL[1]){bI=bI instanceof bm?bI[0]:bI;bJ=(bI?bI.ownerDocument||bI:v);bM=bw.exec(bO);if(bM){if(bm.isPlainObject(bI)){bO=[v.createElement(bM[1])];bm.fn.attr.call(bO,bI,true)}else{bO=[bJ.createElement(bM[1])]}}else{bM=bm.buildFragment([bL[1]],[bJ]);bO=(bM.cacheable?bm.clone(bM.fragment):bM.fragment).childNodes}return bm.merge(this,bO)}else{bK=v.getElementById(bL[2]);if(bK&&bK.parentNode){if(bK.id!==bL[2]){return bN.find(bO)}this.length=1;this[0]=bK}this.context=v;this.selector=bO;return this}}else{if(!bI||bI.jquery){return(bI||bN).find(bO)}else{return this.constructor(bI).find(bO)}}}else{if(bm.isFunction(bO)){return bN.ready(bO)}}if(bO.selector!==a7){this.selector=bO.selector;this.context=bO.context}return bm.makeArray(bO,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return bC.call(this,0)},get:function(bI){return bI==null?this.toArray():(bI<0?this[this.length+bI]:this[bI])},pushStack:function(bI,bJ,bL){var bK=this.constructor();if(bm.isArray(bI)){bn.apply(bK,bI)}else{bm.merge(bK,bI)}bK.prevObject=this;bK.context=this.context;if(bJ==="find"){bK.selector=this.selector+(this.selector?" ":"")+bL}else{if(bJ){bK.selector=this.selector+"."+bJ+"("+bL+")"}}return bK},each:function(bJ,bI){return bm.each(this,bJ,bI)},ready:function(bI){bm.bindReady();bq.done(bI);return this},eq:function(bI){return bI===-1?this.slice(bI):this.slice(bI,+bI+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bC.apply(this,arguments),"slice",bC.call(arguments).join(","))},map:function(bI){return this.pushStack(bm.map(this,function(bJ,bK){return bI.call(bJ,bK,bJ)}))},end:function(){return this.prevObject||this.constructor(null)},push:bn,sort:[].sort,splice:[].splice};bm.fn.init.prototype=bm.fn;bm.extend=bm.fn.extend=function(){var bP,bO,bQ,bJ,bK,bI,bR=arguments[0]||{},bM=1,bN=arguments.length,bL=false;if(typeof bR==="boolean"){bL=bR;bR=arguments[1]||{};bM=2}if(typeof bR!=="object"&&!bm.isFunction(bR)){bR={}}if(bN===bM){bR=this;--bM}for(;bM<bN;bM++){if((bP=arguments[bM])!=null){for(bO in bP){bQ=bR[bO];bJ=bP[bO];if(bR===bJ){continue}if(bL&&bJ&&(bm.isPlainObject(bJ)||(bK=bm.isArray(bJ)))){if(bK){bK=false;bI=bQ&&bm.isArray(bQ)?bQ:[]}else{bI=bQ&&bm.isPlainObject(bQ)?bQ:{}}bR[bO]=bm.extend(bL,bI,bJ)}else{if(bJ!==a7){bR[bO]=bJ}}}}}return bR};bm.extend({noConflict:function(bI){a8.$=e;if(bI){a8.jQuery=bf}return bm},isReady:false,readyWait:1,ready:function(bI){if(bI===true){bm.readyWait--}if(!bm.readyWait||(bI!==true&&!bm.isReady)){if(!v.body){return setTimeout(bm.ready,1)}bm.isReady=true;if(bI!==true&&--bm.readyWait>0){return}bq.resolveWith(v,[bm]);if(bm.fn.trigger){bm(v).trigger("ready").unbind("ready")}}},bindReady:function(){if(bq){return}bq=bm._Deferred();if(v.readyState==="complete"){return setTimeout(bm.ready,1)}if(v.addEventListener){v.addEventListener("DOMContentLoaded",bi,false);a8.addEventListener("load",bm.ready,false)}else{if(v.attachEvent){v.attachEvent("onreadystatechange",bi);a8.attachEvent("onload",bm.ready);var bJ=false;try{bJ=a8.frameElement==null}catch(bI){}if(v.documentElement.doScroll&&bJ){bj()}}}},isFunction:function(bI){return bm.type(bI)==="function"},isArray:Array.isArray||function(bI){return bm.type(bI)==="array"},isWindow:function(bI){return bI&&typeof bI==="object"&&"setInterval" in bI},isNaN:function(bI){return bI==null||!bp.test(bI)||isNaN(bI)},type:function(bI){return bI==null?String(bI):bh[bD.call(bI)]||"object"},isPlainObject:function(bJ){if(!bJ||bm.type(bJ)!=="object"||bJ.nodeType||bm.isWindow(bJ)){return false}if(bJ.constructor&&!bk.call(bJ,"constructor")&&!bk.call(bJ.constructor.prototype,"isPrototypeOf")){return false}var bI;for(bI in bJ){}return bI===a7||bk.call(bJ,bI)},isEmptyObject:function(bJ){for(var bI in bJ){return false}return true},error:function(bI){throw bI},parseJSON:function(bI){if(typeof bI!=="string"||!bI){return null}bI=bm.trim(bI);if(by.test(bI.replace(bz,"@").replace(bA,"]").replace(bx,""))){return a8.JSON&&a8.JSON.parse?a8.JSON.parse(bI):(new Function("return "+bI))()}else{bm.error("Invalid JSON: "+bI)}},parseXML:function(bI,bK,bJ){if(a8.DOMParser){bJ=new DOMParser();bK=bJ.parseFromString(bI,"text/xml")}else{bK=new ActiveXObject("Microsoft.XMLDOM");bK.async="false";bK.loadXML(bI)}bJ=bK.documentElement;if(!bJ||!bJ.nodeName||bJ.nodeName==="parsererror"){bm.error("Invalid XML: "+bI)}return bK},noop:function(){},globalEval:function(bI){if(bI&&bt.test(bI)){var bJ=v.head||v.getElementsByTagName("head")[0]||v.documentElement,bK=v.createElement("script");if(bm.support.scriptEval()){bK.appendChild(v.createTextNode(bI))}else{bK.text=bI}bJ.insertBefore(bK,bJ.firstChild);bJ.removeChild(bK)}},nodeName:function(bI,bJ){return bI.nodeName&&bI.nodeName.toUpperCase()===bJ.toUpperCase()},each:function(bO,bJ,bI){var bN,bK=0,bM=bO.length,bL=bM===a7||bm.isFunction(bO);if(bI){if(bL){for(bN in bO){if(bJ.apply(bO[bN],bI)===false){break}}}else{for(;bK<bM;){if(bJ.apply(bO[bK++],bI)===false){break}}}}else{if(bL){for(bN in bO){if(bJ.call(bO[bN],bN,bO[bN])===false){break}}}else{for(var bP=bO[0];bK<bM&&bJ.call(bP,bK,bP)!==false;bP=bO[++bK]){}}}return bO},trim:bE?function(bI){return bI==null?"":bE.call(bI)}:function(bI){return bI==null?"":bI.toString().replace(bF,"").replace(bG,"")},makeArray:function(bI,bJ){var bK=bJ||[];if(bI!=null){var bL=bm.type(bI);if(bI.length==null||bL==="string"||bL==="function"||bL==="regexp"||bm.isWindow(bI)){bn.call(bK,bI)}else{bm.merge(bK,bI)}}return bK},inArray:function(bJ,bI){if(bI.indexOf){return bI.indexOf(bJ)}for(var bK=0,bL=bI.length;bK<bL;bK++){if(bI[bK]===bJ){return bK}}return -1},merge:function(bI,bM){var bJ=bI.length,bK=0;if(typeof bM.length==="number"){for(var bL=bM.length;bK<bL;bK++){bI[bJ++]=bM[bK]}}else{while(bM[bK]!==a7){bI[bJ++]=bM[bK++]}}bI.length=bJ;return bI},grep:function(bJ,bI,bL){var bN=[],bO;bL=!!bL;for(var bK=0,bM=bJ.length;bK<bM;bK++){bO=!!bI(bJ[bK],bK);if(bL!==bO){bN.push(bJ[bK])}}return bN},map:function(bK,bJ,bI){var bN=[],bO;for(var bL=0,bM=bK.length;bL<bM;bL++){bO=bJ(bK[bL],bL,bI);if(bO!=null){bN[bN.length]=bO}}return bN.concat.apply([],bN)},guid:1,proxy:function(bI,bJ,bK){if(arguments.length===2){if(typeof bJ==="string"){bK=bI;bI=bK[bJ];bJ=a7}else{if(bJ&&!bm.isFunction(bJ)){bK=bJ;bJ=a7}}}if(!bJ&&bI){bJ=function(){return bI.apply(bK||this,arguments)}}if(bI){bJ.guid=bI.guid=bI.guid||bJ.guid||bm.guid++}return bJ},access:function(bI,bN,bQ,bJ,bK,bP){var bO=bI.length;if(typeof bN==="object"){for(var bM in bN){bm.access(bI,bM,bN[bM],bJ,bK,bQ)}return bI}if(bQ!==a7){bJ=!bP&&bJ&&bm.isFunction(bQ);for(var bL=0;bL<bO;bL++){bK(bI[bL],bN,bJ?bQ.call(bI[bL],bL,bK(bI[bL],bN)):bQ,bP)}return bI}return bO?bK(bI[0],bN):a7},now:function(){return(new Date()).getTime()},uaMatch:function(bJ){bJ=bJ.toLowerCase();var bI=bB.exec(bJ)||bv.exec(bJ)||bs.exec(bJ)||bJ.indexOf("compatible")<0&&br.exec(bJ)||[];return{browser:bI[1]||"",version:bI[2]||"0"}},sub:function(){function bJ(bM,bL){return new bJ.fn.init(bM,bL)}bm.extend(true,bJ,this);bJ.superclass=this;bJ.fn=bJ.prototype=this();bJ.fn.constructor=bJ;bJ.subclass=this.subclass;bJ.fn.init=function bI(bM,bL){if(bL&&bL instanceof bm&&!(bL instanceof bJ)){bL=bJ(bL)}return bm.fn.init.call(this,bM,bL,bK)};bJ.fn.init.prototype=bJ.fn;var bK=bJ(v);return bJ},browser:{}});bm.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(bI,bJ){bh["[object "+bJ+"]"]=bJ.toLowerCase()});bg=bm.uaMatch(bH);if(bg.browser){bm.browser[bg.browser]=true;bm.browser.version=bg.version}if(bm.browser.webkit){bm.browser.safari=true}if(bl){bm.inArray=function(bJ,bI){return bl.call(bI,bJ)}}if(bt.test("\xA0")){bF=/^[\s\xA0]+/;bG=/[\s\xA0]+$/}bu=bm(v);if(v.addEventListener){bi=function(){v.removeEventListener("DOMContentLoaded",bi,false);bm.ready()}}else{if(v.attachEvent){bi=function(){if(v.readyState==="complete"){v.detachEvent("onreadystatechange",bi);bm.ready()}}}}function bj(){if(bm.isReady){return}try{v.documentElement.doScroll("left")}catch(bI){setTimeout(bj,1);return}bm.ready()}return bm})();var V="then done fail isResolved isRejected promise".split(" "),a1=[].slice;N.extend({_Deferred:function(){var e=[],bh,bi,bf,bg={done:function(){if(!bf){var bk=arguments,bm,bn,bl,bo,bj;if(bh){bj=bh;bh=0}for(bm=0,bn=bk.length;bm<bn;bm++){bl=bk[bm];bo=N.type(bl);if(bo==="array"){bg.done.apply(bg,bl)}else{if(bo==="function"){e.push(bl)}}}if(bj){bg.resolveWith(bj[0],bj[1])}}return this},resolveWith:function(bk,bj){if(!bf&&!bh&&!bi){bj=bj||[];bi=1;try{while(e[0]){e.shift().apply(bk,bj)}}finally{bh=[bk,bj];bi=0}}return this},resolve:function(){bg.resolveWith(this,arguments);return this},isResolved:function(){return !!(bi||bh)},cancel:function(){bf=1;e=[];return this}};return bg},Deferred:function(bg){var e=N._Deferred(),bf=N._Deferred(),bh;N.extend(e,{then:function(bi,bj){e.done(bi).fail(bj);return this},fail:bf.done,rejectWith:bf.resolveWith,reject:bf.resolve,isRejected:bf.isResolved,promise:function(bj){if(bj==null){if(bh){return bh}bh=bj={}}var bi=V.length;while(bi--){bj[V[bi]]=e[V[bi]]}return bj}});e.done(bf.cancel).fail(e.cancel);delete e.cancel;if(bg){bg.call(e,e)}return e},when:function(bh){var e=arguments,bi=0,bj=e.length,bf=bj,bg=bj<=1&&bh&&N.isFunction(bh.promise)?bh:N.Deferred();function bk(bl){return function(bm){e[bl]=arguments.length>1?a1.call(arguments,0):bm;if(!(--bf)){bg.resolveWith(bg,a1.call(e,0))}}}if(bj>1){for(;bi<bj;bi++){if(e[bi]&&N.isFunction(e[bi].promise)){e[bi].promise().then(bk(bi),bg.reject)}else{--bf}}if(!bf){bg.resolveWith(bg,e)}}else{if(bg!==bh){bg.resolveWith(bg,bj?[bh]:[])}}return bg.promise()}});(function(){N.support={};var bj=v.createElement("div");bj.style.display="none";bj.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var bh=bj.getElementsByTagName("*"),bg=bj.getElementsByTagName("a")[0],bp=v.createElement("select"),bo=bp.appendChild(v.createElement("option")),bn=bj.getElementsByTagName("input")[0];if(!bh||!bh.length||!bg){return}N.support={leadingWhitespace:bj.firstChild.nodeType===3,tbody:!bj.getElementsByTagName("tbody").length,htmlSerialize:!!bj.getElementsByTagName("link").length,style:/red/.test(bg.getAttribute("style")),hrefNormalized:bg.getAttribute("href")==="/a",opacity:/^0.55$/.test(bg.style.opacity),cssFloat:!!bg.style.cssFloat,checkOn:bn.value==="on",optSelected:bo.selected,deleteExpando:true,optDisabled:false,checkClone:false,noCloneEvent:true,noCloneChecked:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true,reliableMarginRight:true};bn.checked=true;N.support.noCloneChecked=bn.cloneNode(true).checked;bp.disabled=true;N.support.optDisabled=!bo.disabled;var bf=null;N.support.scriptEval=function(){if(bf===null){var bs=v.documentElement,bt=v.createElement("script"),br="script"+N.now();try{bt.appendChild(v.createTextNode("window."+br+"=1;"))}catch(bq){}bs.insertBefore(bt,bs.firstChild);if(a8[br]){bf=true;delete a8[br]}else{bf=false}bs.removeChild(bt)}return bf};try{delete bj.test}catch(bk){N.support.deleteExpando=false}if(!bj.addEventListener&&bj.attachEvent&&bj.fireEvent){bj.attachEvent("onclick",function bi(){N.support.noCloneEvent=false;bj.detachEvent("onclick",bi)});bj.cloneNode(true).fireEvent("onclick")}bj=v.createElement("div");bj.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var bm=v.createDocumentFragment();bm.appendChild(bj.firstChild);N.support.checkClone=bm.cloneNode(true).cloneNode(true).lastChild.checked;N(function(){var bq=v.createElement("div"),e=v.getElementsByTagName("body")[0];if(!e){return}bq.style.width=bq.style.paddingLeft="1px";e.appendChild(bq);N.boxModel=N.support.boxModel=bq.offsetWidth===2;if("zoom" in bq.style){bq.style.display="inline";bq.style.zoom=1;N.support.inlineBlockNeedsLayout=bq.offsetWidth===2;bq.style.display="";bq.innerHTML="<div style='width:4px;'></div>";N.support.shrinkWrapBlocks=bq.offsetWidth!==2}bq.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var br=bq.getElementsByTagName("td");N.support.reliableHiddenOffsets=br[0].offsetHeight===0;br[0].style.display="";br[1].style.display="none";N.support.reliableHiddenOffsets=N.support.reliableHiddenOffsets&&br[0].offsetHeight===0;bq.innerHTML="";if(v.defaultView&&v.defaultView.getComputedStyle){bq.style.width="1px";bq.style.marginRight="0";N.support.reliableMarginRight=(parseInt(v.defaultView.getComputedStyle(bq,null).marginRight,10)||0)===0}e.removeChild(bq).style.display="none";bq=br=null});var bl=function(bq){var e=v.createElement("div");bq="on"+bq;if(!e.attachEvent){return true}var br=(bq in e);if(!br){e.setAttribute(bq,"return;");br=typeof e[bq]==="function"}return br};N.support.submitBubbles=bl("submit");N.support.changeBubbles=bl("change");bj=bh=bg=null})();var Y=/^(?:\{.*\}|\[.*\])$/;N.extend({cache:{},uuid:0,expando:"jQuery"+(N.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?N.cache[e[N.expando]]:e[N.expando];return !!e&&!L(e)},data:function(bg,bl,bf,bm){if(!N.acceptData(bg)){return}var bj=N.expando,bh=typeof bl==="string",bn,bk=bg.nodeType,e=bk?N.cache:bg,bi=bk?bg[N.expando]:bg[N.expando]&&N.expando;if((!bi||(bm&&bi&&!e[bi][bj]))&&bh&&bf===a7){return}if(!bi){if(bk){bg[N.expando]=bi=++N.uuid}else{bi=N.expando}}if(!e[bi]){e[bi]={};if(!bk){e[bi].toJSON=N.noop}}if(typeof bl==="object"||typeof bl==="function"){if(bm){e[bi][bj]=N.extend(e[bi][bj],bl)}else{e[bi]=N.extend(e[bi],bl)}}bn=e[bi];if(bm){if(!bn[bj]){bn[bj]={}}bn=bn[bj]}if(bf!==a7){bn[bl]=bf}if(bl==="events"&&!bn[bl]){return bn[bj]&&bn[bj].events}return bh?bn[bl]:bn},removeData:function(bf,bk,bl){if(!N.acceptData(bf)){return}var bi=N.expando,bj=bf.nodeType,e=bj?N.cache:bf,bg=bj?bf[N.expando]:N.expando;if(!e[bg]){return}if(bk){var bm=bl?e[bg][bi]:e[bg];if(bm){delete bm[bk];if(!L(bm)){return}}}if(bl){delete e[bg][bi];if(!L(e[bg])){return}}var bh=e[bg][bi];if(N.support.deleteExpando||e!=a8){delete e[bg]}else{e[bg]=null}if(bh){e[bg]={};if(!bj){e[bg].toJSON=N.noop}e[bg][bi]=bh}else{if(bj){if(N.support.deleteExpando){delete bf[N.expando]}else{if(bf.removeAttribute){bf.removeAttribute(N.expando)}else{bf[N.expando]=null}}}}},_data:function(bf,bg,e){return N.data(bf,bg,e,true)},acceptData:function(e){if(e.nodeName){var bf=N.noData[e.nodeName.toLowerCase()];if(bf){return !(bf===true||e.getAttribute("classid")!==bf)}}return true}});N.fn.extend({data:function(bh,bl){var bf=null;if(typeof bh==="undefined"){if(this.length){bf=N.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,bj;for(var bg=0,bi=e.length;bg<bi;bg++){bj=e[bg].name;if(bj.indexOf("data-")===0){bj=bj.substr(5);s(this[0],bj,bf[bj])}}}}return bf}else{if(typeof bh==="object"){return this.each(function(){N.data(this,bh)})}}var bk=bh.split(".");bk[1]=bk[1]?"."+bk[1]:"";if(bl===a7){bf=this.triggerHandler("getData"+bk[1]+"!",[bk[0]]);if(bf===a7&&this.length){bf=N.data(this[0],bh);bf=s(this[0],bh,bf)}return bf===a7&&bk[1]?this.data(bk[0]):bf}else{return this.each(function(){var bm=N(this),bn=[bk[0],bl];bm.triggerHandler("setData"+bk[1]+"!",bn);N.data(this,bh,bl);bm.triggerHandler("changeData"+bk[1]+"!",bn)})}},removeData:function(e){return this.each(function(){N.removeData(this,e)})}});function s(bh,bi,bf){if(bf===a7&&bh.nodeType===1){bf=bh.getAttribute("data-"+bi);if(typeof bf==="string"){try{bf=bf==="true"?true:bf==="false"?false:bf==="null"?null:!N.isNaN(bf)?parseFloat(bf):Y.test(bf)?N.parseJSON(bf):bf}catch(bg){}N.data(bh,bi,bf)}else{bf=a7}}return bf}function L(bf){for(var e in bf){if(e!=="toJSON"){return false}}return true}N.extend({queue:function(bf,bh,e){if(!bf){return}bh=(bh||"fx")+"queue";var bg=N._data(bf,bh);if(!e){return bg||[]}if(!bg||N.isArray(e)){bg=N._data(bf,bh,N.makeArray(e))}else{bg.push(e)}return bg},dequeue:function(e,bh){bh=bh||"fx";var bg=N.queue(e,bh),bf=bg.shift();if(bf==="inprogress"){bf=bg.shift()}if(bf){if(bh==="fx"){bg.unshift("inprogress")}bf.call(e,function(){N.dequeue(e,bh)})}if(!bg.length){N.removeData(e,bh+"queue",true)}}});N.fn.extend({queue:function(bf,e){if(typeof bf!=="string"){e=bf;bf="fx"}if(e===a7){return N.queue(this[0],bf)}return this.each(function(bg){var bh=N.queue(this,bf,e);if(bf==="fx"&&bh[0]!=="inprogress"){N.dequeue(this,bf)}})},dequeue:function(e){return this.each(function(){N.dequeue(this,e)})},delay:function(e,bf){e=N.fx?N.fx.speeds[e]||e:e;bf=bf||"fx";return this.queue(bf,function(){var bg=this;setTimeout(function(){N.dequeue(bg,bf)},e)})},clearQueue:function(e){return this.queue(e||"fx",[])}});var ab=/[\n\t\r]/g,aM=/\s+/,aH=/\r/g,aO=/^(?:href|src|style)$/,aS=/^(?:button|input)$/i,ai=/^(?:button|input|object|select|textarea)$/i,ac=/^a(?:rea)?$/i,aG=/^(?:radio|checkbox)$/i;N.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};N.fn.extend({attr:function(e,bf){return N.access(this,e,bf,true,N.attr)},removeAttr:function(bf,e){return this.each(function(){N.attr(this,bf,"");if(this.nodeType===1){this.removeAttribute(bf)}})},addClass:function(bm){if(N.isFunction(bm)){return this.each(function(bn){var bo=N(this);bo.addClass(bm.call(this,bn,bo.attr("class")))})}if(bm&&typeof bm==="string"){var bh=(bm||"").split(aM);for(var bj=0,bk=this.length;bj<bk;bj++){var bi=this[bj];if(bi.nodeType===1){if(!bi.className){bi.className=bm}else{var bg=" "+bi.className+" ",bl=bi.className;for(var e=0,bf=bh.length;e<bf;e++){if(bg.indexOf(" "+bh[e]+" ")<0){bl+=" "+bh[e]}}bi.className=N.trim(bl)}}}}return this},removeClass:function(bl){if(N.isFunction(bl)){return this.each(function(bm){var bn=N(this);bn.removeClass(bl.call(this,bm,bn.attr("class")))})}if((bl&&typeof bl==="string")||bl===a7){var bh=(bl||"").split(aM);for(var bj=0,bk=this.length;bj<bk;bj++){var bi=this[bj];if(bi.nodeType===1&&bi.className){if(bl){var bg=(" "+bi.className+" ").replace(ab," ");for(var e=0,bf=bh.length;e<bf;e++){bg=bg.replace(" "+bh[e]+" "," ")}bi.className=N.trim(bg)}else{bi.className=""}}}}return this},toggleClass:function(bh,bf){var bg=typeof bh,e=typeof bf==="boolean";if(N.isFunction(bh)){return this.each(function(bi){var bj=N(this);bj.toggleClass(bh.call(this,bi,bj.attr("class"),bf),bf)})}return this.each(function(){if(bg==="string"){var bi,bk=0,bl=N(this),bm=bf,bj=bh.split(aM);while((bi=bj[bk++])){bm=e?bm:!bl.hasClass(bi);bl[bm?"addClass":"removeClass"](bi)}}else{if(bg==="undefined"||bg==="boolean"){if(this.className){N._data(this,"__className__",this.className)}this.className=this.className||bh===false?"":N._data(this,"__className__")||""}}})},hasClass:function(bh){var e=" "+bh+" ";for(var bf=0,bg=this.length;bf<bg;bf++){if((" "+this[bf].className+" ").replace(ab," ").indexOf(e)>-1){return true}}return false},val:function(bn){if(!arguments.length){var e=this[0];if(e){if(N.nodeName(e,"option")){var bm=e.attributes.value;return !bm||bm.specified?e.value:e.text}if(N.nodeName(e,"select")){var bg=e.selectedIndex,bo=[],bl=e.options,bj=e.type==="select-one";if(bg<0){return null}for(var bf=bj?bg:0,bi=bj?bg+1:bl.length;bf<bi;bf++){var bk=bl[bf];if(bk.selected&&(N.support.optDisabled?!bk.disabled:bk.getAttribute("disabled")===null)&&(!bk.parentNode.disabled||!N.nodeName(bk.parentNode,"optgroup"))){bn=N(bk).val();if(bj){return bn}bo.push(bn)}}if(bj&&!bo.length&&bl.length){return N(bl[bg]).val()}return bo}if(aG.test(e.type)&&!N.support.checkOn){return e.getAttribute("value")===null?"on":e.value}return(e.value||"").replace(aH,"")}return a7}var bh=N.isFunction(bn);return this.each(function(bp){var bq=N(this),br=bn;if(this.nodeType!==1){return}if(bh){br=bn.call(this,bp,bq.val())}if(br==null){br=""}else{if(typeof br==="number"){br+=""}else{if(N.isArray(br)){br=N.map(br,function(bt){return bt==null?"":bt+""})}}}if(N.isArray(br)&&aG.test(this.type)){this.checked=N.inArray(bq.val(),br)>=0}else{if(N.nodeName(this,"select")){var bs=N.makeArray(br);N("option",this).each(function(){this.selected=N.inArray(N(this).val(),bs)>=0});if(!bs.length){this.selectedIndex=-1}}else{this.value=br}}})}});N.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bg,bh,bn,bk){if(!bg||bg.nodeType===3||bg.nodeType===8||bg.nodeType===2){return a7}if(bk&&bh in N.attrFn){return N(bg)[bh](bn)}var bi=bg.nodeType!==1||!N.isXMLDoc(bg),bl=bn!==a7;bh=bi&&N.props[bh]||bh;if(bg.nodeType===1){var bm=aO.test(bh);if(bh==="selected"&&!N.support.optSelected){var bj=bg.parentNode;if(bj){bj.selectedIndex;if(bj.parentNode){bj.parentNode.selectedIndex}}}if((bh in bg||bg[bh]!==a7)&&bi&&!bm){if(bl){if(bh==="type"&&aS.test(bg.nodeName)&&bg.parentNode){N.error("type property can't be changed")}if(bn===null){if(bg.nodeType===1){bg.removeAttribute(bh)}}else{bg[bh]=bn}}if(N.nodeName(bg,"form")&&bg.getAttributeNode(bh)){return bg.getAttributeNode(bh).nodeValue}if(bh==="tabIndex"){var bf=bg.getAttributeNode("tabIndex");return bf&&bf.specified?bf.value:ai.test(bg.nodeName)||ac.test(bg.nodeName)&&bg.href?0:a7}return bg[bh]}if(!N.support.style&&bi&&bh==="style"){if(bl){bg.style.cssText=""+bn}return bg.style.cssText}if(bl){bg.setAttribute(bh,""+bn)}if(!bg.attributes[bh]&&(bg.hasAttribute&&!bg.hasAttribute(bh))){return a7}var e=!N.support.hrefNormalized&&bi&&bm?bg.getAttribute(bh,2):bg.getAttribute(bh);return e===null?a7:e}if(bl){bg[bh]=bn}return bg[bh]}});var av=/\.(.*)$/,aj=/^(?:textarea|input|select)$/i,aD=/\./g,aL=/ /g,af=/[^\w\s.|`]/g,A=function(e){return e.replace(af,"\\$&")};N.event={add:function(bh,bt,bn,bf){if(bh.nodeType===3||bh.nodeType===8){return}try{if(N.isWindow(bh)&&(bh!==a8&&!bh.frameElement)){bh=a8}}catch(bg){}if(bn===false){bn=ag}else{if(!bn){return}}var bm,bl;if(bn.handler){bm=bn;bn=bm.handler}if(!bn.guid){bn.guid=N.guid++}var bi=N._data(bh);if(!bi){return}var bk=bi.events,bj=bi.handle;if(!bk){bi.events=bk={}}if(!bj){bi.handle=bj=function(bu){return typeof N!=="undefined"&&N.event.triggered!==bu.type?N.event.handle.apply(bj.elem,arguments):a7}}bj.elem=bh;bt=bt.split(" ");var bs,bp=0,bq;while((bs=bt[bp++])){bl=bm?N.extend({},bm):{handler:bn,data:bf};if(bs.indexOf(".")>-1){bq=bs.split(".");bs=bq.shift();bl.namespace=bq.slice(0).sort().join(".")}else{bq=[];bl.namespace=""}bl.type=bs;if(!bl.guid){bl.guid=bn.guid}var bo=bk[bs],br=N.event.special[bs]||{};if(!bo){bo=bk[bs]=[];if(!br.setup||br.setup.call(bh,bf,bq,bj)===false){if(bh.addEventListener){bh.addEventListener(bs,bj,false)}else{if(bh.attachEvent){bh.attachEvent("on"+bs,bj)}}}}if(br.add){br.add.call(bh,bl);if(!bl.handler.guid){bl.handler.guid=bn.guid}}bo.push(bl);N.event.global[bs]=true}bh=null},global:{},remove:function(bf,bw,bm,bs){if(bf.nodeType===3||bf.nodeType===8){return}if(bm===false){bm=ag}var bt,bv,bj,bo,bn=0,e,bq,bp,bu,bi,bl,br,bg=N.hasData(bf)&&N._data(bf),bh=bg&&bg.events;if(!bg||!bh){return}if(bw&&bw.type){bm=bw.handler;bw=bw.type}if(!bw||typeof bw==="string"&&bw.charAt(0)==="."){bw=bw||"";for(bv in bh){N.event.remove(bf,bv+bw)}return}bw=bw.split(" ");while((bv=bw[bn++])){br=bv;bl=null;e=bv.indexOf(".")<0;bq=[];if(!e){bq=bv.split(".");bv=bq.shift();bp=new RegExp("(^|\\.)"+N.map(bq.slice(0).sort(),A).join("\\.(?:.*\\.)?")+"(\\.|$)")}bi=bh[bv];if(!bi){continue}if(!bm){for(bo=0;bo<bi.length;bo++){bl=bi[bo];if(e||bp.test(bl.namespace)){N.event.remove(bf,br,bl.handler,bo);bi.splice(bo--,1)}}continue}bu=N.event.special[bv]||{};for(bo=bs||0;bo<bi.length;bo++){bl=bi[bo];if(bm.guid===bl.guid){if(e||bp.test(bl.namespace)){if(bs==null){bi.splice(bo--,1)}if(bu.remove){bu.remove.call(bf,bl)}}if(bs!=null){break}}}if(bi.length===0||bs!=null&&bi.length===1){if(!bu.teardown||bu.teardown.call(bf,bq)===false){N.removeEvent(bf,bv,bg.handle)}bt=null;delete bh[bv]}}if(N.isEmptyObject(bh)){var bk=bg.handle;if(bk){bk.elem=null}delete bg.events;delete bg.handle;if(N.isEmptyObject(bg)){N.removeData(bf,a7,true)}}},trigger:function(bh,bf,bg){var bq=bh.type||bh,e=arguments[3];if(!e){bh=typeof bh==="object"?bh[N.expando]?bh:N.extend(N.Event(bq),bh):N.Event(bq);if(bq.indexOf("!")>=0){bh.type=bq=bq.slice(0,-1);bh.exclusive=true}if(!bg){bh.stopPropagation();if(N.event.global[bq]){N.each(N.cache,function(){var bt=N.expando,bs=this[bt];if(bs&&bs.events&&bs.events[bq]){N.event.trigger(bh,bf,bs.handle.elem)}})}}if(!bg||bg.nodeType===3||bg.nodeType===8){return a7}bh.result=a7;bh.target=bg;bf=N.makeArray(bf);bf.unshift(bh)}bh.currentTarget=bg;var bi=N._data(bg,"handle");if(bi){bi.apply(bg,bf)}var bm=bg.parentNode||bg.ownerDocument;try{if(!(bg&&bg.nodeName&&N.noData[bg.nodeName.toLowerCase()])){if(bg["on"+bq]&&bg["on"+bq].apply(bg,bf)===false){bh.result=false;bh.preventDefault()}}}catch(bj){}if(!bh.isPropagationStopped()&&bm){N.event.trigger(bh,bf,bm,true)}else{if(!bh.isDefaultPrevented()){var bl,bo=bh.target,bp=bq.replace(av,""),bk=N.nodeName(bo,"a")&&bp==="click",bn=N.event.special[bp]||{};if((!bn._default||bn._default.call(bg,bh)===false)&&!bk&&!(bo&&bo.nodeName&&N.noData[bo.nodeName.toLowerCase()])){try{if(bo[bp]){bl=bo["on"+bp];if(bl){bo["on"+bp]=null}N.event.triggered=bh.type;bo[bp]()}}catch(br){}if(bl){bo["on"+bp]=bl}N.event.triggered=a7}}}},handle:function(bg){var e,bj,bo,bm,bh,bn=[],bf=N.makeArray(arguments);bg=bf[0]=N.event.fix(bg||a8.event);bg.currentTarget=this;e=bg.type.indexOf(".")<0&&!bg.exclusive;if(!e){bo=bg.type.split(".");bg.type=bo.shift();bn=bo.slice(0).sort();bm=new RegExp("(^|\\.)"+bn.join("\\.(?:.*\\.)?")+"(\\.|$)")}bg.namespace=bg.namespace||bn.join(".");bh=N._data(this,"events");bj=(bh||{})[bg.type];if(bh&&bj){bj=bj.slice(0);for(var bk=0,bl=bj.length;bk<bl;bk++){var bi=bj[bk];if(e||bm.test(bi.namespace)){bg.handler=bi.handler;bg.data=bi.data;bg.handleObj=bi;var bp=bi.handler.apply(this,bf);if(bp!==a7){bg.result=bp;if(bp===false){bg.preventDefault();bg.stopPropagation()}}if(bg.isImmediatePropagationStopped()){break}}}}return bg.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(bg){if(bg[N.expando]){return bg}var bi=bg;bg=N.Event(bi);for(var bh=this.props.length,bj;bh;){bj=this.props[--bh];bg[bj]=bi[bj]}if(!bg.target){bg.target=bg.srcElement||v}if(bg.target.nodeType===3){bg.target=bg.target.parentNode}if(!bg.relatedTarget&&bg.fromElement){bg.relatedTarget=bg.fromElement===bg.target?bg.toElement:bg.fromElement}if(bg.pageX==null&&bg.clientX!=null){var bf=v.documentElement,e=v.body;bg.pageX=bg.clientX+(bf&&bf.scrollLeft||e&&e.scrollLeft||0)-(bf&&bf.clientLeft||e&&e.clientLeft||0);bg.pageY=bg.clientY+(bf&&bf.scrollTop||e&&e.scrollTop||0)-(bf&&bf.clientTop||e&&e.clientTop||0)}if(bg.which==null&&(bg.charCode!=null||bg.keyCode!=null)){bg.which=bg.charCode!=null?bg.charCode:bg.keyCode}if(!bg.metaKey&&bg.ctrlKey){bg.metaKey=bg.ctrlKey}if(!bg.which&&bg.button!==a7){bg.which=(bg.button&1?1:(bg.button&2?3:(bg.button&4?2:0)))}return bg},guid:100000000,proxy:N.proxy,special:{ready:{setup:N.bindReady,teardown:N.noop},live:{add:function(e){N.event.add(this,Q(e.origType,e.selector),N.extend({},e,{handler:R,guid:e.handler.guid}))},remove:function(e){N.event.remove(this,Q(e.origType,e.selector),e)}},beforeunload:{setup:function(e,bg,bf){if(N.isWindow(this)){this.onbeforeunload=bf}},teardown:function(bf,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}}};N.removeEvent=v.removeEventListener?function(e,bg,bf){if(e.removeEventListener){e.removeEventListener(bg,bf,false)}}:function(e,bg,bf){if(e.detachEvent){e.detachEvent("on"+bg,bf)}};N.Event=function(e){if(!this.preventDefault){return new N.Event(e)}if(e&&e.type){this.originalEvent=e;this.type=e.type;this.isDefaultPrevented=(e.defaultPrevented||e.returnValue===false||e.getPreventDefault&&e.getPreventDefault())?ah:ag}else{this.type=e}this.timeStamp=N.now();this[N.expando]=true};function ag(){return false}function ah(){return true}N.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ah;var bf=this.originalEvent;if(!bf){return}if(bf.preventDefault){bf.preventDefault()}else{bf.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=ah;var bf=this.originalEvent;if(!bf){return}if(bf.stopPropagation){bf.stopPropagation()}bf.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ah;this.stopPropagation()},isDefaultPrevented:ag,isPropagationStopped:ag,isImmediatePropagationStopped:ag};var ba=function(bg){var bh=bg.relatedTarget;try{if(bh&&bh!==v&&!bh.parentNode){return}while(bh&&bh!==this){bh=bh.parentNode}if(bh!==this){bg.type=bg.data;N.event.handle.apply(this,arguments)}}catch(bf){}},u=function(e){e.type=e.data;N.event.handle.apply(this,arguments)};N.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bf,e){N.event.special[bf]={setup:function(bg){N.event.add(this,e,bg&&bg.selector?u:ba,bf)},teardown:function(bg){N.event.remove(this,e,bg&&bg.selector?u:ba)}}});if(!N.support.submitBubbles){N.event.special.submit={setup:function(e,bf){if(this.nodeName&&this.nodeName.toLowerCase()!=="form"){N.event.add(this,"click.specialSubmit",function(bg){var bh=bg.target,bi=bh.type;if((bi==="submit"||bi==="image")&&N(bh).closest("form").length){a6("submit",this,arguments)}});N.event.add(this,"keypress.specialSubmit",function(bg){var bh=bg.target,bi=bh.type;if((bi==="text"||bi==="password")&&N(bh).closest("form").length&&bg.keyCode===13){a6("submit",this,arguments)}})}else{return false}},teardown:function(e){N.event.remove(this,".specialSubmit")}}}if(!N.support.changeBubbles){var i,F=function(e){var bf=e.type,bg=e.value;if(bf==="radio"||bf==="checkbox"){bg=e.checked}else{if(bf==="select-multiple"){bg=e.selectedIndex>-1?N.map(e.options,function(bh){return bh.selected}).join("-"):""}else{if(e.nodeName.toLowerCase()==="select"){bg=e.selectedIndex}}}return bg},a2=function a2(bg){var bh=bg.target,bf,bi;if(!aj.test(bh.nodeName)||bh.readOnly){return}bf=N._data(bh,"_change_data");bi=F(bh);if(bg.type!=="focusout"||bh.type!=="radio"){N._data(bh,"_change_data",bi)}if(bf===a7||bi===bf){return}if(bf!=null||bi){bg.type="change";bg.liveFired=a7;N.event.trigger(bg,arguments[1],bh)}};N.event.special.change={filters:{focusout:a2,beforedeactivate:a2,click:function(bf){var bg=bf.target,bh=bg.type;if(bh==="radio"||bh==="checkbox"||bg.nodeName.toLowerCase()==="select"){a2.call(this,bf)}},keydown:function(bf){var bg=bf.target,bh=bg.type;if((bf.keyCode===13&&bg.nodeName.toLowerCase()!=="textarea")||(bf.keyCode===32&&(bh==="checkbox"||bh==="radio"))||bh==="select-multiple"){a2.call(this,bf)}},beforeactivate:function(bf){var bg=bf.target;N._data(bg,"_change_data",F(bg))}},setup:function(e,bf){if(this.type==="file"){return false}for(var bg in i){N.event.add(this,bg+".specialChange",i[bg])}return aj.test(this.nodeName)},teardown:function(e){N.event.remove(this,".specialChange");return aj.test(this.nodeName)}};i=N.event.special.change.filters;i.focus=i.beforeactivate}function a6(bh,bf,e){var bg=N.extend({},e[0]);bg.type=bh;bg.originalEvent={};bg.liveFired=a7;N.event.handle.call(bf,bg);if(bg.isDefaultPrevented()){e[0].preventDefault()}}if(v.addEventListener){N.each({focus:"focusin",blur:"focusout"},function(bh,bf){var e=0;N.event.special[bf]={setup:function(){if(e++===0){v.addEventListener(bh,bg,true)}},teardown:function(){if(--e===0){v.removeEventListener(bh,bg,true)}}};function bg(bi){var bj=N.event.fix(bi);bj.type=bf;bj.originalEvent={};N.event.trigger(bj,null,bj.target);if(bj.isDefaultPrevented()){bi.preventDefault()}}})}N.each(["bind","one"],function(e,bf){N.fn[bf]=function(bm,bg,bh){if(typeof bm==="object"){for(var bk in bm){this[bf](bk,bg,bm[bk],bh)}return this}if(N.isFunction(bg)||bg===false){bh=bg;bg=a7}var bi=bf==="one"?N.proxy(bh,function(bn){N(this).unbind(bn,bi);return bh.apply(this,arguments)}):bh;if(bm==="unload"&&bf!=="one"){this.one(bm,bg,bh)}else{for(var bj=0,bl=this.length;bj<bl;bj++){N.event.add(this[bj],bm,bi,bg)}}return this}});N.fn.extend({unbind:function(bi,e){if(typeof bi==="object"&&!bi.preventDefault){for(var bg in bi){this.unbind(bg,bi[bg])}}else{for(var bf=0,bh=this.length;bf<bh;bf++){N.event.remove(this[bf],bi,e)}}return this},delegate:function(bg,bh,e,bf){return this.live(bh,e,bf,bg)},undelegate:function(bf,bg,e){if(arguments.length===0){return this.unbind("live")}else{return this.die(bg,null,e,bf)}},trigger:function(bf,e){return this.each(function(){N.event.trigger(bf,e,this)})},triggerHandler:function(bg,e){if(this[0]){var bf=N.Event(bg);bf.preventDefault();bf.stopPropagation();N.event.trigger(bf,e,this[0]);return bf.result}},toggle:function(bf){var e=arguments,bg=1;while(bg<e.length){N.proxy(bf,e[bg++])}return this.click(N.proxy(bf,function(bh){var bi=(N._data(this,"lastToggle"+bf.guid)||0)%bg;N._data(this,"lastToggle"+bf.guid,bi+1);bh.preventDefault();return e[bi].apply(this,arguments)||false}))},hover:function(bf,e){return this.mouseenter(bf).mouseleave(e||bf)}});var S={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};N.each(["live","die"],function(e,bf){N.fn[bf]=function(bt,bh,bi,bp){var bs,bj=0,bn,bo,bq,br=bp||this.selector,bg=bp?this:N(this.context);if(typeof bt==="object"&&!bt.preventDefault){for(var bl in bt){bg[bf](bl,bh,bt[bl],br)}return this}if(N.isFunction(bh)){bi=bh;bh=a7}bt=(bt||"").split(" ");while((bs=bt[bj++])!=null){bn=av.exec(bs);bo="";if(bn){bo=bn[0];bs=bs.replace(av,"")}if(bs==="hover"){bt.push("mouseenter"+bo,"mouseleave"+bo);continue}bq=bs;if(bs==="focus"||bs==="blur"){bt.push(S[bs]+bo);bs=bs+bo}else{bs=(S[bs]||bs)+bo}if(bf==="live"){for(var bk=0,bm=bg.length;bk<bm;bk++){N.event.add(bg[bk],"live."+Q(bs,br),{data:bh,selector:br,handler:bi,origType:bs,origHandler:bi,preType:bq})}}else{bg.unbind("live."+Q(bs,br),bi)}}return this}});function R(bi){var bv,bq,bs,bp,bk,bg,bm,bl,bn,bf,e,br,bt,bh=[],bu=[],bj=N._data(this,"events");if(bi.liveFired===this||!bj||!bj.live||bi.target.disabled||bi.button&&bi.type==="click"){return}if(bi.namespace){br=new RegExp("(^|\\.)"+bi.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")}bi.liveFired=this;var bo=bj.live.slice(0);for(bm=0;bm<bo.length;bm++){bk=bo[bm];if(bk.origType.replace(av,"")===bi.type){bu.push(bk.selector)}else{bo.splice(bm--,1)}}bp=N(bi.target).closest(bu,bi.currentTarget);for(bl=0,bn=bp.length;bl<bn;bl++){e=bp[bl];for(bm=0;bm<bo.length;bm++){bk=bo[bm];if(e.selector===bk.selector&&(!br||br.test(bk.namespace))&&!e.elem.disabled){bg=e.elem;bs=null;if(bk.preType==="mouseenter"||bk.preType==="mouseleave"){bi.type=bk.preType;bs=N(bi.relatedTarget).closest(bk.selector)[0]}if(!bs||bs!==bg){bh.push({elem:bg,handleObj:bk,level:e.level})}}}}for(bl=0,bn=bh.length;bl<bn;bl++){bp=bh[bl];if(bq&&bp.level>bq){break}bi.currentTarget=bp.elem;bi.data=bp.handleObj.data;bi.handleObj=bp.handleObj;bt=bp.handleObj.origHandler.apply(bp.elem,arguments);if(bt===false||bi.isPropagationStopped()){bq=bp.level;if(bt===false){bv=false}if(bi.isImmediatePropagationStopped()){break}}}return bv}function Q(bf,e){return(bf&&bf!=="*"?bf+".":"")+e.replace(aD,"`").replace(aL,"&")}N.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" "),function(e,bf){N.fn[bf]=function(bg,bh){if(bh==null){bh=bg;bg=null}return arguments.length>0?this.bind(bf,bg,bh):this.trigger(bf)};if(N.attrFn){N.attrFn[bf]=true}});
/*
 * Sizzle CSS Selector Engine
 *  Copyright 2011, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var bg=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bj=0,bx=Object.prototype.toString,bn=false,bf=true,br=/\\/g,bs=/\W/;[0,0].sort(function(){bf=false;return 0});var bu=function(bL,by,bI,bK){bI=bI||[];by=by||v;var bE=by;if(by.nodeType!==1&&by.nodeType!==9){return[]}if(!bL||typeof bL!=="string"){return bI}var bD,bM,e,bB,bJ,bA,bG,bC,bH=true,bz=bu.isXML(by),bF=[],bN=bL;do{bg.exec("");bD=bg.exec(bN);if(bD){bN=bD[3];bF.push(bD[1]);if(bD[2]){bB=bD[3];break}}}while(bD);if(bF.length>1&&bp.exec(bL)){if(bF.length===2&&bl.relative[bF[0]]){bM=bq(bF[0]+bF[1],by)}else{bM=bl.relative[bF[0]]?[by]:bu(bF.shift(),by);while(bF.length){bL=bF.shift();if(bl.relative[bL]){bL+=bF.shift()}bM=bq(bL,bM)}}}else{if(!bK&&bF.length>1&&by.nodeType===9&&!bz&&bl.match.ID.test(bF[0])&&!bl.match.ID.test(bF[bF.length-1])){bJ=bu.find(bF.shift(),by,bz);by=bJ.expr?bu.filter(bJ.expr,bJ.set)[0]:bJ.set[0]}if(by){bJ=bK?{expr:bF.pop(),set:bo(bK)}:bu.find(bF.pop(),bF.length===1&&(bF[0]==="~"||bF[0]==="+")&&by.parentNode?by.parentNode:by,bz);bM=bJ.expr?bu.filter(bJ.expr,bJ.set):bJ.set;if(bF.length>0){e=bo(bM)}else{bH=false}while(bF.length){bA=bF.pop();bG=bA;if(!bl.relative[bA]){bA=""}else{bG=bF.pop()}if(bG==null){bG=by}bl.relative[bA](e,bG,bz)}}else{e=bF=[]}}if(!e){e=bM}if(!e){bu.error(bA||bL)}if(bx.call(e)==="[object Array]"){if(!bH){bI.push.apply(bI,e)}else{if(by&&by.nodeType===1){for(bC=0;e[bC]!=null;bC++){if(e[bC]&&(e[bC]===true||e[bC].nodeType===1&&bu.contains(by,e[bC]))){bI.push(bM[bC])}}}else{for(bC=0;e[bC]!=null;bC++){if(e[bC]&&e[bC].nodeType===1){bI.push(bM[bC])}}}}}else{bo(e,bI)}if(bB){bu(bB,bE,bI,bK);bu.uniqueSort(bI)}return bI};bu.uniqueSort=function(by){if(bv){bn=bf;by.sort(bv);if(bn){for(var e=1;e<by.length;e++){if(by[e]===by[e-1]){by.splice(e--,1)}}}}return by};bu.matches=function(e,by){return bu(e,null,null,by)};bu.matchesSelector=function(by,e){return bu(e,null,null,[by]).length>0};bu.find=function(by,e,bA){var bE;if(!by){return[]}for(var bz=0,bB=bl.order.length;bz<bB;bz++){var bD,bF=bl.order[bz];if((bD=bl.leftMatch[bF].exec(by))){var bC=bD[1];bD.splice(1,1);if(bC.substr(bC.length-1)!=="\\"){bD[1]=(bD[1]||"").replace(br,"");bE=bl.find[bF](bD,e,bA);if(bE!=null){by=by.replace(bl.match[bF],"");break}}}}if(!bE){bE=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:bE,expr:by}};bu.filter=function(bz,bM,bD,bI){var bH,e,bJ=bz,bL=[],by=bM,bE=bM&&bM[0]&&bu.isXML(bM[0]);while(bz&&bM.length){for(var bN in bl.filter){if((bH=bl.leftMatch[bN].exec(bz))!=null&&bH[2]){var bB,bF,bA=bl.filter[bN],bG=bH[1];e=false;bH.splice(1,1);if(bG.substr(bG.length-1)==="\\"){continue}if(by===bL){bL=[]}if(bl.preFilter[bN]){bH=bl.preFilter[bN](bH,by,bD,bL,bI,bE);if(!bH){e=bB=true}else{if(bH===true){continue}}}if(bH){for(var bC=0;(bF=by[bC])!=null;bC++){if(bF){bB=bA(bF,bH,bC,by);var bK=bI^!!bB;if(bD&&bB!=null){if(bK){e=true}else{by[bC]=false}}else{if(bK){bL.push(bF);e=true}}}}}if(bB!==a7){if(!bD){by=bL}bz=bz.replace(bl.match[bN],"");if(!e){return[]}break}}}if(bz===bJ){if(e==null){bu.error(bz)}else{break}}bJ=bz}return by};bu.error=function(e){throw"Syntax error, unrecognized expression: "+e};var bl=bu.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(e,bE){var bA=typeof bE==="string",bC=bA&&!bs.test(bE),bB=bA&&!bC;if(bC){bE=bE.toLowerCase()}for(var bz=0,bD=e.length,by;bz<bD;bz++){if((by=e[bz])){while((by=by.previousSibling)&&by.nodeType!==1){}e[bz]=bB||by&&by.nodeName.toLowerCase()===bE?by||false:by===bE}}if(bB){bu.filter(bE,e,true)}},">":function(e,bD){var by,bA=typeof bD==="string",bz=0,bB=e.length;if(bA&&!bs.test(bD)){bD=bD.toLowerCase();for(;bz<bB;bz++){by=e[bz];if(by){var bC=by.parentNode;e[bz]=bC.nodeName.toLowerCase()===bD?bC:false}}}else{for(;bz<bB;bz++){by=e[bz];if(by){e[bz]=bA?by.parentNode:by.parentNode===bD}}if(bA){bu.filter(bD,e,true)}}},"":function(by,bC,bA){var bB,bz=bj++,e=bh;if(typeof bC==="string"&&!bs.test(bC)){bC=bC.toLowerCase();bB=bC;e=bi}e("parentNode",bC,bz,by,bB,bA)},"~":function(by,bC,bA){var bB,bz=bj++,e=bh;if(typeof bC==="string"&&!bs.test(bC)){bC=bC.toLowerCase();bB=bC;e=bi}e("previousSibling",bC,bz,by,bB,bA)}},find:{ID:function(bA,e,by){if(typeof e.getElementById!=="undefined"&&!by){var bz=e.getElementById(bA[1]);return bz&&bz.parentNode?[bz]:[]}},NAME:function(bA,e){if(typeof e.getElementsByName!=="undefined"){var bC=[],bB=e.getElementsByName(bA[1]);for(var by=0,bz=bB.length;by<bz;by++){if(bB[by].getAttribute("name")===bA[1]){bC.push(bB[by])}}return bC.length===0?null:bC}},TAG:function(by,e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName(by[1])}}},preFilter:{CLASS:function(bC,e,bA,bE,bD,bB){bC=" "+bC[1].replace(br,"")+" ";if(bB){return bC}for(var bz=0,by;(by=e[bz])!=null;bz++){if(by){if(bD^(by.className&&(" "+by.className+" ").replace(/[\t\n\r]/g," ").indexOf(bC)>=0)){if(!bA){bE.push(by)}}else{if(bA){e[bz]=false}}}}return false},ID:function(e){return e[1].replace(br,"")},TAG:function(by,e){return by[1].replace(br,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){bu.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var by=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(by[1]+(by[2]||1))-0;e[3]=by[3]-0}else{if(e[2]){bu.error(e[0])}}e[0]=bj++;return e},ATTR:function(bA,e,by,bD,bC,bz){var bB=bA[1]=bA[1].replace(br,"");if(!bz&&bl.attrMap[bB]){bA[1]=bl.attrMap[bB]}bA[4]=(bA[4]||bA[5]||"").replace(br,"");if(bA[2]==="~="){bA[4]=" "+bA[4]+" "}return bA},PSEUDO:function(bz,e,by,bB,bA){if(bz[1]==="not"){if((bg.exec(bz[3])||"").length>1||/^\w/.test(bz[3])){bz[3]=bu(bz[3],null,null,e)}else{var bC=bu.filter(bz[3],e,by,true^bA);if(!by){bB.push.apply(bB,bC)}return false}}else{if(bl.match.POS.test(bz[0])||bl.match.CHILD.test(bz[0])){return true}}return bz},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(e,by,bz){return !!bu(bz[3],e).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(by){var e=by.getAttribute("type"),bz=by.type;return"text"===bz&&(e===bz||e===null)},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(e,by){return by===0},last:function(by,bz,bA,e){return bz===e.length-1},even:function(e,by){return by%2===0},odd:function(e,by){return by%2===1},lt:function(e,by,bz){return by<bz[3]-0},gt:function(e,by,bz){return by>bz[3]-0},nth:function(e,by,bz){return bz[3]-0===by},eq:function(e,by,bz){return bz[3]-0===by}},filter:{PSEUDO:function(by,bD,bA,e){var bE=bD[1],bz=bl.filters[bE];if(bz){return bz(by,bA,bD,e)}else{if(bE==="contains"){return(by.textContent||by.innerText||bu.getText([by])||"").indexOf(bD[3])>=0}else{if(bE==="not"){var bF=bD[3];for(var bB=0,bC=bF.length;bB<bC;bB++){if(bF[bB]===by){return false}}return true}else{bu.error(bE)}}}},CHILD:function(bA,bD){var bG=bD[1],bE=bA;switch(bG){case"only":case"first":while((bE=bE.previousSibling)){if(bE.nodeType===1){return false}}if(bG==="first"){return true}bE=bA;case"last":while((bE=bE.nextSibling)){if(bE.nodeType===1){return false}}return true;case"nth":var bB=bD[2],bC=bD[3];if(bB===1&&bC===0){return true}var bz=bD[0],bF=bA.parentNode;if(bF&&(bF.sizcache!==bz||!bA.nodeIndex)){var e=0;for(bE=bF.firstChild;bE;bE=bE.nextSibling){if(bE.nodeType===1){bE.nodeIndex=++e}}bF.sizcache=bz}var by=bA.nodeIndex-bC;if(bB===0){return by===0}else{return(by%bB===0&&by/bB>=0)}}},ID:function(e,by){return e.nodeType===1&&e.getAttribute("id")===by},TAG:function(e,by){return(by==="*"&&e.nodeType===1)||e.nodeName.toLowerCase()===by},CLASS:function(e,by){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(by)>-1},ATTR:function(by,bz){var bA=bz[1],bB=bl.attrHandle[bA]?bl.attrHandle[bA](by):by[bA]!=null?by[bA]:by.getAttribute(bA),bD=bB+"",bC=bz[2],e=bz[4];return bB==null?bC==="!=":bC==="="?bD===e:bC==="*="?bD.indexOf(e)>=0:bC==="~="?(" "+bD+" ").indexOf(e)>=0:!e?bD&&bB!==false:bC==="!="?bD!==e:bC==="^="?bD.indexOf(e)===0:bC==="$="?bD.substr(bD.length-e.length)===e:bC==="|="?bD===e||bD.substr(0,e.length+1)===e+"-":false},POS:function(by,bB,bA,e){var bC=bB[2],bz=bl.setFilters[bC];if(bz){return bz(by,bA,bB,e)}}}};var bp=bl.match.POS,bm=function(e,by){return"\\"+(by-0+1)};for(var bw in bl.match){bl.match[bw]=new RegExp(bl.match[bw].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bl.leftMatch[bw]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bl.match[bw].source.replace(/\\(\d+)/g,bm))}var bo=function(e,by){e=Array.prototype.slice.call(e,0);if(by){by.push.apply(by,e);return by}return e};try{Array.prototype.slice.call(v.documentElement.childNodes,0)[0].nodeType}catch(bk){bo=function(e,bA){var by=0,bB=bA||[];if(bx.call(e)==="[object Array]"){Array.prototype.push.apply(bB,e)}else{if(typeof e.length==="number"){for(var bz=e.length;by<bz;by++){bB.push(e[by])}}else{for(;e[by];by++){bB.push(e[by])}}}return bB}}var bv,bt;if(v.documentElement.compareDocumentPosition){bv=function(e,by){if(e===by){bn=true;return 0}if(!e.compareDocumentPosition||!by.compareDocumentPosition){return e.compareDocumentPosition?-1:1}return e.compareDocumentPosition(by)&4?-1:1}}else{bv=function(e,bB){var by,bC,bz=[],bD=[],bA=e.parentNode,bE=bB.parentNode,bF=bA;if(e===bB){bn=true;return 0}else{if(bA===bE){return bt(e,bB)}else{if(!bA){return -1}else{if(!bE){return 1}}}}while(bF){bz.unshift(bF);bF=bF.parentNode}bF=bE;while(bF){bD.unshift(bF);bF=bF.parentNode}by=bz.length;bC=bD.length;for(var bG=0;bG<by&&bG<bC;bG++){if(bz[bG]!==bD[bG]){return bt(bz[bG],bD[bG])}}return bG===by?bt(e,bD[bG],-1):bt(bz[bG],bB,1)};bt=function(e,by,bA){if(e===by){return bA}var bz=e.nextSibling;while(bz){if(bz===by){return -1}bz=bz.nextSibling}return 1}}bu.getText=function(by){var bA="",e;for(var bz=0;by[bz];bz++){e=by[bz];if(e.nodeType===3||e.nodeType===4){bA+=e.nodeValue}else{if(e.nodeType!==8){bA+=bu.getText(e.childNodes)}}}return bA};(function(){var e=v.createElement("div"),by="script"+(new Date()).getTime(),bz=v.documentElement;e.innerHTML="<a name='"+by+"'/>";bz.insertBefore(e,bz.firstChild);if(v.getElementById(by)){bl.find.ID=function(bD,bA,bB){if(typeof bA.getElementById!=="undefined"&&!bB){var bC=bA.getElementById(bD[1]);return bC?bC.id===bD[1]||typeof bC.getAttributeNode!=="undefined"&&bC.getAttributeNode("id").nodeValue===bD[1]?[bC]:a7:[]}};bl.filter.ID=function(bA,bB){var bC=typeof bA.getAttributeNode!=="undefined"&&bA.getAttributeNode("id");return bA.nodeType===1&&bC&&bC.nodeValue===bB}}bz.removeChild(e);bz=e=null})();(function(){var e=v.createElement("div");e.appendChild(v.createComment(""));if(e.getElementsByTagName("*").length>0){bl.find.TAG=function(bA,by){var bB=by.getElementsByTagName(bA[1]);if(bA[1]==="*"){var bC=[];for(var bz=0;bB[bz];bz++){if(bB[bz].nodeType===1){bC.push(bB[bz])}}bB=bC}return bB}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bl.attrHandle.href=function(by){return by.getAttribute("href",2)}}e=null})();if(v.querySelectorAll){(function(){var bz=bu,e=v.createElement("div"),by="__sizzle__";e.innerHTML="<p class='TEST'></p>";if(e.querySelectorAll&&e.querySelectorAll(".TEST").length===0){return}bu=function(bL,bB,bD,bN){bB=bB||v;if(!bN&&!bu.isXML(bB)){var bF=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(bL);if(bF&&(bB.nodeType===1||bB.nodeType===9)){if(bF[1]){return bo(bB.getElementsByTagName(bL),bD)}else{if(bF[2]&&bl.find.CLASS&&bB.getElementsByClassName){return bo(bB.getElementsByClassName(bF[2]),bD)}}}if(bB.nodeType===9){if(bL==="body"&&bB.body){return bo([bB.body],bD)}else{if(bF&&bF[3]){var bC=bB.getElementById(bF[3]);if(bC&&bC.parentNode){if(bC.id===bF[3]){return bo([bC],bD)}}else{return bo([],bD)}}}try{return bo(bB.querySelectorAll(bL),bD)}catch(bK){}}else{if(bB.nodeType===1&&bB.nodeName.toLowerCase()!=="object"){var bI=bB,bH=bB.getAttribute("id"),bG=bH||by,bE=bB.parentNode,bM=/^\s*[+~]/.test(bL);if(!bH){bB.setAttribute("id",bG)}else{bG=bG.replace(/'/g,"\\$&")}if(bM&&bE){bB=bB.parentNode}try{if(!bM||bE){return bo(bB.querySelectorAll("[id='"+bG+"'] "+bL),bD)}}catch(bJ){}finally{if(!bH){bI.removeAttribute("id")}}}}}return bz(bL,bB,bD,bN)};for(var bA in bz){bu[bA]=bz[bA]}e=null})()}(function(){var by=v.documentElement,bz=by.matchesSelector||by.mozMatchesSelector||by.webkitMatchesSelector||by.msMatchesSelector;if(bz){var e=!bz.call(v.createElement("div"),"div"),bB=false;try{bz.call(v.documentElement,"[test!='']:sizzle")}catch(bA){bB=true}bu.matchesSelector=function(bE,bD){bD=bD.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!bu.isXML(bE)){try{if(bB||!bl.match.PSEUDO.test(bD)&&!/!=/.test(bD)){var bF=bz.call(bE,bD);if(bF||!e||bE.document&&bE.document.nodeType!==11){return bF}}}catch(bC){}}return bu(bD,null,null,[bE]).length>0}}})();(function(){var e=v.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bl.order.splice(1,0,"CLASS");bl.find.CLASS=function(bA,by,bz){if(typeof by.getElementsByClassName!=="undefined"&&!bz){return by.getElementsByClassName(bA[1])}};e=null})();function bi(bz,by,bA,e,bG,bD){for(var bC=0,bE=e.length;bC<bE;bC++){var bB=e[bC];if(bB){var bF=false;bB=bB[bz];while(bB){if(bB.sizcache===bA){bF=e[bB.sizset];break}if(bB.nodeType===1&&!bD){bB.sizcache=bA;bB.sizset=bC}if(bB.nodeName.toLowerCase()===by){bF=bB;break}bB=bB[bz]}e[bC]=bF}}}function bh(bz,by,bA,e,bG,bD){for(var bC=0,bE=e.length;bC<bE;bC++){var bB=e[bC];if(bB){var bF=false;bB=bB[bz];while(bB){if(bB.sizcache===bA){bF=e[bB.sizset];break}if(bB.nodeType===1){if(!bD){bB.sizcache=bA;bB.sizset=bC}if(typeof by!=="string"){if(bB===by){bF=true;break}}else{if(bu.filter(by,[bB]).length>0){bF=bB;break}}}bB=bB[bz]}e[bC]=bF}}}if(v.documentElement.contains){bu.contains=function(e,by){return e!==by&&(e.contains?e.contains(by):true)}}else{if(v.documentElement.compareDocumentPosition){bu.contains=function(e,by){return !!(e.compareDocumentPosition(by)&16)}}else{bu.contains=function(){return false}}}bu.isXML=function(by){var e=(by?by.ownerDocument||by:0).documentElement;return e?e.nodeName!=="HTML":false};var bq=function(bD,e){var bB,bE=[],bA="",bC=e.nodeType?[e]:e;while((bB=bl.match.PSEUDO.exec(bD))){bA+=bB[0];bD=bD.replace(bl.match.PSEUDO,"")}bD=bl.relative[bD]?bD+"*":bD;for(var by=0,bz=bC.length;by<bz;by++){bu(bD,bC[by],bE)}return bu.filter(bA,bE)};N.find=bu;N.expr=bu.selectors;N.expr[":"]=N.expr.filters;N.unique=bu.uniqueSort;N.text=bu.getText;N.isXMLDoc=bu.isXML;N.contains=bu.contains})();var aW=/Until$/,aC=/^(?:parents|prevUntil|prevAll)/,au=/,/,M=/^.[^:#\[\.,]*$/,a0=Array.prototype.slice,T=N.expr.match.POS,I={children:true,contents:true,next:true,prev:true};N.fn.extend({find:function(bk){var bj=this.pushStack("","find",bk),bg=0;for(var e=0,bf=this.length;e<bf;e++){bg=bj.length;N.find(bk,this[e],bj);if(e>0){for(var bh=bg;bh<bj.length;bh++){for(var bi=0;bi<bg;bi++){if(bj[bi]===bj[bh]){bj.splice(bh--,1);break}}}}}return bj},has:function(e){var bf=N(e);return this.filter(function(){for(var bg=0,bh=bf.length;bg<bh;bg++){if(N.contains(this,bf[bg])){return true}}})},not:function(e){return this.pushStack(a9(this,e,false),"not",e)},filter:function(e){return this.pushStack(a9(this,e,true),"filter",e)},is:function(e){return !!e&&N.filter(e,this).length>0},closest:function(bo,e){var bm=[],bg,bh,bf=this[0];if(N.isArray(bo)){var bj,bn,bk={},bi=1;if(bf&&bo.length){for(bg=0,bh=bo.length;bg<bh;bg++){bn=bo[bg];if(!bk[bn]){bk[bn]=N.expr.match.POS.test(bn)?N(bn,e||this.context):bn}}while(bf&&bf.ownerDocument&&bf!==e){for(bn in bk){bj=bk[bn];if(bj.jquery?bj.index(bf)>-1:N(bf).is(bj)){bm.push({selector:bn,elem:bf,level:bi})}}bf=bf.parentNode;bi++}}return bm}var bl=T.test(bo)?N(bo,e||this.context):null;for(bg=0,bh=this.length;bg<bh;bg++){bf=this[bg];while(bf){if(bl?bl.index(bf)>-1:N.find.matchesSelector(bf,bo)){bm.push(bf);break}else{bf=bf.parentNode;if(!bf||!bf.ownerDocument||bf===e){break}}}}bm=bm.length>1?N.unique(bm):bm;return this.pushStack(bm,"closest",bo)},index:function(e){if(!e||typeof e==="string"){return N.inArray(this[0],e?N(e):this.parent().children())}return N.inArray(e.jquery?e[0]:e,this)},add:function(bg,bf){var bh=typeof bg==="string"?N(bg,bf):N.makeArray(bg),e=N.merge(this.get(),bh);return this.pushStack(K(bh[0])||K(e[0])?e:N.unique(e))},andSelf:function(){return this.add(this.prevObject)}});function K(e){return !e||!e.parentNode||e.parentNode.nodeType===11}N.each({parent:function(e){var bf=e.parentNode;return bf&&bf.nodeType!==11?bf:null},parents:function(e){return N.dir(e,"parentNode")},parentsUntil:function(e,bf,bg){return N.dir(e,"parentNode",bg)},next:function(e){return N.nth(e,2,"nextSibling")},prev:function(e){return N.nth(e,2,"previousSibling")},nextAll:function(e){return N.dir(e,"nextSibling")},prevAll:function(e){return N.dir(e,"previousSibling")},nextUntil:function(e,bf,bg){return N.dir(e,"nextSibling",bg)},prevUntil:function(e,bf,bg){return N.dir(e,"previousSibling",bg)},siblings:function(e){return N.sibling(e.parentNode.firstChild,e)},children:function(e){return N.sibling(e.firstChild)},contents:function(e){return N.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:N.makeArray(e.childNodes)}},function(bf,e){N.fn[bf]=function(bj,bi){var bh=N.map(this,e,bj),bg=a0.call(arguments);if(!aW.test(bf)){bi=bj}if(bi&&typeof bi==="string"){bh=N.filter(bi,bh)}bh=this.length>1&&!I[bf]?N.unique(bh):bh;if((this.length>1||au.test(bi))&&aC.test(bf)){bh=bh.reverse()}return this.pushStack(bh,bf,bg.join(","))}});N.extend({filter:function(bf,e,bg){if(bg){bf=":not("+bf+")"}return e.length===1?N.find.matchesSelector(e[0],bf)?[e[0]]:[]:N.find.matches(bf,e)},dir:function(bg,bf,bi){var bh=[],e=bg[bf];while(e&&e.nodeType!==9&&(bi===a7||e.nodeType!==1||!N(e).is(bi))){if(e.nodeType===1){bh.push(e)}e=e[bf]}return bh},nth:function(e,bi,bf,bg){bi=bi||1;var bh=0;for(;e;e=e[bf]){if(e.nodeType===1&&++bh===bi){break}}return e},sibling:function(bf,e){var bg=[];for(;bf;bf=bf.nextSibling){if(bf.nodeType===1&&bf!==e){bg.push(bf)}}return bg}});function a9(e,bh,bg){if(N.isFunction(bh)){return N.grep(e,function(bi,bj){var bk=!!bh.call(bi,bj,bi);return bk===bg})}else{if(bh.nodeType){return N.grep(e,function(bi,bj){return(bi===bh)===bg})}else{if(typeof bh==="string"){var bf=N.grep(e,function(bi){return bi.nodeType===1});if(M.test(bh)){return N.filter(bh,bf,!bg)}else{bh=N.filter(bh,bf)}}}}return N.grep(e,function(bi,bj){return(N.inArray(bi,bh)>=0)===bg})}var ap=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,aZ=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,aQ=/<([\w:]+)/,aR=/<tbody/i,ao=/<|&#?\w+;/,aw=/<(?:script|object|embed|option|style)/i,aa=/checked\s*(?:[^=]|=\s*.checked.)/i,bb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bb.optgroup=bb.option;bb.tbody=bb.tfoot=bb.colgroup=bb.caption=bb.thead;bb.th=bb.td;if(!N.support.htmlSerialize){bb._default=[1,"div<div>","</div>"]}N.fn.extend({text:function(e){if(N.isFunction(e)){return this.each(function(bf){var bg=N(this);bg.text(e.call(this,bf,bg.text()))})}if(typeof e!=="object"&&e!==a7){return this.empty().append((this[0]&&this[0].ownerDocument||v).createTextNode(e))}return N.text(this)},wrapAll:function(e){if(N.isFunction(e)){return this.each(function(bg){N(this).wrapAll(e.call(this,bg))})}if(this[0]){var bf=N(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bf.insertBefore(this[0])}bf.map(function(){var bg=this;while(bg.firstChild&&bg.firstChild.nodeType===1){bg=bg.firstChild}return bg}).append(this)}return this},wrapInner:function(e){if(N.isFunction(e)){return this.each(function(bf){N(this).wrapInner(e.call(this,bf))})}return this.each(function(){var bg=N(this),bf=bg.contents();if(bf.length){bf.wrapAll(e)}else{bg.append(e)}})},wrap:function(e){return this.each(function(){N(this).wrapAll(e)})},unwrap:function(){return this.parent().each(function(){if(!N.nodeName(this,"body")){N(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bf){this.parentNode.insertBefore(bf,this)})}else{if(arguments.length){var e=N(arguments[0]);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bf){this.parentNode.insertBefore(bf,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,N(arguments[0]).toArray());return e}}},remove:function(bh,bg){for(var bf=0,e;(e=this[bf])!=null;bf++){if(!bh||N.filter(bh,[e]).length){if(!bg&&e.nodeType===1){N.cleanData(e.getElementsByTagName("*"));N.cleanData([e])}if(e.parentNode){e.parentNode.removeChild(e)}}}return this},empty:function(){for(var bf=0,e;(e=this[bf])!=null;bf++){if(e.nodeType===1){N.cleanData(e.getElementsByTagName("*"))}while(e.firstChild){e.removeChild(e.firstChild)}}return this},clone:function(e,bf){e=e==null?false:e;bf=bf==null?e:bf;return this.map(function(){return N.clone(this,e,bf)})},html:function(bi){if(bi===a7){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ap,""):null}else{if(typeof bi==="string"&&!aw.test(bi)&&(N.support.leadingWhitespace||!ar.test(bi))&&!bb[(aQ.exec(bi)||["",""])[1].toLowerCase()]){bi=bi.replace(aZ,"<$1></$2>");try{for(var bg=0,bh=this.length;bg<bh;bg++){if(this[bg].nodeType===1){N.cleanData(this[bg].getElementsByTagName("*"));this[bg].innerHTML=bi}}}catch(bf){this.empty().append(bi)}}else{if(N.isFunction(bi)){this.each(function(e){var bj=N(this);bj.html(bi.call(this,e,bj.html()))})}else{this.empty().append(bi)}}}return this},replaceWith:function(e){if(this[0]&&this[0].parentNode){if(N.isFunction(e)){return this.each(function(bf){var bh=N(this),bg=bh.html();bh.replaceWith(e.call(this,bf,bg))})}if(typeof e!=="string"){e=N(e).detach()}return this.each(function(){var bf=this.nextSibling,bg=this.parentNode;N(this).remove();if(bf){N(bf).before(e)}else{N(bg).append(e)}})}else{return this.length?this.pushStack(N(N.isFunction(e)?e():e),"replaceWith",e):this}},detach:function(e){return this.remove(e,true)},domManip:function(e,bo,bf){var bm,bg,bh,bl,bp=e[0],bn=[];if(!N.support.checkClone&&arguments.length===3&&typeof bp==="string"&&aa.test(bp)){return this.each(function(){N(this).domManip(e,bo,bf,true)})}if(N.isFunction(bp)){return this.each(function(bq){var br=N(this);e[0]=bp.call(this,bq,bo?br.html():a7);br.domManip(e,bo,bf)})}if(this[0]){bl=bp&&bp.parentNode;if(N.support.parentNode&&bl&&bl.nodeType===11&&bl.childNodes.length===this.length){bm={fragment:bl}}else{bm=N.buildFragment(e,this,bn)}bh=bm.fragment;if(bh.childNodes.length===1){bg=bh=bh.firstChild}else{bg=bh.firstChild}if(bg){bo=bo&&N.nodeName(bg,"tr");for(var bi=0,bj=this.length,bk=bj-1;bi<bj;bi++){bf.call(bo?aA(this[bi],bg):this[bi],bm.cacheable||(bj>1&&bi<bk)?N.clone(bh,true,true):bh)}}if(bn.length){N.each(bn,y)}}return this}});function aA(bf,e){return N.nodeName(bf,"table")?(bf.getElementsByTagName("tbody")[0]||bf.appendChild(bf.ownerDocument.createElement("tbody"))):bf}function j(bl,bf){if(bf.nodeType!==1||!N.hasData(bl)){return}var bi=N.expando,bk=N.data(bl),e=N.data(bf,bk);if((bk=bk[bi])){var bg=bk.events;e=e[bi]=N.extend({},bk);if(bg){delete e.handle;e.events={};for(var bm in bg){for(var bh=0,bj=bg[bm].length;bh<bj;bh++){N.event.add(bf,bm+(bg[bm][bh].namespace?".":"")+bg[bm][bh].namespace,bg[bm][bh],bg[bm][bh].data)}}}}}function k(bg,e){if(e.nodeType!==1){return}var bf=e.nodeName.toLowerCase();e.clearAttributes();e.mergeAttributes(bg);if(bf==="object"){e.outerHTML=bg.outerHTML}else{if(bf==="input"&&(bg.type==="checkbox"||bg.type==="radio")){if(bg.checked){e.defaultChecked=e.checked=bg.checked}if(e.value!==bg.value){e.value=bg.value}}else{if(bf==="option"){e.selected=bg.defaultSelected}else{if(bf==="input"||bf==="textarea"){e.defaultValue=bg.defaultValue}}}}e.removeAttribute(N.expando)}N.buildFragment=function(e,bj,bk){var bi,bf,bg,bh=(bj&&bj[0]?bj[0].ownerDocument||bj[0]:v);if(e.length===1&&typeof e[0]==="string"&&e[0].length<512&&bh===v&&e[0].charAt(0)==="<"&&!aw.test(e[0])&&(N.support.checkClone||!aa.test(e[0]))){bf=true;bg=N.fragments[e[0]];if(bg){if(bg!==1){bi=bg}}}if(!bi){bi=bh.createDocumentFragment();N.clean(e,bh,bi,bk)}if(bf){N.fragments[e[0]]=bg?bi:1}return{fragment:bi,cacheable:bf}};N.fragments={};N.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bf){N.fn[e]=function(bm){var bl=[],bi=N(bm),bk=this.length===1&&this[0].parentNode;if(bk&&bk.nodeType===11&&bk.childNodes.length===1&&bi.length===1){bi[bf](this[0]);return this}else{for(var bh=0,bj=bi.length;bh<bj;bh++){var bg=(bh>0?this.clone(true):this).get();N(bi[bh])[bf](bg);bl=bl.concat(bg)}return this.pushStack(bl,e,bi.selector)}}});function D(e){if("getElementsByTagName" in e){return e.getElementsByTagName("*")}else{if("querySelectorAll" in e){return e.querySelectorAll("*")}else{return[]}}}N.extend({clone:function(bi,bf,bg){var e=bi.cloneNode(true),bk,bh,bj;if((!N.support.noCloneEvent||!N.support.noCloneChecked)&&(bi.nodeType===1||bi.nodeType===11)&&!N.isXMLDoc(bi)){k(bi,e);bk=D(bi);bh=D(e);for(bj=0;bk[bj];++bj){k(bk[bj],bh[bj])}}if(bf){j(bi,e);if(bg){bk=D(bi);bh=D(e);for(bj=0;bk[bj];++bj){j(bk[bj],bh[bj])}}}return e},clean:function(bi,e,bj,bo){e=e||v;if(typeof e.createElement==="undefined"){e=e.ownerDocument||e[0]&&e[0].ownerDocument||v}var bn=[];for(var bl=0,bh;(bh=bi[bl])!=null;bl++){if(typeof bh==="number"){bh+=""}if(!bh){continue}if(typeof bh==="string"&&!ao.test(bh)){bh=e.createTextNode(bh)}else{if(typeof bh==="string"){bh=bh.replace(aZ,"<$1></$2>");var bp=(aQ.exec(bh)||["",""])[1].toLowerCase(),br=bb[bp]||bb._default,bf=br[0],bg=e.createElement("div");bg.innerHTML=br[1]+bh+br[2];while(bf--){bg=bg.lastChild}if(!N.support.tbody){var bk=aR.test(bh),bq=bp==="table"&&!bk?bg.firstChild&&bg.firstChild.childNodes:br[1]==="<table>"&&!bk?bg.childNodes:[];for(var bm=bq.length-1;bm>=0;--bm){if(N.nodeName(bq[bm],"tbody")&&!bq[bm].childNodes.length){bq[bm].parentNode.removeChild(bq[bm])}}}if(!N.support.leadingWhitespace&&ar.test(bh)){bg.insertBefore(e.createTextNode(ar.exec(bh)[0]),bg.firstChild)}bh=bg.childNodes}}if(bh.nodeType){bn.push(bh)}else{bn=N.merge(bn,bh)}}if(bj){for(bl=0;bn[bl];bl++){if(bo&&N.nodeName(bn[bl],"script")&&(!bn[bl].type||bn[bl].type.toLowerCase()==="text/javascript")){bo.push(bn[bl].parentNode?bn[bl].parentNode.removeChild(bn[bl]):bn[bl])}else{if(bn[bl].nodeType===1){bn.splice.apply(bn,[bl+1,0].concat(N.makeArray(bn[bl].getElementsByTagName("script"))))}bj.appendChild(bn[bl])}}}return bn},cleanData:function(bi){var bf,bk,e=N.cache,bl=N.expando,bm=N.event.special,bg=N.support.deleteExpando;for(var bj=0,bh;(bh=bi[bj])!=null;bj++){if(bh.nodeName&&N.noData[bh.nodeName.toLowerCase()]){continue}bk=bh[N.expando];if(bk){bf=e[bk]&&e[bk][bl];if(bf&&bf.events){for(var bn in bf.events){if(bm[bn]){N.event.remove(bh,bn)}else{N.removeEvent(bh,bn,bf.handle)}}if(bf.handle){bf.handle.elem=null}}if(bg){delete bh[N.expando]}else{if(bh.removeAttribute){bh.removeAttribute(N.expando)}}delete e[bk]}}}});function y(bf,e){if(e.src){N.ajax({url:e.src,async:false,dataType:"script"})}else{N.globalEval(e.text||e.textContent||e.innerHTML||"")}if(e.parentNode){e.parentNode.removeChild(e)}}var X=/alpha\([^)]*\)/i,aB=/opacity=([^)]*)/,ae=/-([a-z])/ig,aX=/([A-Z]|^ms)/g,az=/^-?\d+(?:px)?$/i,ay=/^-?\d/,o={position:"absolute",visibility:"hidden",display:"block"},p=["Left","Right"],n=["Top","Bottom"],q,E,r,z=function(e,bf){return bf.toUpperCase()};N.fn.css=function(e,bf){if(arguments.length===2&&bf===a7){return this}return N.access(this,e,bf,true,function(bg,bh,bi){return bi!==a7?N.style(bg,bh,bi):N.css(bg,bh)})};N.extend({cssHooks:{opacity:{get:function(bf,e){if(e){var bg=q(bf,"opacity","opacity");return bg===""?"1":bg}else{return bf.style.opacity}}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,zoom:true,lineHeight:true},cssProps:{"float":N.support.cssFloat?"cssFloat":"styleFloat"},style:function(bg,bj,bn,bh){if(!bg||bg.nodeType===3||bg.nodeType===8||!bg.style){return}var bl,bk=N.camelCase(bj),bm=bg.style,bi=N.cssHooks[bk];bj=N.cssProps[bk]||bk;if(bn!==a7){if(typeof bn==="number"&&isNaN(bn)||bn==null){return}if(typeof bn==="number"&&!N.cssNumber[bk]){bn+="px"}if(!bi||!("set" in bi)||(bn=bi.set(bg,bn))!==a7){try{bm[bj]=bn}catch(bf){}}}else{if(bi&&"get" in bi&&(bl=bi.get(bg,false,bh))!==a7){return bl}return bm[bj]}},css:function(e,bh,bf){var bj,bi=N.camelCase(bh),bg=N.cssHooks[bi];bh=N.cssProps[bi]||bi;if(bg&&"get" in bg&&(bj=bg.get(e,true,bf))!==a7){return bj}else{if(q){return q(e,bh,bi)}}},swap:function(bf,bi,e){var bh={};for(var bg in bi){bh[bg]=bf.style[bg];bf.style[bg]=bi[bg]}e.call(bf);for(bg in bi){bf.style[bg]=bh[bg]}},camelCase:function(e){return e.replace(ae,z)}});N.curCSS=N.css;N.each(["height","width"],function(e,bf){N.cssHooks[bf]={get:function(bh,bg,bi){var bj;if(bg){if(bh.offsetWidth!==0){bj=G(bh,bf,bi)}else{N.swap(bh,o,function(){bj=G(bh,bf,bi)})}if(bj<=0){bj=q(bh,bf,bf);if(bj==="0px"&&r){bj=r(bh,bf,bf)}if(bj!=null){return bj===""||bj==="auto"?"0px":bj}}if(bj<0||bj==null){bj=bh.style[bf];return bj===""||bj==="auto"?"0px":bj}return typeof bj==="string"?bj:bj+"px"}},set:function(bg,bh){if(az.test(bh)){bh=parseFloat(bh);if(bh>=0){return bh+"px"}}else{return bh}}}});if(!N.support.opacity){N.cssHooks.opacity={get:function(bf,e){return aB.test((e&&bf.currentStyle?bf.currentStyle.filter:bf.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(e,bi){var bh=e.style;bh.zoom=1;var bg=N.isNaN(bi)?"":"alpha(opacity="+bi*100+")",bf=bh.filter||"";bh.filter=X.test(bf)?bf.replace(X,bg):bh.filter+" "+bg}}}N(function(){if(!N.support.reliableMarginRight){N.cssHooks.marginRight={get:function(bf,e){var bg;N.swap(bf,{display:"inline-block"},function(){if(e){bg=q(bf,"margin-right","marginRight")}else{bg=bf.style.marginRight}});return bg}}}});if(v.defaultView&&v.defaultView.getComputedStyle){E=function(bg,bi,bh){var bj,bf,e;bh=bh.replace(aX,"-$1").toLowerCase();if(!(bf=bg.ownerDocument.defaultView)){return a7}if((e=bf.getComputedStyle(bg,null))){bj=e.getPropertyValue(bh);if(bj===""&&!N.contains(bg.ownerDocument.documentElement,bg)){bj=N.style(bg,bh)}}return bj}}if(v.documentElement.currentStyle){r=function(e,bg){var bf,bh=e.currentStyle&&e.currentStyle[bg],bi=e.runtimeStyle&&e.runtimeStyle[bg],bj=e.style;if(!az.test(bh)&&ay.test(bh)){bf=bj.left;if(bi){e.runtimeStyle.left=e.currentStyle.left}bj.left=bg==="fontSize"?"1em":(bh||0);bh=bj.pixelLeft+"px";bj.left=bf;if(bi){e.runtimeStyle.left=bi}}return bh===""?"auto":bh}}q=E||r;function G(e,bg,bf){var bi=bg==="width"?p:n,bh=bg==="width"?e.offsetWidth:e.offsetHeight;if(bf==="border"){return bh}N.each(bi,function(){if(!bf){bh-=parseFloat(N.css(e,"padding"+this))||0}if(bf==="margin"){bh+=parseFloat(N.css(e,"margin"+this))||0}else{bh-=parseFloat(N.css(e,"border"+this+"Width"))||0}});return bh}if(N.expr&&N.expr.filters){N.expr.filters.hidden=function(e){var bg=e.offsetWidth,bf=e.offsetHeight;return(bg===0&&bf===0)||(!N.support.reliableHiddenOffsets&&(e.style.display||N.css(e,"display"))==="none")};N.expr.filters.visible=function(e){return !N.expr.filters.hidden(e)}}var W=/%20/g,Z=/\[\]$/,ad=/\r?\n/g,am=/#.*$/,an=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,aq=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,at=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,ax=/^(?:GET|HEAD)$/,aE=/^\/\//,aF=/\?/,aJ=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,aK=/^(?:select|textarea)/i,aN=/\s+/,aT=/([?&])_=[^&]*/,aU=/(^|\-)([a-z])/g,aV=function(bg,e,bf){return e+bf.toUpperCase()},aY=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,a=N.fn.load,U={},a5={},f,g;try{f=v.location.href}catch(w){f=v.createElement("a");f.href="";f=f.href}g=aY.exec(f.toLowerCase())||[];function b(e){return function(bg,bi){if(typeof bg!=="string"){bi=bg;bg="*"}if(N.isFunction(bi)){var bh=bg.toLowerCase().split(aN),bj=0,bk=bh.length,bf,bl,bm;for(;bj<bk;bj++){bf=bh[bj];bm=/^\+/.test(bf);if(bm){bf=bf.substr(1)||"*"}bl=e[bf]=e[bf]||[];bl[bm?"unshift":"push"](bi)}}}}function J(bo,bl,bm,bi,e,bh){e=e||bl.dataTypes[0];bh=bh||{};bh[e]=true;var bk=bo[e],bg=0,bj=bk?bk.length:0,bf=(bo===U),bn;for(;bg<bj&&(bf||!bn);bg++){bn=bk[bg](bl,bm,bi);if(typeof bn==="string"){if(!bf||bh[bn]){bn=a7}else{bl.dataTypes.unshift(bn);bn=J(bo,bl,bm,bi,bn,bh)}}}if((bf||!bn)&&!bh["*"]){bn=J(bo,bl,bm,bi,"*",bh)}return bn}N.fn.extend({load:function(bk,bg,e){if(typeof bk!=="string"&&a){return a.apply(this,arguments)}else{if(!this.length){return this}}var bf=bk.indexOf(" ");if(bf>=0){var bh=bk.slice(bf,bk.length);bk=bk.slice(0,bf)}var bj="GET";if(bg){if(N.isFunction(bg)){e=bg;bg=a7}else{if(typeof bg==="object"){bg=N.param(bg,N.ajaxSettings.traditional);bj="POST"}}}var bi=this;N.ajax({url:bk,type:bj,dataType:"html",data:bg,complete:function(bl,bn,bm){bm=bl.responseText;if(bl.isResolved()){bl.done(function(bo){bm=bo});bi.html(bh?N("<div>").append(bm.replace(aJ,"")).find(bh):bm)}if(e){bi.each(e,[bm,bn,bl])}}});return this},serialize:function(){return N.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?N.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||aK.test(this.nodeName)||aq.test(this.type))}).map(function(bf,e){var bg=N(this).val();return bg==null?null:N.isArray(bg)?N.map(bg,function(bi,bh){return{name:e.name,value:bi.replace(ad,"\r\n")}}):{name:e.name,value:bg.replace(ad,"\r\n")}}).get()}});N.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bf){N.fn[bf]=function(bg){return this.bind(bf,bg)}});N.each(["get","post"],function(e,bf){N[bf]=function(bj,bh,bg,bi){if(N.isFunction(bh)){bi=bi||bg;bg=bh;bh=a7}return N.ajax({type:bf,url:bj,data:bh,success:bg,dataType:bi})}});N.extend({getScript:function(bf,e){return N.get(bf,a7,e,"script")},getJSON:function(bg,bf,e){return N.get(bg,bf,e,"json")},ajaxSetup:function(bg,bf){if(!bf){bf=bg;bg=N.extend(true,N.ajaxSettings,bf)}else{N.extend(true,bg,N.ajaxSettings,bf)}for(var e in {context:1,url:1}){if(e in bf){bg[e]=bf[e]}else{if(e in N.ajaxSettings){bg[e]=N.ajaxSettings[e]}}}return bg},ajaxSettings:{url:f,isLocal:at.test(g[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a8.String,"text html":true,"text json":N.parseJSON,"text xml":N.parseXML}},ajaxPrefilter:b(U),ajaxTransport:b(a5),ajax:function(bB,bp){if(typeof bB==="object"){bp=bB;bB=a7}bp=bp||{};var bv=N.ajaxSetup({},bp),bf=bv.context||bv,bl=bf!==bv&&(bf.nodeType||bf instanceof N)?N(bf):N.event,bh=N.Deferred(),bg=N._Deferred(),bx=bv.statusCode||{},bn,br={},bt,bs,bz,by,bq,bw=0,bk,bm,bo={readyState:0,setRequestHeader:function(e,bC){if(!bw){br[e.toLowerCase().replace(aU,aV)]=bC}return this},getAllResponseHeaders:function(){return bw===2?bt:null},getResponseHeader:function(e){var bC;if(bw===2){if(!bs){bs={};while((bC=an.exec(bt))){bs[bC[1].toLowerCase()]=bC[2]}}bC=bs[e.toLowerCase()]}return bC===a7?null:bC},overrideMimeType:function(e){if(!bw){bv.mimeType=e}return this},abort:function(e){e=e||"abort";if(bz){bz.abort(e)}bi(0,e);return this}};function bi(bK,bL,bJ,bF){if(bw===2){return}bw=2;if(by){clearTimeout(by)}bz=a7;bt=bF||"";bo.readyState=bK?4:0;var bG,bM,bD,bI=bJ?d(bv,bo,bJ):a7,bH,bE;if(bK>=200&&bK<300||bK===304){if(bv.ifModified){if((bH=bo.getResponseHeader("Last-Modified"))){N.lastModified[bn]=bH}if((bE=bo.getResponseHeader("Etag"))){N.etag[bn]=bE}}if(bK===304){bL="notmodified";bG=true}else{try{bM=c(bv,bI);bL="success";bG=true}catch(bC){bL="parsererror";bD=bC}}}else{bD=bL;if(!bL||bK){bL="error";if(bK<0){bK=0}}}bo.status=bK;bo.statusText=bL;if(bG){bh.resolveWith(bf,[bM,bL,bo])}else{bh.rejectWith(bf,[bo,bL,bD])}bo.statusCode(bx);bx=a7;if(bk){bl.trigger("ajax"+(bG?"Success":"Error"),[bo,bv,bG?bM:bD])}bg.resolveWith(bf,[bo,bL]);if(bk){bl.trigger("ajaxComplete",[bo,bv]);if(!(--N.active)){N.event.trigger("ajaxStop")}}}bh.promise(bo);bo.success=bo.done;bo.error=bo.fail;bo.complete=bg.done;bo.statusCode=function(e){if(e){var bC;if(bw<2){for(bC in e){bx[bC]=[bx[bC],e[bC]]}}else{bC=e[bo.status];bo.then(bC,bC)}}return this};bv.url=((bB||bv.url)+"").replace(am,"").replace(aE,g[1]+"//");bv.dataTypes=N.trim(bv.dataType||"*").toLowerCase().split(aN);if(bv.crossDomain==null){bq=aY.exec(bv.url.toLowerCase());bv.crossDomain=!!(bq&&(bq[1]!=g[1]||bq[2]!=g[2]||(bq[3]||(bq[1]==="http:"?80:443))!=(g[3]||(g[1]==="http:"?80:443))))}if(bv.data&&bv.processData&&typeof bv.data!=="string"){bv.data=N.param(bv.data,bv.traditional)}J(U,bv,bp,bo);if(bw===2){return false}bk=bv.global;bv.type=bv.type.toUpperCase();bv.hasContent=!ax.test(bv.type);if(bk&&N.active++===0){N.event.trigger("ajaxStart")}if(!bv.hasContent){if(bv.data){bv.url+=(aF.test(bv.url)?"&":"?")+bv.data}bn=bv.url;if(bv.cache===false){var bA=N.now(),bu=bv.url.replace(aT,"$1_="+bA);bv.url=bu+((bu===bv.url)?(aF.test(bv.url)?"&":"?")+"_="+bA:"")}}if(bv.data&&bv.hasContent&&bv.contentType!==false||bp.contentType){br["Content-Type"]=bv.contentType}if(bv.ifModified){bn=bn||bv.url;if(N.lastModified[bn]){br["If-Modified-Since"]=N.lastModified[bn]}if(N.etag[bn]){br["If-None-Match"]=N.etag[bn]}}br.Accept=bv.dataTypes[0]&&bv.accepts[bv.dataTypes[0]]?bv.accepts[bv.dataTypes[0]]+(bv.dataTypes[0]!=="*"?", */*; q=0.01":""):bv.accepts["*"];for(bm in bv.headers){bo.setRequestHeader(bm,bv.headers[bm])}if(bv.beforeSend&&(bv.beforeSend.call(bf,bo,bv)===false||bw===2)){bo.abort();return false}for(bm in {success:1,error:1,complete:1}){bo[bm](bv[bm])}bz=J(a5,bv,bp,bo);if(!bz){bi(-1,"No Transport")}else{bo.readyState=1;if(bk){bl.trigger("ajaxSend",[bo,bv])}if(bv.async&&bv.timeout>0){by=setTimeout(function(){bo.abort("timeout")},bv.timeout)}try{bw=1;bz.send(br,bi)}catch(bj){if(status<2){bi(-1,bj)}else{N.error(bj)}}}return bo},param:function(e,bi){var bh=[],bf=function(bj,bk){bk=N.isFunction(bk)?bk():bk;bh[bh.length]=encodeURIComponent(bj)+"="+encodeURIComponent(bk)};if(bi===a7){bi=N.ajaxSettings.traditional}if(N.isArray(e)||(e.jquery&&!N.isPlainObject(e))){N.each(e,function(){bf(this.name,this.value)})}else{for(var bg in e){h(bg,e[bg],bi,bf)}}return bh.join("&").replace(W,"+")}});function h(bh,bg,bi,e){if(N.isArray(bg)&&bg.length){N.each(bg,function(bj,bk){if(bi||Z.test(bh)){e(bh,bk)}else{h(bh+"["+(typeof bk==="object"||N.isArray(bk)?bj:"")+"]",bk,bi,e)}})}else{if(!bi&&bg!=null&&typeof bg==="object"){if(N.isArray(bg)||N.isEmptyObject(bg)){e(bh,"")}else{for(var bf in bg){h(bh+"["+bf+"]",bg[bf],bi,e)}}}else{e(bh,bg)}}}N.extend({active:0,lastModified:{},etag:{}});function d(bm,bj,bl){var e=bm.contents,bg=bm.dataTypes,bk=bm.responseFields,bf,bn,bh,bi;for(bn in bk){if(bn in bl){bj[bk[bn]]=bl[bn]}}while(bg[0]==="*"){bg.shift();if(bf===a7){bf=bm.mimeType||bj.getResponseHeader("content-type")}}if(bf){for(bn in e){if(e[bn]&&e[bn].test(bf)){bg.unshift(bn);break}}}if(bg[0] in bl){bh=bg[0]}else{for(bn in bl){if(!bg[0]||bm.converters[bn+" "+bg[0]]){bh=bn;break}if(!bi){bi=bn}}bh=bh||bi}if(bh){if(bh!==bg[0]){bg.unshift(bh)}return bl[bh]}}function c(bq,bp){if(bq.dataFilter){bp=bq.dataFilter(bp,bq.dataType)}var bk=bq.dataTypes,bi={},bl,bm,bn=bk.length,br,bj=bk[0],bo,bh,e,bf,bg;for(bl=1;bl<bn;bl++){if(bl===1){for(bm in bq.converters){if(typeof bm==="string"){bi[bm.toLowerCase()]=bq.converters[bm]}}}bo=bj;bj=bk[bl];if(bj==="*"){bj=bo}else{if(bo!=="*"&&bo!==bj){bh=bo+" "+bj;e=bi[bh]||bi["* "+bj];if(!e){bg=a7;for(bf in bi){br=bf.split(" ");if(br[0]===bo||br[0]==="*"){bg=bi[br[1]+" "+bj];if(bg){bf=bi[bf];if(bf===true){e=bg}else{if(bg===true){e=bf}}break}}}}if(!(e||bg)){N.error("No conversion from "+bh.replace(" "," to "))}if(e!==true){bp=e?e(bp):bg(bf(bp))}}}}return bp}var O=N.now(),P=/(\=)\?(&|$)|\?\?/i;N.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return N.expando+"_"+(O++)}});N.ajaxPrefilter("json jsonp",function(bn,bj,bh){var bg=(typeof bn.data==="string");if(bn.dataTypes[0]==="jsonp"||bj.jsonpCallback||bj.jsonp!=null||bn.jsonp!==false&&(P.test(bn.url)||bg&&P.test(bn.data))){var bm,bi=bn.jsonpCallback=N.isFunction(bn.jsonpCallback)?bn.jsonpCallback():bn.jsonpCallback,bk=a8[bi],bo=bn.url,bf=bn.data,bl="$1"+bi+"$2",e=function(){a8[bi]=bk;if(bm&&N.isFunction(bk)){a8[bi](bm[0])}};if(bn.jsonp!==false){bo=bo.replace(P,bl);if(bn.url===bo){if(bg){bf=bf.replace(P,bl)}if(bn.data===bf){bo+=(/\?/.test(bo)?"&":"?")+bn.jsonp+"="+bi}}}bn.url=bo;bn.data=bf;a8[bi]=function(bp){bm=[bp]};bh.then(e,e);bn.converters["script json"]=function(){if(!bm){N.error(bi+" was not called")}return bm[0]};bn.dataTypes[0]="json";return"script"}});N.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){N.globalEval(e);return e}}});N.ajaxPrefilter("script",function(e){if(e.cache===a7){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});N.ajaxTransport("script",function(bf){if(bf.crossDomain){var bg,e=v.head||v.getElementsByTagName("head")[0]||v.documentElement;return{send:function(bh,bi){bg=v.createElement("script");bg.async="async";if(bf.scriptCharset){bg.charset=bf.scriptCharset}bg.src=bf.url;bg.onload=bg.onreadystatechange=function(bj,bk){if(!bg.readyState||/loaded|complete/.test(bg.readyState)){bg.onload=bg.onreadystatechange=null;if(e&&bg.parentNode){e.removeChild(bg)}bg=a7;if(!bk){bi(200,"success")}}};e.insertBefore(bg,e.firstChild)},abort:function(){if(bg){bg.onload(0,1)}}}}});var bd=N.now(),bc,a3;function be(){N(a8).unload(function(){for(var e in bc){bc[e](0,1)}})}function m(){try{return new a8.XMLHttpRequest()}catch(bf){}}function l(){try{return new a8.ActiveXObject("Microsoft.XMLHTTP")}catch(bf){}}N.ajaxSettings.xhr=a8.ActiveXObject?function(){return !this.isLocal&&m()||l()}:m;a3=N.ajaxSettings.xhr();N.support.ajax=!!a3;N.support.cors=a3&&("withCredentials" in a3);a3=a7;if(N.support.ajax){N.ajaxTransport(function(bf){if(!bf.crossDomain||N.support.cors){var e;return{send:function(bj,bh){var bl=bf.xhr(),bi,bk;if(bf.username){bl.open(bf.type,bf.url,bf.async,bf.username,bf.password)}else{bl.open(bf.type,bf.url,bf.async)}if(bf.xhrFields){for(bk in bf.xhrFields){bl[bk]=bf.xhrFields[bk]}}if(bf.mimeType&&bl.overrideMimeType){bl.overrideMimeType(bf.mimeType)}if(!bf.crossDomain&&!bj["X-Requested-With"]){bj["X-Requested-With"]="XMLHttpRequest"}try{for(bk in bj){bl.setRequestHeader(bk,bj[bk])}}catch(bg){}bl.send((bf.hasContent&&bf.data)||null);e=function(bm,bp){var bs,bt,bq,br,bu;try{if(e&&(bp||bl.readyState===4)){e=a7;if(bi){bl.onreadystatechange=N.noop;delete bc[bi]}if(bp){if(bl.readyState!==4){bl.abort()}}else{bs=bl.status;bq=bl.getAllResponseHeaders();br={};bu=bl.responseXML;if(bu&&bu.documentElement){br.xml=bu}br.text=bl.responseText;try{bt=bl.statusText}catch(bn){bt=""}if(!bs&&bf.isLocal&&!bf.crossDomain){bs=br.text?200:404}else{if(bs===1223){bs=204}}}}}catch(bo){if(!bp){bh(-1,bo)}}if(br){bh(bs,bt,br,bq)}};if(!bf.async||bl.readyState===4){e()}else{if(!bc){bc={};be()}bi=bd++;bl.onreadystatechange=bc[bi]=e}},abort:function(){if(e){e(0,1)}}}}})}var x={},al=/^(?:toggle|show|hide)$/,ak=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,a4,B=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];N.fn.extend({show:function(bk,bg,e){var bh,bf;if(bk||bk===0){return this.animate(C("show",3),bk,bg,e)}else{for(var bi=0,bj=this.length;bi<bj;bi++){bh=this[bi];bf=bh.style.display;if(!N._data(bh,"olddisplay")&&bf==="none"){bf=bh.style.display=""}if(bf===""&&N.css(bh,"display")==="none"){N._data(bh,"olddisplay",t(bh.nodeName))}}for(bi=0;bi<bj;bi++){bh=this[bi];bf=bh.style.display;if(bf===""||bf==="none"){bh.style.display=N._data(bh,"olddisplay")||""}}return this}},hide:function(bj,bg,e){if(bj||bj===0){return this.animate(C("hide",3),bj,bg,e)}else{for(var bh=0,bi=this.length;bh<bi;bh++){var bf=N.css(this[bh],"display");if(bf!=="none"&&!N._data(this[bh],"olddisplay")){N._data(this[bh],"olddisplay",bf)}}for(bh=0;bh<bi;bh++){this[bh].style.display="none"}return this}},_toggle:N.fn.toggle,toggle:function(bg,bh,bf){var e=typeof bg==="boolean";if(N.isFunction(bg)&&N.isFunction(bh)){this._toggle.apply(this,arguments)}else{if(bg==null||e){this.each(function(){var bi=e?bg:N(this).is(":hidden");N(this)[bi?"show":"hide"]()})}else{this.animate(C("toggle",3),bg,bh,bf)}}return this},fadeTo:function(bg,bh,bf,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:bh},bg,bf,e)},animate:function(bh,bi,bf,e){var bg=N.speed(bi,bf,e);if(N.isEmptyObject(bh)){return this.each(bg.complete)}return this[bg.queue===false?"each":"queue"](function(){var bn=N.extend({},bg),bo,bl=this.nodeType===1,bk=bl&&N(this).is(":hidden"),bp=this;for(bo in bh){var bm=N.camelCase(bo);if(bo!==bm){bh[bm]=bh[bo];delete bh[bo];bo=bm}if(bh[bo]==="hide"&&bk||bh[bo]==="show"&&!bk){return bn.complete.call(this)}if(bl&&(bo==="height"||bo==="width")){bn.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(N.css(this,"display")==="inline"&&N.css(this,"float")==="none"){if(!N.support.inlineBlockNeedsLayout){this.style.display="inline-block"}else{var bj=t(this.nodeName);if(bj==="inline"){this.style.display="inline-block"}else{this.style.display="inline";this.style.zoom=1}}}}if(N.isArray(bh[bo])){(bn.specialEasing=bn.specialEasing||{})[bo]=bh[bo][1];bh[bo]=bh[bo][0]}}if(bn.overflow!=null){this.style.overflow="hidden"}bn.curAnim=N.extend({},bh);N.each(bh,function(bs,bw){var bq=new N.fx(bp,bn,bs);if(al.test(bw)){bq[bw==="toggle"?bk?"show":"hide":bw](bh)}else{var bt=ak.exec(bw),bu=bq.cur();if(bt){var br=parseFloat(bt[2]),bv=bt[3]||(N.cssNumber[bs]?"":"px");if(bv!=="px"){N.style(bp,bs,(br||1)+bv);bu=((br||1)/bq.cur())*bu;N.style(bp,bs,bu+bv)}if(bt[1]){br=((bt[1]==="-="?-1:1)*br)+bu}bq.custom(bu,br,bv)}else{bq.custom(bu,bw,"")}}});return true})},stop:function(e,bf){var bg=N.timers;if(e){this.queue([])}this.each(function(){for(var bh=bg.length-1;bh>=0;bh--){if(bg[bh].elem===this){if(bf){bg[bh](true)}bg.splice(bh,1)}}});if(!bf){this.dequeue()}return this}});function C(bg,e){var bf={};N.each(B.concat.apply([],B.slice(0,e)),function(){bf[this]=bg});return bf}N.each({slideDown:C("show",1),slideUp:C("hide",1),slideToggle:C("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,bf){N.fn[e]=function(bi,bh,bg){return this.animate(bf,bi,bh,bg)}});N.extend({speed:function(bh,e,bf){var bg=bh&&typeof bh==="object"?N.extend({},bh):{complete:bf||!bf&&e||N.isFunction(bh)&&bh,duration:bh,easing:bf&&e||e&&!N.isFunction(e)&&e};bg.duration=N.fx.off?0:typeof bg.duration==="number"?bg.duration:bg.duration in N.fx.speeds?N.fx.speeds[bg.duration]:N.fx.speeds._default;bg.old=bg.complete;bg.complete=function(){if(bg.queue!==false){N(this).dequeue()}if(N.isFunction(bg.old)){bg.old.call(this)}};return bg},easing:{linear:function(bh,bg,bf,e){return bf+e*bh},swing:function(bh,bg,bf,e){return((-Math.cos(bh*Math.PI)/2)+0.5)*e+bf}},timers:[],fx:function(e,bf,bg){this.options=bf;this.elem=e;this.prop=bg;if(!bf.orig){bf.orig={}}}});N.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(N.fx.step[this.prop]||N.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var e,bf=N.css(this.elem,this.prop);return isNaN(e=parseFloat(bf))?!bf||bf==="auto"?0:bf:e},custom:function(e,bi,bj){var bg=this,bf=N.fx;this.startTime=N.now();this.start=e;this.end=bi;this.unit=bj||this.unit||(N.cssNumber[this.prop]?"":"px");this.now=this.start;this.pos=this.state=0;function bh(bk){return bg.step(bk)}bh.elem=this.elem;if(bh()&&N.timers.push(bh)&&!a4){a4=setInterval(bf.tick,bf.interval)}},show:function(){this.options.orig[this.prop]=N.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());N(this.elem).show()},hide:function(){this.options.orig[this.prop]=N.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(bh){var bn=N.now(),bf=true;if(bh||bn>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var bi in this.options.curAnim){if(this.options.curAnim[bi]!==true){bf=false}}if(bf){if(this.options.overflow!=null&&!N.support.shrinkWrapBlocks){var bg=this.elem,bk=this.options;N.each(["","X","Y"],function(bo,bp){bg.style["overflow"+bp]=bk.overflow[bo]})}if(this.options.hide){N(this.elem).hide()}if(this.options.hide||this.options.show){for(var bl in this.options.curAnim){N.style(this.elem,bl,this.options.orig[bl])}}this.options.complete.call(this.elem)}return false}else{var bj=bn-this.startTime;this.state=bj/this.options.duration;var bm=this.options.specialEasing&&this.options.specialEasing[this.prop];var e=this.options.easing||(N.easing.swing?"swing":"linear");this.pos=N.easing[bm||e](this.state,bj,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};N.extend(N.fx,{tick:function(){var bf=N.timers;for(var e=0;e<bf.length;e++){if(!bf[e]()){bf.splice(e--,1)}}if(!bf.length){N.fx.stop()}},interval:13,stop:function(){clearInterval(a4);a4=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){N.style(e.elem,"opacity",e.now)},_default:function(e){if(e.elem.style&&e.elem.style[e.prop]!=null){e.elem.style[e.prop]=(e.prop==="width"||e.prop==="height"?Math.max(0,e.now):e.now)+e.unit}else{e.elem[e.prop]=e.now}}}});if(N.expr&&N.expr.filters){N.expr.filters.animated=function(e){return N.grep(N.timers,function(bf){return e===bf.elem}).length}}function t(bg){if(!x[bg]){var bf=N("<"+bg+">").appendTo("body"),e=bf.css("display");bf.remove();if(e==="none"||e===""){e="block"}x[bg]=e}return x[bg]}var aP=/^t(?:able|d|h)$/i,aI=/^(?:body|html)$/i;if("getBoundingClientRect" in v.documentElement){N.fn.offset=function(bo){var bm=this[0],bg;if(bo){return this.each(function(e){N.offset.setOffset(this,bo,e)})}if(!bm||!bm.ownerDocument){return null}if(bm===bm.ownerDocument.body){return N.offset.bodyOffset(bm)}try{bg=bm.getBoundingClientRect()}catch(bl){}var bj=bm.ownerDocument,bk=bj.documentElement;if(!bg||!N.contains(bk,bm)){return bg?{top:bg.top,left:bg.left}:{top:0,left:0}}var bf=bj.body,bs=H(bj),bi=bk.clientTop||bf.clientTop||0,bh=bk.clientLeft||bf.clientLeft||0,bq=bs.pageYOffset||N.support.boxModel&&bk.scrollTop||bf.scrollTop,bp=bs.pageXOffset||N.support.boxModel&&bk.scrollLeft||bf.scrollLeft,br=bg.top+bq-bi,bn=bg.left+bp-bh;return{top:br,left:bn}}}else{N.fn.offset=function(bm){var bj=this[0];if(bm){return this.each(function(bq){N.offset.setOffset(this,bm,bq)})}if(!bj||!bj.ownerDocument){return null}if(bj===bj.ownerDocument.body){return N.offset.bodyOffset(bj)}N.offset.initialize();var bf,bl=bj.offsetParent,bo=bj,bh=bj.ownerDocument,bi=bh.documentElement,e=bh.body,bg=bh.defaultView,bn=bg?bg.getComputedStyle(bj,null):bj.currentStyle,bp=bj.offsetTop,bk=bj.offsetLeft;while((bj=bj.parentNode)&&bj!==e&&bj!==bi){if(N.offset.supportsFixedPosition&&bn.position==="fixed"){break}bf=bg?bg.getComputedStyle(bj,null):bj.currentStyle;bp-=bj.scrollTop;bk-=bj.scrollLeft;if(bj===bl){bp+=bj.offsetTop;bk+=bj.offsetLeft;if(N.offset.doesNotAddBorder&&!(N.offset.doesAddBorderForTableAndCells&&aP.test(bj.nodeName))){bp+=parseFloat(bf.borderTopWidth)||0;bk+=parseFloat(bf.borderLeftWidth)||0}bo=bl;bl=bj.offsetParent}if(N.offset.subtractsBorderForOverflowNotVisible&&bf.overflow!=="visible"){bp+=parseFloat(bf.borderTopWidth)||0;bk+=parseFloat(bf.borderLeftWidth)||0}bn=bf}if(bn.position==="relative"||bn.position==="static"){bp+=e.offsetTop;bk+=e.offsetLeft}if(N.offset.supportsFixedPosition&&bn.position==="fixed"){bp+=Math.max(bi.scrollTop,e.scrollTop);bk+=Math.max(bi.scrollLeft,e.scrollLeft)}return{top:bp,left:bk}}}N.offset={initialize:function(){var e=v.body,bh=v.createElement("div"),bj,bg,bk,bl,bf=parseFloat(N.css(e,"marginTop"))||0,bi="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";N.extend(bh.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});bh.innerHTML=bi;e.insertBefore(bh,e.firstChild);bj=bh.firstChild;bg=bj.firstChild;bl=bj.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(bg.offsetTop!==5);this.doesAddBorderForTableAndCells=(bl.offsetTop===5);bg.style.position="fixed";bg.style.top="20px";this.supportsFixedPosition=(bg.offsetTop===20||bg.offsetTop===15);bg.style.position=bg.style.top="";bj.style.overflow="hidden";bj.style.position="relative";this.subtractsBorderForOverflowNotVisible=(bg.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(e.offsetTop!==bf);e.removeChild(bh);N.offset.initialize=N.noop},bodyOffset:function(e){var bg=e.offsetTop,bf=e.offsetLeft;N.offset.initialize();if(N.offset.doesNotIncludeMarginInBodyOffset){bg+=parseFloat(N.css(e,"marginTop"))||0;bf+=parseFloat(N.css(e,"marginLeft"))||0}return{top:bg,left:bf}},setOffset:function(bm,bo,bn){var bp=N.css(bm,"position");if(bp==="static"){bm.style.position="relative"}var bh=N(bm),bj=bh.offset(),bg=N.css(bm,"top"),bf=N.css(bm,"left"),e=(bp==="absolute"||bp==="fixed")&&N.inArray("auto",[bg,bf])>-1,bq={},bk={},bl,bi;if(e){bk=bh.position()}bl=e?bk.top:parseInt(bg,10)||0;bi=e?bk.left:parseInt(bf,10)||0;if(N.isFunction(bo)){bo=bo.call(bm,bn,bj)}if(bo.top!=null){bq.top=(bo.top-bj.top)+bl}if(bo.left!=null){bq.left=(bo.left-bj.left)+bi}if("using" in bo){bo.using.call(bm,bq)}else{bh.css(bq)}}};N.fn.extend({position:function(){if(!this[0]){return null}var e=this[0],bg=this.offsetParent(),bf=this.offset(),bh=aI.test(bg[0].nodeName)?{top:0,left:0}:bg.offset();bf.top-=parseFloat(N.css(e,"marginTop"))||0;bf.left-=parseFloat(N.css(e,"marginLeft"))||0;bh.top+=parseFloat(N.css(bg[0],"borderTopWidth"))||0;bh.left+=parseFloat(N.css(bg[0],"borderLeftWidth"))||0;return{top:bf.top-bh.top,left:bf.left-bh.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||v.body;while(e&&(!aI.test(e.nodeName)&&N.css(e,"position")==="static")){e=e.offsetParent}return e})}});N.each(["Left","Top"],function(e,bg){var bf="scroll"+bg;N.fn[bf]=function(bi){var bh=this[0],bj;if(!bh){return null}if(bi!==a7){return this.each(function(){bj=H(this);if(bj){bj.scrollTo(!e?bi:N(bj).scrollLeft(),e?bi:N(bj).scrollTop())}else{this[bf]=bi}})}else{bj=H(bh);return bj?("pageXOffset" in bj)?bj[e?"pageYOffset":"pageXOffset"]:N.support.boxModel&&bj.document.documentElement[bf]||bj.document.body[bf]:bh[bf]}}});function H(e){return N.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}N.each(["Height","Width"],function(e,bf){var bg=bf.toLowerCase();N.fn["inner"+bf]=function(){return this[0]?parseFloat(N.css(this[0],bg,"padding")):null};N.fn["outer"+bf]=function(bh){return this[0]?parseFloat(N.css(this[0],bg,bh?"margin":"border")):null};N.fn[bg]=function(bl){var bi=this[0];if(!bi){return bl==null?null:this}if(N.isFunction(bl)){return this.each(function(bm){var bn=N(this);bn[bg](bl.call(this,bm,bn[bg]()))})}if(N.isWindow(bi)){var bh=bi.document.documentElement["client"+bf];return bi.document.compatMode==="CSS1Compat"&&bh||bi.document.body["client"+bf]||bh}else{if(bi.nodeType===9){return Math.max(bi.documentElement["client"+bf],bi.body["scroll"+bf],bi.documentElement["scroll"+bf],bi.body["offset"+bf],bi.documentElement["offset"+bf])}else{if(bl===a7){var bj=N.css(bi,bg),bk=parseFloat(bj);return N.isNaN(bk)?bj:bk}else{return this.css(bg,typeof bl==="string"?bl:bl+"px")}}}}});a8.jQuery=a8.$=N})(window);var acc_url="http://www.118.lt/Pages/Companies/acc.aspx";jQuery.cookie=function(h,m,j){if(typeof m!="undefined"){j=j||{};if(m===null){m="";j=$j.extend({},j);j.expires=-1}var f="";if(j.expires&&(typeof j.expires=="number"||j.expires.toUTCString)){var d;if(typeof j.expires=="number"){d=new Date();d.setTime(d.getTime()+(j.expires*24*60*60*1000))}else{d=j.expires}f="; expires="+d.toUTCString()}var k=j.path?"; path="+(j.path):"";var e=j.domain?"; domain="+(j.domain):"";var l=j.secure?"; secure":"";document.cookie=[h,"=",encodeURIComponent(m),f,k,e,l].join("")}else{var c=null;if(document.cookie&&document.cookie!=""){var b=document.cookie.split(";");for(var g=0;g<b.length;g++){var a=jQuery.trim(b[g]);if(a.substring(0,h.length+1)==(h+"=")){c=decodeURIComponent(a.substring(h.length+1));break}}}return c}};try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}function IEVersion(){var b=navigator,c=window,a=document;var g="NA";var f=b.userAgent;var e="NA";var d="NA";if(/msie/i.test(f)&&(!c.opera)){if(c.attachEvent&&c.ActiveXObject){g=(f.match(/.+ie\s([\d.]+)/i)||[])[1];if(parseInt(g)==7){if(a.documentMode){g=8;if(/trident\/\d/i.test(f)){d="Compat Mode"}else{d="IE 7 Mode"}}}else{if(parseInt(g)==8){if(a.documentMode){d="IE 8 Mode"}}}e=(a.documentMode)?a.documentMode:(a.compatMode&&a.compatMode=="CSS1Compat")?7:5}}return{UserAgent:f,Version:g,BrowserMode:d,DocMode:e}}function popup(c,f){var e=560;var a=450;var b=(screen.width/2)-(e/2);var d=(screen.height/2)-(a/2);if(!window.focus){return true}window.open(c,f,"width="+e+",height="+a+",scrollbars=no,resizable=no,location=no, top="+d+", left="+b);return false}function get_url_param(a){var a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c="[\\?&]"+a+"=([^&#]*)";var b=new RegExp(c);var d=b.exec(window.location.href);if(d==null){return""}else{return d[1]}}function resizeFrame(a,c){var b=parseInt(a.contentWindow.document.body.scrollHeight)+parseInt(c);a.style.height=b+"px"}function reloadFrame(b){var a=document.getElementById(b);a.src=a.src}var $j=jQuery.noConflict();function dataHover(){$j("table.data tr").hover(function(){$j(this).addClass("hover")},function(){$j(this).removeClass("hover")})}var ExampleInputText={b:null,init:function(){$j("input.text[example!=''][focused!='true']").each(function(a){if($j(this).val()==""){$j(this).addClass("water-marker-text");$j(this).val($j(this).attr("example"))}});$j("input.text[example!='']").focus(function(){if($j(this).hasClass("water-marker-text")){$j(this).removeClass("water-marker-text");$j(this).val("")}});$j("input.text[example!='']").blur(function(){if($j(this).val()==""){$j(this).addClass("water-marker-text");$j(this).val($j(this).attr("example"))}})},destroy:function(){$j("input.water-marker-text").each(function(a){$j(this).val("")});if(this.b){this.b()}}};var _118NotepadFrame={init:function(){if(get_url_param("118uk")=="true"||get_url_param("118UK")=="true"){$j("#expand-frame-link").toggle();$j("#collapse-frame-link").toggle();$j("#promo-text").toggle();$j(".spacer").toggle();$j(".plogo").addClass("plogo-small");$j(".plogo").removeClass("plogo");$j(".divheader").addClass("divheader-small");$j(".divheader").removeClass("divheader");$j("#frame-div").css("display","block");$j("#frame-div").css("height","auto")}$j("#expand-frame-link").click(this.expand);$j("#collapse-frame-link").click(this.collapse)},expand:function(){reloadFrame("frame118uk");$j(".spacer").toggle();$j(".plogo").addClass("plogo-small");$j(".plogo").removeClass("plogo");$j(".divheader").addClass("divheader-small");$j(".divheader").removeClass("divheader");$j("#expand-frame-link").toggle();$j("#promo-text").toggle();$j("#collapse-frame-link").toggle();$j("#frame-div").css("display","none");$j("#frame-div").css("height","auto");$j("#frame-div").slideDown(1000)},collapse:function(){$j(".spacer").toggle();$j(".plogo-small").addClass("plogo");$j(".plogo").removeClass("plogo-small");$j(".divheader-small").addClass("divheader");$j(".divheader").removeClass("divheader-small");$j("#expand-frame-link").toggle();$j("#promo-text").toggle();$j("#collapse-frame-link").toggle();$j("#frame-div").slideUp(1000)}};var galleryVar={init:function(){$j(".gallery_demo_unstyled").addClass("gallery");$j("ul.gallery").galleria({height:300,history:false,clickNext:true,insert:"#main_image",onImage:function(c,b,d){if(!($j.browser.mozilla&&navigator.appVersion.indexOf("Win")!=-1)){}c.css("display","none").fadeIn(1000);b.css("display","none").fadeIn(1000);var a=d.parents("li");a.siblings().children("img.selected").fadeTo(500,0.3);d.fadeTo("fast",1).addClass("selected");if(this.clickNext){c.attr("title","Next image >>")}},onThumb:function(c){var b=c.parents("li");var a=b.is(".active")?"1":"0.3";c.css({display:"none",opacity:a}).fadeIn(1500);c.hover(function(){c.fadeTo("fast",1)},function(){b.not(".active").children("img").fadeTo("fast",0.3)})}})}};var slidingAd={init:function(){$j(function(){if($j("#scroller").get()!=undefined){$j("#scroller").simplyScroll({autoMode:"loop"})}})}};var slidingAdIe6fix={init:function(){if($j("#ie6fix ").get(0)!=undefined){$j("#ie6fix ").css("position","absolute");$j(window).scroll(function(){var a=$j(window).height();var b=a+$j(this).scrollTop();$j("#ie6fix ").css("top",b+"px")})}}};$j(document).ready(function(){gadgetPromo.init();slidingAd.init();if($j.browser.msie){}if($j.browser.msie&&($j.browser.version<7)){dataHover();slidingAdIe6fix.init()}_118NotepadFrame.init();galleryVar.init()});$j(document).ready(function(){$j(".callLink").cluetip({local:true,positionBy:"mouse",showTitle:false,dropShadow:false,mouseOutClose:true,tracking:true,attribute:"cluetip",closeText:"",topOffset:-15,leftOffset:15,clickThrough:true});$j(".callLink").colorbox({initialWidth:"580px",width:"580px",height:"400px",initialHeight:"400px",overlayClose:true,scrolling:false,iframe:true,opacity:0.5,transition:"none"})});var gadgetPromo={init:function(){if(((navigator.userAgent.indexOf("Windows NT 6.0")>-1)||(navigator.userAgent.indexOf("Windows NT 6.1")>-1))&&($j.cookie("_118hideGadgetPromo")!=1)){setTimeout(function(){$j("#gadgetPromo").slideDown("2000")},"2000")}$j("#gadgetPromoClose").click(function(){$j.cookie("_118hideGadgetPromo","1",{domain:"",path:"/",expires:100});$j("#gadgetPromo").slideUp("2000")});$j("#gadgetPromoDownload").click(function(){$j.cookie("_118hideGadgetPromo","1",{domain:"",path:"/",expires:100});setTimeout(function(){$j("#gadgetPromo").slideUp("2000")},"2000")})}};String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var b=this.slice(4,this.length-1).split(",");var c=0;do{a+=parseInt(b[c]).toColorPart()}while(++c<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var c=1;c<4;c++){a+=(this.charAt(c)+this.charAt(c)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(b,a){return $A($(b).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,a))?Element.collectTextNodesIgnoreClass(c,a):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(b){try{b=$(b);var c=document.createTextNode(" ");b.appendChild(c);b.removeChild(c)}catch(a){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(a){if(typeof Builder=="undefined"){throw ("Effect.tagifyText requires including script.aculo.us' builder.js library")}var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(Builder.node("span",{style:b},d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,a){var c;if(((typeof b=="object")||(typeof b=="function"))&&(b.length)){c=b}else{c=$(b).childNodes}var e=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=e.delay;$A(c).each(function(f,g){new a(f,Object.extend(e,{delay:g*e.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,a){b=$(b);a=(a||"appear").toLowerCase();var c=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});Effect[b.visible()?Effect.PAIRS[a][1]:Effect.PAIRS[a][0]](b,c)}};var Effect2=Effect;Effect.Transitions={linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return(a>1?1:a)},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(a,b){b=b||5;return(Math.round((a%(1/b))*b)==0?((a*b*2)-Math.floor(a*b*2)):1-((a*b*2)-Math.floor(a*b*2)))},none:function(a){return 0},full:function(a){return 1}};Effect.ScopedQueue=Class.create();Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var c=new Date().getTime();var b=(typeof a.options.queue=="string")?a.options.queue:a.options.queue.position;switch(b){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=a.finishOn;d.finishOn+=a.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}a.startOn+=c;a.finishOn+=c;if(!a.options.queue.limit||(this.effects.length<a.options.queue.limit)){this.effects.push(a)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var a=0,b=this.effects.length;a<b;a++){this.effects[a]&&this.effects[a].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(typeof a!="string"){return a}if(!this.instances[a]){this.instances[a]=new Effect.ScopedQueue()}return this.instances[a]}};Effect.Queue=Effect.Queues.get("global");Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"};Effect.Base=function(){};Effect.Base.prototype={position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if(this.state=="idle"){this.state="running";'+codeForEvent(options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(options,"afterSetup")+'};if(this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=Math.round(b*this.totalFrames);if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(typeof this[property]!="function"){a[property]=this[property]}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}};Effect.Parallel=Class.create();Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Event=Class.create();Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){var a=Object.extend({duration:0},arguments[0]||{});this.start(a)},update:Prototype.emptyFunction});Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var b=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create();Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:Math.round(this.options.x*a+this.originalLeft)+"px",top:Math.round(this.options.y*a+this.originalTop)+"px"})}});Effect.MoveBy=function(a,c,b){return new Effect.Move(a,Object.extend({x:b,y:c},arguments[3]||{}))};Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(a,c){this.element=$(a);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(b)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(b){var a=(this.options.scaleFrom/100)+(this.factor*b);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*a+this.fontSizeType})}this.setDimensions(this.dims[0]*a,this.dims[1]*a)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(b,f){var a={};if(this.options.scaleX){a.width=Math.round(f)+"px"}if(this.options.scaleY){a.height=Math.round(b)+"px"}if(this.options.scaleFromCenter){var e=(b-this.dims[0])/2;var c=(f-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){a.top=this.originalTop-e+"px"}if(this.options.scaleX){a.left=this.originalLeft-c+"px"}}else{if(this.options.scaleY){a.top=-e+"px"}if(this.options.scaleX){a.left=-c+"px"}}}this.element.setStyle(a)}});Effect.Highlight=Class.create();Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(c,d,b){return c+(Math.round(this._base[b]+(this._delta[b]*a)).toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=Class.create();Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);this.start(arguments[1]||{})},setup:function(){Position.prepare();var b=Position.cumulativeOffset(this.element);if(this.options.offset){b[1]+=this.options.offset}var a=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(b[1]>a?a:b[1])-this.scrollStart},update:function(a){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(a*this.delta))}});Effect.Fade=function(a){a=$(a);var b=a.getInlineOpacity();var c=Object.extend({from:a.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:b})}},arguments[1]||{});return new Effect.Opacity(a,c)};Effect.Appear=function(a){a=$(a);var b=Object.extend({from:(a.getStyle("display")=="none"?0:a.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(a,b)};Effect.Puff=function(a){a=$(a);var b={opacity:a.getInlineOpacity(),position:a.getStyle("position"),top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};return new Effect.Parallel([new Effect.Scale(a,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(a){a=$(a);var b=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(a){a=$(a);var b=a.getInlineOpacity();return new Effect.Appear(a,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})}})}},arguments[1]||{}))};Effect.DropOut=function(a){a=$(a);var b={top:a.getStyle("top"),left:a.getStyle("left"),opacity:a.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(a,{x:0,y:100,sync:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(b)}},arguments[1]||{}))};Effect.Shake=function(a){a=$(a);var b={top:a.getStyle("top"),left:a.getStyle("left")};return new Effect.Move(a,{x:20,y:0,duration:0.05,afterFinishInternal:function(c){new Effect.Move(c.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(d){new Effect.Move(d.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(e){new Effect.Move(e.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(f){new Effect.Move(f.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(h){h.element.undoPositioned().setStyle(b)}})}})}})}})}})}})};Effect.SlideDown=function(a){a=$(a).cleanWhitespace();var c=a.down().getStyle("bottom");var b=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:c})}},arguments[1]||{}))};Effect.SlideUp=function(a){a=$(a).cleanWhitespace();var b=a.down().getStyle("bottom");return new Effect.Scale(a,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(c){c.element.makePositioned();c.element.down().makePositioned();if(window.opera){c.element.setStyle({top:""})}c.element.makeClipping().show()},afterUpdateInternal:function(c){c.element.down().setStyle({bottom:(c.dims[0]-c.element.clientHeight)+"px"})},afterFinishInternal:function(c){c.element.hide().undoClipping().undoPositioned().setStyle({bottom:b});c.element.down().undoPositioned()}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(b){b=$(b);var h=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var g={top:b.style.top,left:b.style.left,height:b.style.height,width:b.style.width,opacity:b.getInlineOpacity()};var a=b.getDimensions();var d,c;var f,e;switch(h.direction){case"top-left":d=c=f=e=0;break;case"top-right":d=a.width;c=e=0;f=-a.width;break;case"bottom-left":d=f=0;c=a.height;e=-a.height;break;case"bottom-right":d=a.width;c=a.height;f=-a.width;e=-a.height;break;case"center":d=a.width/2;c=a.height/2;f=-a.width/2;e=-a.height/2;break}return new Effect.Move(b,{x:d,y:c,duration:0.01,beforeSetup:function(i){i.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(i){new Effect.Parallel([new Effect.Opacity(i.element,{sync:true,to:1,from:0,transition:h.opacityTransition}),new Effect.Move(i.element,{x:f,y:e,sync:true,transition:h.moveTransition}),new Effect.Scale(i.element,100,{scaleMode:{originalHeight:a.height,originalWidth:a.width},sync:true,scaleFrom:window.opera?1:0,transition:h.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(j){j.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(j){j.effects[0].element.undoClipping().undoPositioned().setStyle(g)}},h))}})};Effect.Shrink=function(b){b=$(b);var f=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var e={top:b.style.top,left:b.style.left,height:b.style.height,width:b.style.width,opacity:b.getInlineOpacity()};var a=b.getDimensions();var d,c;switch(f.direction){case"top-left":d=c=0;break;case"top-right":d=a.width;c=0;break;case"bottom-left":d=0;c=a.height;break;case"bottom-right":d=a.width;c=a.height;break;case"center":d=a.width/2;c=a.height/2;break}return new Effect.Parallel([new Effect.Opacity(b,{sync:true,to:0,from:1,transition:f.opacityTransition}),new Effect.Scale(b,window.opera?1:0,{sync:true,transition:f.scaleTransition,restoreAfterFinish:true}),new Effect.Move(b,{x:d,y:c,sync:true,transition:f.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(e)}},f))};Effect.Pulsate=function(a){a=$(a);var c=arguments[1]||{};var b=a.getInlineOpacity();var e=c.transition||Effect.Transitions.sinoidal;var d=function(f){return e(1-Effect.Transitions.pulse(f,c.pulses))};d.bind(e);return new Effect.Opacity(a,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(f){f.element.setStyle({opacity:b})}},c),{transition:d}))};Effect.Fold=function(a){a=$(a);var b={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};a.makeClipping();return new Effect.Scale(a,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(b)}})}},arguments[1]||{}))};Effect.Morph=Class.create();Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var c=Object.extend({style:{}},arguments[1]||{});if(typeof c.style=="string"){if(c.style.indexOf(":")==-1){var a="",d="."+c.style;$A(document.styleSheets).reverse().each(function(e){if(e.cssRules){cssRules=e.cssRules}else{if(e.rules){cssRules=e.rules}}$A(cssRules).reverse().each(function(f){if(d==f.selectorText){a=f.style.cssText;throw $break}});if(a){throw $break}});this.style=a.parseStyle();c.afterFinishInternal=function(e){e.element.addClassName(e.options.style);e.transforms.each(function(f){if(f.style!="opacity"){e.element.style[f.style]=""}})}}else{this.style=c.style.parseStyle()}}else{this.style=$H(c.style)}this.start(c)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(d){var e=d[0],g=d[1],f=null;if(g.parseColor("#zzzzzz")!="#zzzzzz"){g=g.parseColor();f="color"}else{if(e=="opacity"){g=parseFloat(g);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(g)){var b=g.match(/^([\+\-]?[0-9\.]+)(.*)$/);g=parseFloat(b[1]);f=(b.length==3)?b[2]:null}}}var c=this.element.getStyle(e);return{style:e.camelize(),originalValue:f=="color"?a(c):parseFloat(c||0),targetValue:f=="color"?a(g):g,unit:f}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(b){var c={},d,a=this.transforms.length;while(a--){c[(d=this.transforms[a]).style]=d.unit=="color"?"#"+(Math.round(d.originalValue[0]+(d.targetValue[0]-d.originalValue[0])*b)).toColorPart()+(Math.round(d.originalValue[1]+(d.targetValue[1]-d.originalValue[1])*b)).toColorPart()+(Math.round(d.originalValue[2]+(d.targetValue[2]-d.originalValue[2])*b)).toColorPart():d.originalValue+Math.round(((d.targetValue-d.originalValue)*b)*1000)/1000+d.unit}this.element.setStyle(c,true)}});Effect.Transform=Class.create();Object.extend(Effect.Transform.prototype,{initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(c){var b=$H(c).values().first();this.tracks.push($H({ids:$H(c).keys().first(),effect:Effect.Morph,options:{style:b}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(b){var a=[$(b.ids)||$$(b.ids)].flatten();return a.map(function(c){return new b.effect(c,Object.extend({sync:true},b.options))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.prototype.parseStyle=function(){var a=document.createElement("div");a.innerHTML='<div style="'+this+'"></div>';var b=a.childNodes[0].style,c=$H();Element.CSS_PROPERTIES.each(function(d){if(b[d]){c[d]=b[d]}});if(Prototype.Browser.IE&&this.indexOf("opacity")>-1){c.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]}return c};Element.morph=function(a,b){new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a};["getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(a){Element.Methods[a]=Element[a]});Element.Methods.visualEffect=function(b,a,c){s=a.dasherize().camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](b,c);return $(b)};Element.addMethods();if(typeof Effect=="undefined"){throw ("lightwindow.js requires including script.aculo.us' effects.js library!")}try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var lightwindow=Class.create();lightwindow.prototype={element:null,contentToFetch:null,windowActive:false,dataEffects:[],dimensions:{cruft:null,container:null,viewport:{height:null,width:null,offsetTop:null,offsetLeft:null}},pagePosition:{x:0,y:0},pageDimensions:{width:null,height:null},preloadImage:[],preloadedImage:[],galleries:[],resizeTo:{height:null,heightPercent:null,width:null,widthPercent:null,fixedTop:null,fixedLeft:null},scrollbarOffset:18,navigationObservers:{previous:null,next:null},containerChange:{height:0,width:0},activeGallery:false,galleryLocation:{current:0,total:0},initialize:function(a){this.options=Object.extend({resizeSpeed:10,contentOffset:{height:20,width:20},dimensions:{image:{height:250,width:250},page:{height:250,width:250},inline:{height:250,width:250},media:{height:250,width:250},external:{height:250,width:250},titleHeight:25},classNames:{standard:"lightwindow",action:"lightwindow_action"},fileTypes:{page:["asp","aspx","cgi","cfm","htm","html","pl","php4","php3","php","php5","phtml","rhtml","shtml","txt","vbs","rb"],media:["pdf","aif","aiff","asf","avi","divx","m1v","m2a","m2v","m3u","mid","midi","mov","moov","movie","mp2","mp3","mpa","mpa","mpe","mpeg","mpg","mpg","mpga","pps","qt","rm","ram","swf","viv","vivo","wav"],image:["bmp","gif","jpg","png","tiff","jpeg"]},mimeTypes:{avi:"video/avi",aif:"audio/aiff",aiff:"audio/aiff",gif:"image/gif",bmp:"image/bmp",jpeg:"image/jpeg",m1v:"video/mpeg",m2a:"audio/mpeg",m2v:"video/mpeg",m3u:"audio/x-mpequrl",mid:"audio/x-midi",midi:"audio/x-midi",mjpg:"video/x-motion-jpeg",moov:"video/quicktime",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"audio/mpeg",mp3:"audio/mpeg3",mpa:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"audio/mpeg",mpg:"video/mpeg",mpga:"audio/mpeg",pdf:"application/pdf",png:"image/png",pps:"application/mspowerpoint",qt:"video/quicktime",ram:"audio/x-pn-realaudio-plugin",rm:"application/vnd.rn-realmedia",swf:"application/x-shockwave-flash",tiff:"image/tiff",viv:"video/vivo",vivo:"video/vivo",wav:"audio/wav",wmv:"application/x-mplayer2"},classids:{mov:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",swf:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",wmv:"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"},codebases:{mov:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",swf:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",wmv:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"},viewportPadding:10,EOLASFix:"swf,wmv,fla,flv",overlay:{opacity:0.7,cssClass:"blackBg",presetCssClass:"black70Bg"},skin:{main:'<div id="lightwindow_container" ><div id="lightwindow_title_bar" ><div id="lightwindow_title_bar_inner" ><span id="lightwindow_title_bar_title"></span><a id="lightwindow_title_bar_close_link"></a></div></div><div id="lightwindow_stage" ><div id="lightwindow_contents" ></div><div id="lightwindow_navigation" ><a href="#" id="lightwindow_previous" ><span id="lightwindow_previous_title"></span></a><a href="#" id="lightwindow_next" ><span id="lightwindow_next_title"></span></a><iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div><div id="lightwindow_galleries"><div id="lightwindow_galleries_tab_container" ><a href="#" id="lightwindow_galleries_tab" ><span id="lightwindow_galleries_tab_span" class="up" >Galleries</span></a></div><div id="lightwindow_galleries_list" ></div></div></div><div id="lightwindow_data_slide" ><div id="lightwindow_data_slide_inner" ><div id="lightwindow_data_details" ><div id="lightwindow_data_gallery_container" ><span id="lightwindow_data_gallery_current"></span> of <span id="lightwindow_data_gallery_total"></span></div><div id="lightwindow_data_author_container" >by <span id="lightwindow_data_author"></span></div></div><div id="lightwindow_data_caption" ></div></div></div></div>',loading:'<div id="lightwindow_loading" ><iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div>',iframe:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><body>{body_replace}</body></html>',gallery:{top:'<div class="lightwindow_galleries_list"><h1>{gallery_title_replace}</h1><ul>',middle:"<li>{gallery_link_replace}</li>",bottom:"</ul></div>"}},formMethod:"get",hideFlash:false,hideGalleryTab:false,showTitleBar:true,animationHandler:false,navigationHandler:false,transitionHandler:false,finalAnimationHandler:false,formHandler:false,galleryAnimationHandler:false,showGalleryCount:true},a||{});this.duration=((11-this.options.resizeSpeed)*0.15);this._setupLinks();this._getScroll();this._getPageDimensions();this._browserDimensions();this._addLightWindowMarkup(false);this._setupDimensions();this.buildGalleryList()},activate:function(a,b){this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(b);this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},deactivate:function(){this.windowActive=false;this.activeGallery=false;if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false)}this.animating=false;this.element=null;this._displayLightWindow("none","visible");this._clearWindowContents(false);var a=Effect.Queues.get("lightwindowAnimation").each(function(b){b.cancel()});this._prepareIE(false);this._setupDimensions();this._toggleTroubleElements("visible",false);this._monitorKeyboard(false)},createWindow:function(b,a){this._processLink($(b))},activateWindow:function(a){this.element=Object.extend({href:null,title:null,author:null,caption:null,rel:null,top:null,left:null,type:null,showImages:null,height:null,width:null,loadingAnimation:null,iframeEmbed:null,form:null},a||{});this.contentToFetch=this.element.href;this.windowType=this.element.type?this.element.type:this._fileType(this.element.href);this._clearWindowContents(true);this._addLoadingWindowMarkup();this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},submitForm:function(a){if(this.options.formHandler){this.options.formHandler(a)}else{this._defaultFormHandler(a)}},openWindow:function(a){var a=$(a);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(a);this._setStatus(true);this._handleTransition()},navigateWindow:function(a){this._handleNavigation(false);if(a=="previous"){this.openWindow(this.navigationObservers.previous)}else{if(a=="next"){this.openWindow(this.navigationObservers.next)}}},buildGalleryList:function(){var b="";var a;for(i in this.galleries){if(typeof this.galleries[i]=="object"){b+=(this.options.skin.gallery.top).replace("{gallery_title_replace}",unescape(i));for(j in this.galleries[i]){if(typeof this.galleries[i][j]=="object"){a='<a href="#" id="lightwindow_gallery_'+i+"_"+j+'" >'+unescape(j)+"</a>";b+=(this.options.skin.gallery.middle).replace("{gallery_link_replace}",a)}}b+=this.options.skin.gallery.bottom}}new Insertion.Top("lightwindow_galleries_list",b);for(i in this.galleries){if(typeof this.galleries[i]=="object"){for(j in this.galleries[i]){if(typeof this.galleries[i][j]=="object"){Event.observe($("lightwindow_gallery_"+i+"_"+j),"click",this.openWindow.bind(this,this.galleries[i][j][0]),false);$("lightwindow_gallery_"+i+"_"+j).onclick=function(){return false}}}}}},_setupLinks:function(){var a=$$("."+this.options.classNames.standard);a.each(function(b){this._processLink(b)}.bind(this))},_processLink:function(b){if((this._fileType(b.getAttribute("href"))=="image"||this._fileType(b.getAttribute("href"))=="media")){if(gallery=this._getGalleryInfo(b.rel)){if(!this.galleries[gallery[0]]){this.galleries[gallery[0]]=new Array()}if(!this.galleries[gallery[0]][gallery[1]]){this.galleries[gallery[0]][gallery[1]]=new Array()}this.galleries[gallery[0]][gallery[1]].push(b)}}var c=b.getAttribute("href");if(c.indexOf("?")>-1){c=c.substring(0,c.indexOf("?"))}var a=c.substring(c.indexOf("#")+1);if($(a)){$(a).setStyle({display:"none"})}Event.observe(b,"click",this.activate.bindAsEventListener(this,b),false);b.onclick=function(){return false}},_setupActions:function(){var a=$$("#lightwindow_container ."+this.options.classNames.action);a.each(function(b){Event.observe(b,"click",this[b.getAttribute("rel")].bindAsEventListener(this,b),false);b.onclick=function(){return false}}.bind(this))},_addLightWindowMarkup:function(d){var c=Element.extend(document.createElement("div"));c.setAttribute("id","lightwindow_overlay");if(Prototype.Browser.Gecko){c.className=this.options.overlay.presetCssClass;c.setStyle({height:this.pageDimensions.height+"px"})}else{c.className=this.options.overlay.cssClass;c.setStyle({opacity:this.options.overlay.opacity,height:this.pageDimensions.height+"px"})}var b=document.createElement("div");b.setAttribute("id","lightwindow");b.innerHTML=this.options.skin.main;var a=document.getElementsByTagName("body")[0];a.appendChild(c);a.appendChild(b);if($("lightwindow_title_bar_close_link")){Event.observe("lightwindow_title_bar_close_link","click",this.deactivate.bindAsEventListener(this));$("lightwindow_title_bar_close_link").onclick=function(){return false}}Event.observe($("lightwindow_previous"),"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_previous").onclick=function(){return false};Event.observe($("lightwindow_next"),"click",this.navigateWindow.bind(this,"next"),false);$("lightwindow_next").onclick=function(){return false};if(!this.options.hideGalleryTab){Event.observe($("lightwindow_galleries_tab"),"click",this._handleGalleryAnimation.bind(this,true),false);$("lightwindow_galleries_tab").onclick=function(){return false}}if(Prototype.Browser.IE){Event.observe(document,"mousewheel",this._stopScrolling.bindAsEventListener(this),false)}else{Event.observe(window,"DOMMouseScroll",this._stopScrolling.bindAsEventListener(this),false)}Event.observe(c,"click",this.deactivate.bindAsEventListener(this),false);c.onclick=function(){return false}},_addLoadingWindowMarkup:function(){$("lightwindow_contents").innerHTML+=this.options.skin.loading},_setupWindowElements:function(a){this.element=a;this.element.title=null?"":a.getAttribute("title");this.element.author=null?"":a.getAttribute("author");this.element.caption=null?"":a.getAttribute("caption");this.element.rel=null?"":a.getAttribute("rel");this.element.params=null?"":a.getAttribute("params");this.contentToFetch=this.element.href;this.windowType=this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.contentToFetch)},_clearWindowContents:function(a){if($("lightwindow_iframe")){Element.remove($("lightwindow_iframe"))}if($("lightwindow_media_primary")){try{$("lightwindow_media_primary").Stop()}catch(b){}Element.remove($("lightwindow_media_primary"))}if($("lightwindow_media_secondary")){try{$("lightwindow_media_secondary").Stop()}catch(b){}Element.remove($("lightwindow_media_secondary"))}this.activeGallery=false;this._handleNavigation(this.activeGallery);if(a){$("lightwindow_contents").innerHTML="";$("lightwindow_contents").setStyle({overflow:"hidden"});if(!this.windowActive){$("lightwindow_data_slide_inner").setStyle({display:"none"});$("lightwindow_title_bar_title").innerHTML=""}$("lightwindow_data_slide").setStyle({height:"auto"})}this.resizeTo.height=null;this.resizeTo.width=null},_setStatus:function(a){this.animating=a;if(a){Element.show("lightwindow_loading")}if(!(/MSIE 6./i.test(navigator.userAgent))){this._fixedWindow(a)}},_fixedWindow:function(a){if(a){if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"absolute",top:parseFloat($("lightwindow").getStyle("top"))+this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))+this.pagePosition.x+"px"})}else{$("lightwindow").setStyle({position:"absolute"})}}else{if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"fixed",top:parseFloat($("lightwindow").getStyle("top"))-this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))-this.pagePosition.x+"px"})}else{if($("lightwindow_iframe")){this._browserDimensions()}$("lightwindow").setStyle({position:"fixed",top:(parseFloat(this._getParameter("lightwindow_top"))?parseFloat(this._getParameter("lightwindow_top"))+"px":this.dimensions.viewport.height/2+"px"),left:(parseFloat(this._getParameter("lightwindow_left"))?parseFloat(this._getParameter("lightwindow_left"))+"px":this.dimensions.viewport.width/2+"px")})}}},_prepareIE:function(g){if(Prototype.Browser.IE){var b,f,d;if(g){var b="100%"}else{var b="auto"}var a=document.getElementsByTagName("body")[0];var c=document.getElementsByTagName("html")[0];c.style.height=a.style.height=b}},_stopScrolling:function(a){if(this.animating){if(a.preventDefault){a.preventDefault()}a.returnValue=false}},_getScroll:function(){if(typeof(window.pageYOffset)=="number"){this.pagePosition.x=window.pageXOffset;this.pagePosition.y=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){this.pagePosition.x=document.body.scrollLeft;this.pagePosition.y=document.body.scrollTop}else{if(document.documentElement){this.pagePosition.x=document.documentElement.scrollLeft;this.pagePosition.y=document.documentElement.scrollTop}}}},_setScroll:function(b,a){document.documentElement.scrollLeft=b;document.documentElement.scrollTop=a},_toggleTroubleElements:function(h,a){if(a){var g=$("lightwindow_contents").getElementsByTagName("select")}else{var g=document.getElementsByTagName("select")}for(var c=0;c<g.length;c++){g[c].style.visibility=h}if(!a){if(this.options.hideFlash){var f=document.getElementsByTagName("object");for(c=0;c!=f.length;c++){f[c].style.visibility=h}var b=document.getElementsByTagName("embed");for(c=0;c!=b.length;c++){b[c].style.visibility=h}}var d=document.getElementsByTagName("iframe");for(c=0;c!=d.length;c++){d[c].style.visibility=h}}},_getPageDimensions:function(){var d,a;if(window.innerHeight&&window.scrollMaxY){d=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){d=document.body.scrollWidth;a=document.body.scrollHeight}else{d=document.body.offsetWidth;a=document.body.offsetHeight}}var c,b;if(self.innerHeight){c=self.innerWidth;b=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){c=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body){c=document.body.clientWidth;b=document.body.clientHeight}}}if(a<b){this.pageDimensions.height=b}else{this.pageDimensions.height=a}if(d<c){this.pageDimensions.width=c}else{this.pageDimensions.width=d}},_displayLightWindow:function(a,b){$("lightwindow_overlay").style.display=$("lightwindow").style.display=$("lightwindow_container").style.display=a;$("lightwindow_overlay").style.visibility=$("lightwindow").style.visibility=$("lightwindow_container").style.visibility=b},_setupDimensions:function(){var c,d;switch(this.windowType){case"page":c=this.options.dimensions.page.height;d=this.options.dimensions.page.width;break;case"image":c=this.options.dimensions.image.height;d=this.options.dimensions.image.width;break;case"media":c=this.options.dimensions.media.height;d=this.options.dimensions.media.width;break;case"external":c=this.options.dimensions.external.height;d=this.options.dimensions.external.width;break;case"inline":c=this.options.dimensions.inline.height;d=this.options.dimensions.inline.width;break;default:c=this.options.dimensions.page.height;d=this.options.dimensions.page.width;break}var a=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y;var b=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;$("lightwindow").setStyle({top:a+"px",left:b+"px"});$("lightwindow_container").setStyle({height:c+"px",width:d+"px",left:-(d/2)+"px",top:-(c/2)+"px"});$("lightwindow_contents").setStyle({height:c+"px",width:d+"px"})},_fileType:function(f){var a=new RegExp("[^.].("+this.options.fileTypes.image.join("|")+")s*$","i");if(a.test(f)){return"image"}if(f.indexOf("#")>-1&&(document.domain==this._getDomain(f))){return"inline"}if(f.indexOf("?")>-1){f=f.substring(0,f.indexOf("?"))}var d="unknown";var c=new RegExp("[^.].("+this.options.fileTypes.page.join("|")+")s*$","i");var b=new RegExp("[^.].("+this.options.fileTypes.media.join("|")+")s*$","i");if(document.domain!=this._getDomain(f)){d="external"}if(b.test(f)){d="media"}if(d=="external"||d=="media"){return d}if(c.test(f)||f.substr((f.length-1),f.length)=="/"){d="page"}return d},_fileExtension:function(b){if(b.indexOf("?")>-1){b=b.substring(0,b.indexOf("?"))}var a="";for(var c=(b.length-1);c>-1;c--){if(b.charAt(c)=="."){return a}a=b.charAt(c)+a}},_monitorKeyboard:function(a){if(a){document.onkeydown=this._eventKeypress.bind(this)}else{document.onkeydown=""}},_eventKeypress:function(a){if(a==null){var b=event.keyCode}else{var b=a.which}switch(b){case 27:this.deactivate();break;case 13:return;default:break}if(this.animating){return false}switch(String.fromCharCode(b).toLowerCase()){case"p":if(this.navigationObservers.previous){this.navigateWindow("previous")}break;case"n":if(this.navigationObservers.next){this.navigateWindow("next")}break;default:break}},_getGalleryInfo:function(a){if(!a){return false}if(a.indexOf("[")>-1){return new Array(escape(a.substring(0,a.indexOf("["))),escape(a.substring(a.indexOf("[")+1,a.indexOf("]"))))}else{return false}},_getDomain:function(g){var c=g.indexOf("//");var b=c+2;var h=g.substring(b,g.length);var d=h.indexOf("/");var a=h.substring(0,d);if(a.indexOf(":")>-1){var f=a.indexOf(":");a=a.substring(0,f)}return a},_getParameter:function(f,h){if(!this.element){return false}if(f=="lightwindow_top"&&this.element.top){return unescape(this.element.top)}else{if(f=="lightwindow_left"&&this.element.left){return unescape(this.element.left)}else{if(f=="lightwindow_type"&&this.element.type){return unescape(this.element.type)}else{if(f=="lightwindow_show_images"&&this.element.showImages){return unescape(this.element.showImages)}else{if(f=="lightwindow_height"&&this.element.height){return unescape(this.element.height)}else{if(f=="lightwindow_width"&&this.element.width){return unescape(this.element.width)}else{if(f=="lightwindow_loading_animation"&&this.element.loadingAnimation){return unescape(this.element.loadingAnimation)}else{if(f=="lightwindow_iframe_embed"&&this.element.iframeEmbed){return unescape(this.element.iframeEmbed)}else{if(f=="lightwindow_form"&&this.element.form){return unescape(this.element.form)}else{if(!h){if(this.element.params){h=this.element.params}else{return}}var k;var g=h.split(",");var b=f+"=";var a=b.length;for(var d=0;d<g.length;d++){if(g[d].substr(0,a)==b){var c=g[d].split("=");k=c[1];break}}if(!k){return false}else{return unescape(k)}}}}}}}}}}},_browserDimensions:function(){if(Prototype.Browser.IE){this.dimensions.viewport.height=document.documentElement.clientHeight;this.dimensions.viewport.width=document.documentElement.clientWidth}else{this.dimensions.viewport.height=window.innerHeight;this.dimensions.viewport.width=document.width||document.body.offsetWidth}},_getScrollerWidth:function(){var d=Element.extend(document.createElement("div"));d.setAttribute("id","lightwindow_scroll_div");d.setStyle({position:"absolute",top:"-10000px",left:"-10000px",width:"100px",height:"100px",overflow:"hidden"});var b=Element.extend(document.createElement("div"));b.setAttribute("id","lightwindow_content_scroll_div");b.setStyle({width:"100%",height:"200px"});d.appendChild(b);var a=document.getElementsByTagName("body")[0];a.appendChild(d);var c=$("lightwindow_content_scroll_div").offsetWidth;d.style.overflow="auto";var f=$("lightwindow_content_scroll_div").offsetWidth;Element.remove($("lightwindow_scroll_div"));this.scrollbarOffset=c-f},_addParamToObject:function(b,f,c,a){var d=document.createElement("param");d.setAttribute("value",f);d.setAttribute("name",b);if(a){d.setAttribute("id",a)}c.appendChild(d);return c},_outerHTML:function(c){if(Prototype.Browser.IE){return c.outerHTML}else{var a=c.cloneNode(true);var b=document.createElement("div");b.appendChild(a);return b.innerHTML}},_convertToMarkup:function(d,a){var c=this._outerHTML(d).replace("</"+a+">","");if(Prototype.Browser.IE){for(var b=0;b<d.childNodes.length;b++){c+=this._outerHTML(d.childNodes[b])}c+="</"+a+">"}return c},_appendObject:function(d,b,a){if(Prototype.Browser.IE){a.innerHTML+=this._convertToMarkup(d,b);if(this.options.EOLASFix.indexOf(this._fileType(this.element.href))>-1){var f=document.getElementsByTagName("object");for(var c=0;c<f.length;c++){if(f[c].getAttribute("data")){f[c].removeAttribute("data")}f[c].outerHTML=f[c].outerHTML;f[c].style.visibility="visible"}}}else{a.appendChild(d)}},_appendIframe:function(b){var a=document.createElement("iframe");a.setAttribute("id","lightwindow_iframe");a.setAttribute("name","lightwindow_iframe");a.setAttribute("src","about:blank");a.setAttribute("height","100%");a.setAttribute("width","100%");a.setAttribute("frameborder","0");a.setAttribute("marginwidth","0");a.setAttribute("marginheight","0");a.setAttribute("scrolling",b);this._appendObject(a,"iframe",$("lightwindow_contents"))},_writeToIframe:function(a){var b=this.options.skin.iframe;b=b.replace("{body_replace}",a);if($("lightwindow_iframe").contentWindow){$("lightwindow_iframe").contentWindow.document.open();$("lightwindow_iframe").contentWindow.document.write(b);$("lightwindow_iframe").contentWindow.document.close()}else{$("lightwindow_iframe").contentDocument.open();$("lightwindow_iframe").contentDocument.write(b);$("lightwindow_iframe").contentDocument.close()}},_loadWindow:function(){switch(this.windowType){case"image":var b=0;var d=[];this.checkImage=[];this.resizeTo.height=this.resizeTo.width=0;this.imageCount=this._getParameter("lightwindow_show_images")?parseInt(this._getParameter("lightwindow_show_images")):1;if(gallery=this._getGalleryInfo(this.element.rel)){for(b=0;b<this.galleries[gallery[0]][gallery[1]].length;b++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][b].href)>-1){break}}if(this.galleries[gallery[0]][gallery[1]][b-this.imageCount]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][b-this.imageCount]}else{this.navigationObservers.previous=false}if(this.galleries[gallery[0]][gallery[1]][b+this.imageCount]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][b+this.imageCount]}else{this.navigationObservers.next=false}this.activeGallery=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false}for(var c=b;c<(b+this.imageCount);c++){if(gallery&&this.galleries[gallery[0]][gallery[1]][c]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][c].href;this.galleryLocation={current:(c+1)/this.imageCount,total:(this.galleries[gallery[0]][gallery[1]].length)/this.imageCount};if(!this.galleries[gallery[0]][gallery[1]][c+this.imageCount]){$("lightwindow_next").setStyle({display:"none"})}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][c+this.imageCount].title}if(!this.galleries[gallery[0]][gallery[1]][c-this.imageCount]){$("lightwindow_previous").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][c-this.imageCount].title}}d[c]=document.createElement("img");d[c].setAttribute("id","lightwindow_image_"+c);d[c].setAttribute("border","0");d[c].setAttribute("src",this.contentToFetch);$("lightwindow_contents").appendChild(d[c]);this.checkImage[c]=new PeriodicalExecuter(function(g){if(!(typeof $("lightwindow_image_"+g).naturalWidth!="undefined"&&$("lightwindow_image_"+g).naturalWidth==0)){this.checkImage[g].stop();var h=$("lightwindow_image_"+g).getHeight();if(h>this.resizeTo.height){this.resizeTo.height=h}this.resizeTo.width+=$("lightwindow_image_"+g).getWidth();this.imageCount--;$("lightwindow_image_"+g).setStyle({height:"100%"});if(this.imageCount==0){this._processWindow()}}}.bind(this,c),1)}break;case"media":var b=0;this.resizeTo.height=this.resizeTo.width=0;if(gallery=this._getGalleryInfo(this.element.rel)){for(b=0;b<this.galleries[gallery[0]][gallery[1]].length;b++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][b].href)>-1){break}}if(this.galleries[gallery[0]][gallery[1]][b-1]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][b-1]}else{this.navigationObservers.previous=false}if(this.galleries[gallery[0]][gallery[1]][b+1]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][b+1]}else{this.navigationObservers.next=false}this.activeGallery=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false}if(gallery&&this.galleries[gallery[0]][gallery[1]][b]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][b].href;this.galleryLocation={current:b+1,total:this.galleries[gallery[0]][gallery[1]].length};if(!this.galleries[gallery[0]][gallery[1]][b+1]){$("lightwindow_next").setStyle({display:"none"})}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][b+1].title}if(!this.galleries[gallery[0]][gallery[1]][b-1]){$("lightwindow_previous").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][b-1].title}}if(this._getParameter("lightwindow_iframe_embed")){this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width}else{this.resizeTo.height=this._getParameter("lightwindow_height");this.resizeTo.width=this._getParameter("lightwindow_width")}this._processWindow();break;case"external":this._appendIframe("auto");this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width;this._processWindow();break;case"page":var f=new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",onComplete:function(g){$("lightwindow_contents").innerHTML+=g.responseText;this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.options.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.options.contentOffset.width);this._processWindow()}.bind(this)});break;case"inline":var a=this.contentToFetch;if(a.indexOf("?")>-1){a=a.substring(0,a.indexOf("?"))}a=a.substring(a.indexOf("#")+1);new Insertion.Top($("lightwindow_contents"),$(a).innerHTML);this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.options.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.options.contentOffset.width);this._toggleTroubleElements("hidden",true);this._processWindow();break;default:throw ("Page Type could not be determined, please amend this lightwindow URL "+this.contentToFetch);break}},_resizeWindowToFit:function(){if(this.resizeTo.height+this.dimensions.cruft.height>this.dimensions.viewport.height){var a=this.resizeTo.height/this.resizeTo.width;this.resizeTo.height=this.dimensions.viewport.height-this.dimensions.cruft.height-(2*this.options.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.width=this.resizeTo.height/a;$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px"})}}if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){var b=this.resizeTo.width/this.resizeTo.height;this.resizeTo.width=this.dimensions.viewport.width-2*this.dimensions.cruft.width-(2*this.options.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.height=this.resizeTo.width/b;$("lightwindow_data_slide_inner").setStyle({height:this.resizeTo.height+"px"})}}},_presetWindowSize:function(){if(this._getParameter("lightwindow_height")){this.resizeTo.height=parseFloat(this._getParameter("lightwindow_height"))}if(this._getParameter("lightwindow_width")){this.resizeTo.width=parseFloat(this._getParameter("lightwindow_width"))}},_processWindow:function(){this.dimensions.dataEffects=[];if(this.element.caption||this.element.author||(this.activeGallery&&this.options.showGalleryCount)){if(this.element.caption){$("lightwindow_data_caption").innerHTML=this.element.caption;$("lightwindow_data_caption").setStyle({display:"block"})}else{$("lightwindow_data_caption").setStyle({display:"none"})}if(this.element.author){$("lightwindow_data_author").innerHTML=this.element.author;$("lightwindow_data_author_container").setStyle({display:"block"})}else{$("lightwindow_data_author_container").setStyle({display:"none"})}if(this.activeGallery&&this.options.showGalleryCount){$("lightwindow_data_gallery_current").innerHTML=this.galleryLocation.current;$("lightwindow_data_gallery_total").innerHTML=this.galleryLocation.total;$("lightwindow_data_gallery_container").setStyle({display:"block"})}else{$("lightwindow_data_gallery_container").setStyle({display:"none"})}$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px",height:"auto",visibility:"visible",display:"block"});$("lightwindow_data_slide").setStyle({height:$("lightwindow_data_slide").getHeight()+"px",width:"1px",overflow:"hidden",display:"block"})}else{$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});$("lightwindow_data_slide_inner").setStyle({display:"none",visibility:"hidden",width:this.resizeTo.width+"px",height:"0px"})}if(this.element.title!="null"){$("lightwindow_title_bar_title").innerHTML=this.element.title}else{$("lightwindow_title_bar_title").innerHTML=""}var b={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};$("lightwindow_container").setStyle({height:"auto",width:$("lightwindow_container").getWidth()+this.options.contentOffset.width-(this.windowActive?this.options.contentOffset.width:0)+"px"});var a={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.containerChange={height:b.height-a.height,width:b.width-a.width};this.dimensions.container={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.dimensions.cruft={height:this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.options.contentOffset.height,width:this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.options.contentOffset.width};this._presetWindowSize();this._resizeWindowToFit();if(!this.windowActive){$("lightwindow_container").setStyle({left:-(this.dimensions.container.width/2)+"px",top:-(this.dimensions.container.height/2)+"px"})}$("lightwindow_container").setStyle({height:this.dimensions.container.height+"px",width:this.dimensions.container.width+"px"});this._displayLightWindow("block","visible");this._animateLightWindow()},_animateLightWindow:function(){if(this.options.animationHandler){this.options.animationHandler().bind(this)}else{this._defaultAnimationHandler()}},_handleNavigation:function(a){if(this.options.navigationHandler){this.options.navigationHandler().bind(this,a)}else{this._defaultDisplayNavigation(a)}},_handleTransition:function(){if(this.options.transitionHandler){this.options.transitionHandler().bind(this)}else{this._defaultTransitionHandler()}},_handleFinalWindowAnimation:function(a){if(this.options.finalAnimationHandler){this.options.finalAnimationHandler().bind(this,a)}else{this._defaultfinalWindowAnimationHandler(a)}},_handleGalleryAnimation:function(a){if(this.options.galleryAnimationHandler){this.options.galleryAnimationHandler().bind(this,a)}else{this._defaultGalleryAnimationHandler(a)}},_defaultDisplayNavigation:function(a){if(a){$("lightwindow_navigation").setStyle({display:"block",height:$("lightwindow_contents").getHeight()+"px",width:"100%",marginTop:this.options.dimensions.titleHeight+"px"})}else{$("lightwindow_navigation").setStyle({display:"none",height:"auto",width:"auto"})}},_defaultAnimationHandler:function(){if(this.element.caption||this.element.author||(this.activeGallery&&this.options.showGalleryCount)){$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});this.dimensions.dataEffects.push(new Effect.SlideDown("lightwindow_data_slide",{sync:true}),new Effect.Appear("lightwindow_data_slide",{sync:true,from:0,to:1}))}$("lightwindow_title_bar_inner").setStyle({height:"0px",marginTop:this.options.dimensions.titleHeight+"px"});this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:this.options.dimensions.titleHeight+"px",marginTop:"0px"}}),new Effect.Appear("lightwindow_title_bar_inner",{sync:true,from:0,to:1}));if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false);if($("lightwindow_galleries_tab_container").getHeight()==0){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"20px",marginTop:"0px"}}));$("lightwindow_galleries").setStyle({width:"0px"})}}var b=false;var a=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.options.contentOffset.width;if(a!=$("lightwindow_container").getWidth()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.width/$("lightwindow_contents").getWidth()),{scaleFrom:100*($("lightwindow_contents").getWidth()/($("lightwindow_contents").getWidth()+(this.options.contentOffset.width))),sync:true,scaleY:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(a/(this.dimensions.container.width)),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:"end",scope:"lightwindowAnimation"}})}a=this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.resizeTo.height+this.options.contentOffset.height;if(a!=$("lightwindow_container").getHeight()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.height/$("lightwindow_contents").getHeight()),{scaleFrom:100*($("lightwindow_contents").getHeight()/($("lightwindow_contents").getHeight()+(this.options.contentOffset.height))),sync:true,scaleX:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(a/(this.dimensions.container.height)),{sync:true,scaleX:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,afterFinish:function(){if(this.dimensions.dataEffects.length>0){if(!this.options.hideGalleryTab){$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"})}new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}});b=true}if(!b&&this.dimensions.dataEffects.length>0){new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,beforeStart:function(){if(!this.options.hideGalleryTab){$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"})}if(this.containerChange.height!=0||this.containerChange.width!=0){new Effect.MoveBy("lightwindow_container",this.containerChange.height,this.containerChange.width,{transition:Effect.Transitions.sinoidal})}}.bind(this),afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultfinalWindowAnimationHandler:function(a){if(this.windowType=="media"||this._getParameter("lightwindow_loading_animation")){Element.hide("lightwindow_loading");this._handleNavigation(this.activeGallery);this._setStatus(false)}else{Effect.Fade("lightwindow_loading",{duration:0.75,delay:1,afterFinish:function(){if(this.windowType!="image"&&this.windowType!="media"&&this.windowType!="external"){$("lightwindow_contents").setStyle({overflow:"auto"})}this._handleNavigation(this.activeGallery);this._defaultGalleryAnimationHandler();this._setStatus(false)}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultGalleryAnimationHandler:function(b){if(this.activeGallery){$("lightwindow_galleries").setStyle({display:"block",marginBottom:$("lightwindow_data_slide").getHeight()+this.options.contentOffset.height/2+"px"});$("lightwindow_navigation").setStyle({height:$("lightwindow_contents").getHeight()-20+"px"})}else{$("lightwindow_galleries").setStyle({display:"none"});$("lightwindow_galleries_tab_container").setStyle({height:"0px",marginTop:"20px"});$("lightwindow_galleries_list").setStyle({height:"0px"});return false}if(b){if($("lightwindow_galleries_list").getHeight()==0){var a=$("lightwindow_contents").getHeight()*0.8;$("lightwindow_galleries_tab_span").className="down"}else{var a=0;$("lightwindow_galleries_tab_span").className="up"}new Effect.Morph("lightwindow_galleries_list",{duration:this.duration,transition:Effect.Transitions.sinoidal,style:{height:a+"px"},beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})},queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultTransitionHandler:function(){this.dimensions.dataEffects=[];if($("lightwindow_data_slide").getStyle("display")!="none"){this.dimensions.dataEffects.push(new Effect.SlideUp("lightwindow_data_slide",{sync:true}),new Effect.Fade("lightwindow_data_slide",{sync:true,from:1,to:0}))}if(!this.options.hideGalleryTab){if($("lightwindow_galleries").getHeight()!=0&&!this.options.hideGalleryTab){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"0px",marginTop:"20px"}}))}if($("lightwindow_galleries_list").getHeight()!=0){$("lightwindow_galleries_tab_span").className="up";this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_list",{sync:true,style:{height:"0px"},transition:Effect.Transitions.sinoidal,beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})}}))}}this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:"0px",marginTop:this.options.dimensions.titleHeight+"px"}}),new Effect.Fade("lightwindow_title_bar_inner",{sync:true,from:1,to:0}));new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._loadWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultFormHandler:function(a){var b=Event.element(a).parentNode;var d=Form.serialize(this._getParameter("lightwindow_form",b.getAttribute("params")));if(this.options.formMethod=="post"){var c=new Ajax.Request(b.href,{method:"post",postBody:d,onComplete:this.openWindow.bind(this,b)})}else{if(this.options.formMethod=="get"){var c=new Ajax.Request(b.href,{method:"get",parameters:d,onComplete:this.openWindow.bind(this,b)})}}},_finishWindow:function(){if(this.windowType=="external"){$("lightwindow_iframe").setAttribute("src",this.element.href);this._handleFinalWindowAnimation(1)}else{if(this.windowType=="media"){var b=document.createElement("object");b.setAttribute("classid",this.options.classids[this._fileExtension(this.contentToFetch)]);b.setAttribute("codebase",this.options.codebases[this._fileExtension(this.contentToFetch)]);b.setAttribute("id","lightwindow_media_primary");b.setAttribute("name","lightwindow_media_primary");b.setAttribute("width",this.resizeTo.width);b.setAttribute("height",this.resizeTo.height);b=this._addParamToObject("movie",this.contentToFetch,b);b=this._addParamToObject("src",this.contentToFetch,b);b=this._addParamToObject("controller","true",b);b=this._addParamToObject("wmode","transparent",b);b=this._addParamToObject("cache","false",b);b=this._addParamToObject("quality","high",b);if(!Prototype.Browser.IE){var a=document.createElement("object");a.setAttribute("type",this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);a.setAttribute("data",this.contentToFetch);a.setAttribute("id","lightwindow_media_secondary");a.setAttribute("name","lightwindow_media_secondary");a.setAttribute("width",this.resizeTo.width);a.setAttribute("height",this.resizeTo.height);a=this._addParamToObject("controller","true",a);a=this._addParamToObject("wmode","transparent",a);a=this._addParamToObject("cache","false",a);a=this._addParamToObject("quality","high",a);b.appendChild(a)}if(this._getParameter("lightwindow_iframe_embed")){this._appendIframe("no");this._writeToIframe(this._convertToMarkup(b,"object"))}else{this._appendObject(b,"object",$("lightwindow_contents"))}this._handleFinalWindowAnimation(0)}else{this._handleFinalWindowAnimation(0)}}this._setupActions()}};Event.observe(window,"load",lightwindowInit,false);var myLightWindow=null;function lightwindowInit(){myLightWindow=new lightwindow()};(function(d){var x=this,D=x.document,j=d(D),M=d(x),a=!0,r=navigator.userAgent.toLowerCase(),m=x.location.hash.replace(/#\//,""),K=function(){var e=3,f=D.createElement("div"),g=f.getElementsByTagName("i");do{f.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->"}while(g[0]);return e>4?e:void 0}(),N=function(){return{html:D.documentElement,body:D.body,head:D.getElementsByTagName("head")[0],title:D.title}},p=function(){var e=[];d.each("data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image".split(" "),function(f,g){e.push(g);/_/.test(g)&&e.push(g.replace(/_/g,""))});return e}(),q=function(e){var f;if(typeof e!=="object"){return e}d.each(e,function(g,l){/^[a-z]+_/.test(g)&&(f="",d.each(g.split("_"),function(n,o){f+=n>0?o.substr(0,1).toUpperCase()+o.substr(1):o}),e[f]=l,delete e[g])});return e},b=function(e){if(d.inArray(e,p)>-1){return k[e.toUpperCase()]}return e},O={trunk:{},add:function(f,g,l,n){n=n||!1;this.clear(f);if(n){var o=g,g=function(){o();O.add(f,g,l)}}this.trunk[f]=x.setTimeout(g,l)},clear:function(e){var f=function(l){x.clearTimeout(this.trunk[l]);delete this.trunk[l]},g;if(e&&e in this.trunk){f.call(O,e)}else{if(typeof e==="undefined"){for(g in this.trunk){this.trunk.hasOwnProperty(g)&&f.call(O,g)}}}}},c=[],P=[],s=!1,L=!1,i=function(){return{array:function(e){return Array.prototype.slice.call(e)},create:function(e,f){var g=D.createElement(f||"div");g.className=e;return g},animate:function(){var e=function(A){var B="transition WebkitTransition MozTransition OTransition".split(" "),C;for(C=0;B[C];C++){if(typeof A[B[C]]!=="undefined"){return B[C]}}return !1}((document.body||document.documentElement).style),f={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[e],g={_default:[0.25,0.1,0.25,1],galleria:[0.645,0.045,0.355,1],galleriaIn:[0.55,0.085,0.68,0.53],galleriaOut:[0.25,0.46,0.45,0.94],ease:[0.25,0,0.25,1],linear:[0.25,0.25,0.75,0.75],"ease-in":[0.42,0,1,1],"ease-out":[0,0,0.58,1],"ease-in-out":[0.42,0,0.58,1]},l=function(A,B,C){var E={},C=C||"transition";d.each("webkit moz ms o".split(" "),function(){E["-"+this+"-"+C]=B});A.css(E)},u=function(A){l(A,"none","transition");k.WEBKIT&&(l(A,"translate3d(0,0,0)","transform"),A.data("revert")&&(A.css(A.data("revert")),A.data("revert",null)))},v,t,o,w,y,z,n;return function(A,B,C){C=d.extend({duration:400,complete:function(){},stop:!1},C);A=d(A);C.duration?e?(C.stop&&(A.unbind(f),u(A)),v=!1,d.each(B,function(E,F){n=A.css(E);i.parseValue(n)!=i.parseValue(F)&&(v=!0);A.css(E,n)}),v?(t=[],o=C.easing in g?g[C.easing]:g._default,w=" "+C.duration+"ms cubic-bezier("+o.join(",")+")",x.setTimeout(function(){A.one(f,function(E){return function(){u(E);C.complete.call(E[0])}}(A));if(k.WEBKIT&&k.TOUCH&&(y={},z=[0,0,0],d.each(["left","top"],function(E,F){F in B&&(z[E]=i.parseValue(B[F])-i.parseValue(A.css(F))+"px",y[F]=B[F],delete B[F])}),z[0]||z[1])){A.data("revert",y),t.push("-webkit-transform"+w),l(A,"translate3d("+z.join(",")+")","transform")}d.each(B,function(E){t.push(E+w)});l(A,t.join(","));A.css(B)},1)):x.setTimeout(function(){C.complete.call(A[0])},C.duration)):A.animate(B,C):(A.css(B),C.complete.call(A[0]))}}(),forceStyles:function(e,f){e=d(e);e.attr("style")&&e.data("styles",e.attr("style")).removeAttr("style");e.css(f)},revertStyles:function(){d.each(i.array(arguments),function(e,f){f=d(f);f.removeAttr("style");f.attr("style","");f.data("styles")&&f.attr("style",f.data("styles")).data("styles",null)})},moveOut:function(e){i.forceStyles(e,{position:"absolute",left:-10000})},moveIn:function(){i.revertStyles.apply(i,i.array(arguments))},hide:function(e,f,g){e=d(e);e.data("opacity")||e.data("opacity",e.css("opacity"));var l={opacity:0};f?i.animate(e,l,{duration:f,complete:g,stop:!0}):e.css(l)},show:function(e,f,g){var e=d(e),l={opacity:parseFloat(e.data("opacity"))||1};f?i.animate(e,l,{duration:f,complete:g,stop:!0}):e.css(l)},optimizeTouch:function(){var e,l,n,o,t={},u=function(f){f.preventDefault();t=d.extend({},f,!0)},w=function(){this.evt=t},v=function(){this.handler.call(e,this.evt)};return function(f){d(f).bind("touchstart",function(g){e=g.target;for(o=!0;e.parentNode&&e!=g.currentTarget&&o;){l=d(e).data("events"),n=d(e).data("fakes"),l&&"click" in l?(o=!1,g.preventDefault(),d(e).click(u).click(),l.click.pop(),d.each(l.click,w),d(e).data("fakes",l.click),delete l.click):n&&(o=!1,g.preventDefault(),d.each(n,v)),e=e.parentNode}})}}(),addTimer:function(){O.add.apply(O,i.array(arguments));return this},clearTimer:function(){O.clear.apply(O,i.array(arguments));return this},wait:function(e){var e=d.extend({until:function(){return !1},success:function(){},error:function(){k.raise("Could not complete wait function.")},timeout:3000},e),f=i.timestamp(),g,l,n=function(){l=i.timestamp();g=l-f;if(e.until(g)){return e.success(),!1}if(l>=f+e.timeout){return e.error(),!1}x.setTimeout(n,2)};x.setTimeout(n,2)},toggleQuality:function(e,f){if(!(K!==7&&K!==8)&&e){typeof f==="undefined"&&(f=e.style.msInterpolationMode==="nearest-neighbor"),e.style.msInterpolationMode=f?"bicubic":"nearest-neighbor"}},insertStyleTag:function(e){var f=D.createElement("style");N().head.appendChild(f);f.styleSheet?f.styleSheet.cssText=e:(e=D.createTextNode(e),f.appendChild(e))},loadScript:function(e,f){var g=!1,l=d("<script>").attr({src:e,async:!0}).get(0);l.onload=l.onreadystatechange=function(){if(!g&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){g=!0,l.onload=l.onreadystatechange=null,typeof f==="function"&&f.call(this,this)}};N().head.appendChild(l)},parseValue:function(e){return typeof e==="number"?e:typeof e==="string"?(e=e.match(/\-?\d|\./g))&&e.constructor===Array?e.join("")*1:0:0},timestamp:function(){return(new Date).getTime()},loadCSS:function(e,f,g){var l,n=!1,o;d("link[rel=stylesheet]").each(function(){if(RegExp(e).test(this.href)){return l=this,!1}});typeof f==="function"&&(g=f,f=void 0);g=g||function(){};if(l){return g.call(l,l),l}o=D.styleSheets.length;a&&(e+="?"+i.timestamp());d("#"+f).length?(d("#"+f).attr("href",e),o--,n=!0):(l=d("<link>").attr({rel:"stylesheet",href:e,id:f}).get(0),x.setTimeout(function(){var t=d('link[rel="stylesheet"], style');t.length?t.get(0).parentNode.insertBefore(l,t[0]):N().head.appendChild(l);K?o>=31?k.raise("You have reached the browser stylesheet limit (31)",!0):l.onreadystatechange=function(){if(!n&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){n=!0}}:/file:\/\//i.test(e)?n=!0:d.ajax({url:e,success:function(){n=!0},error:function(u){u.isRejected()&&k.WEBKIT&&(n=!0)}})},10));typeof g==="function"&&i.wait({until:function(){return n&&D.styleSheets.length>o},success:function(){x.setTimeout(function(){g.call(l,l)},100)},error:function(){k.raise("Theme CSS could not load",!0)},timeout:10000});return l}}}(),h=function(){var e=function(f,l,n,o){var v=this.getOptions("easing"),u=this.getStageWidth(),t={left:u*(f.rewind?-1:1)},w={left:0};if(n){t.opacity=0,w.opacity=1}d(f.next).css(t);i.animate(f.next,w,{duration:f.speed,complete:function(g){return function(){l();g.css({left:0})}}(d(f.next).add(f.prev)),queue:!1,easing:v});if(o){f.rewind=!f.rewind}if(f.prev){t={left:0};w={left:u*(f.rewind?1:-1)};if(n){t.opacity=1,w.opacity=0}d(f.prev).css(t);i.animate(f.prev,w,{duration:f.speed,queue:!1,easing:v,complete:function(){d(this).css("opacity",0)}})}};return{fade:function(f,g){d(f.next).css("opacity",0).show();i.animate(f.next,{opacity:1},{duration:f.speed,complete:g});f.prev&&(d(f.prev).css("opacity",1).show(),i.animate(f.prev,{opacity:0},{duration:f.speed}))},flash:function(f,g){d(f.next).css("opacity",0);f.prev?i.animate(f.prev,{opacity:0},{duration:f.speed/2,complete:function(){i.animate(f.next,{opacity:1},{duration:f.speed,complete:g})}}):i.animate(f.next,{opacity:1},{duration:f.speed,complete:g})},pulse:function(f,g){f.prev&&d(f.prev).hide();d(f.next).css("opacity",0).show();i.animate(f.next,{opacity:1},{duration:f.speed,complete:g})},slide:function(){e.apply(this,i.array(arguments))},fadeslide:function(){e.apply(this,i.array(arguments).concat([!0]))},doorslide:function(){e.apply(this,i.array(arguments).concat([!1,!0]))}}}(),k=function(){var e=this;this._theme=void 0;this._options={};this._playing=!1;this._playtime=5000;this._active=null;this._queue={length:0};this._data=[];this._dom={};this._thumbnails=[];this._firstrun=this._initialized=!1;this._stageHeight=this._stageWidth=0;this._target=void 0;this._id=Math.random();d.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "),function(v,w){e._dom[w]=i.create("galleria-"+w)});d.each("current total".split(" "),function(v,w){e._dom[w]=i.create("galleria-"+w,"span")});var f=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:!1,press:function(v){var w=v.keyCode||v.which;w in f.map&&typeof f.map[w]==="function"&&f.map[w].call(e,v)},attach:function(v){var w,y;for(w in v){v.hasOwnProperty(w)&&(y=w.toUpperCase(),y in f.keys?f.map[f.keys[y]]=v[w]:f.map[y]=v[w])}if(!f.bound){f.bound=!0,j.bind("keydown",f.press)}},detach:function(){f.bound=!1;f.map={};j.unbind("keydown",f.press)}},g=this._controls={0:void 0,1:void 0,active:0,swap:function(){g.active=g.active?0:1},getActive:function(){return g[g.active]},getNext:function(){return g[1-g.active]}},l=this._carousel={next:e.$("thumb-nav-right"),prev:e.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var v=0,w=0,y=[0];d.each(e._thumbnails,function(z,A){A.ready&&(v+=A.outerWidth||d(A.container).outerWidth(!0),y[z+1]=v,w=Math.max(w,A.outerHeight||d(A.container).outerHeight(!0)))});e.$("thumbnails").css({width:v,height:w});l.max=v;l.hooks=y;l.width=e.$("thumbnails-list").width();l.setClasses();e.$("thumbnails-container").toggleClass("galleria-carousel",v>l.width);l.width=e.$("thumbnails-list").width()},bindControls:function(){var v;l.next.bind("click",function(w){w.preventDefault();if(e._options.carouselSteps==="auto"){for(v=l.current;v<l.hooks.length;v++){if(l.hooks[v]-l.hooks[l.current]>l.width){l.set(v-2);break}}}else{l.set(l.current+e._options.carouselSteps)}});l.prev.bind("click",function(w){w.preventDefault();if(e._options.carouselSteps==="auto"){for(v=l.current;v>=0;v--){if(l.hooks[l.current]-l.hooks[v]>l.width){l.set(v+2);break}else{if(v===0){l.set(0);break}}}}else{l.set(l.current-e._options.carouselSteps)}})},set:function(v){for(v=Math.max(v,0);l.hooks[v-1]+l.width>=l.max&&v>=0;){v--}l.current=v;l.animate()},getLast:function(v){return(v||l.current)-1},follow:function(v){if(v===0||v===l.hooks.length-2){l.set(v)}else{for(var w=l.current;l.hooks[w]-l.hooks[l.current]<l.width&&w<=l.hooks.length;){w++}v-1<l.current?l.set(v-1):v+2>w&&l.set(v-w+l.current+2)}},setClasses:function(){l.prev.toggleClass("disabled",!l.current);l.next.toggleClass("disabled",l.hooks[l.current]+l.width>=l.max)},animate:function(){l.setClasses();var v=l.hooks[l.current]*-1;isNaN(v)||i.animate(e.get("thumbnails"),{left:v},{duration:e._options.carouselSpeed,easing:e._options.easing,queue:!1})}},t=this._tooltip={initialized:!1,open:!1,init:function(){t.initialized=!0;i.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}");e.$("tooltip").css("opacity",0.8);i.hide(e.get("tooltip"))},move:function(v){var w=e.getMousePosition(v).x,v=e.getMousePosition(v).y,y=e.$("tooltip"),z=v,A=y.outerHeight(!0)+1,B=y.outerWidth(!0),C=A+15,B=e.$("container").width()-B-2,A=e.$("container").height()-A-2;!isNaN(w)&&!isNaN(z)&&(w+=10,z-=30,w=Math.max(0,Math.min(B,w)),z=Math.max(0,Math.min(A,z)),v<C&&(z=C),y.css({left:w,top:z}))},bind:function(v,w){if(!k.TOUCH){t.initialized||t.init();var y=function(z,A){t.define(z,A);d(z).hover(function(){i.clearTimer("switch_tooltip");e.$("container").unbind("mousemove",t.move).bind("mousemove",t.move).trigger("mousemove");t.show(z);k.utils.addTimer("tooltip",function(){e.$("tooltip").stop().show().animate({opacity:1});t.open=!0},t.open?0:500)},function(){e.$("container").unbind("mousemove",t.move);i.clearTimer("tooltip");e.$("tooltip").stop().animate({opacity:0},200,function(){e.$("tooltip").hide();i.addTimer("switch_tooltip",function(){t.open=!1},1000)})})};typeof w==="string"?y(v in e._dom?e.get(v):v,w):d.each(v,function(z,A){y(e.get(z),A)})}},show:function(v){var v=d(v in e._dom?e.get(v):v),w=v.data("tt"),y=function(z){x.setTimeout(function(A){return function(){t.move(A)}}(z),10);v.unbind("mouseup",y)};if(w=typeof w==="function"?w():w){e.$("tooltip").html(w.replace(/\s/,"&nbsp;")),v.bind("mouseup",y)}},define:function(v,w){if(typeof w!=="function"){var y=w,w=function(){return y}}v=d(v in e._dom?e.get(v):v).data("tt",w);t.show(v)}},u=this._fullscreen={scrolled:0,active:!1,keymap:e._keyboard.map,enter:function(v){u.active=!0;i.hide(e.getActiveImage());e.$("container").addClass("fullscreen");u.scrolled=M.scrollTop();i.forceStyles(e.get("container"),{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:10000});var w={height:"100%",overflow:"hidden",margin:0,padding:0},y=e.getData();i.forceStyles(N().html,w);i.forceStyles(N().body,w);u.keymap=d.extend({},e._keyboard.map);e.attachKeyboard({escape:e.exitFullscreen,right:e.next,left:e.prev});if(y&&y.big&&y.image!==y.big){var w=new k.Picture,z=w.isCached(y.big),B=e.getIndex(),A=e._thumbnails[B];e.trigger({type:k.LOADSTART,cached:z,index:B,imageTarget:e.getActiveImage(),thumbTarget:A});w.load(y.big,function(C){e._scaleImage(C,{complete:function(E){e.trigger({type:k.LOADFINISH,cached:z,index:B,imageTarget:E.image,thumbTarget:A});var F=e._controls.getActive().image;F&&d(F).width(E.image.width).height(E.image.height).attr("style",d(E.image).attr("style")).attr("src",E.image.src)}})})}e.rescale(function(){i.addTimer("fullscreen_enter",function(){i.show(e.getActiveImage());typeof v==="function"&&v.call(e)},100);e.trigger(k.FULLSCREEN_ENTER)});M.resize(function(){u.scale()})},scale:function(){e.rescale()},exit:function(v){u.active=!1;i.hide(e.getActiveImage());e.$("container").removeClass("fullscreen");i.revertStyles(e.get("container"),N().html,N().body);x.scrollTo(0,u.scrolled);e.detachKeyboard();e.attachKeyboard(u.keymap);e.rescale(function(){i.addTimer("fullscreen_exit",function(){i.show(e.getActiveImage());typeof v==="function"&&v.call(e)},50);e.trigger(k.FULLSCREEN_EXIT)});M.unbind("resize",u.scale)}},o=this._idle={trunk:[],bound:!1,add:function(v,w){if(v){o.bound||o.addEvent();var v=d(v),y={},z;for(z in w){w.hasOwnProperty(z)&&(y[z]=v.css(z))}v.data("idle",{from:y,to:w,complete:!0,busy:!1});o.addTimer();o.trunk.push(v)}},remove:function(v){v=jQuery(v);d.each(o.trunk,function(w,y){y.length&&!y.not(v).length&&(e._idle.show(v),e._idle.trunk.splice(w,1))});o.trunk.length||(o.removeEvent(),i.clearTimer("idle"))},addEvent:function(){o.bound=!0;e.$("container").bind("mousemove click",o.showAll)},removeEvent:function(){o.bound=!1;e.$("container").unbind("mousemove click",o.showAll)},addTimer:function(){i.addTimer("idle",function(){e._idle.hide()},e._options.idleTime)},hide:function(){e._options.idleMode&&(e.trigger(k.IDLE_ENTER),d.each(o.trunk,function(v,w){var y=w.data("idle");if(y){w.data("idle").complete=!1,i.animate(w,y.to,{duration:e._options.idleSpeed})}}))},showAll:function(){i.clearTimer("idle");d.each(e._idle.trunk,function(v,w){e._idle.show(w)})},show:function(v){var w=v.data("idle");if(!w.busy&&!w.complete){w.busy=!0,e.trigger(k.IDLE_EXIT),i.clearTimer("idle"),i.animate(v,w.from,{duration:e._options.idleSpeed/2,complete:function(){d(this).data("idle").busy=!1;d(this).data("idle").complete=!0}})}o.addTimer()}},n=this._lightbox={width:0,height:0,initialized:!1,active:null,image:null,elems:{},keymap:!1,init:function(){e.trigger(k.LIGHTBOX_OPEN);if(!n.initialized){n.initialized=!0;var v={},w=e._options,y="",w={overlay:"position:fixed;display:none;opacity:"+w.overlayOpacity+";filter:alpha(opacity="+w.overlayOpacity*100+");top:0;left:0;width:100%;height:100%;background:"+w.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:"position:absolute;background:#000;width:100%;height:100%;",content:"position:absolute;background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:"position:absolute;bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",close:"position:absolute;top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:"position:absolute;top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:"position:absolute;width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:"position:absolute;width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",next:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"},z={};K===8&&(w.nextholder+="background:#000;filter:alpha(opacity=0);",w.prevholder+="background:#000;filter:alpha(opacity=0);");d.each(w,function(A,B){y+=".galleria-lightbox-"+A+"{"+B+"}"});i.insertStyleTag(y);d.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),function(A,B){e.addElement("lightbox-"+B);v[B]=n.elems[B]=e.get("lightbox-"+B)});n.image=new k.Picture;d.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(A,B){var C=[];d.each(B.split(" "),function(E,F){C.push("lightbox-"+F)});z["lightbox-"+A]=C});e.append(z);d(v.image).append(n.image.container);d(N().body).append(v.overlay,v.box);i.optimizeTouch(v.box);(function(A){return A.hover(function(){d(this).css("color","#bbb")},function(){d(this).css("color","#444")})})(d(v.close).bind("click",n.hide).html("&#215;"));d.each(["Prev","Next"],function(A,B){var C=d(v[B.toLowerCase()]).html(/v/.test(B)?"&#8249;&nbsp;":"&nbsp;&#8250;"),E=d(v[B.toLowerCase()+"holder"]);E.bind("click",function(){n["show"+B]()});K<8||k.TOUCH?C.show():E.hover(function(){C.show()},function(){C.stop().fadeOut(200)})});d(v.overlay).bind("click",n.hide);if(k.IPAD){e._options.lightboxTransitionSpeed=0}}},rescale:function(v){var w=Math.min(M.width()-40,n.width),y=Math.min(M.height()-60,n.height),y=Math.min(w/n.width,y/n.height),w=Math.round(n.width*y)+40,y=Math.round(n.height*y)+60,w={width:w,height:y,"margin-top":Math.ceil(y/2)*-1,"margin-left":Math.ceil(w/2)*-1};v?d(n.elems.box).css(w):d(n.elems.box).animate(w,{duration:e._options.lightboxTransitionSpeed,easing:e._options.easing,complete:function(){var z=n.image,A=e._options.lightboxFadeSpeed;e.trigger({type:k.LIGHTBOX_IMAGE,imageTarget:z.image});d(z.container).show();i.show(z.image,A);i.show(n.elems.info,A)}})},hide:function(){n.image.image=null;M.unbind("resize",n.rescale);d(n.elems.box).hide();i.hide(n.elems.info);e.detachKeyboard();e.attachKeyboard(n.keymap);n.keymap=!1;i.hide(n.elems.overlay,200,function(){d(this).hide().css("opacity",e._options.overlayOpacity);e.trigger(k.LIGHTBOX_CLOSE)})},showNext:function(){n.show(e.getNext(n.active))},showPrev:function(){n.show(e.getPrev(n.active))},show:function(v){n.active=v=typeof v==="number"?v:e.getIndex();n.initialized||n.init();if(!n.keymap){n.keymap=d.extend({},e._keyboard.map),e.attachKeyboard({escape:n.hide,right:n.showNext,left:n.showPrev})}M.unbind("resize",n.rescale);var w=e.getData(v),y=e.getDataLength();i.hide(n.elems.info);n.image.load(w.big||w.image,function(z){n.width=z.original.width;n.height=z.original.height;d(z.image).css({width:"100.5%",height:"100.5%",top:0,zIndex:99998});i.hide(z.image);n.elems.title.innerHTML=w.title||"";n.elems.counter.innerHTML=v+1+" / "+y;M.resize(n.rescale);n.rescale()});d(n.elems.overlay).show();d(n.elems.box).show()}};return this};k.prototype={constructor:k,init:function(e,f){var g=this,f=q(f);this._original={target:e,options:f,data:null};this._target=this._dom.target=e.nodeName?e:d(e).get(0);P.push(this);this._target?(this._options={autoplay:!1,carousel:!0,carouselFollow:!0,carouselSpeed:400,carouselSteps:"auto",clicknext:!1,dataConfig:function(){return{}},dataSelector:"img",dataSource:this._target,debug:void 0,easing:"galleria",extend:function(){},fullscreenDoubleTap:!0,height:"auto",idleMode:!0,idleTime:3000,idleSpeed:200,imageCrop:!1,imageMargin:0,imagePan:!1,imagePanSmoothness:12,imagePosition:"50%",initialTransition:void 0,keepSource:!1,lightbox:!1,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceTmages:!0,maxScaleRatio:void 0,minScaleRatio:void 0,overlayOpacity:0.85,overlayBackground:"#0b0b0b",pauseOnInteraction:!0,popupLinks:!1,preload:2,protect:!1,queue:!0,show:0,showInfo:!0,showCounter:!0,showImagenav:!0,swipe:!0,thumbCrop:!0,thumbEventType:"click",thumbFit:!0,thumbMargin:0,thumbQuality:"auto",thumbnails:!0,transition:"fade",transitionInitial:void 0,transitionSpeed:400,useCanvas:!1,width:"auto"},this._options.initialTransition=this._options.initialTransition||this._options.transitionInitial,f&&f.debug===!1&&(a=!1),d(this._target).children().hide(),typeof k.theme==="object"?this._init():i.wait({until:function(){return typeof k.theme==="object"},success:function(){g._init.call(g)},error:function(){k.raise("No theme found.",!0)},timeout:5000})):k.raise("Target not found.",!0)},_init:function(){var e=this;if(this._initialized){return k.raise("Init failed: Gallery instance already initialized."),this}this._initialized=!0;if(!k.theme){return k.raise("Init failed: No theme found."),this}d.extend(!0,this._options,k.theme.defaults,this._original.options);(function(f){"getContext" in f&&(L=L||{elem:f,context:f.getContext("2d"),cache:{},length:0})})(D.createElement("canvas"));this.bind(k.DATA,function(){this._original.data=this._data;this.get("total").innerHTML=this.getDataLength();var f=this.$("container"),g={width:0,height:0},l=function(){return e.$("stage").height()};i.wait({until:function(){d.each(["width","height"],function(n,o){g[o]=e._options[o]&&typeof e._options[o]==="number"?e._options[o]:Math.max(i.parseValue(f.css(o)),i.parseValue(e.$("target").css(o)),f[o](),e.$("target")[o]());f[o](g[o])});return l()&&g.width&&g.height>10},success:function(){k.WEBKIT?x.setTimeout(function(){e._run()},1):e._run()},error:function(){l()?k.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+g.width+"px, height: "+g.height+"px.",!0):k.raise("Could not extract a stage height from the CSS. Traced height: "+l()+"px.",!0)},timeout:2000})});this.append({"info-text":["info-title","info-description"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]});i.hide(this.$("counter").append(this.get("current")," / ",this.get("total")));this.setCounter("&#8211;");i.hide(e.get("tooltip"));this.$("container").addClass(k.TOUCH?"touch":"notouch");d.each(Array(2),function(f){var g=new k.Picture;d(g.container).css({position:"absolute",top:0,left:0});e.$("images").append(g.container);e._controls[f]=g});this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"});this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"});this.$("image-nav-right, image-nav-left").bind("click",function(f){e._options.clicknext&&f.stopPropagation();e._options.pauseOnInteraction&&e.pause();f=/right/.test(this.className)?"next":"prev";e[f]()});d.each(["info","counter","image-nav"],function(f,g){e._options["show"+g.substr(0,1).toUpperCase()+g.substr(1).replace(/-/,"")]===!1&&i.moveOut(e.get(g.toLowerCase()))});this.load();if(!this._options.keep_source&&!K){this._target.innerHTML=""}this.$("target").append(this.get("container"));this._options.carousel&&this.bind(k.THUMBNAIL,function(){this.updateCarousel()});this._options.swipe&&(function(f){var l=[0,0],n=[0,0],o=!1,t=0,v,u={start:"touchstart",move:"touchmove",stop:"touchend"},w=function(g){g.originalEvent.touches&&g.originalEvent.touches.length>1||(v=g.originalEvent.touches?g.originalEvent.touches[0]:g,n=[v.pageX,v.pageY],l[0]||(l=n),Math.abs(l[0]-n[0])>10&&g.preventDefault())},y=function(g){f.unbind(u.move,w);g.originalEvent.touches&&g.originalEvent.touches.length||o?o=!o:(i.timestamp()-t<1000&&Math.abs(l[0]-n[0])>30&&Math.abs(l[1]-n[1])<100&&(g.preventDefault(),e[l[0]>n[0]?"next":"prev"]()),l=n=[0,0])};f.bind(u.start,function(g){g.originalEvent.touches&&g.originalEvent.touches.length>1||(v=g.originalEvent.touches?g.originalEvent.touches[0]:g,t=i.timestamp(),l=n=[v.pageX,v.pageY],f.bind(u.move,w).one(u.stop,y))})}(e.$("images")),this._options.fullscreenDoubleTap&&this.$("stage").bind("touchstart",function(){var g,l,n,o,t,u;return function(f){u=k.utils.timestamp();l=(f.originalEvent.touches?f.originalEvent.touches[0]:f).pageX;n=(f.originalEvent.touches?f.originalEvent.touches[0]:f).pageY;u-g<500&&l-o<20&&n-t<20?(e.toggleFullscreen(),f.preventDefault(),e.$("stage").unbind("touchend",arguments.callee)):(g=u,o=l,t=n)}}()));i.optimizeTouch(this.get("container"));return this},_createThumbnails:function(){this.get("total").innerHTML=this.getDataLength();var e,f,g,l,u,v=this,t=this._options,n=function(){var o=v.$("thumbnails").find(".active");if(!o.length){return !1}return o.find("img").attr("src")}(),w=typeof t.thumbnails==="string"?t.thumbnails.toLowerCase():null,A=function(o){return D.defaultView&&D.defaultView.getComputedStyle?D.defaultView.getComputedStyle(g.container,null)[o]:u.css(o)},B=function(o,C,E){return function(){d(E).append(o);v.trigger({type:k.THUMBNAIL,thumbTarget:o,index:C})}},y=function(o){t.pauseOnInteraction&&v.pause();var C=d(o.currentTarget).data("index");v.getIndex()!==C&&v.show(C);o.preventDefault()},z=function(o){o.scale({width:o.data.width,height:o.data.height,crop:t.thumbCrop,margin:t.thumbMargin,canvas:t.useCanvas,complete:function(C){var E=["left","top"],F,G;d.each(["Width","Height"],function(H,I){F=I.toLowerCase();if((t.thumbCrop!==!0||t.thumbCrop===F)&&t.thumbFit){G={},G[F]=C[F],d(C.container).css(G),G={},G[E[H]]=0,d(C.image).css(G)}C["outer"+I]=d(C.container)["outer"+I](!0)});i.toggleQuality(C.image,t.thumbQuality===!0||t.thumbQuality==="auto"&&C.original.width<C.width*3);v.trigger({type:k.THUMBNAIL,thumbTarget:C.image,index:C.data.order})}})};this._thumbnails=[];this.$("thumbnails").empty();for(e=0;this._data[e];e++){l=this._data[e],t.thumbnails===!0?(g=new k.Picture(e),f=l.thumb||l.image,this.$("thumbnails").append(g.container),u=d(g.container),g.data={width:i.parseValue(A("width")),height:i.parseValue(A("height")),order:e},t.thumbFit&&t.thumbCrop!==!0?u.css({width:0,height:0}):u.css({width:g.data.width,height:g.data.height}),g.load(f,z),t.preload==="all"&&g.add(l.image)):w==="empty"||w==="numbers"?(g={container:i.create("galleria-image"),image:i.create("img","span"),ready:!0},w==="numbers"&&d(g.image).text(e+1),this.$("thumbnails").append(g.container),x.setTimeout(B(g.image,e,g.container),50+e*20)):g={container:null,image:null},d(g.container).add(t.keepSource&&t.linkSourceImages?l.original:null).data("index",e).bind(t.thumbEventType,y),n===f&&d(g.container).addClass("active"),this._thumbnails.push(g)}},_run:function(){var e=this;e._createThumbnails();i.wait({until:function(){k.OPERA&&e.$("stage").css("display","inline-block");e._stageWidth=e.$("stage").width();e._stageHeight=e.$("stage").height();return e._stageWidth&&e._stageHeight>50},success:function(){c.push(e);i.show(e.get("counter"));e._options.carousel&&e._carousel.bindControls();if(e._options.autoplay){e.pause();if(typeof e._options.autoplay==="number"){e._playtime=e._options.autoplay}e.trigger(k.PLAY);e._playing=!0}e._firstrun?typeof e._options.show==="number"&&e.show(e._options.show):(e._firstrun=!0,e._options.clicknext&&!k.TOUCH&&(d.each(e._data,function(f,g){delete g.link}),e.$("stage").css({cursor:"pointer"}).bind("click",function(){e._options.pauseOnInteraction&&e.pause();e.next()})),k.History&&k.History.change(function(f){f=parseInt(f.value.replace(/\//,""),10);isNaN(f)?x.history.go(-1):e.show(f,void 0,!0)}),d.each(k.ready.callbacks,function(){this.call(e,e._options)}),e.trigger(k.READY),k.theme.init.call(e,e._options),e._options.extend.call(e,e._options),/^[0-9]{1,4}$/.test(m)&&k.History?e.show(m,void 0,!0):e._data[e._options.show]&&e.show(e._options.show))},error:function(){k.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+e._stageWidth+"px, height: "+e._stageHeight+"px.",!0)}})},load:function(e,f,g){var l=this;this._data=[];this._thumbnails=[];this.$("thumbnails").empty();typeof f==="function"&&(g=f,f=null);e=e||this._options.dataSource;f=f||this._options.dataSelector;g=g||this._options.dataConfig;/^function Object/.test(e.constructor)&&(e=[e]);if(e.constructor===Array){return this.validate(e)?(this._data=e,this._parseData().trigger(k.DATA)):k.raise("Load failed: JSON Array not valid."),this}d(e).find(f).each(function(n,o){var o=d(o),t={},u=o.parent(),v=u.attr("href"),u=u.attr("rel"),w=/\.(png|gif|jpg|jpeg)(\?.*)?$/i;if(w.test(v)){t.image=v,t.big=w.test(u)?u:v}else{if(v){t.link=v}}l._data.push(d.extend({title:o.attr("title")||"",thumb:o.attr("src"),image:o.attr("src"),big:o.attr("src"),description:o.attr("alt")||"",link:o.attr("longdesc"),original:o.get(0)},t,g(o)))});this.getDataLength()?this.trigger(k.DATA):k.raise("Load failed: no data found.");return this},_parseData:function(){var e=this;d.each(this._data,function(f,g){if("thumb" in g===!1){e._data[f].thumb=g.image}if(!1 in g){e._data[f].big=g.image}});return this},splice:function(){Array.prototype.splice.apply(this._data,i.array(arguments));return this._parseData()._createThumbnails()},push:function(){Array.prototype.push.apply(this._data,i.array(arguments));return this._parseData()._createThumbnails()},_getActive:function(){return this._controls.getActive()},validate:function(){return !0},bind:function(e,f){e=b(e);this.$("container").bind(e,this.proxy(f));return this},unbind:function(e){e=b(e);this.$("container").unbind(e);return this},trigger:function(e){e=typeof e==="object"?d.extend(e,{scope:this}):{type:b(e),scope:this};this.$("container").trigger(e);return this},addIdleState:function(){this._idle.add.apply(this._idle,i.array(arguments));return this},removeIdleState:function(){this._idle.remove.apply(this._idle,i.array(arguments));return this},enterIdleMode:function(){this._idle.hide();return this},exitIdleMode:function(){this._idle.showAll();return this},enterFullscreen:function(){this._fullscreen.enter.apply(this,i.array(arguments));return this},exitFullscreen:function(){this._fullscreen.exit.apply(this,i.array(arguments));return this},toggleFullscreen:function(){this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,i.array(arguments));return this},bindTooltip:function(){this._tooltip.bind.apply(this._tooltip,i.array(arguments));return this},defineTooltip:function(){this._tooltip.define.apply(this._tooltip,i.array(arguments));return this},refreshTooltip:function(){this._tooltip.show.apply(this._tooltip,i.array(arguments));return this},openLightbox:function(){this._lightbox.show.apply(this._lightbox,i.array(arguments));return this},closeLightbox:function(){this._lightbox.hide.apply(this._lightbox,i.array(arguments));return this},getActiveImage:function(){return this._getActive().image||void 0},getActiveThumb:function(){return this._thumbnails[this._active].image||void 0},getMousePosition:function(e){return{x:e.pageX-this.$("container").offset().left,y:e.pageY-this.$("container").offset().top}},addPan:function(e){if(this._options.imageCrop!==!1){var e=d(e||this.getActiveImage()),f=this,o=e.width()/2,t=e.height()/2,u=parseInt(e.css("left"),10),y=parseInt(e.css("top"),10),w=u||0,v=y||0,B=0,F=0,A=!1,C=i.timestamp(),E=0,G=0,H=function(g,l,n){if(g>0&&(G=Math.round(Math.max(g*-1,Math.min(0,l))),E!==G)){if(E=G,K===8){e.parent()["scroll"+n](G*-1)}else{g={},g[n.toLowerCase()]=G,e.css(g)}}},z=function(g){if(!(i.timestamp()-C<50)){A=!0,o=f.getMousePosition(g).x,t=f.getMousePosition(g).y}};K===8&&(e.parent().scrollTop(v*-1).scrollLeft(w*-1),e.css({top:0,left:0}));this.$("stage").unbind("mousemove",z).bind("mousemove",z);i.addTimer("pan",function(){A&&(B=e.width()-f._stageWidth,F=e.height()-f._stageHeight,u=o/f._stageWidth*B*-1,y=t/f._stageHeight*F*-1,w+=(u-w)/f._options.imagePanSmoothness,v+=(y-v)/f._options.imagePanSmoothness,H(F,v,"Top"),H(B,w,"Left"))},50,!0);return this}},proxy:function(e,f){if(typeof e!=="function"){return function(){}}f=f||this;return function(){return e.apply(f,i.array(arguments))}},removePan:function(){this.$("stage").unbind("mousemove");i.clearTimer("pan");return this},addElement:function(){var e=this._dom;d.each(i.array(arguments),function(f,g){e[g]=i.create("galleria-"+g)});return this},attachKeyboard:function(){this._keyboard.attach.apply(this._keyboard,i.array(arguments));return this},detachKeyboard:function(){this._keyboard.detach.apply(this._keyboard,i.array(arguments));return this},appendChild:function(e,f){this.$(e).append(this.get(f)||f);return this},prependChild:function(e,f){this.$(e).prepend(this.get(f)||f);return this},remove:function(){this.$(i.array(arguments).join(",")).remove();return this},append:function(e){var f,g;for(f in e){if(e.hasOwnProperty(f)){if(e[f].constructor===Array){for(g=0;e[f][g];g++){this.appendChild(f,e[f][g])}}else{this.appendChild(f,e[f])}}}return this},_scaleImage:function(e,f){f=d.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition},f);(e||this._controls.getActive()).scale(f);return this},updateCarousel:function(){this._carousel.update();return this},rescale:function(f,g,l){var n=this;typeof f==="function"&&(l=f,f=void 0);var o=function(){n._stageWidth=f||n.$("stage").width();n._stageHeight=g||n.$("stage").height();n._scaleImage();n._options.carousel&&n.updateCarousel();n.trigger(k.RESCALE);typeof l==="function"&&l.call(n)};k.WEBKIT&&!f&&!g?i.addTimer("scale",o,10):o.call(n);return this},refreshImage:function(){this._scaleImage();this._options.imagePan&&this.addPan();return this},show:function(e,f,g){if(!(e===!1||!this._options.queue&&this._queue.stalled)){if(e=Math.max(0,Math.min(parseInt(e,10),this.getDataLength()-1)),f=typeof f!=="undefined"?!!f:e<this.getIndex(),!g&&k.History){k.History.value(e.toString())}else{return this._active=e,Array.prototype.push.call(this._queue,{index:e,rewind:f}),this._queue.stalled||this._show(),this}}},_show:function(){var e=this,f=this._queue[0],g=this.getData(f.index);if(g){var l=this.isFullscreen()&&"big" in g?g.big:g.image,v=this._controls.getActive(),w=this._controls.getNext(),u=w.isCached(l),t=this._thumbnails[f.index],y=function(n,o,E,F,G){return function(){e._queue.stalled=!1;i.toggleQuality(o.image,e._options.imageQuality);d(E.container).css({zIndex:0,opacity:0}).show();d(o.container).css({zIndex:1,opacity:1}).show();e._controls.swap();e._options.imagePan&&e.addPan(o.image);(n.link||e._options.lightbox)&&d(o.image).css({cursor:"pointer"}).bind("mouseup",function(){n.link?e._options.popupLinks?x.open(n.link,"_blank"):x.location.href=n.link:e.openLightbox()});Array.prototype.shift.call(e._queue);e._queue.length&&e._show();e._playCheck();e.trigger({type:k.IMAGE,index:F.index,imageTarget:o.image,thumbTarget:G.image})}}(g,w,v,f,t);this._options.carousel&&this._options.carouselFollow&&this._carousel.follow(f.index);if(this._options.preload){var C,z,g=this.getNext(),A;try{for(z=this._options.preload;z>0;z--){C=new k.Picture,A=e.getData(g),C.add(this.isFullscreen()&&"big" in A?A.big:A.image),g=e.getNext(g)}}catch(B){}}i.show(w.container);d(e._thumbnails[f.index].container).addClass("active").siblings(".active").removeClass("active");e.trigger({type:k.LOADSTART,cached:u,index:f.index,imageTarget:w.image,thumbTarget:t.image});w.load(l,function(n){e._scaleImage(n,{complete:function(o){"image" in v&&i.toggleQuality(v.image,!1);i.toggleQuality(o.image,!1);e._queue.stalled=!0;e.removePan();e.setInfo(f.index);e.setCounter(f.index);e.trigger({type:k.LOADFINISH,cached:u,index:f.index,imageTarget:o.image,thumbTarget:e._thumbnails[f.index].image});var E=v.image===null&&e._options.initialTransition!==void 0?e._options.initialTransition:e._options.transition;E in h===!1?y():h[E].call(e,{prev:v.container,next:o.container,rewind:f.rewind,speed:e._options.transitionSpeed||400},y)}})})}},getNext:function(e){e=typeof e==="number"?e:this.getIndex();return e===this.getDataLength()-1?0:e+1},getPrev:function(e){e=typeof e==="number"?e:this.getIndex();return e===0?this.getDataLength()-1:e-1},next:function(){this.getDataLength()>1&&this.show(this.getNext(),!1);return this},prev:function(){this.getDataLength()>1&&this.show(this.getPrev(),!0);return this},get:function(e){return e in this._dom?this._dom[e]:null},getData:function(e){return e in this._data?this._data[e]:this._data[this._active]},getDataLength:function(){return this._data.length},getIndex:function(){return typeof this._active==="number"?this._active:!1},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(e){return typeof e==="undefined"?this._options:this._options[e]},setOptions:function(e,f){typeof e==="object"?d.extend(this._options,e):this._options[e]=f;return this},play:function(e){this._playing=!0;this._playtime=e||this._playtime;this._playCheck();this.trigger(k.PLAY);return this},pause:function(){this._playing=!1;this.trigger(k.PAUSE);return this},playToggle:function(e){return this._playing?this.pause():this.play(e)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var f=this,g=0,l=i.timestamp(),n="play"+this._id;if(this._playing){i.clearTimer(n);var o=function(){g=i.timestamp()-l;g>=f._playtime&&f._playing?(i.clearTimer(n),f.next()):f._playing&&(f.trigger({type:k.PROGRESS,percent:Math.ceil(g/f._playtime*100),seconds:Math.floor(g/1000),milliseconds:g}),i.addTimer(n,o,20))};i.addTimer(n,o,20)}},setIndex:function(e){this._active=e;return this},setCounter:function(e){typeof e==="number"?e++:typeof e==="undefined"&&(e=this.getIndex()+1);this.get("current").innerHTML=e;if(K){var e=this.$("counter"),f=e.css("opacity"),g=e.attr("style");g&&parseInt(f,10)===1?e.attr("style",g.replace(/filter[^\;]+\;/i,"")):this.$("counter").css("opacity",f)}return this},setInfo:function(e){var f=this,g=this.getData(e);d.each(["title","description"],function(l,n){var o=f.$("info-"+n);g[n]?o[g[n].length?"show":"hide"]().html(g[n]):o.empty().hide()});return this},hasInfo:function(e){var f="title description".split(" "),g;for(g=0;f[g];g++){if(this.getData(e)[f[g]]){return !0}}return !1},jQuery:function(e){var f=this,g=[];d.each(e.split(","),function(n,o){o=d.trim(o);f.get(o)&&g.push(o)});var l=d(f.get(g.shift()));d.each(g,function(n,o){l=l.add(f.get(o))});return l},$:function(){return this.jQuery.apply(this,i.array(arguments))}};d.each(p,function(e,f){var g=/_/.test(f)?f.replace(/_/g,""):f;k[f.toUpperCase()]="galleria."+g});d.extend(k,{IE9:K===9,IE8:K===8,IE7:K===7,IE6:K===6,IE:!!K,WEBKIT:/webkit/.test(r),SAFARI:/safari/.test(r),CHROME:/chrome/.test(r),QUIRK:K&&D.compatMode&&D.compatMode==="BackCompat",MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!x.opera,IPHONE:/iphone/.test(r),IPAD:/ipad/.test(r),ANDROID:/android/.test(r),TOUCH:"ontouchstart" in document});k.addTheme=function(e){e.name||k.raise("No theme name specified");e.defaults=typeof e.defaults!=="object"?{}:q(e.defaults);var f=!1,g;typeof e.css==="string"?(d("link").each(function(l,n){g=RegExp(e.css);if(g.test(n.href)){return f=!0,k.theme=e,!1}}),f||d("script").each(function(l,n){g=RegExp("galleria\\."+e.name.toLowerCase()+"\\.");g.test(n.src)&&(f=n.src.replace(/[^\/]*$/,"")+e.css,i.addTimer("css",function(){i.loadCSS(f,"galleria-theme",function(){k.theme=e})},1))}),f||k.raise("No theme CSS loaded")):k.theme=e;return e};k.loadTheme=function(e,f){var g=!1,l=c.length;k.theme=void 0;i.loadScript(e,function(){g=!0});i.wait({until:function(){return g},error:function(){k.raise("Theme at "+e+" could not load, check theme path.",!0)},success:function(){if(l){var n=[];d.each(k.get(),function(o,t){var u=d.extend(t._original.options,{data_source:t._data},f);t.$("container").remove();var v=new k;v._id=t._id;v.init(t._original.target,u);n.push(v)});c=n}},timeout:2000})};k.get=function(e){if(P[e]){return P[e]}else{if(typeof e!=="number"){return P}else{k.raise("Gallery index "+e+" not found")}}};k.addTransition=function(e,f){h[e]=f};k.utils=i;k.log=function(){try{x.console.log.apply(x.console,i.array(arguments))}catch(e){try{x.opera.postError.apply(x.opera,arguments)}catch(f){x.alert(i.array(arguments).split(", "))}}};k.ready=function(e){k.ready.callbacks.push(e)};k.ready.callbacks=[];k.raise=function(e,f){var g=f?"Fatal error":"Error",l=function(n){var o='<div style="padding:4px;margin:0 0 2px;background:#'+(f?"811":"222")+'";>'+(f?"<strong>"+g+": </strong>":"")+n+"</div>";d.each(P,function(){var t=this.$("errors"),u=this.$("target");t.length||(u.css("position","relative"),t=this.addElement("errors").appendChild("target","errors").$("errors").css({color:"#fff",position:"absolute",top:0,left:0,zIndex:100000}));t.append(o)})};if(a){if(l(e),f){throw Error(g+": "+e)}}else{f&&!s&&(s=!0,f=!1,l("Image gallery could not load."))}};k.Picture=function(e){this.id=e||null;this.image=null;this.container=i.create("galleria-image");d(this.container).css({overflow:"hidden",position:"relative"});this.original={width:0,height:0};this.loaded=this.ready=!1};k.Picture.prototype={cache:{},add:function(e){var g=0,l=this,n=new Image,o=function(){if((!this.width||!this.height)&&g<1000){g++,d(n).load(o).attr("src",e+"?"+(new Date).getTime())}l.original={height:this.height,width:this.width};l.cache[e]=e;l.loaded=!0};d(n).css("display","block");if(l.cache[e]){return n.src=e,o.call(n),n}d(n).load(o).error(function(){k.raise("image could not load: "+e)}).attr("src",e);return n},show:function(){i.show(this.image)},hide:function(){i.moveOut(this.image)},clear:function(){this.image=null},isCached:function(e){return !!this.cache[e]},load:function(e,f){var g=this;d(this.container).empty(!0);this.image=this.add(e);i.hide(this.image);d(this.container).append(this.image);i.wait({until:function(){return g.loaded&&g.image.complete&&g.original.width&&g.image.width},success:function(){x.setTimeout(function(){f.call(g,g)},1)},error:function(){x.setTimeout(function(){f.call(g,g)},1);k.raise("image not loaded in 30 seconds: "+e)},timeout:30000});return this.container},scale:function(e){e=d.extend({width:0,height:0,min:void 0,max:void 0,margin:0,complete:function(){},position:"center",crop:!1,canvas:!1},e);if(!this.image){return this.container}var f,g,l=this,n=d(l.container),o;i.wait({until:function(){f=e.width||n.width()||i.parseValue(n.css("width"));g=e.height||n.height()||i.parseValue(n.css("height"));return f&&g},success:function(){var t=(f-e.margin*2)/l.original.width,u=(g-e.margin*2)/l.original.height,v={"true":Math.max(t,u),width:t,height:u,"false":Math.min(t,u)}[e.crop.toString()],t="";e.max&&(v=Math.min(e.max,v));e.min&&(v=Math.max(e.min,v));d.each(["width","height"],function(A,B){d(l.image)[B](l[B]=l.image[B]=Math.round(l.original[B]*v))});d(l.container).width(f).height(g);if(e.canvas&&L){L.elem.width=l.width,L.elem.height=l.height,t=l.image.src+":"+l.width+"x"+l.height,l.image.src=L.cache[t]||function(A){L.context.drawImage(l.image,0,0,l.original.width*v,l.original.height*v);try{return o=L.elem.toDataURL(),L.length+=o.length,L.cache[A]=o}catch(B){return l.image.src}}(t)}var w={},y={},t=function(A,B,C){var E=0;/\%/.test(A)?(A=parseInt(A,10)/100,B=l.image[B]||d(l.image)[B](),E=Math.ceil(B*-1*A+C*A)):E=i.parseValue(A);return E},z={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};d.each(e.position.toLowerCase().split(" "),function(A,B){B==="center"&&(B="50%");w[A?"top":"left"]=B});d.each(w,function(A,B){z.hasOwnProperty(B)&&d.extend(y,z[B])});w=w.top?d.extend(w,y):y;w=d.extend({top:"50%",left:"50%"},w);d(l.image).css({position:"relative",top:t(w.top,"height",g),left:t(w.left,"width",f)});l.show();l.ready=!0;e.complete.call(l,l)},error:function(){k.raise("Could not scale image: "+l.image.src)},timeout:1000});return this}};d.extend(d.easing,{galleria:function(f,g,l,n,o){if((g/=o/2)<1){return n/2*g*g*g+l}return n/2*((g-=2)*g*g+2)+l},galleriaIn:function(f,g,l,n,o){return n*(g/=o)*g+l},galleriaOut:function(f,g,l,n,o){return -n*(g/=o)*(g-2)+l}});d.fn.galleria=function(e){return this.each(function(){(new k).init(this,e)})};x.Galleria=k})(jQuery);/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.99 (12-MAR-2011)
 * Dual licensed under the MIT and GPL licenses.
 * http://jquery.malsup.com/license.html
 * Requires: jQuery v1.3.2 or later
 */
(function(a){var q="2.99";if(a.support==undefined){a.support={opacity:!(a.browser.msie)}}function f(r){a.fn.cycle.debug&&l(r)}function l(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}a.expr[":"].paused=function(r){return r.cyclePause};a.fn.cycle=function(t,r){var s={s:this.selector,c:this.context};if(this.length===0&&t!="stop"){if(!a.isReady&&s.s){l("DOM not ready, queuing slideshow");a(function(){a(s.s,s.c).cycle(t,r)});return this}l("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var x=k(this,t,r);if(x===false){return}x.updateActivePagerLink=x.updateActivePagerLink||a.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var u=a(this);var v=x.slideExpr?a(x.slideExpr,this):u.children();var w=v.get();if(w.length<2){l("terminating; too few slides: "+w.length);return}var y=c(u,v,w,x,s);if(y===false){return}var z=y.continuous?10:i(w[y.currSlide],w[y.nextSlide],y,!y.backwards);if(z){z+=(y.delay||0);if(z<10){z=10}f("first timeout: "+z);this.cycleTimeout=setTimeout(function(){j(w,y,0,!x.backwards)},z)}})};function k(t,v,r){if(t.cycleStop==undefined){t.cycleStop=0}if(v===undefined||v===null){v={}}if(v.constructor==String){switch(v){case"destroy":case"stop":var w=a(t).data("cycle.opts");if(!w){return false}t.cycleStop++;if(t.cycleTimeout){clearTimeout(t.cycleTimeout)}t.cycleTimeout=0;a(t).removeData("cycle.opts");if(v=="destroy"){g(w)}return false;case"toggle":t.cyclePause=(t.cyclePause===1)?0:1;s(t.cyclePause,r,t);return false;case"pause":t.cyclePause=1;return false;case"resume":t.cyclePause=0;s(false,r,t);return false;case"prev":case"next":var w=a(t).data("cycle.opts");if(!w){l('options not found, "prev/next" ignored');return false}a.fn.cycle[v](w);return false;default:v={fx:v}}return v}else{if(v.constructor==Number){var u=v;v=a(t).data("cycle.opts");if(!v){l("options not found, can not advance slide");return false}if(u<0||u>=v.elements.length){l("invalid slide index: "+u);return false}v.nextSlide=u;if(t.cycleTimeout){clearTimeout(t.cycleTimeout);t.cycleTimeout=0}if(typeof r=="string"){v.oneTimeFx=r}j(v.elements,v,1,u>=v.currSlide);return false}}return v;function s(z,x,y){if(!z&&x===true){var A=a(y).data("cycle.opts");if(!A){l("options not found, can not resume");return false}if(y.cycleTimeout){clearTimeout(y.cycleTimeout);y.cycleTimeout=0}j(A.elements,A,1,!A.backwards)}}}function m(r,s){if(!a.support.opacity&&s.cleartype&&r.style.filter){try{r.style.removeAttribute("filter")}catch(t){}}}function g(r){if(r.next){a(r.next).unbind(r.prevNextEvent)}if(r.prev){a(r.prev).unbind(r.prevNextEvent)}if(r.pager||r.pagerAnchorBuilder){a.each(r.pagerAnchors||[],function(){this.unbind().remove()})}r.pagerAnchors=null;if(r.destroy){r.destroy(r)}}function c(r,t,z,I,H){var J=a.extend({},a.fn.cycle.defaults,I||{},a.metadata?r.metadata():a.meta?r.data():{});if(J.autostop){J.countdown=J.autostopCount||z.length}var v=r[0];r.data("cycle.opts",J);J.$cont=r;J.stopCount=v.cycleStop;J.elements=z;J.before=J.before?[J.before]:[];J.after=J.after?[J.after]:[];if(!a.support.opacity&&J.cleartype){J.after.push(function(){m(this,J)})}if(J.continuous){J.after.push(function(){j(z,J,0,!J.backwards)})}n(J);if(!a.support.opacity&&J.cleartype&&!J.cleartypeNoBg){e(t)}if(r.css("position")=="static"){r.css("position","relative")}if(J.width){r.width(J.width)}if(J.height&&J.height!="auto"){r.height(J.height)}if(J.startingSlide){J.startingSlide=parseInt(J.startingSlide)}else{if(J.backwards){J.startingSlide=z.length-1}}if(J.random){J.randomMap=[];for(var C=0;C<z.length;C++){J.randomMap.push(C)}J.randomMap.sort(function(w,N){return Math.random()-0.5});J.randomIndex=1;J.startingSlide=J.randomMap[1]}else{if(J.startingSlide>=z.length){J.startingSlide=0}}J.currSlide=J.startingSlide||0;var A=J.startingSlide;t.css({position:"absolute",top:0,left:0}).hide().each(function(w){var N;if(J.backwards){N=A?w<=A?z.length+(w-A):A-w:z.length-w}else{N=A?w>=A?z.length-(w-A):A-w:z.length-w}a(this).css("z-index",N)});a(z[A]).css("opacity",1).show();m(z[A],J);if(J.fit&&J.width){t.width(J.width)}if(J.fit&&J.height&&J.height!="auto"){t.height(J.height)}var L=J.containerResize&&!r.innerHeight();if(L){var G=0,F=0;for(var E=0;E<z.length;E++){var s=a(z[E]),x=s[0],M=s.outerWidth(),B=s.outerHeight();if(!M){M=x.offsetWidth||x.width||s.attr("width")}if(!B){B=x.offsetHeight||x.height||s.attr("height")}G=M>G?M:G;F=B>F?B:F}if(G>0&&F>0){r.css({width:G+"px",height:F+"px"})}}if(J.pause){r.hover(function(){this.cyclePause++},function(){this.cyclePause--})}if(o(J)===false){return false}var K=false;I.requeueAttempts=I.requeueAttempts||0;t.each(function(){var w=a(this);this.cycleH=(J.fit&&J.height)?J.height:(w.height()||this.offsetHeight||this.height||w.attr("height")||0);this.cycleW=(J.fit&&J.width)?J.width:(w.width()||this.offsetWidth||this.width||w.attr("width")||0);if(w.is("img")){var O=(a.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var N=(a.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var P=(a.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var Q=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(O||N||P||Q){if(H.s&&J.requeueOnImageNotLoaded&&++I.requeueAttempts<100){l(I.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){a(H.s,H.c).cycle(I)},J.requeueTimeout);K=true;return false}else{l("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(K){return false}J.cssBefore=J.cssBefore||{};J.cssAfter=J.cssAfter||{};J.cssFirst=J.cssFirst||{};J.animIn=J.animIn||{};J.animOut=J.animOut||{};t.not(":eq("+A+")").css(J.cssBefore);a(t[A]).css(J.cssFirst);if(J.timeout){J.timeout=parseInt(J.timeout);if(J.speed.constructor==String){J.speed=a.fx.speeds[J.speed]||parseInt(J.speed)}if(!J.sync){J.speed=J.speed/2}var u=J.fx=="none"?0:J.fx=="shuffle"?500:250;while((J.timeout-J.speed)<u){J.timeout+=J.speed}}if(J.easing){J.easeIn=J.easeOut=J.easing}if(!J.speedIn){J.speedIn=J.speed}if(!J.speedOut){J.speedOut=J.speed}J.slideCount=z.length;J.currSlide=J.lastSlide=A;if(J.random){if(++J.randomIndex==z.length){J.randomIndex=0}J.nextSlide=J.randomMap[J.randomIndex]}else{if(J.backwards){J.nextSlide=J.startingSlide==0?(z.length-1):J.startingSlide-1}else{J.nextSlide=J.startingSlide>=(z.length-1)?0:J.startingSlide+1}}if(!J.multiFx){var D=a.fn.cycle.transitions[J.fx];if(a.isFunction(D)){D(r,t,J)}else{if(J.fx!="custom"&&!J.multiFx){l("unknown transition: "+J.fx,"; slideshow terminating");return false}}}var y=t[A];if(J.before.length){J.before[0].apply(y,[y,y,J,true])}if(J.after.length){J.after[0].apply(y,[y,y,J,true])}if(J.next){a(J.next).bind(J.prevNextEvent,function(){return b(J,1)})}if(J.prev){a(J.prev).bind(J.prevNextEvent,function(){return b(J,0)})}if(J.pager||J.pagerAnchorBuilder){d(z,J)}h(J,z);return J}function n(r){r.original={before:[],after:[]};r.original.cssBefore=a.extend({},r.cssBefore);r.original.cssAfter=a.extend({},r.cssAfter);r.original.animIn=a.extend({},r.animIn);r.original.animOut=a.extend({},r.animOut);a.each(r.before,function(){r.original.before.push(this)});a.each(r.after,function(){r.original.after.push(this)})}function o(t){var s,w,x=a.fn.cycle.transitions;if(t.fx.indexOf(",")>0){t.multiFx=true;t.fxs=t.fx.replace(/\s*/g,"").split(",");for(s=0;s<t.fxs.length;s++){var r=t.fxs[s];w=x[r];if(!w||!x.hasOwnProperty(r)||!a.isFunction(w)){l("discarding unknown transition: ",r);t.fxs.splice(s,1);s--}}if(!t.fxs.length){l("No valid transitions named; slideshow terminating.");return false}}else{if(t.fx=="all"){t.multiFx=true;t.fxs=[];for(p in x){w=x[p];if(x.hasOwnProperty(p)&&a.isFunction(w)){t.fxs.push(p)}}}}if(t.multiFx&&t.randomizeEffects){var u=Math.floor(Math.random()*20)+30;for(s=0;s<u;s++){var v=Math.floor(Math.random()*t.fxs.length);t.fxs.push(t.fxs.splice(v,1)[0])}f("randomized fx sequence: ",t.fxs)}return true}function h(s,r){s.addSlide=function(u,v){var t=a(u),w=t[0];if(!s.autostopCount){s.countdown++}r[v?"unshift":"push"](w);if(s.els){s.els[v?"unshift":"push"](w)}s.slideCount=r.length;t.css("position","absolute");t[v?"prependTo":"appendTo"](s.$cont);if(v){s.currSlide++;s.nextSlide++}if(!a.support.opacity&&s.cleartype&&!s.cleartypeNoBg){e(t)}if(s.fit&&s.width){t.width(s.width)}if(s.fit&&s.height&&s.height!="auto"){t.height(s.height)}w.cycleH=(s.fit&&s.height)?s.height:t.height();w.cycleW=(s.fit&&s.width)?s.width:t.width();t.css(s.cssBefore);if(s.pager||s.pagerAnchorBuilder){a.fn.cycle.createPagerAnchor(r.length-1,w,a(s.pager),r,s)}if(a.isFunction(s.onAddSlide)){s.onAddSlide(t)}else{t.hide()}}}a.fn.cycle.resetState=function(t,r){r=r||t.fx;t.before=[];t.after=[];t.cssBefore=a.extend({},t.original.cssBefore);t.cssAfter=a.extend({},t.original.cssAfter);t.animIn=a.extend({},t.original.animIn);t.animOut=a.extend({},t.original.animOut);t.fxFn=null;a.each(t.original.before,function(){t.before.push(this)});a.each(t.original.after,function(){t.after.push(this)});var s=a.fn.cycle.transitions[r];if(a.isFunction(s)){s(t.$cont,a(t.elements),t)}};function j(u,A,x,v){if(x&&A.busy&&A.manualTrump){f("manualTrump in go(), stopping active transition");a(u).stop(true,true);A.busy=0}if(A.busy){f("transition active, ignoring new tx request");return}var B=A.$cont[0],t=u[A.currSlide],z=u[A.nextSlide];if(B.cycleStop!=A.stopCount||B.cycleTimeout===0&&!x){return}if(!x&&!B.cyclePause&&!A.bounce&&((A.autostop&&(--A.countdown<=0))||(A.nowrap&&!A.random&&A.nextSlide<A.currSlide))){if(A.end){A.end(A)}return}var s=false;if((x||!B.cyclePause)&&(A.nextSlide!=A.currSlide)){s=true;var w=A.fx;t.cycleH=t.cycleH||a(t).height();t.cycleW=t.cycleW||a(t).width();z.cycleH=z.cycleH||a(z).height();z.cycleW=z.cycleW||a(z).width();if(A.multiFx){if(A.lastFx==undefined||++A.lastFx>=A.fxs.length){A.lastFx=0}w=A.fxs[A.lastFx];A.currFx=w}if(A.oneTimeFx){w=A.oneTimeFx;A.oneTimeFx=null}a.fn.cycle.resetState(A,w);if(A.before.length){a.each(A.before,function(D,E){if(B.cycleStop!=A.stopCount){return}E.apply(z,[t,z,A,v])})}var r=function(){A.busy=0;a.each(A.after,function(D,E){if(B.cycleStop!=A.stopCount){return}E.apply(z,[t,z,A,v])})};f("tx firing("+w+"); currSlide: "+A.currSlide+"; nextSlide: "+A.nextSlide);A.busy=1;if(A.fxFn){A.fxFn(t,z,A,r,v,x&&A.fastOnEvent)}else{if(a.isFunction(a.fn.cycle[A.fx])){a.fn.cycle[A.fx](t,z,A,r,v,x&&A.fastOnEvent)}else{a.fn.cycle.custom(t,z,A,r,v,x&&A.fastOnEvent)}}}if(s||A.nextSlide==A.currSlide){A.lastSlide=A.currSlide;if(A.random){A.currSlide=A.nextSlide;if(++A.randomIndex==u.length){A.randomIndex=0}A.nextSlide=A.randomMap[A.randomIndex];if(A.nextSlide==A.currSlide){A.nextSlide=(A.currSlide==A.slideCount-1)?0:A.currSlide+1}}else{if(A.backwards){var C=(A.nextSlide-1)<0;if(C&&A.bounce){A.backwards=!A.backwards;A.nextSlide=1;A.currSlide=0}else{A.nextSlide=C?(u.length-1):A.nextSlide-1;A.currSlide=C?0:A.nextSlide+1}}else{var C=(A.nextSlide+1)==u.length;if(C&&A.bounce){A.backwards=!A.backwards;A.nextSlide=u.length-2;A.currSlide=u.length-1}else{A.nextSlide=C?0:A.nextSlide+1;A.currSlide=C?u.length-1:A.nextSlide-1}}}}if(s&&A.pager){A.updateActivePagerLink(A.pager,A.currSlide,A.activePagerClass)}var y=0;if(A.timeout&&!A.continuous){y=i(u[A.currSlide],u[A.nextSlide],A,v)}else{if(A.continuous&&B.cyclePause){y=10}}if(y>0){B.cycleTimeout=setTimeout(function(){j(u,A,0,!A.backwards)},y)}}a.fn.cycle.updateActivePagerLink=function(t,s,r){a(t).each(function(){a(this).children().removeClass(r).eq(s).addClass(r)})};function i(r,u,v,s){if(v.timeoutFn){var w=v.timeoutFn.call(r,r,u,v,s);while(v.fx!="none"&&(w-v.speed)<250){w+=v.speed}f("calculated timeout: "+w+"; speed: "+v.speed);if(w!==false){return w}}return v.timeout}a.fn.cycle.next=function(r){b(r,1)};a.fn.cycle.prev=function(r){b(r,0)};function b(u,t){var x=t?1:-1;var s=u.elements;var v=u.$cont[0],w=v.cycleTimeout;if(w){clearTimeout(w);v.cycleTimeout=0}if(u.random&&x<0){u.randomIndex--;if(--u.randomIndex==-2){u.randomIndex=s.length-2}else{if(u.randomIndex==-1){u.randomIndex=s.length-1}}u.nextSlide=u.randomMap[u.randomIndex]}else{if(u.random){u.nextSlide=u.randomMap[u.randomIndex]}else{u.nextSlide=u.currSlide+x;if(u.nextSlide<0){if(u.nowrap){return false}u.nextSlide=s.length-1}else{if(u.nextSlide>=s.length){if(u.nowrap){return false}u.nextSlide=0}}}}var r=u.onPrevNextEvent||u.prevNextClick;if(a.isFunction(r)){r(x>0,u.nextSlide,s[u.nextSlide])}j(s,u,1,t);return false}function d(s,t){var r=a(t.pager);a.each(s,function(u,v){a.fn.cycle.createPagerAnchor(u,v,r,s,t)});t.updateActivePagerLink(t.pager,t.startingSlide,t.activePagerClass)}a.fn.cycle.createPagerAnchor=function(x,v,s,w,y){var t;if(a.isFunction(y.pagerAnchorBuilder)){t=y.pagerAnchorBuilder(x,v);f("pagerAnchorBuilder("+x+", el) returned: "+t)}else{t='<a href="#">'+(x+1)+"</a>"}if(!t){return}var r=a(t);if(r.parents("body").length===0){var u=[];if(s.length>1){s.each(function(){var z=r.clone(true);a(this).append(z);u.push(z[0])});r=a(u)}else{r.appendTo(s)}}y.pagerAnchors=y.pagerAnchors||[];y.pagerAnchors.push(r);r.bind(y.pagerEvent,function(A){A.preventDefault();y.nextSlide=x;var B=y.$cont[0],C=B.cycleTimeout;if(C){clearTimeout(C);B.cycleTimeout=0}var z=y.onPagerEvent||y.pagerClick;if(a.isFunction(z)){z(y.nextSlide,w[y.nextSlide])}j(w,y,1,y.currSlide<x)});if(!/^click/.test(y.pagerEvent)&&!y.allowPagerClickBubble){r.bind("click.cycle",function(){return false})}if(y.pauseOnPagerHover){r.hover(function(){y.$cont[0].cyclePause++},function(){y.$cont[0].cyclePause--})}};a.fn.cycle.hopsFromLast=function(v,s){var t,u=v.lastSlide,r=v.currSlide;if(s){t=r>u?r-u:v.slideCount-u}else{t=r<u?u-r:u+v.slideCount-r}return t};function e(r){f("applying clearType background-color hack");function t(u){u=parseInt(u).toString(16);return u.length<2?"0"+u:u}function s(u){for(;u&&u.nodeName.toLowerCase()!="html";u=u.parentNode){var x=a.css(u,"background-color");if(x&&x.indexOf("rgb")>=0){var w=x.match(/\d+/g);return"#"+t(w[0])+t(w[1])+t(w[2])}if(x&&x!="transparent"){return x}}return"#ffffff"}r.each(function(){a(this).css("background-color",s(this))})}a.fn.cycle.commonReset=function(r,t,u,x,s,v){a(u.elements).not(r).hide();if(typeof u.cssBefore.opacity=="undefined"){u.cssBefore.opacity=1}u.cssBefore.display="block";if(u.slideResize&&x!==false&&t.cycleW>0){u.cssBefore.width=t.cycleW}if(u.slideResize&&s!==false&&t.cycleH>0){u.cssBefore.height=t.cycleH}u.cssAfter=u.cssAfter||{};u.cssAfter.display="none";a(r).css("zIndex",u.slideCount+(v===true?1:0));a(t).css("zIndex",u.slideCount+(v===true?0:1))};a.fn.cycle.custom=function(u,z,A,t,y,D){var r=a(u),s=a(z);var B=A.speedIn,C=A.speedOut,v=A.easeIn,w=A.easeOut;s.css(A.cssBefore);if(D){if(typeof D=="number"){B=C=D}else{B=C=1}v=w=null}var x=function(){s.animate(A.animIn,B,v,function(){t()})};r.animate(A.animOut,C,w,function(){r.css(A.cssAfter);if(!A.sync){x()}});if(A.sync){x()}};a.fn.cycle.transitions={fade:function(r,s,t){s.not(":eq("+t.currSlide+")").css("opacity",0);t.before.push(function(u,v,w){a.fn.cycle.commonReset(u,v,w);w.cssBefore.opacity=0});t.animIn={opacity:1};t.animOut={opacity:0};t.cssBefore={top:0,left:0}}};a.fn.cycle.ver=function(){return q};a.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,autostop:0,autostopCount:0,backwards:false,before:null,cleartype:!a.support.opacity,cleartypeNoBg:false,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,slideExpr:null,slideResize:1,speed:1000,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4000,timeoutFn:null,updateActivePagerLink:null}})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version:	 2.73
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(a){a.fn.cycle.transitions.none=function(b,c,d){d.fxFn=function(f,g,h,e){a(g).show();a(f).hide();e()}};a.fn.cycle.transitions.fadeout=function(b,c,d){c.not(":eq("+d.currSlide+")").css({display:"block",opacity:1});d.before.push(function(e,g,i,k,f,j){a(e).css("zIndex",i.slideCount+(!j===true?1:0));a(g).css("zIndex",i.slideCount+(!j===true?0:1))});d.animIn.opacity=1;d.animOut.opacity=0;d.cssBefore.opacity=1;d.cssBefore.display="block";d.cssAfter.zIndex=0};a.fn.cycle.transitions.scrollUp=function(b,c,e){b.css("overflow","hidden");e.before.push(a.fn.cycle.commonReset);var d=b.height();e.cssBefore.top=d;e.cssBefore.left=0;e.cssFirst.top=0;e.animIn.top=0;e.animOut.top=-d};a.fn.cycle.transitions.scrollDown=function(b,c,e){b.css("overflow","hidden");e.before.push(a.fn.cycle.commonReset);var d=b.height();e.cssFirst.top=0;e.cssBefore.top=-d;e.cssBefore.left=0;e.animIn.top=0;e.animOut.top=d};a.fn.cycle.transitions.scrollLeft=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=0-e};a.fn.cycle.transitions.scrollRight=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=-e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.scrollHorz=function(b,c,d){b.css("overflow","hidden").width();d.before.push(function(e,g,h,f){if(h.rev){f=!f}a.fn.cycle.commonReset(e,g,h);h.cssBefore.left=f?(g.cycleW-1):(1-g.cycleW);h.animOut.left=f?-e.cycleW:e.cycleW});d.cssFirst.left=0;d.cssBefore.top=0;d.animIn.left=0;d.animOut.top=0};a.fn.cycle.transitions.scrollVert=function(b,c,d){b.css("overflow","hidden");d.before.push(function(e,g,h,f){if(h.rev){f=!f}a.fn.cycle.commonReset(e,g,h);h.cssBefore.top=f?(1-g.cycleH):(g.cycleH-1);h.animOut.top=f?e.cycleH:-e.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.animIn.top=0;d.animOut.left=0};a.fn.cycle.transitions.slideX=function(b,c,d){d.before.push(function(e,f,g){a(g.elements).not(e).hide();a.fn.cycle.commonReset(e,f,g,false,true);g.animIn.width=f.cycleW});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.width="show";d.animOut.width=0};a.fn.cycle.transitions.slideY=function(b,c,d){d.before.push(function(e,f,g){a(g.elements).not(e).hide();a.fn.cycle.commonReset(e,f,g,true,false);g.animIn.height=f.cycleH});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animIn.height="show";d.animOut.height=0};a.fn.cycle.transitions.shuffle=function(b,c,e){var d,f=b.css("overflow","visible").width();c.css({left:0,top:0});e.before.push(function(g,h,i){a.fn.cycle.commonReset(g,h,i,true,true,true)});if(!e.speedAdjusted){e.speed=e.speed/2;e.speedAdjusted=true}e.random=0;e.shuffle=e.shuffle||{left:-f,top:15};e.els=[];for(d=0;d<c.length;d++){e.els.push(c[d])}for(d=0;d<e.currSlide;d++){e.els.push(e.els.shift())}e.fxFn=function(j,l,m,h,k){if(m.rev){k=!k}var g=k?a(j):a(l);a(l).css(m.cssBefore);var i=m.slideCount;g.animate(m.shuffle,m.speedIn,m.easeIn,function(){var n=a.fn.cycle.hopsFromLast(m,k);for(var q=0;q<n;q++){k?m.els.push(m.els.shift()):m.els.unshift(m.els.pop())}if(k){for(var o=0,r=m.els.length;o<r;o++){a(m.els[o]).css("z-index",r-o+i)}}else{var s=a(j).css("z-index");g.css("z-index",parseInt(s)+1+i)}g.animate({left:0,top:0},m.speedOut,m.easeOut,function(){a(k?this:j).hide();if(h){h()}})})};a.extend(e.cssBefore,{display:"block",opacity:1,top:0,left:0})};a.fn.cycle.transitions.turnUp=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false);g.cssBefore.top=f.cycleH;g.animIn.height=f.cycleH;g.animOut.width=f.cycleW});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.height=0;d.animIn.top=0;d.animOut.height=0};a.fn.cycle.transitions.turnDown=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false);g.animIn.height=f.cycleH;g.animOut.top=e.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animOut.height=0};a.fn.cycle.transitions.turnLeft=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true);g.cssBefore.left=f.cycleW;g.animIn.width=f.cycleW});d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.turnRight=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true);g.animIn.width=f.cycleW;g.animOut.left=e.cycleW});a.extend(d.cssBefore,{top:0,left:0,width:0});d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.zoom=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,false,true);g.cssBefore.top=f.cycleH/2;g.cssBefore.left=f.cycleW/2;a.extend(g.animIn,{top:0,left:0,width:f.cycleW,height:f.cycleH});a.extend(g.animOut,{width:0,height:0,top:e.cycleH/2,left:e.cycleW/2})});d.cssFirst.top=0;d.cssFirst.left=0;d.cssBefore.width=0;d.cssBefore.height=0};a.fn.cycle.transitions.fadeZoom=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,false);g.cssBefore.left=f.cycleW/2;g.cssBefore.top=f.cycleH/2;a.extend(g.animIn,{top:0,left:0,width:f.cycleW,height:f.cycleH})});d.cssBefore.width=0;d.cssBefore.height=0;d.animOut.opacity=0};a.fn.cycle.transitions.blindX=function(b,c,d){var e=b.css("overflow","hidden").width();d.before.push(function(f,g,h){a.fn.cycle.commonReset(f,g,h);h.animIn.width=g.cycleW;h.animOut.left=f.cycleW});d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.blindY=function(b,c,e){var d=b.css("overflow","hidden").height();e.before.push(function(f,g,h){a.fn.cycle.commonReset(f,g,h);h.animIn.height=g.cycleH;h.animOut.top=f.cycleH});e.cssBefore.top=d;e.cssBefore.left=0;e.animIn.top=0;e.animOut.top=d};a.fn.cycle.transitions.blindZ=function(b,c,e){var d=b.css("overflow","hidden").height();var f=b.width();e.before.push(function(g,h,i){a.fn.cycle.commonReset(g,h,i);i.animIn.height=h.cycleH;i.animOut.top=g.cycleH});e.cssBefore.top=d;e.cssBefore.left=f;e.animIn.top=0;e.animIn.left=0;e.animOut.top=d;e.animOut.left=f};a.fn.cycle.transitions.growX=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true);g.cssBefore.left=this.cycleW/2;g.animIn.left=0;g.animIn.width=this.cycleW;g.animOut.left=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.growY=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false);g.cssBefore.top=this.cycleH/2;g.animIn.top=0;g.animIn.height=this.cycleH;g.animOut.top=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.curtainX=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,false,true,true);g.cssBefore.left=f.cycleW/2;g.animIn.left=0;g.animIn.width=this.cycleW;g.animOut.left=e.cycleW/2;g.animOut.width=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.curtainY=function(b,c,d){d.before.push(function(e,f,g){a.fn.cycle.commonReset(e,f,g,true,false,true);g.cssBefore.top=f.cycleH/2;g.animIn.top=0;g.animIn.height=f.cycleH;g.animOut.top=e.cycleH/2;g.animOut.height=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.cover=function(b,c,g){var e=g.direction||"left";var i=b.css("overflow","hidden").width();var f=b.height();g.before.push(function(d,h,j){a.fn.cycle.commonReset(d,h,j);if(e=="right"){j.cssBefore.left=-i}else{if(e=="up"){j.cssBefore.top=f}else{if(e=="down"){j.cssBefore.top=-f}else{j.cssBefore.left=i}}}});g.animIn.left=0;g.animIn.top=0;g.cssBefore.top=0;g.cssBefore.left=0};a.fn.cycle.transitions.uncover=function(b,c,g){var e=g.direction||"left";var i=b.css("overflow","hidden").width();var f=b.height();g.before.push(function(d,h,j){a.fn.cycle.commonReset(d,h,j,true,true,true);if(e=="right"){j.animOut.left=i}else{if(e=="up"){j.animOut.top=-f}else{if(e=="down"){j.animOut.top=f}else{j.animOut.left=-i}}}});g.animIn.left=0;g.animIn.top=0;g.cssBefore.top=0;g.cssBefore.left=0};a.fn.cycle.transitions.toss=function(b,c,e){var f=b.css("overflow","visible").width();var d=b.height();e.before.push(function(g,h,i){a.fn.cycle.commonReset(g,h,i,true,true,true);if(!i.animOut.left&&!i.animOut.top){a.extend(i.animOut,{left:f*2,top:-d/2,opacity:0})}else{i.animOut.opacity=0}});e.cssBefore.left=0;e.cssBefore.top=0;e.animIn.left=0};a.fn.cycle.transitions.wipe=function(c,e,n){var u=c.css("overflow","hidden").width();var j=c.height();n.cssBefore=n.cssBefore||{};var g;if(n.clip){if(/l2r/.test(n.clip)){g="rect(0px 0px "+j+"px 0px)"}else{if(/r2l/.test(n.clip)){g="rect(0px "+u+"px "+j+"px "+u+"px)"}else{if(/t2b/.test(n.clip)){g="rect(0px "+u+"px 0px 0px)"}else{if(/b2t/.test(n.clip)){g="rect("+j+"px "+u+"px "+j+"px 0px)"}else{if(/zoom/.test(n.clip)){var s=parseInt(j/2);var m=parseInt(u/2);g="rect("+s+"px "+m+"px "+s+"px "+m+"px)"}}}}}}n.cssBefore.clip=n.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var i=n.cssBefore.clip.match(/(\d+)/g);var q=parseInt(i[0]),o=parseInt(i[1]),f=parseInt(i[2]),k=parseInt(i[3]);n.before.push(function(l,t,v){if(l==t){return}var b=a(l),d=a(t);a.fn.cycle.commonReset(l,t,v,true,true,false);v.cssAfter.display="block";var w=1,h=parseInt((v.speedIn/13))-1;(function r(){var A=q?q-parseInt(w*(q/h)):0;var y=k?k-parseInt(w*(k/h)):0;var x=f<j?f+parseInt(w*((j-f)/h||1)):j;var z=o<u?o+parseInt(w*((u-o)/h||1)):u;d.css({clip:"rect("+A+"px "+z+"px "+x+"px "+y+"px)"});(w++<=h)?setTimeout(r,13):b.css("display","none")})()});a.extend(n.cssBefore,{display:"block",opacity:1,top:0,left:0});n.animIn={left:0};n.animOut={left:0}}})(jQuery);(function(a){a.fn.simplyScroll=function(c){return this.each(function(){new a.simplyScroll(this,c)})};var b={className:"simply-scroll",frameRate:24,speed:1,horizontal:true,autoMode:"off",loopOverload:0,pauseOnHover:true,localJsonSource:"",flickrFeed:"",jsonImgWidth:240,jsonImgHeight:180};a.simplyScroll=function(c,d){var e=this;this.o=a.extend({},b,d||{});this.auto=this.o.autoMode!=="off"?true:false;this.$list=$j(c);this.$list.addClass("simply-scroll-list").wrap('<div class="simply-scroll-clip"></div>').parent().wrap('<div class="'+this.o.className+' simply-scroll-container"></div>');if(!this.o.auto){this.$list.parent().parent().prepend('<div class="simply-scroll-forward"></div>').prepend('<div class="simply-scroll-back"></div>')}if(this.o.flickrFeed){a.getJSON(this.o.flickrFeed+"&format=json&jsoncallback=?",function(f){json=[];a.each(f.items,function(g,h){json.push({src:h.media.m,title:h.title,link:h.link})});e.renderData(json)})}else{if(this.o.localJsonSource){a.getJSON(this.o.localJsonSource,function(f){e.renderData(f)})}else{$j(window).load(function(){e.init()})}}};a.simplyScroll.fn=a.simplyScroll.prototype={};a.simplyScroll.fn.extend=a.simplyScroll.extend=a.extend;a.simplyScroll.fn.extend({init:function(){this.$items=this.$list.children();this.$clip=this.$list.parent();this.$container=this.$clip.parent();if(!this.o.horizontal){this.itemMax=this.$items.eq(0).height();this.clipMax=this.$clip.height();this.dimension="height";this.moveBackClass="simply-scroll-btn-up";this.moveForwardClass="simply-scroll-btn-down"}else{this.itemMax=this.$items.eq(0).width();this.clipMax=this.$clip.width();this.dimension="width";this.moveBackClass="simply-scroll-btn-left";this.moveForwardClass="simply-scroll-btn-right"}this.posMin=0;this.posMax=this.$items.length*this.itemMax;this.$list.css(this.dimension,this.posMax+"px");if(this.o.autoMode=="loop"){var c=Math.ceil(this.clipMax/this.itemMax)+this.o.loopOverload;this.$items.slice(0,c).clone(true).appendTo(this.$list);this.posMax+=(this.clipMax-this.o.speed);this.$list.css(this.dimension,this.posMax+(this.itemMax*c)+"px")}this.interval=null;this.intervalDelay=Math.floor(1000/this.o.frameRate);while(this.itemMax%this.o.speed!==0){this.o.speed--;if(this.o.speed===0){this.o.speed=1;break}}var d=this;this.trigger=null;this.funcMoveBack=function(){d.trigger=this;d.moveBack()};this.funcMoveForward=function(){d.trigger=this;d.moveForward()};this.funcMoveStop=function(){d.moveStop()};this.funcMoveResume=function(){d.moveResume()};if(this.auto){if(this.o.pauseOnHover){this.$clip.hover(this.funcMoveStop,this.funcMoveResume)}this.moveForward()}else{this.$btnBack=$j(".simply-scroll-back",this.$container).addClass("simply-scroll-btn "+this.moveBackClass+" disabled").hover(this.funcMoveBack,this.funcMoveStop);this.$btnForward=$j(".simply-scroll-forward",this.$container).addClass("simply-scroll-btn "+this.moveForwardClass).hover(this.funcMoveForward,this.funcMoveStop)}},moveForward:function(){var c=this;this.movement="forward";if(this.trigger!==null){this.$btnBack.removeClass("disabled")}c.interval=setInterval(function(){if(!c.o.horizontal&&c.$clip[0].scrollTop<(c.posMax-c.clipMax)){c.$clip[0].scrollTop+=c.o.speed}else{if(c.o.horizontal&&c.$clip[0].scrollLeft<(c.posMax-c.clipMax)){c.$clip[0].scrollLeft+=c.o.speed}else{if(c.o.autoMode=="loop"){c.resetPos()}else{c.moveStop(c.movement)}}}},c.intervalDelay)},moveBack:function(){var c=this;this.movement="back";if(this.trigger!==null){this.$btnForward.removeClass("disabled")}c.interval=setInterval(function(){if(!c.o.horizontal&&c.$clip[0].scrollTop>0){c.$clip[0].scrollTop-=c.o.speed}else{if(c.o.horizontal&&c.$clip[0].scrollLeft>0){c.$clip[0].scrollLeft-=c.o.speed}else{if(c.o.autoMode=="loop"){c.resetPos()}else{c.moveStop(c.movement)}}}},c.intervalDelay)},moveStop:function(c){clearInterval(this.interval);if(this.trigger!==null){if(typeof c!="undefined"){$j(this.trigger).addClass("disabled")}this.trigger=null}if(this.auto){if(this.o.autoMode=="bounce"){c=="forward"?this.moveBack():this.moveForward()}}},moveResume:function(){this.movement=="forward"?this.moveForward():this.moveBack()},resetPos:function(){if(!this.o.horizontal){this.$clip[0].scrollTop=0}else{this.$clip[0].scrollLeft=0}},renderData:function(c){if(c.length>0){var d=this;a.each(c,function(e,f){$j("<img/>").attr({src:f.src,title:f.title,alt:f.title,width:d.o.jsonImgWidth,height:d.o.jsonImgHeight}).appendTo(d.$list)});this.init()}}})})(jQuery);(function(a,B,ae){var A={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,fastIframe:true,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:false},z="colorbox",Y="cbox",x=Y+"Element",I=Y+"_open",H=Y+"_load",F=Y+"_complete",D=Y+"_cleanup",E=Y+"_closed",J=Y+"_purge",O=a.browser.msie&&!a.support.opacity,P=O&&a.browser.version<7,G=Y+"_IE6",n,c,v,e,t,i,q,b,p,u,j,k,l,s,f,r,m,o,d,h,ab,M,N,S,T,C,L,X,W,w,y,K,U,Z;function g(ah,af,ag){ag=B.createElement("div");if(ah){ag.id=Y+ah}ag.style.cssText=af||"";return a(ag)}function aa(ag,af){return Math.round((/%/.test(ag)?((af==="x"?u.width():u.height())/100):1)*parseInt(ag,10))}function Q(af){return ab.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(af)}function V(af){ab=a.extend({},a.data(C,z));for(af in ab){if(a.isFunction(ab[af])&&af.substring(0,2)!=="on"){ab[af]=ab[af].call(C)}}ab.rel=ab.rel||C.rel||"nofollow";ab.href=ab.href||a(C).attr("href");ab.title=ab.title||C.title;if(typeof ab.href==="string"){ab.href=a.trim(ab.href)}}function ad(ag,af){if(af){af.call(C)}a.event.trigger(ag)}function ac(){var ak,af=Y+"Slideshow_",ah="click."+Y,ai,aj,ag;if(ab.slideshow&&p[1]){ai=function(){r.text(ab.slideshowStop).unbind(ah).bind(F,function(){if(L<p.length-1||ab.loop){ak=setTimeout(Z.next,ab.slideshowSpeed)}}).bind(H,function(){clearTimeout(ak)}).one(ah+" "+D,aj);c.removeClass(af+"off").addClass(af+"on");ak=setTimeout(Z.next,ab.slideshowSpeed)};aj=function(){clearTimeout(ak);r.text(ab.slideshowStart).unbind([F,H,D,ah].join(" ")).one(ah,ai);c.removeClass(af+"on").addClass(af+"off")};if(ab.slideshowAuto){ai()}else{aj()}}else{c.removeClass(af+"off "+af+"on")}}function R(ag){if(!y){C=ag;V();p=a(C);L=0;if(ab.rel!=="nofollow"){p=a("."+x).filter(function(){var ah=a.data(this,z).rel||this.rel;return(ah===ab.rel)});L=p.index(C);if(L===-1){p=p.add(C);L=p.length-1}}if(!W){W=w=true;c.show();if(ab.returnFocus){try{C.blur();a(C).one(E,function(){try{this.focus()}catch(ah){}})}catch(af){}}n.css({opacity:+ab.opacity,cursor:ab.overlayClose?"pointer":"auto"}).show();ab.w=aa(ab.initialWidth,"x");ab.h=aa(ab.initialHeight,"y");Z.position();if(P){u.bind("resize."+G+" scroll."+G,function(){n.css({width:u.width(),height:u.height(),top:u.scrollTop(),left:u.scrollLeft()})}).trigger("resize."+G)}ad(I,ab.onOpen);h.add(s).hide();d.html(ab.close).show()}Z.load(true)}}Z=a.fn[z]=a[z]=function(ah,ag){var af=this;ah=ah||{};if(!af[0]){if(af.selector){return af}af=a("<a/>");ah.open=true}if(ag){ah.onComplete=ag}af.each(function(){a.data(this,z,a.extend({},a.data(this,z)||A,ah));a(this).addClass(x)});if((a.isFunction(ah.open)&&ah.open.call(af))||ah.open){R(af[0])}return af};Z.init=function(){u=a(ae);c=g().attr({id:z,"class":O?Y+(P?"IE6":"IE"):""});n=g("Overlay",P?"position:absolute":"").hide();v=g("Wrapper");e=g("Content").append(j=g("LoadedContent","width:0; height:0; overflow:hidden"),l=g("LoadingOverlay").add(g("LoadingGraphic")),s=g("Title"),f=g("Current"),m=g("Next"),o=g("Previous"),r=g("Slideshow").bind(I,ac),d=g("Close"));v.append(g().append(g("TopLeft"),t=g("TopCenter"),g("TopRight")),g(false,"clear:left").append(i=g("MiddleLeft"),e,q=g("MiddleRight")),g(false,"clear:left").append(g("BottomLeft"),b=g("BottomCenter"),g("BottomRight"))).children().children().css({"float":"left"});k=g(false,"position:absolute; width:9999px; visibility:hidden; display:none");a("body").prepend(n,c.append(v,k));e.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover");M=t.height()+b.height()+e.outerHeight(true)-e.height();N=i.width()+q.width()+e.outerWidth(true)-e.width();S=j.outerHeight(true);T=j.outerWidth(true);c.css({"padding-bottom":M,"padding-right":N}).hide();m.click(function(){Z.next()});o.click(function(){Z.prev()});d.click(function(){Z.close()});h=m.add(o).add(f).add(r);e.children().removeClass("hover");n.click(function(){if(ab.overlayClose){Z.close()}});a(B).bind("keydown."+Y,function(af){var ag=af.keyCode;if(W&&ab.escKey&&ag===27){af.preventDefault();Z.close()}if(W&&ab.arrowKey&&p[1]){if(ag===37){af.preventDefault();o.click()}else{if(ag===39){af.preventDefault();m.click()}}}})};Z.remove=function(){c.add(n).remove();a("."+x).removeData(z).removeClass(x)};Z.position=function(ai,ag){var aj=0,af=0;u.unbind("resize."+Y);c.hide();if(ab.fixed&&!P){c.css({position:"fixed"})}else{aj=u.scrollTop();af=u.scrollLeft();c.css({position:"absolute"})}if(ab.right!==false){af+=Math.max(u.width()-ab.w-T-N-aa(ab.right,"x"),0)}else{if(ab.left!==false){af+=aa(ab.left,"x")}else{af+=Math.round(Math.max(u.width()-ab.w-T-N,0)/2)}}if(ab.bottom!==false){aj+=Math.max(B.documentElement.clientHeight-ab.h-S-M-aa(ab.bottom,"y"),0)}else{if(ab.top!==false){aj+=aa(ab.top,"y")}else{aj+=Math.round(Math.max(B.documentElement.clientHeight-ab.h-S-M,0)/2)}}c.show();ai=(c.width()===ab.w+T&&c.height()===ab.h+S)?0:ai||0;v[0].style.width=v[0].style.height="9999px";function ah(ak){t[0].style.width=b[0].style.width=e[0].style.width=ak.style.width;l[0].style.height=l[1].style.height=e[0].style.height=i[0].style.height=q[0].style.height=ak.style.height}c.dequeue().animate({width:ab.w+T,height:ab.h+S,top:aj,left:af},{duration:ai,complete:function(){ah(this);w=false;v[0].style.width=(ab.w+T+N)+"px";v[0].style.height=(ab.h+S+M)+"px";if(ag){ag()}setTimeout(function(){u.bind("resize."+Y,Z.position)},1)},step:function(){ah(this)}})};Z.resize=function(ag){if(W){ag=ag||{};if(ag.width){ab.w=aa(ag.width,"x")-T-N}if(ag.innerWidth){ab.w=aa(ag.innerWidth,"x")}j.css({width:ab.w});if(ag.height){ab.h=aa(ag.height,"y")-S-M}if(ag.innerHeight){ab.h=aa(ag.innerHeight,"y")}if(!ag.innerHeight&&!ag.height){var af=j.wrapInner("<div style='overflow:auto'></div>").children();ab.h=af.height();af.replaceWith(af.children())}j.css({height:ab.h});Z.position(ab.transition==="none"?0:ab.speed)}};Z.prep=function(ai){if(!W){return}var af,aj=ab.transition==="none"?0:ab.speed;j.remove();j=g("LoadedContent").append(ai);function ah(){ab.w=ab.w||j.width();ab.w=ab.mw&&ab.mw<ab.w?ab.mw:ab.w;return ab.w}function ag(){ab.h=ab.h||j.height();ab.h=ab.mh&&ab.mh<ab.h?ab.mh:ab.h;return ab.h}j.hide().appendTo(k.show()).css({width:ah(),overflow:ab.scrolling?"auto":"hidden"}).css({height:ag()}).prependTo(e);k.hide();a(X).css({"float":"none"});if(P){a("select").not(c.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(D,function(){this.style.visibility="inherit"})}af=function(){var ao,ap,am,an,ar=p.length,al,ak;if(!W){return}function aq(){if(O){c[0].style.removeAttribute("filter")}}ak=function(){clearTimeout(U);l.hide();ad(F,ab.onComplete)};if(O){if(X){j.fadeIn(100)}}s.html(ab.title).add(j).show();if(ar>1){if(typeof ab.current==="string"){f.html(ab.current.replace("{current}",L+1).replace("{total}",ar)).show()}m[(ab.loop||L<ar-1)?"show":"hide"]().html(ab.next);o[(ab.loop||L)?"show":"hide"]().html(ab.previous);ao=L?p[L-1]:p[ar-1];am=L<ar-1?p[L+1]:p[0];if(ab.slideshow){r.show()}if(ab.preloading){an=a.data(am,z).href||am.href;ap=a.data(ao,z).href||ao.href;an=a.isFunction(an)?an.call(am):an;ap=a.isFunction(ap)?ap.call(ao):ap;if(Q(an)){a("<img/>")[0].src=an}if(Q(ap)){a("<img/>")[0].src=ap}}}else{h.hide()}if(ab.iframe){al=a("<iframe/>").addClass(Y+"Iframe")[0];if(ab.fastIframe){ak()}else{a(al).one("load",ak)}al.name=Y+(+new Date());al.src=ab.href;if(!ab.scrolling){al.scrolling="no"}if(O){al.frameBorder=0;al.allowTransparency="true"}a(al).appendTo(j).one(J,function(){al.src="//about:blank"})}else{ak()}if(ab.transition==="fade"){c.fadeTo(aj,1,aq)}else{aq()}};if(ab.transition==="fade"){c.fadeTo(aj,0,function(){Z.position(0,af)})}else{Z.position(aj,af)}};Z.load=function(ag){var af,ai,ah=Z.prep;w=true;X=false;C=p[L];if(!ag){V()}ad(J);ad(H,ab.onLoad);ab.h=ab.height?aa(ab.height,"y")-S-M:ab.innerHeight&&aa(ab.innerHeight,"y");ab.w=ab.width?aa(ab.width,"x")-T-N:ab.innerWidth&&aa(ab.innerWidth,"x");ab.mw=ab.w;ab.mh=ab.h;if(ab.maxWidth){ab.mw=aa(ab.maxWidth,"x")-T-N;ab.mw=ab.w&&ab.w<ab.mw?ab.w:ab.mw}if(ab.maxHeight){ab.mh=aa(ab.maxHeight,"y")-S-M;ab.mh=ab.h&&ab.h<ab.mh?ab.h:ab.mh}af=ab.href;U=setTimeout(function(){l.show()},100);if(ab.inline){g().hide().insertBefore(a(af)[0]).one(J,function(){a(this).replaceWith(j.children())});ah(a(af))}else{if(ab.iframe){ah(" ")}else{if(ab.html){ah(ab.html)}else{if(Q(af)){a(X=new Image()).addClass(Y+"Photo").error(function(){ab.title=false;ah(g("Error").text("This image could not be loaded"))}).load(function(){var aj;X.onload=null;if(ab.scalePhotos){ai=function(){X.height-=X.height*aj;X.width-=X.width*aj};if(ab.mw&&X.width>ab.mw){aj=(X.width-ab.mw)/X.width;ai()}if(ab.mh&&X.height>ab.mh){aj=(X.height-ab.mh)/X.height;ai()}}if(ab.h){X.style.marginTop=Math.max(ab.h-X.height,0)/2+"px"}if(p[1]&&(L<p.length-1||ab.loop)){X.style.cursor="pointer";X.onclick=function(){Z.next()}}if(O){X.style.msInterpolationMode="bicubic"}setTimeout(function(){ah(X)},1)});setTimeout(function(){X.src=af},1)}else{if(af){k.load(af,ab.data,function(aj,ak,al){ah(ak==="error"?g("Error").text("Request unsuccessful: "+al.statusText):a(this).contents())})}}}}}};Z.next=function(){if(!w&&p[1]&&(L<p.length-1||ab.loop)){L=L<p.length-1?L+1:0;Z.load()}};Z.prev=function(){if(!w&&p[1]&&(L||ab.loop)){L=L?L-1:p.length-1;Z.load()}};Z.close=function(){if(W&&!y){y=true;W=false;ad(D,ab.onCleanup);u.unbind("."+Y+" ."+G);n.fadeTo(200,0);c.stop().fadeTo(300,0,function(){c.add(n).css({opacity:1,cursor:"auto"}).hide();ad(J);j.remove();setTimeout(function(){y=false;ad(E,ab.onClosed)},1)})}};Z.element=function(){return a(C)};Z.settings=A;K=function(af){if(!((af.button!==0&&typeof af.button!=="undefined")||af.ctrlKey||af.shiftKey||af.altKey)){af.preventDefault();R(this)}};if(a.fn.delegate){a(B).delegate("."+x,"click",K)}else{a("."+x).live("click",K)}a(Z.init)}(jQuery,document,this));(function(a){a.cluetip={version:"1.0.6"};var b,d,e,f,c,g,h,i;a.fn.cluetip=function(l,m){if(typeof l=="object"){m=l;l=null}if(l=="destroy"){return this.removeData("thisInfo").unbind(".cluetip")}return this.each(function(A){var C=this,n=a(this);var L=a.extend(true,{},a.fn.cluetip.defaults,m||{},a.metadata?n.metadata():a.meta?n.data():{});var s=false;var u=+L.cluezIndex;n.data("thisInfo",{title:C.title,zIndex:u});var B=false,q=0;if(!a("#cluetip").length){a(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>',"</div>",'<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>',"</div>"].join(""))[k](j).hide();b=a("#cluetip").css({position:"absolute"});e=a("#cluetip-outer").css({position:"relative",zIndex:u});d=a("#cluetip-inner");f=a("#cluetip-title");c=a("#cluetip-arrows");g=a('<div id="cluetip-waitimage"></div>').css({position:"absolute"}).insertBefore(b).hide()}var x=(L.dropShadow)?+L.dropShadowSteps:0;if(!h){h=a([]);for(var y=0;y<x;y++){h=h.add(a("<div></div>").css({zIndex:u-1,opacity:0.1,top:1+y,left:1+y}))}h.css({position:"absolute",backgroundColor:"#000"}).prependTo(b)}var Q=n.attr(L.attribute),v=L.cluetipClass;if(!Q&&!L.splitTitle&&!l){return true}if(L.local&&L.localPrefix){Q=L.localPrefix+Q}if(L.local&&L.hideLocal){a(Q+":first").hide()}var Y=parseInt(L.topOffset,10),H=parseInt(L.leftOffset,10);var R,Z,w=isNaN(parseInt(L.height,10))?"auto":(/\D/g).test(L.height)?L.height:L.height+"px";var P,E,M,T,I,p;var S=parseInt(L.width,10)||275,W=S+(parseInt(b.css("paddingLeft"),10)||0)+(parseInt(b.css("paddingRight"),10)||0)+x,F=this.offsetWidth,D,N,X,K,aa;var U;var V=(L.attribute!="title")?n.attr(L.titleAttribute):"";if(L.splitTitle){if(V==undefined){V=""}U=V.split(L.splitTitle);V=U.shift()}if(L.escapeTitle){V=V.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;")}var G;function O(){return false}var o=function(ae){if(!L.onActivate(n)){return false}B=true;b.removeClass().css({width:S});if(Q==n.attr("href")){n.css("cursor",L.cursor)}if(L.hoverClass){n.addClass(L.hoverClass)}E=M=n.offset().top;D=n.offset().left;K=ae.pageX;I=ae.pageY;if(C.tagName.toLowerCase()!="area"){P=a(document).scrollTop();aa=a(window).width()}if(L.positionBy=="fixed"){N=F+D+H;b.css({left:N})}else{N=(F>D&&D>W)||D+F+W+H>aa?D-W-H:F+D+H;if(C.tagName.toLowerCase()=="area"||L.positionBy=="mouse"||F+W>aa){if(K+20+W>aa){b.addClass(" cluetip-"+v);N=(K-W-H)>=0?K-W-H-parseInt(b.css("marginLeft"),10)+parseInt(d.css("marginRight"),10):K-(W/2)}else{N=K+H}}var ak=N<0?ae.pageY+Y:ae.pageY;b.css({left:(N>0&&L.positionBy!="bottomTop")?N:(K+(W/2)>aa)?aa/2-W/2:Math.max(K-(W/2),0),zIndex:n.data("thisInfo").zIndex});c.css({zIndex:n.data("thisInfo").zIndex+1})}Z=a(window).height();if(l){if(typeof l=="function"){l=l.call(C)}d.html(l);t(ak)}else{if(U){var al=U.length;d.html(al?U[0]:"");if(al>1){for(var af=1;af<al;af++){d.append('<div class="split-body">'+U[af]+"</div>")}}t(ak)}else{if(!L.local&&Q.indexOf("#")!==0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(Q)){d.html('<img src="'+Q+'" alt="'+V+'" />');t(ak)}else{if(s&&L.ajaxCache){d.html(s);t(ak)}else{var ag=L.ajaxSettings.beforeSend,ai=L.ajaxSettings.error,aj=L.ajaxSettings.success,ah=L.ajaxSettings.complete;var ad={cache:false,url:Q,beforeSend:function(am){if(ag){ag.call(C,am,b,d)}e.children().empty();if(L.waitImage){g.css({top:I+20,left:K+20,zIndex:n.data("thisInfo").zIndex-1}).show()}},error:function(an,am){if(B){if(ai){ai.call(C,an,am,b,d)}else{d.html("<i>sorry, the contents could not be loaded</i>")}}},success:function(am,an){s=L.ajaxProcess.call(C,am);if(B){if(aj){aj.call(C,am,an,b,d)}d.html(s)}},complete:function(an,am){if(ah){ah.call(C,an,am,b,d)}i=a("#cluetip-inner img").length;if(i&&!a.browser.opera){a("#cluetip-inner img").bind("load error",function(){i--;if(i<1){g.hide();if(B){t(ak)}}})}else{g.hide();if(B){t(ak)}}}};var ac=a.extend(true,{},L.ajaxSettings,ad);a.ajax(ac)}}}else{if(L.local){var ab=a(Q+(/#\S+$/.test(Q)?"":":eq("+A+")")).clone(true).show();d.html(ab);t(ak)}}}}};var t=function(ae){b.addClass("cluetip-"+v);if(L.truncate){var ac=d.text().slice(0,L.truncate)+"...";d.html(ac)}function ag(){}V?f.show().html(V):(L.showTitle)?f.show().html("&nbsp;"):f.hide();if(L.sticky){var ab=a('<div id="cluetip-close"><a href="#">'+L.closeText+"</a></div>");(L.closePosition=="bottom")?ab.appendTo(d):(L.closePosition=="title")?ab.prependTo(f):ab.prependTo(d);ab.bind("click.cluetip",function(){r();return false});if(L.mouseOutClose){b.bind("mouseleave.cluetip",function(){r()})}else{b.unbind("mouseleave.cluetip")}}var af="";e.css({zIndex:n.data("thisInfo").zIndex,overflow:w=="auto"?"visible":"auto",height:w});R=w=="auto"?Math.max(b.outerHeight(),b.height()):parseInt(w,10);T=M;p=P+Z;if(L.positionBy=="fixed"){T=M-L.dropShadowSteps+Y}else{if((N<K&&Math.max(N,0)+W>K)||L.positionBy=="bottomTop"){if(M+R+Y>p&&I-P>R+Y){T=I-R-Y;af="top"}else{T=I+Y;af="bottom"}}else{if(M+R+Y>p){T=(R>=Z)?P:p-R-Y}else{if(n.css("display")=="block"||C.tagName.toLowerCase()=="area"||L.positionBy=="mouse"){T=ae-Y}else{T=M-L.dropShadowSteps}}}}if(af==""){N<D?af="left":af="right"}b.css({top:T+"px"}).removeClass().addClass("clue-"+af+"-"+v).addClass(" cluetip-"+v);if(L.arrows){var ad=(M-T-L.dropShadowSteps);c.css({top:(/(left|right)/.test(af)&&N>=0&&ad>0)?ad+"px":/(left|right)/.test(af)?0:""}).show()}else{c.hide()}h.hide();b.hide()[L.fx.open](L.fx.openSpeed||0);if(L.dropShadow){h.css({height:R,width:S,zIndex:n.data("thisInfo").zIndex-1}).show()}if(a.fn.bgiframe){b.bgiframe()}if(L.delayedClose>0){q=setTimeout(r,L.delayedClose)}L.onShow.call(C,b,d)};var z=function(ab){B=false;g.hide();if(!L.sticky||(/click|toggle/).test(L.activation)){r();clearTimeout(q)}if(L.hoverClass){n.removeClass(L.hoverClass)}};var r=function(){e.parent().hide().removeClass();L.onHide.call(C,b,d);n.removeClass("cluetip-clicked");if(V){n.attr(L.titleAttribute,V)}n.css("cursor","");if(L.arrows){c.css({top:""})}};a(document).bind("hideCluetip",function(ab){r()});if((/click|toggle/).test(L.activation)){n.bind("click.cluetip",function(ab){if(b.is(":hidden")||!n.is(".cluetip-clicked")){o(ab);a(".cluetip-clicked").removeClass("cluetip-clicked");n.addClass("cluetip-clicked")}else{z(ab)}this.blur();return false})}else{if(L.activation=="focus"){n.bind("focus.cluetip",function(ab){o(ab)});n.bind("blur.cluetip",function(ab){z(ab)})}else{n[L.clickThrough?"unbind":"bind"]("click",O);var J=function(ab){if(L.tracking==true){var ad=N-ab.pageX;var ac=T?T-ab.pageY:M-ab.pageY;n.bind("mousemove.cluetip",function(ae){b.css({left:ae.pageX+ad,top:ae.pageY+ac})})}};if(a.fn.hoverIntent&&L.hoverIntent){n.hoverIntent({sensitivity:L.hoverIntent.sensitivity,interval:L.hoverIntent.interval,over:function(ab){o(ab);J(ab)},timeout:L.hoverIntent.timeout,out:function(ab){z(ab);n.unbind("mousemove.cluetip")}})}else{n.bind("mouseenter.cluetip",function(ab){o(ab);J(ab)}).bind("mouseleave.cluetip",function(ab){z(ab);n.unbind("mousemove.cluetip")})}n.bind("mouseover.cluetip",function(ab){n.attr("title","")}).bind("mouseleave.cluetip",function(ab){n.attr("title",n.data("thisInfo").title)})}}})};a.fn.cluetip.defaults={width:275,height:"auto",cluezIndex:97,positionBy:"auto",topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:"rel",titleAttribute:"title",splitTitle:"",escapeTitle:false,showTitle:true,cluetipClass:"default",hoverClass:"",waitImage:true,cursor:"help",arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:"hover",clickThrough:false,tracking:false,delayedClose:0,closePosition:"top",closeText:"Close",truncate:0,fx:{open:"show",openSpeed:""},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(l){return true},onShow:function(m,l){},onHide:function(m,l){},ajaxCache:true,ajaxProcess:function(l){l=l.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,"").replace(/<(link|meta)[^>]+>/g,"");return l},ajaxSettings:{dataType:"html"},debug:false};var k="appendTo",j="body";a.cluetip.setup=function(l){if(l&&l.insertionType&&(l.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){k=l.insertionType}if(l&&l.insertionElement){j=l.insertionElement}}})(jQuery);(function(a){function h(ar,s,U){var ah=[],T={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{mode:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null},yaxis:{autoscaleMargin:0.02},x2axis:{autoscaleMargin:null},y2axis:{autoscaleMargin:0.02},points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff"},lines:{show:false,lineWidth:2,fill:false,fillColor:null},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left"},grid:{color:"#545454",backgroundColor:null,tickColor:"#dddddd",labelMargin:5,borderWidth:2,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},selection:{mode:null,color:"#e8cfac"},shadowSize:4},k=null,V=null,C=null,r=null,N=null,aq=ar,j={xaxis:{},yaxis:{},x2axis:{},y2axis:{}},Z={left:0,right:0,top:0,bottom:0},n=0,m=0,aa=0,Y=0,ay={};this.setData=ai;this.setupGrid=ap;this.draw=t;this.clearSelection=o;this.setSelection=al;this.getCanvas=function(){return k};this.getPlotOffset=function(){return Z};this.getData=function(){return ah};this.getAxes=function(){return j};this.highlight=G;this.unhighlight=aw;X(U);ai(s);q();ap();t();function ai(az){ah=W(az);E();ac()}function W(az){var aB=[];for(var aA=0;aA<az.length;++aA){var aC;if(az[aA].data){aC={};for(var aD in az[aA]){aC[aD]=az[aA][aD]}}else{aC={data:az[aA]}}aB.push(aC)}return aB}function X(az){a.extend(true,T,az);if(T.xaxis.noTicks&&T.xaxis.ticks==null){T.xaxis.ticks=T.xaxis.noTicks}if(T.yaxis.noTicks&&T.yaxis.ticks==null){T.yaxis.ticks=T.yaxis.noTicks}if(T.grid.coloredAreas){T.grid.markings=T.grid.coloredAreas}if(T.grid.coloredAreasColor){T.grid.markingsColor=T.grid.coloredAreasColor}}function E(){var aE;var aF=ah.length,aJ=[],az=[];for(aE=0;aE<ah.length;++aE){var aH=ah[aE].color;if(aH!=null){--aF;if(typeof aH=="number"){az.push(aH)}else{aJ.push(g(ah[aE].color))}}}for(aE=0;aE<az.length;++aE){aF=Math.max(aF,az[aE]+1)}var aC=[],aK=0;aE=0;while(aC.length<aF){var aA;if(T.colors.length==aE){aA=new c(100,100,100)}else{aA=g(T.colors[aE])}var aI=aK%2==1?-1:1;var aD=1+aI*Math.ceil(aK/2)*0.2;aA.scale(aD,aD,aD);aC.push(aA);++aE;if(aE>=T.colors.length){aE=0;++aK}}var aB=0,aG;for(aE=0;aE<ah.length;++aE){aG=ah[aE];if(aG.color==null){aG.color=aC[aB].toString();++aB}else{if(typeof aG.color=="number"){aG.color=aC[aG.color].toString()}}aG.lines=a.extend(true,{},T.lines,aG.lines);aG.points=a.extend(true,{},T.points,aG.points);aG.bars=a.extend(true,{},T.bars,aG.bars);if(aG.shadowSize==null){aG.shadowSize=T.shadowSize}if(aG.xaxis&&aG.xaxis==2){aG.xaxis=j.x2axis}else{aG.xaxis=j.xaxis}if(aG.yaxis&&aG.yaxis==2){aG.yaxis=j.y2axis}else{aG.yaxis=j.yaxis}}}function ac(){var aJ=Number.POSITIVE_INFINITY,aC=Number.NEGATIVE_INFINITY,az;for(az in j){j[az].datamin=aJ;j[az].datamax=aC;j[az].used=false}for(var aE=0;aE<ah.length;++aE){var aD=ah[aE].data,aB=ah[aE].xaxis,aA=ah[aE].yaxis,aI=0,aH=0;if(ah[aE].bars.show){aI=ah[aE].bars.align=="left"?0:-ah[aE].bars.barWidth/2;aH=aI+ah[aE].bars.barWidth}aB.used=aA.used=true;for(var aG=0;aG<aD.length;++aG){if(aD[aG]==null){continue}var aK=aD[aG][0],aF=aD[aG][1];if(aK!=null&&!isNaN(aK=+aK)){if(aK+aI<aB.datamin){aB.datamin=aK+aI}if(aK+aH>aB.datamax){aB.datamax=aK+aH}}if(aF!=null&&!isNaN(aF=+aF)){if(aF<aA.datamin){aA.datamin=aF}if(aF>aA.datamax){aA.datamax=aF}}if(aK==null||aF==null||isNaN(aK)||isNaN(aF)){aD[aG]=null}}}for(az in j){if(j[az].datamin==aJ){j[az].datamin=0}if(j[az].datamax==aC){j[az].datamax=1}}}function q(){n=aq.width();m=aq.height();aq.html("");aq.css("position","relative");if(n<=0||m<=0){throw"Invalid dimensions for plot, width = "+n+", height = "+m}k=a('<canvas width="'+n+'" height="'+m+'"></canvas>').appendTo(aq).get(0);if(a.browser.msie){k=window.G_vmlCanvasManager.initElement(k)}r=k.getContext("2d");V=a('<canvas style="position:absolute;left:0px;top:0px;" width="'+n+'" height="'+m+'"></canvas>').appendTo(aq).get(0);if(a.browser.msie){V=window.G_vmlCanvasManager.initElement(V)}N=V.getContext("2d");C=a([V,k]);if(T.selection.mode!=null||T.grid.hoverable){C.each(function(){this.onmousemove=R});if(T.selection.mode!=null){C.mousedown(Q)}}if(T.grid.clickable){C.click(O)}}function ap(){function aA(aB,aC){ak(aB,aC);ab(aB,aC);ao(aB,aC);if(aB==j.xaxis||aB==j.x2axis){aB.p2c=function(aD){return(aD-aB.min)*aB.scale};aB.c2p=function(aD){return aB.min+aD/aB.scale}}else{aB.p2c=function(aD){return(aB.max-aD)*aB.scale};aB.c2p=function(aD){return aB.max-aD/aB.scale}}}for(var az in j){aA(j[az],T[az])}an();K();L()}function ak(az,aA){var aD=aA.min!=null?aA.min:az.datamin;var aC=aA.max!=null?aA.max:az.datamax;if(aC-aD==0){var aE;if(aC==0){aE=1}else{aE=0.01}aD-=aE;aC+=aE}else{var aB=aA.autoscaleMargin;if(aB!=null){if(aA.min==null){aD-=(aC-aD)*aB;if(aD<0&&az.datamin>=0){aD=0}}if(aA.max==null){aC+=(aC-aD)*aB;if(aC>0&&az.datamax<=0){aC=0}}}}az.min=aD;az.max=aC}function ab(az,aA){var aL;if(typeof aA.ticks=="number"&&aA.ticks>0){aL=aA.ticks}else{if(az==j.xaxis||az==j.x2axis){aL=n/100}else{aL=m/60}}var aC=(az.max-az.min)/aL;var aM,aF,aP,aE,aG,aH,aK;if(aA.mode=="time"){function aD(aR,aT,aW){var aV=function(aY){aY=""+aY;return aY.length==1?"0"+aY:aY};var aX=[];var aS=false;if(aW==null){aW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}for(var aU=0;aU<aT.length;++aU){var aQ=aT.charAt(aU);if(aS){switch(aQ){case"h":aQ=""+aR.getUTCHours();break;case"H":aQ=aV(aR.getUTCHours());break;case"M":aQ=aV(aR.getUTCMinutes());break;case"S":aQ=aV(aR.getUTCSeconds());break;case"d":aQ=""+aR.getUTCDate();break;case"m":aQ=""+(aR.getUTCMonth()+1);break;case"y":aQ=""+aR.getUTCFullYear();break;case"i":aQ=""+(aR.getUTCFullYear()+"").substring(2);break;case"b":aQ=""+aW[aR.getUTCMonth()];break}aX.push(aQ);aS=false}else{if(aQ=="%"){aS=true}else{aX.push(aQ)}}}return aX.join("")}var aO={second:1000,minute:60*1000,hour:60*60*1000,day:24*60*60*1000,month:30*24*60*60*1000,year:365.2425*24*60*60*1000};var aN=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var aJ=0;if(aA.minTickSize!=null){if(typeof aA.tickSize=="number"){aJ=aA.tickSize}else{aJ=aA.minTickSize[0]*aO[aA.minTickSize[1]]}}for(aG=0;aG<aN.length-1;++aG){if(aC<(aN[aG][0]*aO[aN[aG][1]]+aN[aG+1][0]*aO[aN[aG+1][1]])/2&&aN[aG][0]*aO[aN[aG][1]]>=aJ){break}}aM=aN[aG][0];aP=aN[aG][1];if(aP=="year"){aH=Math.pow(10,Math.floor(Math.log(aC/aO.year)/Math.LN10));aK=(aC/aO.year)/aH;if(aK<1.5){aM=1}else{if(aK<3){aM=2}else{if(aK<7.5){aM=5}else{aM=10}}}aM*=aH}if(aA.tickSize){aM=aA.tickSize[0];aP=aA.tickSize[1]}aF=function(aQ){var aX=[],aY=aQ.tickSize[0],aZ=aQ.tickSize[1],aS=new Date(aQ.min);var aW=aY*aO[aZ];if(aZ=="second"){aS.setUTCSeconds(e(aS.getUTCSeconds(),aY))}if(aZ=="minute"){aS.setUTCMinutes(e(aS.getUTCMinutes(),aY))}if(aZ=="hour"){aS.setUTCHours(e(aS.getUTCHours(),aY))}if(aZ=="month"){aS.setUTCMonth(e(aS.getUTCMonth(),aY))}if(aZ=="year"){aS.setUTCFullYear(e(aS.getUTCFullYear(),aY))}aS.setUTCMilliseconds(0);if(aW>=aO.minute){aS.setUTCSeconds(0)}if(aW>=aO.hour){aS.setUTCMinutes(0)}if(aW>=aO.day){aS.setUTCHours(0)}if(aW>=aO.day*4){aS.setUTCDate(1)}if(aW>=aO.year){aS.setUTCMonth(0)}var aR=0,a0=Number.NaN,aU;do{aU=a0;a0=aS.getTime();aX.push({v:a0,label:aQ.tickFormatter(a0,aQ)});if(aZ=="month"){if(aY<1){aS.setUTCDate(1);var aV=aS.getTime();aS.setUTCMonth(aS.getUTCMonth()+1);var aT=aS.getTime();aS.setTime(a0+aR*aO.hour+(aT-aV)*aY);aR=aS.getUTCHours();aS.setUTCHours(0)}else{aS.setUTCMonth(aS.getUTCMonth()+aY)}}else{if(aZ=="year"){aS.setUTCFullYear(aS.getUTCFullYear()+aY)}else{aS.setTime(a0+aW)}}}while(a0<aQ.max&&a0!=aU);return aX};aE=function(aU,aQ){var aR=new Date(aU);if(aA.timeformat!=null){return aD(aR,aA.timeformat,aA.monthNames)}var aT=aQ.tickSize[0]*aO[aQ.tickSize[1]];var aS=aQ.max-aQ.min;if(aT<aO.minute){fmt="%h:%M:%S"}else{if(aT<aO.day){if(aS<2*aO.day){fmt="%h:%M"}else{fmt="%b %d %h:%M"}}else{if(aT<aO.month){fmt="%b %d"}else{if(aT<aO.year){if(aS<aO.year){fmt="%b"}else{fmt="%b %y"}}else{fmt="%y"}}}}return aD(aR,fmt,aA.monthNames)}}else{var aI=aA.tickDecimals;var aB=-Math.floor(Math.log(aC)/Math.LN10);if(aI!=null&&aB>aI){aB=aI}aH=Math.pow(10,-aB);aK=aC/aH;if(aK<1.5){aM=1}else{if(aK<3){aM=2;if(aK>2.25&&(aI==null||aB+1<=aI)){aM=2.5;++aB}}else{if(aK<7.5){aM=5}else{aM=10}}}aM*=aH;if(aA.minTickSize!=null&&aM<aA.minTickSize){aM=aA.minTickSize}if(aA.tickSize!=null){aM=aA.tickSize}az.tickDecimals=Math.max(0,(aI!=null)?aI:aB);aF=function(aQ){var aU=[];var aT=e(aQ.min,aQ.tickSize),aR=0,aV=Number.NaN,aS;do{aS=aV;aV=aT+aR*aQ.tickSize;aU.push({v:aV,label:aQ.tickFormatter(aV,aQ)});++aR}while(aV<aQ.max&&aV!=aS);return aU};aE=function(aR,aQ){return aR.toFixed(aQ.tickDecimals)}}az.tickSize=aP?[aM,aP]:aM;az.tickGenerator=aF;if(a.isFunction(aA.tickFormatter)){az.tickFormatter=function(aR,aQ){return""+aA.tickFormatter(aR,aQ)}}else{az.tickFormatter=aE}if(aA.labelWidth!=null){az.labelWidth=aA.labelWidth}if(aA.labelHeight!=null){az.labelHeight=aA.labelHeight}}function ao(az,aA){az.ticks=[];if(!az.used){return}if(aA.ticks==null){az.ticks=az.tickGenerator(az)}else{if(typeof aA.ticks=="number"){if(aA.ticks>0){az.ticks=az.tickGenerator(az)}}else{if(aA.ticks){var aE=aA.ticks;if(a.isFunction(aE)){aE=aE({min:az.min,max:az.max})}var aB,aF;for(aB=0;aB<aE.length;++aB){var aC=null;var aD=aE[aB];if(typeof aD=="object"){aF=aD[0];if(aD.length>1){aC=aD[1]}}else{aF=aD}if(aC==null){aC=az.tickFormatter(aF,az)}az.ticks[aB]={v:aF,label:aC}}}}}if(aA.autoscaleMargin!=null&&az.ticks.length>0){if(aA.min==null){az.min=Math.min(az.min,az.ticks[0].v)}if(aA.max==null&&az.ticks.length>1){az.max=Math.min(az.max,az.ticks[az.ticks.length-1].v)}}}function an(){function aB(aC){if(aC.labelWidth==null){aC.labelWidth=n/6}if(aC.labelHeight==null){labels=[];for(i=0;i<aC.ticks.length;++i){l=aC.ticks[i].label;if(l){labels.push('<div class="tickLabel" style="float:left;width:'+aC.labelWidth+'px">'+l+"</div>")}}aC.labelHeight=0;if(labels.length>0){var aD=a('<div style="position:absolute;top:-10000px;width:10000px;font-size:smaller">'+labels.join("")+'<div style="clear:left"></div></div>').appendTo(aq);aC.labelHeight=aD.height();aD.remove()}}}function aA(aC){if(aC.labelWidth==null||aC.labelHeight==null){var aE,aG=[],aF;for(aE=0;aE<aC.ticks.length;++aE){aF=aC.ticks[aE].label;if(aF){aG.push('<div class="tickLabel">'+aF+"</div>")}}if(aG.length>0){var aD=a('<div style="position:absolute;top:-10000px;font-size:smaller">'+aG.join("")+"</div>").appendTo(aq);if(aC.labelWidth==null){aC.labelWidth=aD.width()}if(aC.labelHeight==null){aC.labelHeight=aD.find("div").height()}aD.remove()}if(aC.labelWidth==null){aC.labelWidth=0}if(aC.labelHeight==null){aC.labelHeight=0}}}aB(j.xaxis);aA(j.yaxis);aB(j.x2axis);aA(j.y2axis);var az=T.grid.borderWidth/2;for(i=0;i<ah.length;++i){az=Math.max(az,2*(ah[i].points.radius+ah[i].points.lineWidth/2))}Z.left=Z.right=Z.top=Z.bottom=az;if(j.xaxis.labelHeight>0){Z.bottom=Math.max(az,j.xaxis.labelHeight+T.grid.labelMargin)}if(j.yaxis.labelWidth>0){Z.left=Math.max(az,j.yaxis.labelWidth+T.grid.labelMargin)}if(j.x2axis.labelHeight>0){Z.top=Math.max(az,j.x2axis.labelHeight+T.grid.labelMargin)}if(j.y2axis.labelWidth>0){Z.right=Math.max(az,j.y2axis.labelWidth+T.grid.labelMargin)}aa=n-Z.left-Z.right;Y=m-Z.bottom-Z.top;j.xaxis.scale=aa/(j.xaxis.max-j.xaxis.min);j.yaxis.scale=Y/(j.yaxis.max-j.yaxis.min);j.x2axis.scale=aa/(j.x2axis.max-j.x2axis.min);j.y2axis.scale=Y/(j.y2axis.max-j.y2axis.min)}function t(){w();for(var az=0;az<ah.length;az++){y(ah[az])}}function D(aD,aA){var aB=aA+"axis",aF=aA+"2axis",az,aC,aG,aE;if(aD[aB]){az=j[aB];aC=aD[aB].from;aG=aD[aB].to}else{if(aD[aF]){az=j[aF];aC=aD[aF].from;aG=aD[aF].to}else{az=j[aB];aC=aD[aA+"1"];aG=aD[aA+"2"]}}if(aC!=null&&aG!=null&&aC>aG){return{from:aG,to:aC,axis:az}}return{from:aC,to:aG,axis:az}}function w(){var aA;r.save();r.clearRect(0,0,n,m);r.translate(Z.left,Z.top);if(T.grid.backgroundColor){r.fillStyle=T.grid.backgroundColor;r.fillRect(0,0,aa,Y)}if(T.grid.markings){var aD=T.grid.markings;if(a.isFunction(aD)){aD=aD({xmin:j.xaxis.min,xmax:j.xaxis.max,ymin:j.yaxis.min,ymax:j.yaxis.max,xaxis:j.xaxis,yaxis:j.yaxis,x2axis:j.x2axis,y2axis:j.y2axis})}for(aA=0;aA<aD.length;++aA){var aC=aD[aA],aF=D(aC,"x"),aB=D(aC,"y");if(aF.from==null){aF.from=aF.axis.min}if(aF.to==null){aF.to=aF.axis.max}if(aB.from==null){aB.from=aB.axis.min}if(aB.to==null){aB.to=aB.axis.max}if(aF.to<aF.axis.min||aF.from>aF.axis.max||aB.to<aB.axis.min||aB.from>aB.axis.max){continue}aF.from=Math.max(aF.from,aF.axis.min);aF.to=Math.min(aF.to,aF.axis.max);aB.from=Math.max(aB.from,aB.axis.min);aB.to=Math.min(aB.to,aB.axis.max);if(aF.from==aF.to&&aB.from==aB.to){continue}aF.from=aF.axis.p2c(aF.from);aF.to=aF.axis.p2c(aF.to);aB.from=aB.axis.p2c(aB.from);aB.to=aB.axis.p2c(aB.to);if(aF.from==aF.to||aB.from==aB.to){r.strokeStyle=aC.color||T.grid.markingsColor;r.lineWidth=aC.lineWidth||T.grid.markingsLineWidth;r.moveTo(Math.floor(aF.from),Math.floor(aB.from));r.lineTo(Math.floor(aF.to),Math.floor(aB.to));r.stroke()}else{r.fillStyle=aC.color||T.grid.markingsColor;r.fillRect(Math.floor(aF.from),Math.floor(aB.to),Math.floor(aF.to-aF.from),Math.floor(aB.from-aB.to))}}}r.lineWidth=1;r.strokeStyle=T.grid.tickColor;r.beginPath();var aE,az=j.xaxis;for(aA=0;aA<az.ticks.length;++aA){aE=az.ticks[aA].v;if(aE<=az.min||aE>=j.xaxis.max){continue}r.moveTo(Math.floor(az.p2c(aE))+r.lineWidth/2,0);r.lineTo(Math.floor(az.p2c(aE))+r.lineWidth/2,Y)}az=j.yaxis;for(aA=0;aA<az.ticks.length;++aA){aE=az.ticks[aA].v;if(aE<=az.min||aE>=az.max){continue}r.moveTo(0,Math.floor(az.p2c(aE))+r.lineWidth/2);r.lineTo(aa,Math.floor(az.p2c(aE))+r.lineWidth/2)}az=j.x2axis;for(aA=0;aA<az.ticks.length;++aA){aE=az.ticks[aA].v;if(aE<=az.min||aE>=az.max){continue}r.moveTo(Math.floor(az.p2c(aE))+r.lineWidth/2,-5);r.lineTo(Math.floor(az.p2c(aE))+r.lineWidth/2,5)}az=j.y2axis;for(aA=0;aA<az.ticks.length;++aA){aE=az.ticks[aA].v;if(aE<=az.min||aE>=az.max){continue}r.moveTo(aa-5,Math.floor(az.p2c(aE))+r.lineWidth/2);r.lineTo(aa+5,Math.floor(az.p2c(aE))+r.lineWidth/2)}r.stroke();if(T.grid.borderWidth){r.lineWidth=T.grid.borderWidth;r.strokeStyle=T.grid.color;r.lineJoin="round";r.strokeRect(0,0,aa,Y)}r.restore()}function K(){aq.find(".tickLabels").remove();var aA='<div class="tickLabels" style="font-size:smaller;color:'+T.grid.color+'">';function az(aB,aD){for(var aC=0;aC<aB.ticks.length;++aC){var aE=aB.ticks[aC];if(!aE.label||aE.v<aB.min||aE.v>aB.max){continue}aA+=aD(aE,aB)}}az(j.xaxis,function(aC,aB){return'<div style="position:absolute;top:'+(Z.top+Y+T.grid.labelMargin)+"px;left:"+(Z.left+aB.p2c(aC.v)-aB.labelWidth/2)+"px;width:"+aB.labelWidth+'px;text-align:center" class="tickLabel">'+aC.label+"</div>"});az(j.yaxis,function(aC,aB){return'<div style="position:absolute;top:'+(Z.top+aB.p2c(aC.v)-aB.labelHeight/2)+"px;right:"+(Z.right+aa+T.grid.labelMargin)+"px;width:"+aB.labelWidth+'px;text-align:right" class="tickLabel">'+aC.label+"</div>"});az(j.x2axis,function(aC,aB){return'<div style="position:absolute;bottom:'+(Z.bottom+Y+T.grid.labelMargin)+"px;left:"+(Z.left+aB.p2c(aC.v)-aB.labelWidth/2)+"px;width:"+aB.labelWidth+'px;text-align:center" class="tickLabel">'+aC.label+"</div>"});az(j.y2axis,function(aC,aB){return'<div style="position:absolute;top:'+(Z.top+aB.p2c(aC.v)-aB.labelHeight/2)+"px;left:"+(Z.left+aa+T.grid.labelMargin)+"px;width:"+aB.labelWidth+'px;text-align:left" class="tickLabel">'+aC.label+"</div>"});aA+="</div>";aq.append(aA)}function y(az){if(az.lines.show||(!az.bars.show&&!az.points.show)){A(az)}if(az.bars.show){z(az)}if(az.points.show){B(az)}}function A(aC){function aA(aH,aN,aF,aE){var aO,aG=null,aJ=null,aI=null;r.beginPath();for(var aK=0;aK<aH.length;++aK){aO=aG;aG=aH[aK];if(aO==null||aG==null){continue}var aP=aO[0],aL=aO[1],aQ=aG[0],aM=aG[1];if(aL<=aM&&aL<aE.min){if(aM<aE.min){continue}aP=(aE.min-aL)/(aM-aL)*(aQ-aP)+aP;aL=aE.min}else{if(aM<=aL&&aM<aE.min){if(aL<aE.min){continue}aQ=(aE.min-aL)/(aM-aL)*(aQ-aP)+aP;aM=aE.min}}if(aL>=aM&&aL>aE.max){if(aM>aE.max){continue}aP=(aE.max-aL)/(aM-aL)*(aQ-aP)+aP;aL=aE.max}else{if(aM>=aL&&aM>aE.max){if(aL>aE.max){continue}aQ=(aE.max-aL)/(aM-aL)*(aQ-aP)+aP;aM=aE.max}}if(aP<=aQ&&aP<aF.min){if(aQ<aF.min){continue}aL=(aF.min-aP)/(aQ-aP)*(aM-aL)+aL;aP=aF.min}else{if(aQ<=aP&&aQ<aF.min){if(aP<aF.min){continue}aM=(aF.min-aP)/(aQ-aP)*(aM-aL)+aL;aQ=aF.min}}if(aP>=aQ&&aP>aF.max){if(aQ>aF.max){continue}aL=(aF.max-aP)/(aQ-aP)*(aM-aL)+aL;aP=aF.max}else{if(aQ>=aP&&aQ>aF.max){if(aP>aF.max){continue}aM=(aF.max-aP)/(aQ-aP)*(aM-aL)+aL;aQ=aF.max}}if(aJ!=aF.p2c(aP)||aI!=aE.p2c(aL)+aN){r.moveTo(aF.p2c(aP),aE.p2c(aL)+aN)}aJ=aF.p2c(aQ);aI=aE.p2c(aM)+aN;r.lineTo(aJ,aI)}r.stroke()}function aB(aJ,aG,aF){var aO,aI=null;var aH=Math.min(Math.max(0,aF.min),aF.max);var aP,aN=0;var aE=false;for(var aK=0;aK<aJ.length;++aK){aO=aI;aI=aJ[aK];if(aE&&aO!=null&&aI==null){r.lineTo(aG.p2c(aN),aF.p2c(aH));r.fill();aE=false;continue}if(aO==null||aI==null){continue}var aQ=aO[0],aL=aO[1],aS=aI[0],aM=aI[1];if(aQ<=aS&&aQ<aG.min){if(aS<aG.min){continue}aL=(aG.min-aQ)/(aS-aQ)*(aM-aL)+aL;aQ=aG.min}else{if(aS<=aQ&&aS<aG.min){if(aQ<aG.min){continue}aM=(aG.min-aQ)/(aS-aQ)*(aM-aL)+aL;aS=aG.min}}if(aQ>=aS&&aQ>aG.max){if(aS>aG.max){continue}aL=(aG.max-aQ)/(aS-aQ)*(aM-aL)+aL;aQ=aG.max}else{if(aS>=aQ&&aS>aG.max){if(aQ>aG.max){continue}aM=(aG.max-aQ)/(aS-aQ)*(aM-aL)+aL;aS=aG.max}}if(!aE){r.beginPath();r.moveTo(aG.p2c(aQ),aF.p2c(aH));aE=true}if(aL>=aF.max&&aM>=aF.max){r.lineTo(aG.p2c(aQ),aF.p2c(aF.max));r.lineTo(aG.p2c(aS),aF.p2c(aF.max));continue}else{if(aL<=aF.min&&aM<=aF.min){r.lineTo(aG.p2c(aQ),aF.p2c(aF.min));r.lineTo(aG.p2c(aS),aF.p2c(aF.min));continue}}var aR=aQ,aT=aS;if(aL<=aM&&aL<aF.min&&aM>=aF.min){aQ=(aF.min-aL)/(aM-aL)*(aS-aQ)+aQ;aL=aF.min}else{if(aM<=aL&&aM<aF.min&&aL>=aF.min){aS=(aF.min-aL)/(aM-aL)*(aS-aQ)+aQ;aM=aF.min}}if(aL>=aM&&aL>aF.max&&aM<=aF.max){aQ=(aF.max-aL)/(aM-aL)*(aS-aQ)+aQ;aL=aF.max}else{if(aM>=aL&&aM>aF.max&&aL<=aF.max){aS=(aF.max-aL)/(aM-aL)*(aS-aQ)+aQ;aM=aF.max}}if(aQ!=aR){if(aL<=aF.min){aP=aF.min}else{aP=aF.max}r.lineTo(aG.p2c(aR),aF.p2c(aP));r.lineTo(aG.p2c(aQ),aF.p2c(aP))}r.lineTo(aG.p2c(aQ),aF.p2c(aL));r.lineTo(aG.p2c(aS),aF.p2c(aM));if(aS!=aT){if(aM<=aF.min){aP=aF.min}else{aP=aF.max}r.lineTo(aG.p2c(aT),aF.p2c(aP));r.lineTo(aG.p2c(aS),aF.p2c(aP))}aN=Math.max(aS,aT)}if(aE){r.lineTo(aG.p2c(aN),aF.p2c(aH));r.fill()}}r.save();r.translate(Z.left,Z.top);r.lineJoin="round";var az=aC.lines.lineWidth;var aD=aC.shadowSize;if(aD>0){r.lineWidth=aD/2;r.strokeStyle="rgba(0,0,0,0.1)";aA(aC.data,az/2+aD/2+r.lineWidth/2,aC.xaxis,aC.yaxis);r.lineWidth=aD/2;r.strokeStyle="rgba(0,0,0,0.2)";aA(aC.data,az/2+r.lineWidth/2,aC.xaxis,aC.yaxis)}r.lineWidth=az;r.strokeStyle=aC.color;aj(aC.lines,aC.color);if(aC.lines.fill){aB(aC.data,aC.xaxis,aC.yaxis)}aA(aC.data,0,aC.xaxis,aC.yaxis);r.restore()}function B(aC){function aA(aG,aK,aH,aF,aE){for(var aI=0;aI<aG.length;++aI){if(aG[aI]==null){continue}var aL=aG[aI][0],aJ=aG[aI][1];if(aL<aF.min||aL>aF.max||aJ<aE.min||aJ>aE.max){continue}r.beginPath();r.arc(aF.p2c(aL),aE.p2c(aJ),aK,0,2*Math.PI,true);if(aH){r.fill()}r.stroke()}}function aB(aG,aJ,aK,aF,aE){for(var aH=0;aH<aG.length;++aH){if(aG[aH]==null){continue}var aL=aG[aH][0],aI=aG[aH][1];if(aL<aF.min||aL>aF.max||aI<aE.min||aI>aE.max){continue}r.beginPath();r.arc(aF.p2c(aL),aE.p2c(aI)+aJ,aK,0,Math.PI,false);r.stroke()}}r.save();r.translate(Z.left,Z.top);var az=aC.lines.lineWidth;var aD=aC.shadowSize;if(aD>0){r.lineWidth=aD/2;r.strokeStyle="rgba(0,0,0,0.1)";aB(aC.data,aD/2+r.lineWidth/2,aC.points.radius,aC.xaxis,aC.yaxis);r.lineWidth=aD/2;r.strokeStyle="rgba(0,0,0,0.2)";aB(aC.data,r.lineWidth/2,aC.points.radius,aC.xaxis,aC.yaxis)}r.lineWidth=aC.points.lineWidth;r.strokeStyle=aC.color;aj(aC.points,aC.color);aA(aC.data,aC.points.radius,aC.points.fill,aC.xaxis,aC.yaxis);r.restore()}function u(aP,aK,aB,aC,aM,aJ,aA,az,aE){var aG=true,aH=true,aI=true,aF=false,aL=aP+aB,aN=aP+aC,aD=0,aO=aK;if(aO<aD){aO=0;aD=aK;aF=true;aI=false}if(aN<aA.min||aL>aA.max||aO<az.min||aD>az.max){return}if(aL<aA.min){aL=aA.min;aG=false}if(aN>aA.max){aN=aA.max;aH=false}if(aD<az.min){aD=az.min;aF=false}if(aO>az.max){aO=az.max;aI=false}if(aJ){aE.beginPath();aE.moveTo(aA.p2c(aL),az.p2c(aD)+aM);aE.lineTo(aA.p2c(aL),az.p2c(aO)+aM);aE.lineTo(aA.p2c(aN),az.p2c(aO)+aM);aE.lineTo(aA.p2c(aN),az.p2c(aD)+aM);aE.fill()}if(aG||aH||aI||aF){aE.beginPath();aL=aA.p2c(aL);aD=az.p2c(aD);aN=aA.p2c(aN);aO=az.p2c(aO);aE.moveTo(aL,aD+aM);if(aG){aE.lineTo(aL,aO+aM)}else{aE.moveTo(aL,aO+aM)}if(aI){aE.lineTo(aN,aO+aM)}else{aE.moveTo(aN,aO+aM)}if(aH){aE.lineTo(aN,aD+aM)}else{aE.moveTo(aN,aD+aM)}if(aF){aE.lineTo(aL,aD+aM)}else{aE.moveTo(aL,aD+aM)}aE.stroke()}}function z(aB){function aA(aG,aE,aF,aJ,aH,aD,aC){for(var aI=0;aI<aG.length;aI++){if(aG[aI]==null){continue}u(aG[aI][0],aG[aI][1],aE,aF,aJ,aH,aD,aC,r)}}r.save();r.translate(Z.left,Z.top);r.lineJoin="round";r.lineWidth=aB.bars.lineWidth;r.strokeStyle=aB.color;aj(aB.bars,aB.color);var az=aB.bars.align=="left"?0:-aB.bars.barWidth/2;aA(aB.data,az,az+aB.bars.barWidth,0,aB.bars.fill,aB.xaxis,aB.yaxis);r.restore()}function aj(aB,aC){var aA=aB.fill;if(!aA){return}if(aB.fillColor){r.fillStyle=aB.fillColor}else{var az=g(aC);az.a=typeof aA=="number"?aA:0.4;az.normalize();r.fillStyle=az.toString()}}function L(){aq.find(".legend").remove();if(!T.legend.show){return}var aB=[];var aH=false;for(i=0;i<ah.length;++i){if(!ah[i].label){continue}if(i%T.legend.noColumns==0){if(aH){aB.push("</tr>")}aB.push("<tr>");aH=true}var aC=ah[i].label;if(T.legend.labelFormatter!=null){aC=T.legend.labelFormatter(aC)}aB.push('<td class="legendColorBox"><div style="border:1px solid '+T.legend.labelBoxBorderColor+';padding:1px"><div style="width:14px;height:10px;background-color:'+ah[i].color+';overflow:hidden"></div></div></td><td class="legendLabel">'+aC+"</td>")}if(aH){aB.push("</tr>")}if(aB.length==0){return}var aI='<table style="font-size:smaller;color:'+T.grid.color+'">'+aB.join("")+"</table>";if(T.legend.container!=null){T.legend.container.html(aI)}else{var aG="";var aF=T.legend.position,aE=T.legend.margin;if(aF.charAt(0)=="n"){aG+="top:"+(aE+Z.top)+"px;"}else{if(aF.charAt(0)=="s"){aG+="bottom:"+(aE+Z.bottom)+"px;"}}if(aF.charAt(1)=="e"){aG+="right:"+(aE+Z.right)+"px;"}else{if(aF.charAt(1)=="w"){aG+="left:"+(aE+Z.left)+"px;"}}var aD=a('<div class="legend">'+aI.replace('style="','style="position:absolute;'+aG+";")+"</div>").appendTo(aq);if(T.legend.backgroundOpacity!=0){var az=T.legend.backgroundColor;if(az==null){var aJ;if(T.grid.backgroundColor){aJ=T.grid.backgroundColor}else{aJ=d(aD)}az=g(aJ).adjust(null,null,null,1).toString()}var aA=aD.children();a('<div style="position:absolute;width:'+aA.width()+"px;height:"+aA.height()+"px;"+aG+"background-color:"+az+';"> </div>').prependTo(aD).css("opacity",T.legend.backgroundOpacity)}}}var M={pageX:null,pageY:null},af={first:{x:-1,y:-1},second:{x:-1,y:-1},show:false,active:false},H=[],p=false,ae=null,I=null;function F(aU,aT){var aP=T.grid.mouseActiveRadius,aO=aP*aP+1,aL=null,aJ=false;function aW(aY,aZ){return{datapoint:ah[aY].data[aZ],dataIndex:aZ,series:ah[aY],seriesIndex:aY}}for(var aK=0;aK<ah.length;++aK){var aF=ah[aK].data,aA=ah[aK].xaxis,az=ah[aK].yaxis,aV=aA.c2p(aU),aS=az.c2p(aT),aR=aP/aA.scale,aQ=aP/az.scale,aD=ah[aK].bars.show,aE=!(ah[aK].bars.show&&!(ah[aK].lines.show||ah[aK].points.show)),aB=ah[aK].bars.align=="left"?0:-ah[aK].bars.barWidth/2,aC=aB+ah[aK].bars.barWidth;for(var aN=0;aN<aF.length;++aN){if(aF[aN]==null){continue}var aX=aF[aN][0],aM=aF[aN][1];if(aD){if(!aJ&&aV>=aX+aB&&aV<=aX+aC&&aS>=Math.min(0,aM)&&aS<=Math.max(0,aM)){aL=aW(aK,aN)}}if(aE){if((aX-aV>aR||aX-aV<-aR)||(aM-aS>aQ||aM-aS<-aQ)){continue}var aI=Math.abs(aA.p2c(aX)-aU),aH=Math.abs(az.p2c(aM)-aT),aG=aI*aI+aH*aH;if(aG<aO){aO=aG;aJ=true;aL=aW(aK,aN)}}}}return aL}function R(aC){var aB=aC||window.event;if(aB.pageX==null&&aB.clientX!=null){var aA=document.documentElement,az=document.body;M.pageX=aB.clientX+(aA&&aA.scrollLeft||az.scrollLeft||0);M.pageY=aB.clientY+(aA&&aA.scrollTop||az.scrollTop||0)}else{M.pageX=aB.pageX;M.pageY=aB.pageY}if(T.grid.hoverable&&!I){I=setTimeout(P,100)}if(af.active){ax(M)}}function Q(az){if(az.which!=1){return}document.body.focus();if(document.onselectstart!==undefined&&ay.onselectstart==null){ay.onselectstart=document.onselectstart;document.onselectstart=function(){return false}}if(document.ondrag!==undefined&&ay.ondrag==null){ay.ondrag=document.ondrag;document.ondrag=function(){return false}}am(af.first,az);M.pageX=null;af.active=true;a(document).one("mouseup",S)}function O(az){if(p){p=false;return}at("plotclick",az)}function P(){at("plothover",M);I=null}function at(aC,aB){var aG=C.offset(),aH={pageX:aB.pageX,pageY:aB.pageY},aA=aB.pageX-aG.left-Z.left,az=aB.pageY-aG.top-Z.top;if(j.xaxis.used){aH.x=j.xaxis.c2p(aA)}if(j.yaxis.used){aH.y=j.yaxis.c2p(az)}if(j.x2axis.used){aH.x2=j.x2axis.c2p(aA)}if(j.y2axis.used){aH.y2=j.y2axis.c2p(az)}var aF=F(aA,az);if(aF){aF.pageX=parseInt(aF.series.xaxis.p2c(aF.datapoint[0])+aG.left+Z.left);aF.pageY=parseInt(aF.series.yaxis.p2c(aF.datapoint[1])+aG.top+Z.top)}if(T.grid.autoHighlight){for(var aE=0;aE<H.length;++aE){var aD=H[aE];if(aD.auto&&!(aF&&aD.series==aF.series&&aD.point==aF.datapoint)){aw(aD.series,aD.point)}}if(aF){G(aF.series,aF.datapoint,true)}}aq.trigger(aC,[aH,aF])}function au(){if(!ae){ae=setTimeout(ad,50)}}function ad(){ae=null;N.save();N.clearRect(0,0,n,m);N.translate(Z.left,Z.top);var aB,aA;for(aB=0;aB<H.length;++aB){aA=H[aB];if(aA.series.bars.show){v(aA.series,aA.point)}else{x(aA.series,aA.point)}}N.restore();if(af.show&&ag()){N.strokeStyle=g(T.selection.color).scale(null,null,null,0.8).toString();N.lineWidth=1;r.lineJoin="round";N.fillStyle=g(T.selection.color).scale(null,null,null,0.4).toString();var aE=Math.min(af.first.x,af.second.x),aC=Math.min(af.first.y,af.second.y),aD=Math.abs(af.second.x-af.first.x),az=Math.abs(af.second.y-af.first.y);N.fillRect(aE+Z.left,aC+Z.top,aD,az);N.strokeRect(aE+Z.left,aC+Z.top,aD,az)}}function G(aC,aB,az){if(typeof aC=="number"){aC=ah[aC]}if(typeof aB=="number"){aB=aC.data[aB]}var aA=J(aC,aB);if(aA==-1){H.push({series:aC,point:aB,auto:az});au()}else{if(!az){H[aA].auto=false}}}function aw(aB,aA){if(typeof aB=="number"){aB=ah[aB]}if(typeof aA=="number"){aA=aB.data[aA]}var az=J(aB,aA);if(az!=-1){H.splice(az,1);au()}}function J(aC,aB){for(var aA=0;aA<H.length;++aA){var az=H[aA];if(az.series==aC&&az.point[0]==aB[0]&&az.point[1]==aB[1]){return aA}}return -1}function x(aF,aC){var aG=aC[0],aB=aC[1],aA=aF.xaxis,az=aF.yaxis;if(aG<aA.min||aG>aA.max||aB<az.min||aB>az.max){return}var aD=aF.points.radius+aF.points.lineWidth/2;N.lineWidth=aD;N.strokeStyle=g(aF.color).scale(1,1,1,0.5).toString();var aE=1.5*aD;N.beginPath();N.arc(aA.p2c(aG),az.p2c(aB),aE,0,2*Math.PI,true);N.stroke()}function v(aB,aA){N.lineJoin="round";N.lineWidth=aB.bars.lineWidth;N.strokeStyle=g(aB.color).scale(1,1,1,0.5).toString();N.fillStyle=g(aB.color).scale(1,1,1,0.5).toString();var az=aB.bars.align=="left"?0:-aB.bars.barWidth/2;u(aA[0],aA[1],az,az+aB.bars.barWidth,0,true,aB.xaxis,aB.yaxis,N)}function av(){var aC=Math.min(af.first.x,af.second.x),aD=Math.max(af.first.x,af.second.x),az=Math.max(af.first.y,af.second.y),aA=Math.min(af.first.y,af.second.y);var aB={};if(j.xaxis.used){aB.xaxis={from:j.xaxis.c2p(aC),to:j.xaxis.c2p(aD)}}if(j.x2axis.used){aB.x2axis={from:j.x2axis.c2p(aC),to:j.x2axis.c2p(aD)}}if(j.yaxis.used){aB.yaxis={from:j.yaxis.c2p(az),to:j.yaxis.c2p(aA)}}if(j.y2axis.used){aB.yaxis={from:j.y2axis.c2p(az),to:j.y2axis.c2p(aA)}}aq.trigger("plotselected",[aB]);if(j.xaxis.used&&j.yaxis.used){aq.trigger("selected",[{x1:aB.xaxis.from,y1:aB.yaxis.from,x2:aB.xaxis.to,y2:aB.yaxis.to}])}}function S(az){if(document.onselectstart!==undefined){document.onselectstart=ay.onselectstart}if(document.ondrag!==undefined){document.ondrag=ay.ondrag}af.active=false;ax(az);if(ag()){av();p=true}return false}function am(aB,az){var aA=C.offset();if(T.selection.mode=="y"){if(aB==af.first){aB.x=0}else{aB.x=aa}}else{aB.x=az.pageX-aA.left-Z.left;aB.x=Math.min(Math.max(0,aB.x),aa)}if(T.selection.mode=="x"){if(aB==af.first){aB.y=0}else{aB.y=Y}}else{aB.y=az.pageY-aA.top-Z.top;aB.y=Math.min(Math.max(0,aB.y),Y)}}function ax(az){if(az.pageX==null){return}am(af.second,az);if(ag()){af.show=true;au()}else{o()}}function o(){if(af.show){af.show=false;au()}}function al(aB,az){var aA;if(T.selection.mode=="y"){af.first.x=0;af.second.x=aa}else{aA=D(aB,"x");af.first.x=aA.axis.p2c(aA.from);af.second.x=aA.axis.p2c(aA.to)}if(T.selection.mode=="x"){af.first.y=0;af.second.y=Y}else{aA=D(aB,"y");af.first.y=aA.axis.p2c(aA.from);af.second.y=aA.axis.p2c(aA.to)}af.show=true;au();if(!az){av()}}function ag(){var az=5;return Math.abs(af.second.x-af.first.x)>=az&&Math.abs(af.second.y-af.first.y)>=az}}a.plot=function(n,j,k){var m=new h(n,j,k);return m};function e(k,j){return j*Math.floor(k/j)}function b(k,m,j){if(m<k){return m}else{if(m>j){return j}else{return m}}}function c(o,m,k,j){var p=["r","g","b","a"];var q=4;while(-1<--q){this[p[q]]=arguments[q]||((q==3)?1:0)}this.toString=function(){if(this.a>=1){return"rgb("+[this.r,this.g,this.b].join(",")+")"}else{return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}};this.scale=function(u,t,s,r){q=4;while(-1<--q){if(arguments[q]!=null){this[p[q]]*=arguments[q]}}return this.normalize()};this.adjust=function(u,t,s,r){q=4;while(-1<--q){if(arguments[q]!=null){this[p[q]]+=arguments[q]}}return this.normalize()};this.clone=function(){return new c(this.r,this.b,this.g,this.a)};var n=function(t,s,r){return Math.max(Math.min(t,r),s)};this.normalize=function(){this.r=n(parseInt(this.r),0,255);this.g=n(parseInt(this.g),0,255);this.b=n(parseInt(this.b),0,255);this.a=n(this.a,0,1);return this};this.normalize()}var f={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};function d(m){var j,k=m;do{j=k.css("background-color").toLowerCase();if(j!=""&&j!="transparent"){break}k=k.parent()}while(!a.nodeName(k.get(0),"body"));if(j=="rgba(0, 0, 0, 0)"){return"transparent"}return j}function g(m){var k;if(k=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(m)){return new c(parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10))}if(k=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(m)){return new c(parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10),parseFloat(k[4]))}if(k=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(m)){return new c(parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55)}if(k=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(m)){return new c(parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55,parseFloat(k[4]))}if(k=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(m)){return new c(parseInt(k[1],16),parseInt(k[2],16),parseInt(k[3],16))}if(k=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(m)){return new c(parseInt(k[1]+k[1],16),parseInt(k[2]+k[2],16),parseInt(k[3]+k[3],16))}var j=a.trim(m).toLowerCase();if(j=="transparent"){return new c(255,255,255,0)}else{k=f[j];return new c(k[0],k[1],k[2])}}})(jQuery);
