/*-----------------------------------------------------------
	Project:	Les Portes du Soleil
	Author:		C2iS - LGU
	Last:		15:55 08/07/2010
-----------------------------------------------------------*/
/** hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ **/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/** Stylish Select 0.4.1 - http://scottdarby.com **/
(function($){$("html").addClass("stylish-select");Array.prototype.indexOf=function(obj,start){for(var i=(start||0);i<this.length;i++){if(this[i]==obj){return i}}};$.fn.extend({getSetSSValue:function(value){if(value){$(this).val(value).change();return this}else{return $(this).find(":selected").val()}},resetSS:function(){var oldOpts=$(this).data("ssOpts");$this=$(this);$this.next().remove();$this.unbind(".sSelect").sSelect(oldOpts)}});$.fn.sSelect=function(options){return this.each(function(){var defaults={defaultText:"Please select",animationSpeed:0,ddMaxHeight:"",containerClass:""};var opts=$.extend(defaults,options),$input=$(this),$containerDivText=$('<div class="selectedTxt"></div>'),$containerDiv=$('<div class="newListSelected '+opts.containerClass+'"></div>'),$newUl=$('<ul class="newList" style="visibility:hidden;"></ul>'),itemIndex=-1,currentIndex=-1,keys=[],prevKey=false,prevented=false,$newLi;$(this).data("ssOpts",options);$containerDiv.insertAfter($input);$containerDiv.attr("tabindex",$input.attr("tabindex")||"0");$containerDivText.prependTo($containerDiv);$newUl.appendTo($containerDiv);$input.hide();$containerDivText.data("ssReRender",!$containerDivText.is(":visible"));if($input.children("optgroup").length==0){$input.children().each(function(i){var option=$(this).html();var key=$(this).val();keys.push(option.charAt(0).toLowerCase());if($(this).attr("selected")==true){opts.defaultText=option;currentIndex=i}$newUl.append($('<li><a href="JavaScript:void(0);">'+option+"</a></li>").data("key",key))});$newLi=$newUl.children().children()}else{$input.children("optgroup").each(function(){var optionTitle=$(this).attr("label"),$optGroup=$('<li class="newListOptionTitle">'+optionTitle+"</li>");$optGroup.appendTo($newUl);var $optGroupList=$("<ul></ul>");$optGroupList.appendTo($optGroup);$(this).children().each(function(){++itemIndex;var option=$(this).html();var key=$(this).val();keys.push(option.charAt(0).toLowerCase());if($(this).attr("selected")==true){opts.defaultText=option;currentIndex=itemIndex}$optGroupList.append($('<li><a href="JavaScript:void(0);">'+option+"</a></li>").data("key",key))})});$newLi=$newUl.find("ul li a")}var newUlHeight=$newUl.height(),containerHeight=$containerDiv.height(),newLiLength=$newLi.length;if(currentIndex!=-1){navigateList(currentIndex,true)}else{$containerDivText.text(opts.defaultText)}function newUlPos(){var containerPosY=$containerDiv.offset().top,docHeight=jQuery(window).height(),scrollTop=jQuery(window).scrollTop();if(newUlHeight>parseInt(opts.ddMaxHeight)){newUlHeight=parseInt(opts.ddMaxHeight)}containerPosY=containerPosY-scrollTop;if(containerPosY+newUlHeight>=docHeight){$newUl.css({top:"-"+newUlHeight+"px",height:newUlHeight});$input.onTop=true}else if( $('#colContent').length ){colContentHeight=$("#colContent").height();if( $containerDiv.parents('#colContent') && containerPosY + newUlHeight >= colContentHeight){$newUl.css({top:"-"+newUlHeight+"px",height:newUlHeight});$input.onTop=true}}else{$newUl.css({top:containerHeight+"px",height:newUlHeight});$input.onTop=false}}newUlPos();$(window).bind("resize.sSelect scroll.sSelect",newUlPos);function positionFix(){$containerDiv.css("position","relative")}function positionHideFix(){$containerDiv.css("position","static")}$containerDivText.bind("click.sSelect",function(event){event.stopPropagation();if($(this).data("ssReRender")){newUlHeight=$newUl.height("").height();containerHeight=$containerDiv.height();$(this).data("ssReRender",false);newUlPos()}$(".newList").not($(this).next()).hide().parent().css("position","static");$newUl.toggle();positionFix();$newLi.eq(currentIndex).focus()});$newLi.bind("click.sSelect",function(e){var $clickedLi=$(e.target);currentIndex=$newLi.index($clickedLi);prevented=true;navigateList(currentIndex);$newUl.hide();$containerDiv.css("position","static")});$newLi.bind("mouseenter.sSelect",function(e){var $hoveredLi=$(e.target);$hoveredLi.addClass("newListHover")}).bind("mouseleave.sSelect",function(e){var $hoveredLi=$(e.target);$hoveredLi.removeClass("newListHover")});function navigateList(currentIndex,init){$newLi.removeClass("hiLite").eq(currentIndex).addClass("hiLite");if($newUl.is(":visible")){$newLi.eq(currentIndex).focus()}var text=$newLi.eq(currentIndex).html();var val=$newLi.eq(currentIndex).parent().data("key");if(init==true){$input.val(val);$containerDivText.text(text);return false}try{$input.val(val)}catch(ex){$input[0].selectedIndex=currentIndex}$input.change();$containerDivText.text(text)}$input.bind("change.sSelect",function(event){$targetInput=$(event.target);if(prevented==true){prevented=false;return false}$currentOpt=$targetInput.find(":selected");currentIndex=$targetInput.find("option").index($currentOpt);navigateList(currentIndex,true)});function keyPress(element){$(element).unbind("keydown.sSelect").bind("keydown.sSelect",function(e){var keycode=e.which;prevented=true;switch(keycode){case 40:case 39:incrementList();return false;break;case 38:case 37:decrementList();return false;break;case 33:case 36:gotoFirst();return false;break;case 34:case 35:gotoLast();return false;break;case 13:case 27:$newUl.hide();positionHideFix();return false;break}keyPressed=String.fromCharCode(keycode).toLowerCase();var currentKeyIndex=keys.indexOf(keyPressed);if(typeof currentKeyIndex!="undefined"){++currentIndex;currentIndex=keys.indexOf(keyPressed,currentIndex);if(currentIndex==-1||currentIndex==null||prevKey!=keyPressed){currentIndex=keys.indexOf(keyPressed)}navigateList(currentIndex);prevKey=keyPressed;return false}})}function incrementList(){if(currentIndex<(newLiLength-1)){++currentIndex;navigateList(currentIndex)}}function decrementList(){if(currentIndex>0){--currentIndex;navigateList(currentIndex)}}function gotoFirst(){currentIndex=0;navigateList(currentIndex)}function gotoLast(){currentIndex=newLiLength-1;navigateList(currentIndex)}$containerDiv.bind("click.sSelect",function(e){e.stopPropagation();keyPress(this)});$containerDiv.bind("focus.sSelect",function(){keyPress(this)});$containerDiv.bind("blur.sSelect",function(){});$(document).bind("click.sSelect",function(){$newUl.hide();positionHideFix()});$containerDivText.bind("mouseenter.sSelect",function(e){var $hoveredTxt=$(e.target);$hoveredTxt.parent().addClass("newListSelHover")}).bind("mouseleave.sSelect",function(e){var $hoveredTxt=$(e.target);$hoveredTxt.parent().removeClass("newListSelHover")});$newUl.css({left:"0",display:"none",visibility:"visible"})})}})(jQuery);

