/* jQuery HoverPulse Plugin http://malsup.com/jquery/hoverpulse/*/
(function($) {

$.fn.hoverpulse = function(options) {
    // in 1.3+ we can fix mistakes with the ready state
    if (this.length == 0) {
        if (!$.isReady && this.selector) {
            var s = this.selector, c = this.context;
            $(function() {
                $(s,c).hoverpulse(options);
            });
        }
        return this;
    }    
    
	var opts = $.extend({}, $.fn.hoverpulse.defaults, options);

	// parent must be relatively positioned
	this.parent().css({ position: 'relative' });
	// pulsing element must be absolutely positioned
	this.css({ position: 'absolute', top: 0, left: 0 });

	this.each(function() {
		var $this = $(this);
		var w = $this.width(), h = $this.height();
		$this.data('hoverpulse.size', { w: parseInt(w), h: parseInt(h) });
	});

	// bind hover event for behavior
	return this.hover(
		// hover over
		function() {
			var $this = $(this);
			$this.parent().css('z-index', opts.zIndexActive);
			
			var size = $this.data('hoverpulse.size');
			var w = size.w, h = size.h;
			$this.stop().animate({ 
				top:  ('-'+(opts.size-4)+'px'), 
				left: ('-'+opts.size+'px'), 
				height: (h+2*(opts.size-4))+'px', 
				width:	(w+2*opts.size)+'px'
			}, opts.speed);
		},
		// hover out
		function() {
			var $this = $(this);
			var size = $this.data('hoverpulse.size');
			var w = size.w, h = size.h;
			
			$this.stop().animate({ 
				top:  0, 
				left: 0, 
				height: (h+'px'), 
				width:	(w+'px')
			}, opts.speed, function() {
				$this.parent().css('z-index', opts.zIndexNormal);
			});
		}
	);
};

$.fn.hoverpulse.defaults = {
	size:  20,
	speed: 200,
	zIndexActive: 100,
	zIndexNormal: 1
};

})(jQuery);


/* grayscale.js Copyright (C) James Padolsey (http://james.padolsey.com)*/
 
