(function($){jQuery.fn.autotip=function(options){var defaults={fixed:false,left:0,top:0,above:true,center:true,maxwidth:"auto"};var options=jQuery.extend(defaults,options);return this.each(function(){var $object=jQuery(this);$("td",$object).each(function(){var $td=$(this);$td.wrapInner("");var $span=$("span",$td);if($span.width()>$td.width())$span.addClass("tip").attr({"title":$span.text()}).hoverbox({fixed:options.fixed,left:options.left,top:options.top,above:options.above,center:options.center,maxwidth:options.maxwidth});});});};})(jQuery);(function($){jQuery.fn.carousel=function(options){var defaults={moveby:null,autoplay:false,autohide:false,delay:3000,speed:300,shadow:true};var options=jQuery.extend(defaults,options);return this.each(function(){var $object=jQuery(this),$panels=jQuery(".panels",$object),$prev=jQuery("Previous"),$next=jQuery("Next"),panels=jQuery(".panel",$object).length,panelw=jQuery(".panel",$object).eq(0).outerWidth(true),canfit=$object.innerWidth()/panelw,totalw=panelw*panels,stopat=panelw*canfit - totalw,timer=null;if(options.shadow==true){$object.children(".wrapper:first-child").append("
");}if(panels>canfit){var moveby=options.moveby==null ? canfit:options.moveby;moveby=moveby>canfit ? canfit:moveby;if(options.autohide==true){$prev.add($next).hide();$object.hover(function(){$prev.add($next).fadeIn("fast");},function(){$prev.add($next).fadeOut("fast");});}$object.append($prev).append($next);$panels.css({"width":totalw});if(options.autoplay){timer=setInterval(function(){$next.click();},options.delay);$object.hover(function(){clearInterval(timer);},function(){if(options.autoplay)timer=setInterval(function(){$next.click();},options.delay);});}$next.click(function(event){event.preventDefault();if(!$panels.is(":animated")){var needed=(canfit+moveby)- panels;if(needed<0)needed=0;if(needed>0){jQuery(".panel",$object).slice(0,needed).clone(true,true).appendTo($panels);totalw=panelw*jQuery(".panel",$object).length;$panels.css({"width":totalw});}var left=-(panelw*moveby);$panels.animate({"left":left},options.speed,function(){if(needed>0)jQuery(".panel",$object).slice(0,needed).remove();jQuery(".panel:last",$object).after(jQuery(".panel",$object).slice(0,(moveby - needed)));$panels.css({"left":0});});}});$prev.click(function(event){event.preventDefault();if(!$panels.is(":animated")){var buffer=(moveby*panelw);var needed=buffer/panelw;jQuery(".panel",$object).slice(-needed).clone(true,true).prependTo($panels);totalw=panelw*jQuery(".panel",$object).length;$panels.css({"width":totalw});$panels.css({"left":-(panelw*moveby)});$panels.animate({"left":0},options.speed,function(){jQuery(".panel",$object).slice(-needed).remove();});}});}});};})(jQuery);(function(jQuery){jQuery.fn.dropdown=function(options){var defaults={invert:false,fade:false};var options=jQuery.extend(defaults,options);return this.each(function(){var $object=jQuery(this);$object.children("li:has(ul)").children("a").addClass("hasdrop").append("");jQuery("li",$object).each(function(index){var $li=jQuery(this);var $ul=$li.children("ul").first();if($ul.length>0){$li.mouseenter(function(){jQuery("a",this).first().addClass("hover");if(options.fade==true)$ul.fadeIn("fast");else $ul.show();var id=$ul.parents("ul").first().attr("id");if(id!=$object.attr("id")&&id!=undefined){if(options.invert==false)$ul.css("left",$ul.parent().width());else $ul.css("left","-"+$ul.width()+"px");}if(jQuery.browser.msie){var w=$ul.width();$ul.children("li").children("a").each(function(){var $a=jQuery(this);var p=($a.outerWidth()- $a.innerWidth())+parseInt($a.css("padding-left"),10)+parseInt($a.css("padding-right"),10);$a.width(w - p);});}});$li.mouseleave(function(){jQuery("a",this).first().removeClass("hover");if(options.fade==true)$ul.fadeOut("fast");else $ul.hide();});}});});};})(jQuery);(function($){jQuery.fn.googlemap=function(options){var defaults={showui:true,zoomto:10};var options=jQuery.extend(defaults,options);return this.each(function(){var $object=jQuery(this);var geocoder,mapref;function map(){$object.empty();geocoder=new google.maps.Geocoder();var mapoptions={zoom:options.zoomto,disableDefaultUI:options.showui,mapTypeId:google.maps.MapTypeId.ROADMAP};mapref=new google.maps.Map(document.getElementById($object.attr("id")),mapoptions);}function geocode(address){geocoder.geocode({"address":address},function(results,status){if(status==google.maps.GeocoderStatus.OK){mapref.setCenter(results[0].geometry.location);var marker=new google.maps.Marker({map:mapref,position:results[0].geometry.location});}else{alert("Geocode was not successful for the following reason:"+status);}});}map();geocode(options.address);});};})(jQuery);(function($){jQuery.fn.hints=function(options){var defaults={};var options=jQuery.extend(defaults,options);return this.each(function(){var $object=jQuery(this);var parsed=$object.attr("alt").split(":");var hint=parsed[1];if($object.val()==hint)$object.addClass("hint");$object.focus(function(){if($object.val()==hint)$object.val("");$object.removeClass("hint");});$object.blur(function(){if($object.val()=="")$object.val(hint).addClass("hint");});});};})(jQuery);(function($){jQuery.fn.hoverbox=function(options){var defaults={fixed:false,left:0,top:0,above:true,center:true,maxwidth:"auto"};var options=jQuery.extend(defaults,options);return this.each(function(){var $object=jQuery(this);var $hoverbox="";$object.hover(function(e){if(this.title){this.a=this.alt;this.t=this.title;this.alt="";this.title="";$hoverbox=$("
").css("max-width",options.maxwidth).appendTo(document.body).hide();$hoverbox.append("
"+this.t+"
").fadeIn("fast");if(options.fixed==false){$(this).mousemove(function(e){var horizontal=options.left;if(options.center)horizontal -=$hoverbox.width()/2;var vertical=options.top;if(options.above)vertical+=$hoverbox.outerHeight(true)*-1;$hoverbox.css({left:(e.pageX+horizontal)+"px",top:(e.pageY+vertical)+"px"});});}else{var offset=$object.offset();var width=$object.outerWidth();var center=width/2+offset.left;var horizontal=options.left;if(options.center)horizontal -=$hoverbox.outerWidth()/2;var vertical=options.top;if(options.above)vertical+=$hoverbox.outerHeight(true)*-1;$hoverbox.css({left:(center+horizontal)+"px",top:(offset.top+vertical)+"px"});}}},function(){this.alt=this.a;this.title=this.t;$hoverbox.fadeOut("fast").remove();});});};})(jQuery);(function($){jQuery.fn.lightbox=function(options){var defaults={overlay:true};var options=jQuery.extend(defaults,options);return this.each(function(){$object=jQuery(this);var $links=jQuery("a[rel^=lightbox]",$object);var $overlay=jQuery("
");var $container=jQuery("
");var $target=jQuery("
");var $caption=jQuery("
");var $close=jQuery("Close");var $prev=jQuery("Previous");var $next=jQuery("Next");if(options.overlay)jQuery("body").append($overlay);jQuery("body").append($container);$container.append($target).append($close);if($links.length>1)$container.append($prev).append($next);$container.show().css({"top":Math.round(($(window).height()- $container.outerHeight())/2)+"px","left":Math.round(($(window).width()- $container.outerWidth())/2)+"px","margin-top":0,"margin-left":0}).hide();$close.add($overlay).click(function(e){e.preventDefault();$overlay.add($container).fadeOut("normal");});$prev.add($next).click(function(e){e.preventDefault();var $current=parseInt($links.filter(".selected").attr("lbpos"),10);var $to=jQuery(this).is(".prev")? $links.eq($current - 1):$links.eq($current+1);if(!$to.size()){$to=jQuery(this).is(".prev")? $links.eq($links.size()- 1):$links.eq(0);}if($to.size())$to.click();});$links.each(function(index){var $link=$(this);$link.click(function(e){e.preventDefault();var caption=$link.attr("title")!=undefined ? $link.attr("title"):"";open($link.attr("href"),caption);$links.filter(".selected").removeClass("selected");$link.addClass("selected");});$link.attr({"lbpos":index});});function open(url,caption){if($container.is(":visible")){$target.children().fadeOut("normal",function(){$target.children().remove();loadpic(url,caption);});}else{$target.children().remove();$overlay.add($container).fadeIn("normal",function(){loadpic(url,caption);});}}function loadpic(url,caption){if($container.is(".loading"))return;$container.addClass("loading");var img=new Image();img.onload=function(){img.style.display="none";var maxwidth=($(window).width()- parseInt($container.css("padding-left"),10)- parseInt($container.css("padding-right"),10))- 100;var maxheight=($(window).height()- parseInt($container.css("padding-top'"),10)- parseInt($container.css("padding-bottom"),10))- 100;if(img.width>maxwidth||img.height>maxheight){var ratio=img.width/img.height;if(img.height>=maxheight){img.height=maxheight;img.width=maxheight*ratio;}else{img.width=maxwidth;img.height=maxwidth*ratio;}}$container.animate({"width":img.width,"height":img.height,"top":Math.round(($(window).height()- img.height - parseInt($container.css("padding-top"),10)- parseInt($container.css("padding-bottom"),10))/2)+"px","left":Math.round(($(window).width()- img.width - parseInt($container.css("padding-left"),10)- parseInt($container.css("padding-right"),10))/2)+"px"},"normal",function(){$target.append(img);if(caption!=""){jQuery(".inside",$caption).html(caption);$target.append($caption);}jQuery(img).add($caption).fadeIn("normal",function(){$container.removeClass("loading");});});};img.src=url;}});};})(jQuery);(function($){jQuery.fn.slideshow=function(options){var defaults={autoplay:true,autohide:true,delay:4000,speed:500};var options=$.extend(defaults,options);return this.each(function(){var $object=jQuery(this);var $slides=jQuery(".slide",$object);var count=$slides.length;var timer=null;var i=0;$slides.eq(0).show();if(options.autohide==true){jQuery(".controls",$object).hide();$object.hover(function(){jQuery(".controls",$object).fadeIn("fast");},function(){jQuery(".controls",$object).fadeOut("fast");});}function start(){timer=setInterval(function(){slide("next");},options.delay);}function stop(){clearTimeout(timer);}function play(){jQuery(".play",$object).hide();jQuery(".pause",$object).show();}function pause(){jQuery(".pause",$object).hide();jQuery(".play",$object).show();}function slide(direction){$slides.eq(i).fadeOut(options.speed);if(direction=="next")i=(i+1==count)? 0:i+1;else i=(i - 1<0)? count - 1:i - 1;$slides.eq(i).fadeIn(options.speed);jQuery(".status",$object).text("Slide "+(i+1)+" of "+count);}if(count>1){jQuery(".next",$object).click(function(event){event.preventDefault();stop();pause();slide("next");});jQuery(".prev",$object).click(function(event){event.preventDefault();stop();pause();slide("prev");});jQuery(".pause",$object).click(function(event){event.preventDefault();stop();pause();});jQuery(".play",$object).click(function(event){event.preventDefault();start();play();});if(options.autoplay==true){start();play();}else pause();}else jQuery(".previous,.pause,.play,.next",$object).hide();});};})(jQuery);(function($){jQuery.fn.switcher=function(options){var defaults={};var options=jQuery.extend(defaults,options);return this.each(function(index){var $object=jQuery(this),$switches=jQuery(".switch",$object),$panels=jQuery($switches.eq(0).attr("rel")+" .panel").first().siblings(".panel").andSelf(),$default=$panels.eq(0);var panel=0;$panels.each(function(index){if(jQuery(this).hasClass("default")){panel=index;}});$panels.hide().filter($panels.eq(panel)).show();$switches.eq(panel).addClass("active");$switches.each(function(index){var $switch=$(this);$switch.click(function(event){event.preventDefault();$panels.hide().filter($panels.eq(index)).show();jQuery(".switch",$object).removeClass("active").filter(this).addClass("active");});});});};})(jQuery);(function($){jQuery.fn.vidswitch=function(options){var defaults={target:"#target"};var options=jQuery.extend(defaults,options);return this.each(function(){var $object=jQuery(this),$switches=jQuery(".switch",$object),$target=jQuery(options.target);$target.attr({"src":$switches.eq(0).attr("href")});$switches.eq(0).addClass("active");$switches.each(function(index){var $switch=$(this);$switch.click(function(event){event.preventDefault();$target.attr({"src":jQuery(this).attr("href")});jQuery(".switch",$object).removeClass("active").filter(this).addClass("active");});});});};})(jQuery);