/** Datepicker 2.1.2  Copyright (c) Kelvin Luck  **/
(function($){$.fn.extend({renderCalendar:function(s){var dc=function(a){return document.createElement(a)};s=$.extend({},$.fn.datePicker.defaults,s);if(s.showHeader!=$.dpConst.SHOW_HEADER_NONE){var headRow=$(dc('tr'));for(var i=Date.firstDayOfWeek;i<Date.firstDayOfWeek+7;i++){var weekday=i%7;var day=Date.dayNames[weekday];headRow.append(jQuery(dc('th')).attr({'scope':'col','abbr':day,'title':day,'class':(weekday==0||weekday==6?'weekend':'weekday')}).html(s.showHeader==$.dpConst.SHOW_HEADER_SHORT?day.substr(0,1):day))}};var calendarTable=$(dc('table')).attr({'cellspacing':2}).addClass('jCalendar').append((s.showHeader!=$.dpConst.SHOW_HEADER_NONE?$(dc('thead')).append(headRow):dc('thead')));var tbody=$(dc('tbody'));var today=(new Date()).zeroTime();var month=s.month==undefined?today.getMonth():s.month;var year=s.year||today.getFullYear();var currentDate=new Date(year,month,1);var firstDayOffset=Date.firstDayOfWeek-currentDate.getDay()+1;if(firstDayOffset>1)firstDayOffset-=7;var weeksToDraw=Math.ceil(((-1*firstDayOffset+1)+currentDate.getDaysInMonth())/7);currentDate.addDays(firstDayOffset-1);var doHover=function(firstDayInBounds){return function(){if(s.hoverClass){var $this=$(this);if(!s.selectWeek){$this.addClass(s.hoverClass)}else if(firstDayInBounds&&!$this.is('.disabled')){$this.parent().addClass('activeWeekHover')}}}};var unHover=function(){if(s.hoverClass){var $this=$(this);$this.removeClass(s.hoverClass);$this.parent().removeClass('activeWeekHover')}};var w=0;while(w++<weeksToDraw){var r=jQuery(dc('tr'));var firstDayInBounds=s.dpController?currentDate>s.dpController.startDate:false;for(var i=0;i<7;i++){var thisMonth=currentDate.getMonth()==month;var d=$(dc('td')).text(currentDate.getDate()+'').addClass((thisMonth?'current-month ':'other-month ')+(currentDate.isWeekend()?'weekend ':'weekday ')+(thisMonth&&currentDate.getTime()==today.getTime()?'today ':'')).data('datePickerDate',currentDate.asString()).hover(doHover(firstDayInBounds),unHover);r.append(d);if(s.renderCallback){s.renderCallback(d,currentDate,month,year)}currentDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate()+1)}tbody.append(r)}calendarTable.append(tbody);return this.each(function(){$(this).empty().append(calendarTable)})},datePicker:function(s){if(!$.event._dpCache)$.event._dpCache=[];s=$.extend({},$.fn.datePicker.defaults,s);return this.each(function(){var $this=$(this);var alreadyExists=true;if(!this._dpId){this._dpId=$.event.guid++;$.event._dpCache[this._dpId]=new DatePicker(this);alreadyExists=false}if(s.inline){s.createButton=false;s.displayClose=false;s.closeOnSelect=false;$this.empty()}var controller=$.event._dpCache[this._dpId];controller.init(s);if(!alreadyExists&&s.createButton){controller.button=$('<a href="#" class="dp-choose-date" title="'+$.dpText.TEXT_CHOOSE_DATE+'">'+$.dpText.TEXT_CHOOSE_DATE+'</a>').bind('click',function(){$this.dpDisplay(this);this.blur();return false});$this.after(controller.button)}if(!alreadyExists&&$this.is(':text')){$this.bind('dateSelected',function(e,selectedDate,$td){this.value=selectedDate.asString()}).bind('change',function(){if(this.value==''){controller.clearSelected()}else{var d=Date.fromString(this.value);if(d){controller.setSelected(d,true,true)}}});if(s.clickInput){$this.bind('click',function(){$this.trigger('change');$this.dpDisplay()})}var d=Date.fromString(this.value);if(this.value!=''&&d){controller.setSelected(d,true,true)}}$this.addClass('dp-applied')})},dpSetDisabled:function(s){return _w.call(this,'setDisabled',s)},dpSetStartDate:function(d){return _w.call(this,'setStartDate',d)},dpSetEndDate:function(d){return _w.call(this,'setEndDate',d)},dpGetSelected:function(){var c=_getController(this[0]);if(c){return c.getSelected()}return null},dpSetSelected:function(d,v,m,e){if(v==undefined)v=true;if(m==undefined)m=true;if(e==undefined)e=true;return _w.call(this,'setSelected',Date.fromString(d),v,m,e)},dpSetDisplayedMonth:function(m,y){return _w.call(this,'setDisplayedMonth',Number(m),Number(y),true)},dpDisplay:function(e){return _w.call(this,'display',e)},dpSetRenderCallback:function(a){return _w.call(this,'setRenderCallback',a)},dpSetPosition:function(v,h){return _w.call(this,'setPosition',v,h)},dpSetOffset:function(v,h){return _w.call(this,'setOffset',v,h)},dpClose:function(){return _w.call(this,'_closeCalendar',false,this[0])},_dpDestroy:function(){}});var _w=function(f,a1,a2,a3,a4){return this.each(function(){var c=_getController(this);if(c){c[f](a1,a2,a3,a4)}})};function DatePicker(ele){this.ele=ele;this.displayedMonth=null;this.displayedYear=null;this.startDate=null;this.endDate=null;this.showYearNavigation=null;this.closeOnSelect=null;this.displayClose=null;this.rememberViewedMonth=null;this.selectMultiple=null;this.numSelectable=null;this.numSelected=null;this.verticalPosition=null;this.horizontalPosition=null;this.verticalOffset=null;this.horizontalOffset=null;this.button=null;this.renderCallback=[];this.selectedDates={};this.inline=null;this.context='#dp-popup';this.settings={}};$.extend(DatePicker.prototype,{init:function(s){this.setStartDate(s.startDate);this.setEndDate(s.endDate);this.setDisplayedMonth(Number(s.month),Number(s.year));this.setRenderCallback(s.renderCallback);this.showYearNavigation=s.showYearNavigation;this.closeOnSelect=s.closeOnSelect;this.displayClose=s.displayClose;this.rememberViewedMonth=s.rememberViewedMonth;this.selectMultiple=s.selectMultiple;this.numSelectable=s.selectMultiple?s.numSelectable:1;this.numSelected=0;this.verticalPosition=s.verticalPosition;this.horizontalPosition=s.horizontalPosition;this.hoverClass=s.hoverClass;this.setOffset(s.verticalOffset,s.horizontalOffset);this.inline=s.inline;this.settings=s;if(this.inline){this.context=this.ele;this.display()}},setStartDate:function(d){if(d){this.startDate=Date.fromString(d)}if(!this.startDate){this.startDate=(new Date()).zeroTime()}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setEndDate:function(d){if(d){this.endDate=Date.fromString(d)}if(!this.endDate){this.endDate=(new Date('12/31/2999'))}if(this.endDate.getTime()<this.startDate.getTime()){this.endDate=this.startDate}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setPosition:function(v,h){this.verticalPosition=v;this.horizontalPosition=h},setOffset:function(v,h){this.verticalOffset=parseInt(v)||0;this.horizontalOffset=parseInt(h)||0},setDisabled:function(s){$e=$(this.ele);$e[s?'addClass':'removeClass']('dp-disabled');if(this.button){$but=$(this.button);$but[s?'addClass':'removeClass']('dp-disabled');$but.attr('title',s?'':$.dpText.TEXT_CHOOSE_DATE)}if($e.is(':text')){$e.attr('disabled',s?'disabled':'')}},setDisplayedMonth:function(m,y,rerender){if(this.startDate==undefined||this.endDate==undefined){return}var s=new Date(this.startDate.getTime());s.setDate(1);var e=new Date(this.endDate.getTime());e.setDate(1);var t;if((!m&&!y)||(isNaN(m)&&isNaN(y))){t=new Date().zeroTime();t.setDate(1)}else if(isNaN(m)){t=new Date(y,this.displayedMonth,1)}else if(isNaN(y)){t=new Date(this.displayedYear,m,1)}else{t=new Date(y,m,1)}if(t.getTime()<s.getTime()){t=s}else if(t.getTime()>e.getTime()){t=e}var oldMonth=this.displayedMonth;var oldYear=this.displayedYear;this.displayedMonth=t.getMonth();this.displayedYear=t.getFullYear();if(rerender&&(this.displayedMonth!=oldMonth||this.displayedYear!=oldYear)){this._rerenderCalendar();$(this.ele).trigger('dpMonthChanged',[this.displayedMonth,this.displayedYear])}},setSelected:function(d,v,moveToMonth,dispatchEvents){if(d<this.startDate||d>this.endDate){return}var s=this.settings;if(s.selectWeek){d=d.addDays(-(d.getDay()-Date.firstDayOfWeek+7)%7);if(d<this.startDate){return}}if(v==this.isSelected(d)){return}if(this.selectMultiple==false){this.clearSelected()}else if(v&&this.numSelected==this.numSelectable){return}if(moveToMonth&&(this.displayedMonth!=d.getMonth()||this.displayedYear!=d.getFullYear())){this.setDisplayedMonth(d.getMonth(),d.getFullYear(),true)}this.selectedDates[d.toString()]=v;this.numSelected+=v?1:-1;var selectorString='td.'+(d.getMonth()==this.displayedMonth?'current-month':'other-month');var $td;$(selectorString,this.context).each(function(){if($(this).data('datePickerDate')==d.asString()){$td=$(this);if(s.selectWeek){$td.parent()[v?'addClass':'removeClass']('selectedWeek')}$td[v?'addClass':'removeClass']('selected')}});$('td',this.context).not('.selected')[this.selectMultiple&&this.numSelected==this.numSelectable?'addClass':'removeClass']('unselectable');if(dispatchEvents){var s=this.isSelected(d);$e=$(this.ele);var dClone=Date.fromString(d.asString());$e.trigger('dateSelected',[dClone,$td,s]);$e.trigger('change')}},isSelected:function(d){return this.selectedDates[d.toString()]},getSelected:function(){var r=[];for(s in this.selectedDates){if(this.selectedDates[s]==true){r.push(Date.parse(s))}}return r},clearSelected:function(){this.selectedDates={};this.numSelected=0;$('td.selected',this.context).removeClass('selected').parent().removeClass('selectedWeek')},display:function(eleAlignTo){if($(this.ele).is('.dp-disabled'))return;eleAlignTo=eleAlignTo||this.ele;var c=this;var $ele=$(eleAlignTo);var eleOffset=$ele.offset();var $createIn;var attrs;var attrsCalendarHolder;var cssRules;if(c.inline){$createIn=$(this.ele);attrs={'id':'calendar-'+this.ele._dpId,'class':'dp-popup dp-popup-inline'};$('.dp-popup',$createIn).remove();cssRules={}}else{$createIn=$('body');attrs={'id':'dp-popup','class':'dp-popup'};cssRules={'top':eleOffset.top+c.verticalOffset,'left':eleOffset.left+c.horizontalOffset};var _checkMouse=function(e){var el=e.target;var cal=$('#dp-popup')[0];while(true){if(el==cal){return true}else if(el==document){c._closeCalendar();return false}else{el=$(el).parent()[0]}}};this._checkMouse=_checkMouse;c._closeCalendar(true);$(document).bind('keydown.datepicker',function(event){if(event.keyCode==27){c._closeCalendar()}})}if(!c.rememberViewedMonth){var selectedDate=this.getSelected()[0];if(selectedDate){selectedDate=new Date(selectedDate);this.setDisplayedMonth(selectedDate.getMonth(),selectedDate.getFullYear(),false)}}$createIn.append($('<div></div>').attr(attrs).css(cssRules).append($('<h2></h2>'),$('<div class="dp-nav-prev"></div>').append($('<a class="dp-nav-prev-year" href="#" title="'+$.dpText.TEXT_PREV_YEAR+'">&lt;&lt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,0,-1)}),$('<a class="dp-nav-prev-month" href="#" title="'+$.dpText.TEXT_PREV_MONTH+'">&lt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,-1,0)})),$('<div class="dp-nav-next"></div>').append($('<a class="dp-nav-next-year" href="#" title="'+$.dpText.TEXT_NEXT_YEAR+'">&gt;&gt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,0,1)}),$('<a class="dp-nav-next-month" href="#" title="'+$.dpText.TEXT_NEXT_MONTH+'">&gt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,1,0)})),$('<div class="dp-calendar"></div>')).bgIframe());var $pop=this.inline?$('.dp-popup',this.context):$('#dp-popup');if(this.showYearNavigation==false){$('.dp-nav-prev-year, .dp-nav-next-year',c.context).css('display','none')}if(this.displayClose){$pop.append($('<a href="#" id="dp-close">'+$.dpText.TEXT_CLOSE+'</a>').bind('click',function(){c._closeCalendar();return false}))}c._renderCalendar();$(this.ele).trigger('dpDisplayed',$pop);if(!c.inline){if(this.verticalPosition==$.dpConst.POS_BOTTOM){$pop.css('top',eleOffset.top+$ele.height()-$pop.height()+c.verticalOffset)}if(this.horizontalPosition==$.dpConst.POS_RIGHT){$pop.css('left',eleOffset.left+$ele.width()-$pop.width()+c.horizontalOffset)}$(document).bind('mousedown.datepicker',this._checkMouse)}},setRenderCallback:function(a){if(a==null)return;if(a&&typeof(a)=='function'){a=[a]}this.renderCallback=this.renderCallback.concat(a)},cellRender:function($td,thisDate,month,year){var c=this.dpController;var d=new Date(thisDate.getTime());$td.bind('click',function(){var $this=$(this);if(!$this.is('.disabled')){c.setSelected(d,!$this.is('.selected')||!c.selectMultiple,false,true);if(c.closeOnSelect){c._closeCalendar()}if(!$.browser.msie){$(c.ele).trigger('focus',[$.dpConst.DP_INTERNAL_FOCUS])}}});if(c.isSelected(d)){$td.addClass('selected');if(c.settings.selectWeek){$td.parent().addClass('selectedWeek')}}else if(c.selectMultiple&&c.numSelected==c.numSelectable){$td.addClass('unselectable')}},_applyRenderCallbacks:function(){var c=this;$('td',this.context).each(function(){for(var i=0;i<c.renderCallback.length;i++){$td=$(this);c.renderCallback[i].apply(this,[$td,Date.fromString($td.data('datePickerDate')),c.displayedMonth,c.displayedYear])}});return},_displayNewMonth:function(ele,m,y){if(!$(ele).is('.disabled')){this.setDisplayedMonth(this.displayedMonth+m,this.displayedYear+y,true)}ele.blur();return false},_rerenderCalendar:function(){this._clearCalendar();this._renderCalendar()},_renderCalendar:function(){$('h2',this.context).html((new Date(this.displayedYear,this.displayedMonth,1)).asString($.dpText.HEADER_FORMAT));$('.dp-calendar',this.context).renderCalendar($.extend({},this.settings,{month:this.displayedMonth,year:this.displayedYear,renderCallback:this.cellRender,dpController:this,hoverClass:this.hoverClass}));if(this.displayedYear==this.startDate.getFullYear()&&this.displayedMonth==this.startDate.getMonth()){$('.dp-nav-prev-year',this.context).addClass('disabled');$('.dp-nav-prev-month',this.context).addClass('disabled');$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Number($this.text())>20){$this.addClass('disabled')}});var d=this.startDate.getDate();$('.dp-calendar td.current-month',this.context).each(function(){var $this=$(this);if(Number($this.text())<d){$this.addClass('disabled')}})}else{$('.dp-nav-prev-year',this.context).removeClass('disabled');$('.dp-nav-prev-month',this.context).removeClass('disabled');var d=this.startDate.getDate();if(d>20){var st=this.startDate.getTime();var sd=new Date(st);sd.addMonths(1);if(this.displayedYear==sd.getFullYear()&&this.displayedMonth==sd.getMonth()){$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Date.fromString($this.data('datePickerDate')).getTime()<st){$this.addClass('disabled')}})}}}if(this.displayedYear==this.endDate.getFullYear()&&this.displayedMonth==this.endDate.getMonth()){$('.dp-nav-next-year',this.context).addClass('disabled');$('.dp-nav-next-month',this.context).addClass('disabled');$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Number($this.text())<14){$this.addClass('disabled')}});var d=this.endDate.getDate();$('.dp-calendar td.current-month',this.context).each(function(){var $this=$(this);if(Number($this.text())>d){$this.addClass('disabled')}})}else{$('.dp-nav-next-year',this.context).removeClass('disabled');$('.dp-nav-next-month',this.context).removeClass('disabled');var d=this.endDate.getDate();if(d<13){var ed=new Date(this.endDate.getTime());ed.addMonths(-1);if(this.displayedYear==ed.getFullYear()&&this.displayedMonth==ed.getMonth()){$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Number($this.text())>d){$this.addClass('disabled')}})}}}this._applyRenderCallbacks()},_closeCalendar:function(programatic,ele){if(!ele||ele==this.ele){$(document).unbind('mousedown.datepicker');$(document).unbind('keydown.datepicker');this._clearCalendar();$('#dp-popup a').unbind();$('#dp-popup').empty().remove();if(!programatic){$(this.ele).trigger('dpClosed',[this.getSelected()])}}},_clearCalendar:function(){$('.dp-calendar td',this.context).unbind();$('.dp-calendar',this.context).empty()}});$.dpConst={SHOW_HEADER_NONE:0,SHOW_HEADER_SHORT:1,SHOW_HEADER_LONG:2,POS_TOP:0,POS_BOTTOM:1,POS_LEFT:0,POS_RIGHT:1,DP_INTERNAL_FOCUS:'dpInternalFocusTrigger'};$.dpText={TEXT_PREV_YEAR:'Ann&eacute;e pr&eacute;c&eacute;dente',TEXT_PREV_MONTH:'Mois pr&eacute;c&eacute;dent',TEXT_NEXT_YEAR:'Ann&eacute;e suivante',TEXT_NEXT_MONTH:'Mois suivant',TEXT_CLOSE:'Fermer',TEXT_CHOOSE_DATE:'Choisir une date',HEADER_FORMAT:'mmmm aaaa'};$.dpVersion='$Id$';$.fn.datePicker.defaults={month:undefined,year:undefined,showHeader:$.dpConst.SHOW_HEADER_SHORT,startDate:undefined,endDate:undefined,inline:false,renderCallback:null,createButton:true,showYearNavigation:true,closeOnSelect:true,displayClose:false,selectMultiple:false,numSelectable:Number.MAX_VALUE,clickInput:false,rememberViewedMonth:true,selectWeek:false,verticalPosition:$.dpConst.POS_TOP,horizontalPosition:$.dpConst.POS_LEFT,verticalOffset:0,horizontalOffset:0,hoverClass:'dp-hover'};function _getController(ele){if(ele._dpId)return $.event._dpCache[ele._dpId];return false};if($.fn.bgIframe==undefined){$.fn.bgIframe=function(){return this}};$(window).bind('unload',function(){var els=$.event._dpCache||[];for(var i in els){$(els[i].ele)._dpDestroy()}})})(jQuery);