var grayscale=(function(){var config={colorProps:['color','backgroundColor','borderBottomColor','borderTopColor','borderLeftColor','borderRightColor','backgroundImage'],externalImageHandler:{init:function(el,src){if(el.nodeName.toLowerCase()==='img'){}else{data(el).backgroundImageSRC=src;el.style.backgroundImage=''}},reset:function(el){if(el.nodeName.toLowerCase()==='img'){}else{el.style.backgroundImage='url('+(data(el).backgroundImageSRC||'')+')'}}}},log=function(){try{window.console.log.apply(console,arguments)}catch(e){}},isExternal=function(url){return(new RegExp('https?://(?!'+window.location.hostname+')')).test(url)},data=(function(){var cache=[0],expando='data'+(+new Date());return function(elem){var cacheIndex=elem[expando],nextCacheIndex=cache.length;if(!cacheIndex){cacheIndex=elem[expando]=nextCacheIndex;cache[cacheIndex]={}}return cache[cacheIndex]}})(),desatIMG=function(img,prepare,realEl){var canvas=document.createElement('canvas'),context=canvas.getContext('2d'),height=img.naturalHeight||img.offsetHeight||img.height,width=img.naturalWidth||img.offsetWidth||img.width,imgData;canvas.height=height;canvas.width=width;context.drawImage(img,0,0);try{imgData=context.getImageData(0,0,width,height)}catch(e){}if(prepare){desatIMG.preparing=true;var y=0;(function(){if(!desatIMG.preparing){return}if(y===height){context.putImageData(imgData,0,0,0,0,width,height);realEl?(data(realEl).BGdataURL=canvas.toDataURL()):(data(img).dataURL=canvas.toDataURL())}for(var x=0;x<width;x++){var i=(y*width+x)*4;imgData.data[i]=imgData.data[i+1]=imgData.data[i+2]=RGBtoGRAYSCALE(imgData.data[i],imgData.data[i+1],imgData.data[i+2])}y++;setTimeout(arguments.callee,0)})();return}else{desatIMG.preparing=false}for(var y=0;y<height;y++){for(var x=0;x<width;x++){var i=(y*width+x)*4;imgData.data[i]=imgData.data[i+1]=imgData.data[i+2]=RGBtoGRAYSCALE(imgData.data[i],imgData.data[i+1],imgData.data[i+2])}}context.putImageData(imgData,0,0,0,0,width,height);return canvas},getStyle=function(el,prop){var style=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(el,null)[prop]:el.currentStyle[prop];if(style&&/^#[A-F0-9]/i.test(style)){var hex=style.match(/[A-F0-9]{2}/ig);style='rgb('+parseInt(hex[0],16)+','+parseInt(hex[1],16)+','+parseInt(hex[2],16)+')'}return style},RGBtoGRAYSCALE=function(r,g,b){return parseInt((0.2125*r)+(0.7154*g)+(0.0721*b),10)},getAllNodes=function(context){var all=Array.prototype.slice.call(context.getElementsByTagName('*'));all.unshift(context);return all};var init=function(context){if(context&&context[0]&&context.length&&context[0].nodeName){var allContexts=Array.prototype.slice.call(context),cIndex=-1,cLen=allContexts.length;while(++cIndex<cLen){init.call(this,allContexts[cIndex])}return}context=context||document.documentElement;if(!document.createElement('canvas').getContext){context.style.filter='progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)';context.style.zoom=1;return}var all=getAllNodes(context),i=-1,len=all.length;while(++i<len){var cur=all[i];if(cur.nodeName.toLowerCase()==='img'){var src=cur.getAttribute('src');if(!src){continue}if(isExternal(src)){config.externalImageHandler.init(cur,src)}else{data(cur).realSRC=src;try{cur.src=data(cur).dataURL||desatIMG(cur).toDataURL()}catch(e){config.externalImageHandler.init(cur,src)}}}else{for(var pIndex=0,pLen=config.colorProps.length;pIndex<pLen;pIndex++){var prop=config.colorProps[pIndex],style=getStyle(cur,prop);if(!style){continue}if(cur.style[prop]){data(cur)[prop]=style}if(style.substring(0,4)==='rgb('){var monoRGB=RGBtoGRAYSCALE.apply(null,style.match(/\d+/g));cur.style[prop]=style='rgb('+monoRGB+','+monoRGB+','+monoRGB+')';continue}if(style.indexOf('url(')>-1){var urlPatt=/\(['"]?(.+?)['"]?\)/,url=style.match(urlPatt)[1];if(isExternal(url)){config.externalImageHandler.init(cur,url);data(cur).externalBG=true;continue}try{var imgSRC=data(cur).BGdataURL||(function(){var temp=document.createElement('img');temp.src=url;return desatIMG(temp).toDataURL()})();cur.style[prop]=style.replace(urlPatt,function(_,url){return'('+imgSRC+')'})}catch(e){config.externalImageHandler.init(cur,url)}}}}}};init.reset=function(context){if(context&&context[0]&&context.length&&context[0].nodeName){var allContexts=Array.prototype.slice.call(context),cIndex=-1,cLen=allContexts.length;while(++cIndex<cLen){init.reset.call(this,allContexts[cIndex])}return}context=context||document.documentElement;if(!document.createElement('canvas').getContext){context.style.filter='progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)';return}var all=getAllNodes(context),i=-1,len=all.length;while(++i<len){var cur=all[i];if(cur.nodeName.toLowerCase()==='img'){var src=cur.getAttribute('src');if(isExternal(src)){config.externalImageHandler.reset(cur,src)}cur.src=data(cur).realSRC||src}else{for(var pIndex=0,pLen=config.colorProps.length;pIndex<pLen;pIndex++){if(data(cur).externalBG){config.externalImageHandler.reset(cur)}var prop=config.colorProps[pIndex];cur.style[prop]=data(cur)[prop]||''}}}};init.prepare=function(context){if(context&&context[0]&&context.length&&context[0].nodeName){var allContexts=Array.prototype.slice.call(context),cIndex=-1,cLen=allContexts.length;while(++cIndex<cLen){init.prepare.call(null,allContexts[cIndex])}return}context=context||document.documentElement;if(!document.createElement('canvas').getContext){return}var all=getAllNodes(context),i=-1,len=all.length;while(++i<len){var cur=all[i];if(data(cur).skip){return}if(cur.nodeName.toLowerCase()==='img'){if(cur.getAttribute('src')&&!isExternal(cur.src)){desatIMG(cur,true)}}else{var style=getStyle(cur,'backgroundImage');if(style.indexOf('url(')>-1){var urlPatt=/\(['"]?(.+?)['"]?\)/,url=style.match(urlPatt)[1];if(!isExternal(url)){var temp=document.createElement('img');temp.src=url;desatIMG(temp,true,cur)}}}}};return init})();


/* jQuery Tooltip plugin 1.3 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip * Copyright (c) 2006 - 2008 Jörn Zaefferer*/
;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt=""}).mouseover(save).mouseout(hide).click(hide)},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative')})}})}:function(){return this},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]()})},url:function(){return this.attr('href')||this.attr('src')}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent)}function settings(element){return $.data(element,"tooltip")}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event)}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent)}helper.body.show()}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part)}helper.body.hideWhenEmpty()}else{helper.title.html(title).show();helper.body.hide()}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments)}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade)}else{helper.parent.show()}update()}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto'}helper.parent.css({left:left,right:right,top:top})}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right")}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom")}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()}}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","")}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else helper.parent.stop().fadeOut(tsettings.fade,complete)}else complete();if(settings(this).fixPNG)helper.parent.unfixPNG()}})(jQuery);

