
function clearInput(field_id,term_to_clear){if(document.getElementById(field_id).value==term_to_clear){document.getElementById(field_id).value='';}
else if(document.getElementById(field_id).value==''){document.getElementById(field_id).value=term_to_clear;}}(function($){
$.jGrowl=function(m,o){
if($("#jGrowl").size()==0){
$("<div id=\"jGrowl\"></div>").addClass($.jGrowl.defaults.position).appendTo("body");
}
$("#jGrowl").jGrowl(m,o);
};
$.fn.jGrowl=function(m,o){
if($.isFunction(this.each)){
var _6=arguments;
return this.each(function(){
var _7=this;
if($(this).data("jGrowl.instance")==undefined){
$(this).data("jGrowl.instance",new $.fn.jGrowl());
$(this).data("jGrowl.instance").startup(this);
}
if($.isFunction($(this).data("jGrowl.instance")[m])){
$(this).data("jGrowl.instance")[m].apply($(this).data("jGrowl.instance"),$.makeArray(_6).slice(1));
}else{
$(this).data("jGrowl.instance").notification(m,o);
}
});
}
};
$.extend($.fn.jGrowl.prototype,{defaults:{header:"",sticky:false,position:"top-left",glue:"after",theme:"default",corners:"10px",check:500,life:3000,speed:"normal",easing:"swing",closer:true,log:function(e,m,o){
},beforeOpen:function(e,m,o){
},open:function(e,m,o){
},beforeClose:function(e,m,o){
},close:function(e,m,o){
},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},element:null,interval:null,notification:function(_17,o){
var _19=this;
var o=$.extend({},this.defaults,o);
o.log.apply(this.element,[this.element,_17,o]);
var _1a=$("<div class=\"jGrowl-notification\"><div class=\"close\">&times;</div><div class=\"header\">"+o.header+"</div><div class=\"message\">"+_17+"</div></div>").data("jGrowl",o).addClass(o.theme).children("div.close").bind("click.jGrowl",function(){
$(this).unbind("click.jGrowl").parent().trigger("jGrowl.beforeClose").animate(o.animateClose,o.speed,o.easing,function(){
$(this).trigger("jGrowl.close").remove();
});
}).parent();
(o.glue=="after")?$("div.jGrowl-notification:last",this.element).after(_1a):$("div.jGrowl-notification:first",this.element).before(_1a);
$(_1a).bind("mouseover.jGrowl",function(){
$(this).data("jGrowl").pause=true;
}).bind("mouseout.jGrowl",function(){
$(this).data("jGrowl").pause=false;
}).bind("jGrowl.beforeOpen",function(){
o.beforeOpen.apply(_19.element,[_19.element,_17,o]);
}).bind("jGrowl.open",function(){
o.open.apply(_19.element,[_19.element,_17,o]);
}).bind("jGrowl.beforeClose",function(){
o.beforeClose.apply(_19.element,[_19.element,_17,o]);
}).bind("jGrowl.close",function(){
o.close.apply(_19.element,[_19.element,_17,o]);
}).trigger("jGrowl.beforeOpen").animate(o.animateOpen,o.speed,o.easing,function(){
$(this).data("jGrowl").created=new Date();
}).trigger("jGrowl.open");
if($.fn.corner!=undefined){
$(_1a).corner(o.corners);
}
if($("div.jGrowl-notification:parent",this.element).size()>1&&$("div.jGrowl-closer",this.element).size()==0&&this.defaults.closer!=false){
$("<div class=\"jGrowl-closer\">[ close all ]</div>").addClass(this.defaults.theme).appendTo(this.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){
$(this).siblings().children("div.close").trigger("click.jGrowl");
if($.isFunction(_19.defaults.closer)){
_19.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);
}
});
}
},update:function(){
$(this.element).find("div.jGrowl-notification:parent").each(function(){
if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl").pause==undefined||$(this).data("jGrowl").pause!=true)){
$(this).children("div.close").trigger("click.jGrowl");
}
});
if($(this.element).find("div.jGrowl-notification:parent").size()<2){
$(this.element).find("div.jGrowl-closer").animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){
$(this).remove();
});
}
},startup:function(e){
this.element=$(e).addClass("jGrowl").append("<div class=\"jGrowl-notification\"></div>");
this.interval=setInterval(function(){
jQuery(e).data("jGrowl.instance").update();
},this.defaults.check);
if($.browser.msie&&parseInt($.browser.version)<7){
$(this.element).addClass("ie6");
}
},shutdown:function(){
$(this.element).removeClass("jGrowl").find("div.jGrowl-notification").remove();
clearInterval(this.interval);
}});
$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;
})(jQuery);