/** Date Format Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron **/
//Date.dayNames=['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'];Date.abbrDayNames=['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'];Date.monthNames=['Janvier','F&eacute;vrier','Mars','Avril','Mai','Juin','Juillet','Ao&ucirc;t','Septembre','Octobre','Novembre','D&eacute;cembre'];Date.abbrMonthNames=['Jan','Fev','Mar','Avr','Mai','Jun','Jul','Aou','Sep','Oct','Nov','Dec'];Date.firstDayOfWeek=1;Date.format='jj/mm/aaaa';Date.fullYearStart='20';(function(){function add(name,method){if(!Date.prototype[name]){Date.prototype[name]=method}};add("isLeapYear",function(){var y=this.getFullYear();return(y%4==0&&y%100!=0)||y%400==0});add("isWeekend",function(){return this.getDay()==0||this.getDay()==6});add("isWeekDay",function(){return!this.isWeekend()});add("getDaysInMonth",function(){return[31,(this.isLeapYear()?29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]});add("getDayName",function(abbreviated){return abbreviated?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()]});add("getMonthName",function(abbreviated){return abbreviated?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()]});add("getDayOfYear",function(){var tmpdtm=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-tmpdtm.getTime())/86400000)});add("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7)});add("setDayOfYear",function(day){this.setMonth(0);this.setDate(day);return this});add("addYears",function(num){this.setFullYear(this.getFullYear()+num);return this});add("addMonths",function(num){var tmpdtm=this.getDate();this.setMonth(this.getMonth()+num);if(tmpdtm>this.getDate())this.addDays(-this.getDate());return this});add("addDays",function(num){this.setTime(this.getTime()+(num*86400000));return this});add("addHours",function(num){this.setHours(this.getHours()+num);return this});add("addMinutes",function(num){this.setMinutes(this.getMinutes()+num);return this});add("addSeconds",function(num){this.setSeconds(this.getSeconds()+num);return this});add("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this});add("asString",function(format){var r=format||Date.format;return r.split('aaaa').join(this.getFullYear()).split('aa').join((this.getFullYear()+'').substring(2)).split('mmmm').join(this.getMonthName(false)).split('mmm').join(this.getMonthName(true)).split('mm').join(_zeroPad(this.getMonth()+1)).split('jj').join(_zeroPad(this.getDate()))});Date.fromString=function(s){var f=Date.format;var d=new Date('01/01/1977');var mLength=0;var iM=f.indexOf('mmmm');if(iM>-1){for(var i=0;i<Date.monthNames.length;i++){var mStr=s.substr(iM,Date.monthNames[i].length);if(Date.monthNames[i]==mStr){mLength=Date.monthNames[i].length-4;break}}d.setMonth(i)}else{iM=f.indexOf('mmm');if(iM>-1){var mStr=s.substr(iM,3);for(var i=0;i<Date.abbrMonthNames.length;i++){if(Date.abbrMonthNames[i]==mStr)break}d.setMonth(i)}else{d.setMonth(Number(s.substr(f.indexOf('mm'),2))-1)}}var iY=f.indexOf('aaaa');if(iY>-1){if(iM<iY){iY+=mLength}d.setFullYear(Number(s.substr(iY,4)))}else{if(iM<iY){iY+=mLength}d.setFullYear(Number(Date.fullYearStart+s.substr(f.indexOf('yy'),2)))}var iD=f.indexOf('jj');if(iM<iD){iD+=mLength}d.setDate(Number(s.substr(iD,2)));if(isNaN(d.getTime())){return false}return d};var _zeroPad=function(num){var s='0'+num;return s.substring(s.length-2)}})();