/* jQuery.timersWritten by Blair Mitchelmore */
jQuery.fn.extend({everyTime:function(interval,label,fn,times,belay){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times,belay)})},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1)})},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn)})}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{'ms':1,'cs':10,'ds':100,'s':1000,'das':10000,'hs':100000,'ks':1000000},timeParse:function(value){if(value==undefined||value==null)return null;var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseInt(result[1],10);var mult=this.powers[result[2]]||1;return num*mult}else{return value}},add:function(element,interval,label,fn,times,belay){var counter=0;if(jQuery.isFunction(label)){if(!times)times=fn;fn=label;label=interval}interval=jQuery.timer.timeParse(interval);if(typeof interval!='number'||isNaN(interval)||interval<=0)return;if(times&&times.constructor!=Number){belay=!!times;times=0}times=times||0;belay=belay||false;if(!element.$timers)element.$timers={};if(!element.$timers[label])element.$timers[label]={};fn.$timerID=fn.$timerID||this.guid++;var handler=function(){if(belay&&this.inProgress)return;this.inProgress=true;if((++counter>times&&times!==0)||fn.call(element,counter)===false)jQuery.timer.remove(element,label,fn);this.inProgress=false};handler.$timerID=fn.$timerID;if(!element.$timers[label][fn.$timerID])element.$timers[label][fn.$timerID]=window.setInterval(handler,interval);if(!this.global[label])this.global[label]=[];this.global[label].push(element)},remove:function(element,label,fn){var timers=element.$timers,ret;if(timers){if(!label){for(label in timers)this.remove(element,label,fn)}else if(timers[label]){if(fn){if(fn.$timerID){window.clearInterval(timers[label][fn.$timerID]);delete timers[label][fn.$timerID]}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn]}}for(ret in timers[label])break;if(!ret){ret=null;delete timers[label]}}for(ret in timers)break;if(!ret)element.$timers=null}}}});if(jQuery.browser.msie)jQuery(window).one("unload",function(){var global=jQuery.timer.global;for(var label in global){var els=global[label],i=els.length;while(--i)jQuery.timer.remove(els[i],label)}});