(function($){$.fn.Calendar=function(opts){var options={activeClass:'active',containerId:'events_month'}
$.extend(options,opts);return this.each(function(){var isCollapsed=false;var $activeDay=false;var $calendar=$(this);$calendar.header=$calendar.find('.header');$calendar.weeks=$calendar.find('.week');$calendar.days=$calendar.find('.day');var $infoPanel=$calendar.find('.infopanel');$infoPanel.header=$infoPanel.find('.header h2');$infoPanel.container=$infoPanel.find('.container');$calendar.find('.label:last-child').addClass('last');$calendar.find('.day:last-child').addClass('last');function init(){$calendar.find('.week').each(cacheOffset);$calendar.find('.infopanel .header .back').click(function(){collapse({direction:'down'});});$calendar.days.click(function(){$day=$(this);$week=$day.parent('.week');if(!$activeDay){$activeDay=$day;}
if($day.attr('id')!=$activeDay.attr('id')||!isCollapsed){$activeDay.removeClass(options.activeClass);$day.addClass(options.activeClass);$activeDay=$day;if(!isCollapsed){hideEvents();collapse({direction:'up'});}else{$activeDay.css({'border-bottom-color':'#F1F1F1'});showEvents();}
updateHeader();}});};function getWeekNumber($week){className=$week[0].className;re=/w\d/;match=re.exec(className);if(match.length==1)
return parseInt(match[0].charAt(match.length));return null;};function cacheOffset(){$week=$(this);if(!$week.data('offset')){headerHeight=$calendar.header.height();weekNumber=getWeekNumber($week);offset=$week.data('offset',headerHeight+(($week.height()+1)*(weekNumber-1)));}};function collapse(options){collapseSpeed=200;fadeSpeed=300;headerHeight=$calendar.header.height();if(options.direction=='down'){$infoPanel.fadeOut(fadeSpeed);setTimeout(function(){$calendar.weeks.each(function(){$week=$(this);weekNumber=getWeekNumber($week);$week.animate({marginTop:$week.data('offset')},collapseSpeed,"swing");})},collapseSpeed-100);isCollapsed=false;$(".event-info").html('');}else{activeWeekNum=getWeekNumber($activeDay.parent('.week'));$calendar.weeks.each(function(){$week=$(this);weekNum=getWeekNumber($week);if(weekNum==activeWeekNum)
$week.css('z-index','100');else
$week.css('z-index',weekNum);if(weekNum>1)
$week.animate({marginTop:$calendar.header.height()},collapseSpeed,"swing");if(weekNum==$calendar.weeks.length)
setTimeout(function(){$infoPanel.fadeIn(fadeSpeed,showEvents);},collapseSpeed-100);});isCollapsed=true;}};function showEvents(){hideEvents();$events=$activeDay.find('.events .event');$events.each(function(i){$el=$(this).clone();if(i==0){$(".event-info").html($(this).children(".description").html());$el.addClass('active');$el.css({borderRight:'8px solid #E7E7E7'});}
$el.hide();$infoPanel.container.find('.events').append($el);$el.show('slide',{direction:"left"},(i+1)*200);});$events=$infoPanel.container.find('.event');$events.click(function(){if(!$(this).hasClass('active')){showEventDetails($(this));$events.removeClass('active');$events.css({borderRight:'1px solid #E7E7E7'});$(this).addClass('active');$(this).animate({borderRight:'8px solid #E7E7E7'},250);}});};function hideEvents(){$infoPanel.container.find('.event').fadeOut().remove();};function showEventDetails($event){$(".event-info").hide().html($event.children(".description").html()).fadeIn(250);return;};function updateHeader(){date=new Date(Date.parse($activeDay.attr('id').replace(/\./g,'/')));$infoPanel.header.text(date.toDateString());};init();});}})(jQuery);