/** Easy Slider Copyright (c) 2009 Alen Grakalic (http://cssglobe.com) **/
(function($) {
	$.fn.easySlider = function(options){
		// default configuration properties
		var defaults = {
			prevId: 		'prevBtn',
			prevText: 		'Previous',
			nextId: 		'nextBtn',	
			nextText: 		'Next',
			orientation:	'', //  'vertical' is optional;
			speed: 			800			
		}; 
		var options = $.extend(defaults, options);  
		return this.each(function() { 
			obj = $(this); 				
			var s = $("li", obj).length;
			if ($("#eventsSlider").length) {
				var w = obj.width()-251;
			}else{
				var w = obj.width();
			};
			var h = obj.height(); 
			var ts = s-1;
			var t = 0;
			var vertical = (options.orientation == 'vertical');
			
			$("ul", obj).css('width',s*w);			
			if(!vertical) $("li", obj).css('float','left');
			
			if ($("#eventsSlider").length) {
				$("a","#"+options.prevId).show();
				$("a","#"+options.nextId).show();
				$("a","#"+options.nextId).click(function(){
					animate("next");
				});
				$("a","#"+options.prevId).click(function(){		
					animate("prev");
				});	
			}else if ($("#eventsContainer #slider, #typeContainer #slider").length){
				$("a","#"+options.prevId).hide();
				$("a","#"+options.nextId).hide();
				$("a","#"+options.nextId).click(function(){		
					animate("next");
					if (t>=ts) $(this).fadeOut();
					if (t>=ts) $("a","#"+options.prevId).fadeIn();
				});
				$("a","#"+options.prevId).click(function(){		
					animate("prev");
					if (t<=0) $(this).fadeOut();
					$("a","#"+options.nextId).fadeIn();
				});	
			}else if ($("ul#stationNav li:last").hasClass("active")){
				$("a","#"+options.prevId).hide();
				$("a","#"+options.nextId).click(function(){		
					animate("next");
					if (t>=ts) $(this).fadeOut();
					$("a","#"+options.prevId).fadeIn();
				});
				$("a","#"+options.prevId).click(function(){		
					animate("prev");
					if (t<=0) $(this).fadeOut();
					$("a","#"+options.nextId).fadeIn();
				});	
			}else{
				$("a","#"+options.prevId).hide();
				$("a","#"+options.nextId).hide();
				$("a","#"+options.nextId).click(function(){		
					animate("next");
					if (t>=ts) $(this).fadeOut();
					$("a","#"+options.prevId).fadeIn();
				});
				$("a","#"+options.prevId).click(function(){		
					animate("prev");
					if (t<=0) $(this).fadeOut();
					$("a","#"+options.nextId).fadeIn();
				});	
			};
			function animate(dir){
				if(dir == "next"){
					t = (t>=ts) ? ts : t+1;	
				} else {
					t = (t<=0) ? 0 : t-1;
				};								
				if(!vertical) {
					p = (t*w*-1);
					$("ul",obj).animate(
						{ marginLeft: p }, 
						options.speed
					);				
				} else {
					p = (t*h*-1);
					$("ul",obj).animate(
						{ marginTop: p }, 
						options.speed
					);					
				}
			};
			if(s>1) $("a","#"+options.nextId).fadeIn();	
		});
	};
})(jQuery);

