(function($){$.fn.carousel=function(options){var opts=$.extend($.fn.carousel.defaults,options);return this.each(function(){var $this=$(this);var i=opts.firstStep,clicked=false,$container=$this,$carousel=$container.children(".carousel"),$itemCont=$carousel.children("ul"),$items=$itemCont.children("li"),itemCount=$items.length,itemWidth=$items.outerWidth(true),row=itemWidth*opts.scrollBy,totalRows=Math.ceil(itemCount/opts.scrollBy),carouselWidth=itemCount*itemWidth,activeItem=$items[i];$(activeItem).addClass("activeItem");if(opts.autoScroll){var run=setInterval(rotate,opts.speed),stopRotation=function(){clearInterval(run)};$carousel.mouseover(function(){stopRotation()}).mouseout(function(){if(!clicked){run=setInterval(rotate,opts.speed)}})}else{stopRotation=function(){}}var ini=(function(){if($container){$carousel.css("overflow","hidden");$itemCont.css({width:carouselWidth*2+"px",left:-row*i});if(opts.createControls){var controlContainer=$("<ol>",{width:(totalRows*12)+"px"}),controls=$("<div>",{"class":"carousel-controls"}),controlLeft=$("<div>",{"class":"carousel-left",html:function(){if(opts.prevHTML){return opts.prevHTML}}}),controlRight=$("<div>",{"class":"carousel-right",html:function(){if(opts.nextHTML){return opts.nextHTML}}});$container.append(controls);var listItems=[];for(var n=0;n<totalRows;n++){listItems[n]="<li class='control-"+n+"' style='cursor:pointer'></li>"}controlContainer.append(listItems.join(""));controls.append(controlContainer).append(controlLeft).append(controlRight);controlLeft.css("cursor","pointer");controlRight.css("cursor","pointer");var $activeControl=controlContainer.find(".control-"+i);$activeControl.addClass("active");controlContainer.delegate("li","click",function(){rotateTo(this)});controlRight.click(function(){rotate();clicked=true;return false});controlLeft.click(function(){stopRotation();rotateBack();clicked=true;return false});return{controlContainer:controlContainer}}}})();function rotate(){var curLeft=parseInt($itemCont.css("left"),10);if(curLeft/row%1==0){if(curLeft==((-totalRows+1)*row)){$itemCont.animate({left:0},"slow");i=0}else{$itemCont.animate({left:(curLeft-row)},"slow");i++}}if(opts.createControls){activeControls()}$($items[i]).addClass("activeItem").siblings().removeClass("activeItem");if($.isFunction(opts.onRotate)){opts.onRotate(i)}}function rotateBack(){var curLeft=parseInt($itemCont.css("left"),10);if(curLeft/row%1==0){if(curLeft==0){$itemCont.animate({left:(-(row*totalRows)+row)},"slow");i=(totalRows-1)}else{$itemCont.animate({left:(curLeft+row)},"slow");i--}}if(opts.createControls){activeControls()}$($items[i]).addClass("activeItem").siblings().removeClass("activeItem");if($.isFunction(opts.onRotate)){opts.onRotate(i)}}function activeControls(){var $controlNodes=ini.controlContainer.find("li");$controlNodes.removeClass("active").parent().children(".control-"+i).addClass("active")}function rotateTo(theNode){var nodeID=$(theNode).attr("class");var pos=parseInt(nodeID.split("-")[1],10);stopRotation();$itemCont.animate({left:-row*pos},"slow");i=pos;activeControls();$($items[i]).addClass("activeItem").siblings().removeClass("activeItem");if($.isFunction(opts.onRotate)){opts.onRotate(i)}}})};$.fn.carousel.defaults={speed:5000,scrollBy:1,onRotate:null,autoScroll:true,createControls:true,prevHTML:null,nextHTML:null,firstStep:0}})(jQuery);(function($){$.fn.toggler=function(options){var opts=$.extend({},$.fn.toggler.defaults,options);return this.each(function(){var $trigger,targetID,toggleTarget;if(opts.noAnchorTrigger){toggleTarget=opts.noAnchorTrigger}else{if($(this).attr("href")){$trigger=$(this)}else{$trigger=$(this).find("a")}targetID=$trigger.attr("href").split("#")[1];toggleTarget=document.getElementById(targetID)}if(!opts.startOpen){$(toggleTarget).hide()}$(this).click(function(e){var isToggleOn=$(toggleTarget).hasClass("toggleOn")?true:false;if($(e.target).attr("href")){e.preventDefault()}if(opts.preventRepeat&&isToggleOn){return false}$(toggleTarget).slideToggle().toggleClass("toggleOn");if(opts.toggleSiblings){$(toggleTarget).siblings(".toggleOn").slideUp().removeClass("toggleOn")}return false})})};$.fn.toggler.defaults={toggleSiblings:false,noAnchorTrigger:false,preventRepeat:false,startOpen:false}})(jQuery);(function($){$.fn.tabigate=function(options){var opts=$.extend({},$.fn.tabigate.defaults,options);return this.each(function(){var $this=$(this);var $tabWrap=$this.find(opts.tabs);var $tabs=$tabWrap.find("li");var $tabContent=$this.find(opts.tabContent);$tabWrap.children("li:first-child").addClass("selected");$tabContent.children("div").hide();$tabContent.children("div:first-child").show();$tabs.click(function(){var activeTab=$(this).children("a").attr("href");if(!$(activeTab).hasClass("active-tab")){$tabs.removeClass("selected");$(this).addClass("selected");$tabContent.children("div").hide().removeClass("active-tab");$(activeTab).fadeIn().addClass("active-tab")}return false})})};$.fn.tabigate.defaults={tabs:"ul.tabs",tabContent:"div.tab-container"}})(jQuery);function addClassName(myElement,myClass){$(myElement).addClass(myClass)}function removeClassName(myElement,myClass){$(myElement).removeClass(myClass)}function switchClassName(myElement,removeClass,addClass){removeClassName(myElement,removeClass);addClassName(myElement,addClass)}function newwindow(x,y){$(x).click(function(){window.open(this.href,"mywindow",y);return false})}DateInput=(function($){function DateInput(el,opts){if(typeof(opts)!="object"){opts={}}$.extend(this,DateInput.DEFAULT_OPTS,opts);this.input=$(el);this.bindMethodsToObj("show","hide","hideIfClickOutside","keydownHandler","selectDate");this.build();this.selectDate();this.hide()}DateInput.DEFAULT_OPTS={month_names:["January","February","March","April","May","June","July","August","September","October","November","December"],short_month_names:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short_day_names:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],start_of_week:1,tie:false,max_diff:false};DateInput.prototype={build:function(){if(this.max_diff){var tiedDate,max=this.max_diff,input=this.input,futureDate;if(this.tie&&this.max_diff){$(this.tie).bind("change",function(){tiedDate=$(this).val();tiedDate=tiedDate.split("/");futureDate=new Date(~~tiedDate[2]+max,~~tiedDate[1]-1,~~tiedDate[0]+1);input.data("max",futureDate)})}else{if(this.max_diff&&this.tie===false){tiedDate=new Date();futureDate=new Date();futureDate.setFullYear(futureDate.getFullYear()+1);input.data("max",futureDate)}}}var monthNav=$('<p class="month_nav"><span class="button prev" title="[Page-Up]">&#171;</span> <span class="month_name"></span> <span class="button next" title="[Page-Down]">&#187;</span></p>');this.monthNameSpan=$(".month_name",monthNav);$(".prev",monthNav).click(this.bindToObj(function(){this.moveMonthBy(-1)}));$(".next",monthNav).click(this.bindToObj(function(){this.moveMonthBy(1)}));var yearNav=$('<p class="year_nav"><span class="button prev" title="[Ctrl+Page-Up]">&#171;</span> <span class="year_name"></span> <span class="button next" title="[Ctrl+Page-Down]">&#187;</span></p>');this.yearNameSpan=$(".year_name",yearNav);$(".prev",yearNav).click(this.bindToObj(function(){this.moveMonthBy(-12)}));$(".next",yearNav).click(this.bindToObj(function(){this.moveMonthBy(12)}));var nav=$('<div class="nav"></div>').append(monthNav,yearNav);var tableShell="<table><thead><tr>";$(this.adjustDays(this.short_day_names)).each(function(){tableShell+="<th>"+this+"</th>"});tableShell+="</tr></thead><tbody></tbody></table>";this.dateSelector=this.rootLayers=$('<div class="date_selector"></div>').append(nav,tableShell).appendTo("body");this.tbody=$("tbody",this.dateSelector);var todaySpan=$("<div class='select-today'><span>Jump to today</span></div>").appendTo(this.dateSelector);$(todaySpan).click(this.bindToObj(function(){this.selectDate(new Date())}));if($.browser.msie&&$.browser.version<7){this.ieframe=$('<iframe class="date_selector_ieframe" frameborder="0" src="#"></iframe>').insertBefore(this.dateSelector);this.rootLayers=this.rootLayers.add(this.ieframe);$(".button",nav).add("span",todaySpan).mouseover(function(){$(this).addClass("hover")});$(".button",nav).add("span",todaySpan).mouseout(function(){$(this).removeClass("hover")})}this.input.change(this.bindToObj(function(){this.selectDate()}));this.selectDate();if(this.input.val()==""){this.input.val($(".today").attr("date"))}},selectMonth:function(date){var newMonth=new Date(date.getFullYear(),date.getMonth(),1);if(!this.currentMonth||!(this.currentMonth.getFullYear()==newMonth.getFullYear()&&this.currentMonth.getMonth()==newMonth.getMonth())){this.currentMonth=newMonth;var rangeStart=this.rangeStart(date),rangeEnd=this.rangeEnd(date);var numDays=this.daysBetween(rangeStart,rangeEnd);var dayCells="";for(var i=0;i<=numDays;i++){var currentDay=new Date(rangeStart.getFullYear(),rangeStart.getMonth(),rangeStart.getDate()+i,12,0);if(this.isFirstDayOfWeek(currentDay)){dayCells+="<tr>"}if(currentDay.getMonth()==date.getMonth()){var before=this.isBeforeToday(currentDay)||this.overMaxDate(currentDay)?"unselected_month":"selectable_day";dayCells+='<td class="'+before+'" date="'+this.dateToString(currentDay)+'">'+currentDay.getDate()+"</td>"}else{dayCells+='<td class="unselected_month" date="'+this.dateToString(currentDay)+'">'+currentDay.getDate()+"</td>"}if(this.isLastDayOfWeek(currentDay)){dayCells+="</tr>"}}this.tbody.empty().append(dayCells);this.monthNameSpan.empty().append(this.monthName(date));this.yearNameSpan.empty().append(this.currentMonth.getFullYear());$("td[date="+this.dateToString(new Date())+"]",this.tbody).addClass("today").removeClass("unselected_month");$(".selectable_day",this.tbody).add(".today",this.tbody).click(this.bindToObj(function(event){this.changeInput($(event.target).attr("date"))}));$("td.selectable_day",this.tbody).add(".today",this.tbody).mouseover(function(){$(this).addClass("hover")});$("td.selectable_day",this.tbody).add(".today",this.tbody).mouseout(function(){$(this).removeClass("hover")})}$(".selected",this.tbody).removeClass("selected");$("td[date="+this.selectedDateString+"]",this.tbody).addClass("selected")},selectDate:function(date){if(typeof(date)=="undefined"){date=this.stringToDate(this.input.val())}if(!date){date=new Date()}this.selectedDate=date;this.selectedDateString=this.dateToString(this.selectedDate);this.selectMonth(this.selectedDate)},changeInput:function(dateString){this.input.val(dateString).change();this.hide()},show:function(){this.input.trigger("blur").addClass("cal-active");this.rootLayers.css("display","block");$([window,document.body]).click(this.hideIfClickOutside);this.input.unbind("focus",this.show);$(document.body).keydown(this.keydownHandler);this.setPosition()},hide:function(){this.input.removeClass("cal-active");this.rootLayers.css("display","none");$([window,document.body]).unbind("click",this.hideIfClickOutside);this.input.focus(this.show);$(document.body).unbind("keydown",this.keydownHandler)},hideIfClickOutside:function(event){if(event.target!=this.input[0]&&!this.insideSelector(event)){this.hide()}},insideSelector:function(event){var offset=this.dateSelector.position();offset.right=offset.left+this.dateSelector.outerWidth(true);offset.bottom=offset.top+this.dateSelector.outerHeight(true);return event.pageY<offset.bottom&&event.pageY>offset.top&&event.pageX<offset.right&&event.pageX>offset.left},keydownHandler:function(event){switch(event.keyCode){case 9:case 27:this.hide();return;break;case 13:this.changeInput(this.selectedDateString);break;case 33:this.moveDateMonthBy(event.ctrlKey?-12:-1);break;case 34:this.moveDateMonthBy(event.ctrlKey?12:1);break;case 38:this.moveDateBy(-7);break;case 40:this.moveDateBy(7);break;case 37:this.moveDateBy(-1);break;case 39:this.moveDateBy(1);break;default:return}event.preventDefault()},stringToDate:function(string){var matches;if(matches=string.match(/^(\d{2,2})\/(\d{2,2})\/(\d{4,4})$/)){return new Date(matches[3],matches[2]-1,matches[1])}else{return null}},dateToString:function(date){var month=(date.getMonth()+1).toString();var dom=date.getDate().toString();if(month.length==1){month="0"+month}if(dom.length==1){dom="0"+dom}return dom+"/"+month+"/"+date.getFullYear()},setPosition:function(){var offset=this.input.offset();this.rootLayers.css({top:offset.top+this.input.outerHeight(),left:offset.left});if(this.ieframe){this.ieframe.css({width:this.dateSelector.outerWidth(),height:this.dateSelector.outerHeight()})}},moveDateBy:function(amount){var newDate=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth(),this.selectedDate.getDate()+amount);this.selectDate(newDate)},moveDateMonthBy:function(amount){var newDate=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth()+amount,this.selectedDate.getDate());if(newDate.getMonth()==this.selectedDate.getMonth()+amount+1){newDate.setDate(0)}this.selectDate(newDate)},moveMonthBy:function(amount){var newMonth=new Date(this.currentMonth.getFullYear(),this.currentMonth.getMonth()+amount,this.currentMonth.getDate());this.selectMonth(newMonth)},monthName:function(date){return this.month_names[date.getMonth()]},bindToObj:function(fn){var self=this;return function(){return fn.apply(self,arguments)}},bindMethodsToObj:function(){for(var i=0;i<arguments.length;i++){this[arguments[i]]=this.bindToObj(this[arguments[i]])}},indexFor:function(array,value){for(var i=0;i<array.length;i++){if(value==array[i]){return i}}},monthNum:function(month_name){return this.indexFor(this.month_names,month_name)},shortMonthNum:function(month_name){return this.indexFor(this.short_month_names,month_name)},shortDayNum:function(day_name){return this.indexFor(this.short_day_names,day_name)},daysBetween:function(start,end){start=Date.UTC(start.getFullYear(),start.getMonth(),start.getDate());end=Date.UTC(end.getFullYear(),end.getMonth(),end.getDate());return(end-start)/86400000},changeDayTo:function(dayOfWeek,date,direction){var difference=direction*(Math.abs(date.getDay()-dayOfWeek-(direction*7))%7);return new Date(date.getFullYear(),date.getMonth(),date.getDate()+difference)},rangeStart:function(date){return this.changeDayTo(this.start_of_week,new Date(date.getFullYear(),date.getMonth()),-1)},rangeEnd:function(date){return this.changeDayTo((this.start_of_week-1)%7,new Date(date.getFullYear(),date.getMonth()+1,0),1)},isFirstDayOfWeek:function(date){return date.getDay()==this.start_of_week},isBeforeToday:function(date){var today=new Date();return(date<today)?true:false},overMaxDate:function(date){if(this.input.data("max")){return(date>=this.input.data("max"))?true:false}},isLastDayOfWeek:function(date){return date.getDay()==(this.start_of_week-1)%7},adjustDays:function(days){var newDays=[];for(var i=0;i<days.length;i++){newDays[i]=days[(i+this.start_of_week)%7]}return newDays}};$.fn.date_input=function(opts){return this.each(function(){new DateInput(this,opts)})};$.date_input={initialize:function(opts){$("input.date_input").date_input(opts)}};return DateInput})(jQuery);$.extend(DateInput.DEFAULT_OPTS,{stringToDate:function(string){var matches;if(matches=string.match(/^(\d{1,2}) ([^\s]+) (\d{4,4})$/)){return new Date(matches[3],this.shortMonthNum(matches[2]),matches[1],12,0)}else{return null}},dateToString:function(date){return date.getDate()+" "+this.short_month_names[date.getMonth()]+" "+date.getFullYear()}});