/** testMediaQueries  by alexander.farkas v 1.1.9 **/
(function(a){a.testMedia=function(f){var c=new Date().getTime(),e,g=a('<div class="testMediaQuery'+c+'"></div>').css({visibility:"hidden",position:"absolute"}).appendTo("body"),d=document.createElement("style");d.setAttribute("type","text/css");d.setAttribute("media",f);d=a(d).prependTo("head");e=document.styleSheets[0];if(e.cssRules||e.rules){if(e.insertRule){e.insertRule(".testMediaQuery"+c+" {display:none !important;}",e.cssRules.length)}else{if(e.addRule){e.addRule(".testMediaQuery"+c,"display:none")}}}var b=g.css("display")==="none";g.remove();d.remove();return b};a.arrayInString=function(d,b){var c=-1;a.each(b,function(e,f){if(d.indexOf(f)!=-1){c=e;return false}});return c};a.enableMediaQuery=(function(){var d=[],e,c=new Date().getTime();function b(p){var n=p.getAttribute("media"),g=/\(\s*min-width\s*:\s*(\d+)px\s*\)/,k=/\(\s*max-width\s*:\s*(\d+)px\s*\)/,m,q,f=["handheld","all","screen","projection","tty","tv","print"],o,l=[];n=(!n)?["all"]:n.split(",");for(var h=0,j=n.length;h<j;h++){o=a.arrayInString(n[h],f);if(o!=-1){o=f[o];if(!m){m=g.exec(n[h]);if(m){m=parseInt(m[1],10)}}if(!q){q=k.exec(n[h]);if(q){q=parseInt(q[1],10)}}l.push(o)}}if(m||q){d.push({obj:p,min:m,max:q,medium:l.join(","),used:false})}}return{init:function(){if(!e){var f;e=a("link[rel*=style]").each(function(){b(this)});a.enableMediaQuery.adjust();a(window).bind("resize.mediaQueries",function(){clearTimeout(f);f=setTimeout(a.enableMediaQuery.adjust,29)})}},adjust:function(){var j=a(window).width(),l=[],k,m,h,f;for(h=0,f=d.length;h<f;h++){m=!d[h].obj.disabled&&((!(d[h].min&&d[h].min>j)&&!(d[h].max&&d[h].max<j))||(!d[h].max&&!d[h].min));if(m){var o=d[h].obj.cloneNode(true);o.setAttribute("media",d[h].medium);o.className="insertStyleforMedia"+c;l.push(o);if(!d[h].used){d[h].used=true;k=true}}else{if(d[h].used!==m){d[h].used=false;k=true}}}if(k){a("link.insertStyleforMedia"+c).remove();var g=document.getElementsByTagName("head");for(h=0,f=l.length;h<f;h++){g[0].appendChild(l[h])}}}}})();a.support.mediaQueries=!(a.browser.msie&&parseFloat(a.browser.version,10)<9)||(a.browser.mozilla&&parseFloat(a.browser.version,10)<1.9);setTimeout(function(){if(!a.isReady&&document.body&&!a.support.mediaQueries){try{a.enableMediaQuery.init()}catch(b){}}},1);a(function(){a.support.mediaQueries=a.testMedia("only all");if(!a.support.mediaQueries){a.enableMediaQuery.init()}})})(jQuery);

/*ColorBox v1.3.5*/
(function(B,P){var C={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,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},t="colorbox",M="cbox",O=M+"_open",e=M+"_load",N=M+"_complete",q=M+"_cleanup",U=M+"_closed",i=M+"_purge",I=M+"_loaded",r=B.browser.msie&&!B.support.opacity,X=r&&B.browser.version<7,T=M+"_IE6",K,Y,Z,d,z,m,b,J,c,S,F,j,h,l,p,Q,o,L,v,aa,k,g,a,s,A,V,x,R,E=false,D,n=M+"Element";function H(ac,ab){ac=ac?' id="'+M+ac+'"':"";ab=ab?' style="'+ab+'"':"";return B("<div"+ac+ab+"/>")}function G(ab,ac){ac=ac==="x"?S.width():S.height();return(typeof ab==="string")?Math.round((/%/.test(ab)?(ac/100)*parseInt(ab,10):parseInt(ab,10))):ab}function w(ab){return V.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(ab)}function W(ac){for(var ab in ac){if(B.isFunction(ac[ab])&&ab.substring(0,2)!=="on"){ac[ab]=ac[ab].call(s)}}ac.rel=ac.rel||s.rel||"nofollow";ac.href=ac.href||B(s).attr("href");ac.title=ac.title||s.title;return ac}function y(ab,ac){if(ac){ac.call(s)}B.event.trigger(ab)}function u(){var ac,ae=M+"Slideshow_",af="click."+M,ag,ad,ab;if(V.slideshow&&c[1]){ag=function(){Q.text(V.slideshowStop).unbind(af).bind(N,function(){if(A<c.length-1||V.loop){ac=setTimeout(D.next,V.slideshowSpeed)}}).bind(e,function(){clearTimeout(ac)}).one(af+" "+q,ad);Y.removeClass(ae+"off").addClass(ae+"on");ac=setTimeout(D.next,V.slideshowSpeed)};ad=function(){clearTimeout(ac);Q.text(V.slideshowStart).unbind([N,e,q,af].join(" ")).one(af,ag);Y.removeClass(ae+"on").addClass(ae+"off")};if(V.slideshowAuto){ag()}else{ad()}}}function f(ab){if(!E){s=ab;V=W(B.extend({},B.data(s,t)));c=B(s);A=0;if(V.rel!=="nofollow"){c=B("."+n).filter(function(){var ad=B.data(this,t).rel||this.rel;return(ad===V.rel)});A=c.index(s);if(A===-1){c=c.add(s);A=c.length-1}}if(!x){x=R=true;Y.show();if(V.returnFocus){try{s.blur();B(s).one(U,function(){try{this.focus()}catch(ad){}})}catch(ac){}}K.css({opacity:+V.opacity,cursor:V.overlayClose?"pointer":"auto"}).show();V.w=G(V.initialWidth,"x");V.h=G(V.initialHeight,"y");D.position(0);if(X){S.bind("resize."+T+" scroll."+T,function(){K.css({width:S.width(),height:S.height(),top:S.scrollTop(),left:S.scrollLeft()})}).trigger("scroll."+T)}y(O,V.onOpen);p.add(L).add(o).add(Q).add(l).hide();v.html(V.close).show()}D.load(true)}}D=B.fn[t]=B[t]=function(ab,ae){var ac=this,ad;if(!ac[0]&&ac.selector){return ac}ab=ab||{};if(ae){ab.onComplete=ae}if(!ac[0]||ac.selector===undefined){ac=B("<a/>");ab.open=true}ac.each(function(){B.data(this,t,B.extend({},B.data(this,t)||C,ab));B(this).addClass(n)});ad=ab.open;if(B.isFunction(ad)){ad=ad.call(ac)}if(ad){f(ac[0])}return ac};D.init=function(){S=B(P);Y=H().attr({id:t,"class":r?M+"IE":""});K=H("Overlay",X?"position:absolute":"").hide();Z=H("Wrapper");d=H("Content").append(F=H("LoadedContent","width:0; height:0; overflow:hidden"),h=H("LoadingOverlay").add(H("LoadingGraphic")),l=H("Title"),p=H("Current"),o=H("Next"),L=H("Previous"),Q=H("Slideshow").bind(O,u),v=H("Close"));Z.append(H().append(H("TopLeft"),z=H("TopCenter"),H("TopRight")),H(false,"clear:left").append(m=H("MiddleLeft"),d,b=H("MiddleRight")),H(false,"clear:left").append(H("BottomLeft"),J=H("BottomCenter"),H("BottomRight"))).children().children().css({"float":"left"});j=H(false,"position:absolute; width:9999px; visibility:hidden; display:none");B("body").prepend(K,Y.append(Z,j));d.children().hover(function(){B(this).addClass("hover")},function(){B(this).removeClass("hover")}).addClass("hover");aa=z.height()+J.height()+d.outerHeight(true)-d.height();k=m.width()+b.width()+d.outerWidth(true)-d.width();g=F.outerHeight(true);a=F.outerWidth(true);Y.css({"padding-bottom":aa,"padding-right":k}).hide();o.click(D.next);L.click(D.prev);v.click(D.close);d.children().removeClass("hover");B("."+n).live("click",function(ab){if(!((ab.button!==0&&typeof ab.button!=="undefined")||ab.ctrlKey||ab.shiftKey||ab.altKey)){ab.preventDefault();f(this)}});K.click(function(){if(V.overlayClose){D.close()}});B(document).bind("keydown",function(ab){if(x&&V.escKey&&ab.keyCode===27){ab.preventDefault();D.close()}if(x&&V.arrowKey&&!R&&c[1]){if(ab.keyCode===37&&(A||V.loop)){ab.preventDefault();L.click()}else{if(ab.keyCode===39&&(A<c.length-1||V.loop)){ab.preventDefault();o.click()}}}})};D.remove=function(){Y.add(K).remove();B("."+n).die("click").removeData(t).removeClass(n)};D.position=function(af,ac){var ae,ad=Math.max(document.documentElement.clientHeight-V.h-g-aa,0)/2+S.scrollTop(),ab=Math.max(S.width()-V.w-a-k,0)/2+S.scrollLeft();ae=(Y.width()===V.w+a&&Y.height()===V.h+g)?0:af;Z[0].style.width=Z[0].style.height="9999px";function ag(ah){z[0].style.width=J[0].style.width=d[0].style.width=ah.style.width;h[0].style.height=h[1].style.height=d[0].style.height=m[0].style.height=b[0].style.height=ah.style.height}Y.dequeue().animate({width:V.w+a,height:V.h+g,top:ad,left:ab},{duration:ae,complete:function(){ag(this);R=false;Z[0].style.width=(V.w+a+k)+"px";Z[0].style.height=(V.h+g+aa)+"px";if(ac){ac()}},step:function(){ag(this)}})};D.resize=function(ab){if(x){ab=ab||{};if(ab.width){V.w=G(ab.width,"x")-a-k}if(ab.innerWidth){V.w=G(ab.innerWidth,"x")}F.css({width:V.w});if(ab.height){V.h=G(ab.height,"y")-g-aa}if(ab.innerHeight){V.h=G(ab.innerHeight,"y")}if(!ab.innerHeight&&!ab.height){var ac=F.wrapInner("<div style='overflow:auto'></div>").children();V.h=ac.height();ac.replaceWith(ac.children())}F.css({height:V.h});D.position(V.transition==="none"?0:V.speed)}};D.prep=function(ae){if(!x){return}var ad,af=V.transition==="none"?0:V.speed;S.unbind("resize."+M);F.remove();F=H("LoadedContent").html(ae);function ab(){V.w=V.w||F.width();V.w=V.mw&&V.mw<V.w?V.mw:V.w;return V.w}function ag(){V.h=V.h||F.height();V.h=V.mh&&V.mh<V.h?V.mh:V.h;return V.h}F.hide().appendTo(j.show()).css({width:ab(),overflow:V.scrolling?"auto":"hidden"}).css({height:ag()}).prependTo(d);j.hide();B("#"+M+"Photo").css({cssFloat:"none",marginLeft:"auto",marginRight:"auto"});if(X){B("select").not(Y.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(q,function(){this.style.visibility="inherit"})}function ac(ak){var am,an,aj,ai,al=c.length,ah=V.loop;D.position(ak,function(){function ao(){if(r){Y[0].style.filter=false}}if(!x){return}if(r){if(ad){F.fadeIn(100)}}F.show();y(I);l.show().html(V.title);if(al>1){if(typeof V.current==="string"){p.html(V.current.replace(/\{current\}/,A+1).replace(/\{total\}/,al)).show()}o[(ah||A<al-1)?"show":"hide"]().html(V.next);L[(ah||A)?"show":"hide"]().html(V.previous);am=A?c[A-1]:c[al-1];aj=A<al-1?c[A+1]:c[0];if(V.slideshow){Q.show()}if(V.preloading){ai=B.data(aj,t).href||aj.href;an=B.data(am,t).href||am.href;ai=B.isFunction(ai)?ai.call(aj):ai;an=B.isFunction(an)?an.call(am):an;if(w(ai)){B("<img/>")[0].src=ai}if(w(an)){B("<img/>")[0].src=an}}}h.hide();if(V.transition==="fade"){Y.fadeTo(af,1,function(){ao()})}else{ao()}S.bind("resize."+M,function(){D.position(0)});y(N,V.onComplete)})}if(V.transition==="fade"){Y.fadeTo(af,0,function(){ac(0)})}else{ac(af)}};D.load=function(ae){var ad,ac,af,ab=D.prep;R=true;s=c[A];if(!ae){V=W(B.extend({},B.data(s,t)))}y(i);y(e,V.onLoad);V.h=V.height?G(V.height,"y")-g-aa:V.innerHeight&&G(V.innerHeight,"y");V.w=V.width?G(V.width,"x")-a-k:V.innerWidth&&G(V.innerWidth,"x");V.mw=V.w;V.mh=V.h;if(V.maxWidth){V.mw=G(V.maxWidth,"x")-a-k;V.mw=V.w&&V.w<V.mw?V.w:V.mw}if(V.maxHeight){V.mh=G(V.maxHeight,"y")-g-aa;V.mh=V.h&&V.h<V.mh?V.h:V.mh}ad=V.href;h.show();if(V.inline){H().hide().insertBefore(B(ad)[0]).one(i,function(){B(this).replaceWith(F.children())});ab(B(ad))}else{if(V.iframe){Y.one(I,function(){var ag=B("<iframe name='"+new Date().getTime()+"' frameborder=0"+(V.scrolling?"":" scrolling='no'")+(r?" allowtransparency='true'":"")+" style='width:100%; height:100%; border:0; display:block;'/>");ag[0].src=V.href;ag.appendTo(F).one(i,function(){ag[0].src="//about:blank"})});ab(" ")}else{if(V.html){ab(V.html)}else{if(w(ad)){ac=new Image();ac.onload=function(){var ag;ac.onload=null;ac.id=M+"Photo";B(ac).css({border:"none",display:"block",cssFloat:"left"});if(V.scalePhotos){af=function(){ac.height-=ac.height*ag;ac.width-=ac.width*ag};if(V.mw&&ac.width>V.mw){ag=(ac.width-V.mw)/ac.width;af()}if(V.mh&&ac.height>V.mh){ag=(ac.height-V.mh)/ac.height;af()}}if(V.h){ac.style.marginTop=Math.max(V.h-ac.height,0)/2+"px"}if(c[1]&&(A<c.length-1||V.loop)){B(ac).css({cursor:"pointer"}).click(D.next)}if(r){ac.style.msInterpolationMode="bicubic"}setTimeout(function(){ab(ac)},1)};setTimeout(function(){ac.src=ad},1)}else{if(ad){j.load(ad,function(ah,ag,ai){ab(ag==="error"?"Request unsuccessful: "+ai.statusText:B(this).children())})}}}}}};D.next=function(){if(!R){A=A<c.length-1?A+1:0;D.load()}};D.prev=function(){if(!R){A=A?A-1:c.length-1;D.load()}};D.close=function(){if(x&&!E){E=true;x=false;y(q,V.onCleanup);S.unbind("."+M+" ."+T);K.fadeTo("fast",0);Y.stop().fadeTo("fast",0,function(){y(i);F.remove();Y.add(K).css({opacity:1,cursor:"auto"}).hide();setTimeout(function(){E=false;y(U,V.onClosed)},1)})}};D.element=function(){return B(s)};D.settings=C;B(D.init)}(jQuery,this));


/** Ojbect Oriented Javascript Cookies
Copyright (c) 2009 Dominique Kimbell - Dual licensed under the MIT and GPL licenses
**/	
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/** TipTip Copyright 2010 Drew Wilson - v1.3 - Updated: Mar. 23, 2010 **/
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);



