 /**
 * jQuery.timers - Timer abstractions for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/10/16
 *
 * @author Blair Mitchelmore
 * @version 1.2
 *
 **/

jQuery.fn.extend({
	everyTime: function(interval, label, fn, times) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times);
		});
	},
	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: {
		global: [],
		guid: 1,
		dataKey: "jQuery.timer",
		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'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 = parseFloat(result[1]);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times) {
			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 (typeof times != 'number' || isNaN(times) || times < 0) 
				times = 0;
			
			times = times || 0;
			
			var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
			
			if (!timers[label])
				timers[label] = {};
			
			fn.timerID = fn.timerID || this.guid++;
			
			var handler = function() {
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
			};
			
			handler.timerID = fn.timerID;
			
			if (!timers[label][fn.timerID])
				timers[label][fn.timerID] = window.setInterval(handler,interval);
			
			this.global.push( element );
			
		},
		remove: function(element, label, fn) {
			var timers = jQuery.data(element, this.dataKey), 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 ) 
					jQuery.removeData(element, this.dataKey);
			}
		}
	}
});

jQuery(window).bind("unload", function() {
	jQuery.each(jQuery.timer.global, function(index, item) {
		jQuery.timer.remove(item);
	});
});

/**
* jQuery.fn.dualSlider - Dual sliders, why not?
* Date: June 2010
*
* @author Rob Phillips http://www.robertjamesphillips.com (Front End Developer - Hugo & Cat - http://www.hugoandcat.com)
* @version 0.3
* @web http://www.hugoandcat.com/DualSlider/index.html
*
* Requirements:
* jquery.1.3.2.js - http://jquery.com/
* jquery.easing.1.3.js - http://gsgd.co.uk/sandbox/jquery/easing/
* jquery.timers-1.2.js - http://plugins.jquery.com/project/timers
*
* 0.2 - Tested and fixed for IE6+, auto loops, manual pause/play controls
*     - Disabled buttons until animation finishes - Thanks for the bug John.
* 0.3 - Now with a seamless loop, instead of that nasty rewind...was 'too much' apparently
*
**/

/**
* jQuery.fn.dualSlider - Dual sliders, why not?
* Date: June 2010
*
* @author Rob Phillips http://www.robertjamesphillips.com (Front End Developer - Hugo & Cat - http://www.hugoandcat.com)
* @version 0.3
* @web http://www.hugoandcat.com/DualSlider/index.html
*
* Requirements:
* jquery.1.3.2.js - http://jquery.com/
* jquery.easing.1.3.js - http://gsgd.co.uk/sandbox/jquery/easing/
* jquery.timers-1.2.js - http://plugins.jquery.com/project/timers
*
* 0.2 - Tested and fixed for IE6+, auto loops, manual pause/play controls
*     - Disabled buttons until animation finishes - Thanks for the bug John.
* 0.3 - Now with a seamless loop, instead of that nasty rewind...was 'too much' apparently
*
**/


(function($) {

    $.fn.dualSlider = function(options) {

        // default configuration properties
        var defaults = {
            auto: true,
            autoDelay: 6000,
            easingCarousel: 'swing',
            easingDetails: 'easeOutBack',
            durationCarousel: 1000,
            durationDetails: 600
        };

        var options = $.extend(defaults, options);

        this.each(function() {

            var obj = $(this);
            var carousel;
            var carouselTotal = $(".backgrounds", obj).children().length;
            var carouselPosition = 1;
            var carouselLinkIndex = 1;
            var carouselLinks = "";
            var carouselwidth = $(obj).width();
            var detailWidth = $(".panel .details_wrapper", obj).width();
            var locked = false;
			
			if(options.auto == true)
			{
				//Creat duplicates for seamless looping
				$(".backgrounds", obj).prepend($(".backgrounds .item:last-child", obj).clone().css("margin-left", "-" + carouselwidth + "px"));
				$(".backgrounds", obj).append($(".backgrounds .item:nth-child(2)", obj).clone());

				$(".details", obj).prepend($(".details .detail:last-child", obj).clone().css("margin-left", "-" + detailWidth + "px"));
				$(".details", obj).append($(".details .detail:nth-child(2)", obj).clone());
			}
			else{
				$(".previous", obj).hide();
				$(".play, .pause", obj).hide();
			}


            //Set main background width
            $(".backgrounds", obj).css("width", ((carouselTotal+1) * carouselwidth) + 100 + "px");
            

            //Set main detail width
            $(".details_wrapper .details", obj).css("width", ((carouselTotal+1) * carouselwidth)  + "px");

            for (i = 1; i <= carouselTotal; i++) {
                (i == 1) ? carouselLinks += "<a rel=\"" + carouselLinkIndex + "\" title=\"Go to page " + carouselLinkIndex + " \" class=\"link" + carouselLinkIndex + " selected\" href=\"javascript:void(0)\">" + carouselLinkIndex + "</a>" : carouselLinks += "<a rel=\"" + carouselLinkIndex + "\"  title=\"Go to page " + carouselLinkIndex + " \" class=\"link" + carouselLinkIndex + "\" href=\"javascript:void(0)\" >" + carouselLinkIndex + "</a>";
                carouselLinkIndex++;
            }
            $("#numbers", obj).html(carouselLinks);

            //Bind carousel controls
            $(".next", obj).click(function() {
                carouselPage(parseInt(carouselPosition + 1), false);
                lock();
            });
            
            $(".previous", obj).click(function() {
                carouselPage(parseInt(carouselPosition - 1), false);
                lock();
            });

            $("#numbers a", obj).click(function() {
                carouselPage($(this).attr("rel"), false);
                lock();
            });

            $(".pause", obj).click(function() {
                autoPause();
            });
            $(".play", obj).click(function() {
                autoPlay();
            });

            function lock() {
                locked = true;
            }

            function unLock() {
                locked = false;
            }


            function checkPreviousNext() {
                $("#numbers a", obj).removeClass("selected");
                $("#numbers .link" + carouselPosition, obj).addClass("selected");
                
				if(options.auto == false)
				{
					(carouselPosition == carouselTotal) ? $(".next", obj).hide() : $(".next", obj).show();
					(carouselPosition < 2) ? $(".previous", obj).hide() : $(".previous", obj).show();
				}
            }
			
			function adjust() {

                if (carouselPosition < 1) {
                    //alert("trickery required");
                    $(".backgrounds", obj).css("margin-left", (-1 * ((carouselTotal - 1) * carouselwidth)));
                    $(".details", obj).css("margin-left", (-1 * ((carouselTotal - 1) * detailWidth)));
                    carouselPosition = carouselTotal;

                }
                if (carouselPosition > carouselTotal) {
                    //alert("more trickery required");
                    $(".backgrounds", obj).css("margin-left", 0);
                    $(".details", obj).css("margin-left", 0);
                    carouselPosition = 1;
                }

            }

            function carouselPage(x, y) {

                if (locked != true) {

                    //console.log("New page: " + x);
                    carouselPosition = parseFloat(x);
                    //Cancel timer if manual click
                    if (y == false) autoPause();

                    var newPage = (x * carouselwidth) - carouselwidth;
                    var newPageDetail = (x * detailWidth) - detailWidth;

                    if (newPage != 0) {
                        newPage = newPage * -1;
                        newPageDetail = newPageDetail * -1;
                    }

                    $(".backgrounds", obj).animate({
                        marginLeft: newPage
                    });
					
					//Now animate the details
					$(".details", obj).animate({
						marginLeft: newPageDetail
					}, {
						"duration": options.durationDetails, "easing": options.easingDetails,
						complete: function() {
							//alert("finished details");
							adjust();
							checkPreviousNext();
							unLock();
						}

					});
                }
                

            }

            function autoPause() {
                $(".pause", obj).hide();
                $(".play", obj).show();
                $("body").stopTime("autoScroll");
            }

            function autoPlay() {
                $(".pause", obj).show();
                $(".play", obj).hide();
                $("body").everyTime(options.autoDelay, "autoScroll", function() {
                    carouselPage(carouselPosition + 1, true);
                    lock();
                });
            }

            if (options.auto == true) {
                autoPlay();
            }

        });

    };

})(jQuery);


/**

* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+

* <http://cherne.net/brian/resources/jquery.hoverIntent.html>

* 

* @param  f  onMouseOver function || An object with configuration options

* @param  g  onMouseOut function  || Nothing (use configuration options object)

* @author    Brian Cherne <brian@cherne.net>

*/

(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:50,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);


// Tooltip from CSS Globe written by Alen Grakalic (http://cssglobe.com)

this.tooltip = function(){xOffset = -10;yOffset = 10;jQuery.noConflict();jQuery(".tooltip").hover(function(e){this.t = this.title;this.title = "";jQuery("body").append("<p class='itooltip'>"+ this.t +"</p>");jQuery(".itooltip").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px").fadeIn(500);},function(){this.title = this.t; jQuery(".itooltip").remove();});jQuery("a.tooltip").mousemove(function(e){jQuery(".itooltip").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px");});};
//END TOOLTIP

/* ------------------------------------------------------------------------
 * 	Class: prettyPhoto
 * 	Use: Lightbox clone for jQuery
 * 	Author: Stephane Caron (http://www.no-margin-for-errors.com)
 * 	Version: 2.5.6
 ------------------------------------------------------------------------- */

(function($){$.prettyPhoto={version:'2.5.6'};$.fn.prettyPhoto=function(settings){settings=jQuery.extend({animationSpeed:'normal',opacity:0.80,showTitle:true,allowresize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'light_rounded',hideflash:false,wmode:'opaque',autoplay:true,modal:false,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> \
      <div class="pp_top"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
      <div class="pp_content_container"> \
       <div class="pp_left"> \
       <div class="pp_right"> \
        <div class="pp_content"> \
         <div class="pp_loaderIcon"></div> \
         <div class="pp_fade"> \
          <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
          <div class="pp_hoverContainer"> \
           <a class="pp_next" href="#">next</a> \
           <a class="pp_previous" href="#">previous</a> \
          </div> \
          <div id="pp_full_res"></div> \
          <div class="pp_details clearfix"> \
           <a class="pp_close" href="#">Close</a> \
           <p class="pp_description"></p> \
           <div class="pp_nav"> \
            <a href="#" class="pp_arrow_previous">Previous</a> \
            <p class="currentTextHolder">0/0</p> \
            <a href="#" class="pp_arrow_next">Next</a> \
           </div> \
          </div> \
         </div> \
        </div> \
       </div> \
       </div> \
      </div> \
      <div class="pp_bottom"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
     </div> \
     <div class="pp_overlay"></div> \
     <div class="ppt"></div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>'},settings);if($.browser.msie&&parseInt($.browser.version)==6){settings.theme="light_square";}
if($('.pp_overlay').size()==0)_buildOverlay();var doresize=true,percentBased=false,correctSizes,$pp_pic_holder,$ppt,$pp_overlay,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),setPosition=0,scrollPos=_getScroll();$(window).scroll(function(){scrollPos=_getScroll();_centerOverlay();_resizeOverlay();});$(window).resize(function(){_centerOverlay();_resizeOverlay();});$(document).keydown(function(e){if($pp_pic_holder.is(':visible'))
switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');break;case 39:$.prettyPhoto.changePage('next');break;case 27:if(!settings.modal)
$.prettyPhoto.close();break;};});$(this).each(function(){$(this).bind('click',function(){_self=this;theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);var images=new Array(),titles=new Array(),descriptions=new Array();if(theGallery){$('a[rel*='+theGallery+']').each(function(i){if($(this)[0]===$(_self)[0])setPosition=i;images.push($(this).attr('href'));titles.push($(this).find('img').attr('alt'));descriptions.push($(this).attr('title'));});}else{images=$(this).attr('href');titles=($(this).find('img').attr('alt'))?$(this).find('img').attr('alt'):'';descriptions=($(this).attr('title'))?$(this).attr('title'):'';}
$.prettyPhoto.open(images,titles,descriptions);return false;});});$.prettyPhoto.open=function(gallery_images,gallery_titles,gallery_descriptions){if($.browser.msie&&$.browser.version==6){$('select').css('visibility','hidden');};if(settings.hideflash)$('object,embed').css('visibility','hidden');images=$.makeArray(gallery_images);titles=$.makeArray(gallery_titles);descriptions=$.makeArray(gallery_descriptions);image_set=($(images).size()>0)?true:false;_checkPosition($(images).size());$('.pp_loaderIcon').show();$pp_overlay.show().fadeTo(settings.animationSpeed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((setPosition+1)+settings.counter_separator_label+$(images).size());if(descriptions[setPosition]){$pp_pic_holder.find('.pp_description').show().html(unescape(descriptions[setPosition]));}else{$pp_pic_holder.find('.pp_description').hide().text('');};if(titles[setPosition]&&settings.showTitle){hasTitle=true;$ppt.html(unescape(titles[setPosition]));}else{hasTitle=false;};movie_width=(parseFloat(grab_param('width',images[setPosition])))?grab_param('width',images[setPosition]):settings.default_width.toString();movie_height=(parseFloat(grab_param('height',images[setPosition])))?grab_param('height',images[setPosition]):settings.default_height.toString();if(movie_width.indexOf('%')!=-1||movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-100);movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-100);percentBased=true;}
$pp_pic_holder.fadeIn(function(){imgPreloader="";switch(_getFileType(images[setPosition])){case'image':imgPreloader=new Image();nextImage=new Image();if(image_set&&setPosition>$(images).size())nextImage.src=images[setPosition+1];prevImage=new Image();if(image_set&&images[setPosition-1])prevImage.src=images[setPosition-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup;$pp_pic_holder.find('#fullResImage').attr('src',images[setPosition]);imgPreloader.onload=function(){correctSizes=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=images[setPosition];break;case'youtube':correctSizes=_fitToViewport(movie_width,movie_height);movie='http://www.youtube.com/v/'+grab_param('v',images[setPosition]);if(settings.autoplay)movie+="&autoplay=1";toInject=settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':correctSizes=_fitToViewport(movie_width,movie_height);movie_id=images[setPosition];movie='http://vimeo.com/moogaloop.swf?clip_id='+movie_id.replace('http://vimeo.com/','');if(settings.autoplay)movie+="&autoplay=1";toInject=settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'quicktime':correctSizes=_fitToViewport(movie_width,movie_height);correctSizes['height']+=15;correctSizes['contentHeight']+=15;correctSizes['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,images[setPosition]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':correctSizes=_fitToViewport(movie_width,movie_height);flash_vars=images[setPosition];flash_vars=flash_vars.substring(images[setPosition].indexOf('flashvars')+10,images[setPosition].length);filename=images[setPosition];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':correctSizes=_fitToViewport(movie_width,movie_height);frame_url=images[setPosition];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,frame_url);break;case'inline':myClone=$(images[setPosition]).clone().css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo($('body'));correctSizes=_fitToViewport($(myClone).width(),$(myClone).height());$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(images[setPosition]).html());break;};if(!imgPreloader){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});};$.prettyPhoto.changePage=function(direction){if(direction=='previous'){setPosition--;if(setPosition<0){setPosition=0;return;};}else{if($('.pp_arrow_next').is('.disabled'))return;setPosition++;};if(!doresize)doresize=true;_hideContent(function(){$.prettyPhoto.open(images,titles,descriptions)});$('a.pp_expand,a.pp_contract').fadeOut(settings.animationSpeed);};$.prettyPhoto.close=function(){$pp_pic_holder.find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animationSpeed);$pp_overlay.fadeOut(settings.animationSpeed,function(){$('#pp_full_res').html('');$pp_pic_holder.attr('style','').find('div:not(.pp_hoverContainer)').attr('style','');_centerOverlay();if($.browser.msie&&$.browser.version==6){$('select').css('visibility','visible');};if(settings.hideflash)$('object,embed').css('visibility','visible');setPosition=0;settings.callback();});doresize=true;};_showContent=function(){$('.pp_loaderIcon').hide();projectedTop=scrollPos['scrollTop']+((windowHeight/2)-(correctSizes['containerHeight']/2));if(projectedTop<0)projectedTop=0+$ppt.height();$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animationSpeed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(correctSizes['containerWidth']/2),'width':correctSizes['containerWidth']},settings.animationSpeed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animationSpeed);if(image_set&&_getFileType(images[setPosition])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
if(settings.showTitle&&hasTitle){$ppt.css({'top':$pp_pic_holder.offset().top-25,'left':$pp_pic_holder.offset().left+20,'display':'none'});$ppt.fadeIn(settings.animationSpeed);};if(correctSizes['resized'])$('a.pp_expand,a.pp_contract').fadeIn(settings.animationSpeed);settings.changepicturecallback();});};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animationSpeed,function(){$('.pp_loaderIcon').show();if(callback)callback();});$ppt.fadeOut(settings.animationSpeed);}
function _checkPosition(setCount){if(setPosition==setCount-1){$pp_pic_holder.find('a.pp_next').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_next').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_next.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};if(setPosition==0){$pp_pic_holder.find('a.pp_previous').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_previous').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_previous.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});};if(setCount>1){$('.pp_nav').show();}else{$('.pp_nav').hide();}};function _fitToViewport(width,height){hasBeenResized=false;_getDimensions(width,height);imageWidth=width;imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allowresize&&!percentBased){hasBeenResized=true;notFitting=true;while(notFitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{notFitting=false;};pp_containerHeight=imageHeight;pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+40,contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:hasBeenResized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+$ppt.height()+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.indexOf('.mov')!=-1){return'quicktime';}else if(itemSrc.indexOf('.swf')!=-1){return'flash';}else if(itemSrc.indexOf('iframe')!=-1){return'iframe'}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _centerOverlay(){if(doresize){titleHeight=$ppt.height();contentHeight=$pp_pic_holder.height();contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scrollPos['scrollTop']-((contentHeight+titleHeight)/2);$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scrollPos['scrollLeft']-(contentwidth/2)});$ppt.css({'top':projectedTop-titleHeight,'left':(windowWidth/2)+scrollPos['scrollLeft']-(contentwidth/2)+20});};};function _getScroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resizeOverlay(){windowHeight=$(window).height();windowWidth=$(window).width();$pp_overlay.css({'height':$(document).height()});};function _buildOverlay(){$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');$pp_overlay=$('div.pp_overlay');$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height()}).bind('click',function(){if(!settings.modal)
$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(){$this=$(this);if($this.hasClass('pp_expand')){$this.removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$this.removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open(images,titles,descriptions)});$pp_pic_holder.find('.pp_fade').fadeOut(settings.animationSpeed);return false;});$pp_pic_holder.find('.pp_previous, .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});$pp_pic_holder.find('.pp_next, .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};_centerOverlay();};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);if(results==null)
return"";else
return results[1];}})(jQuery);
//END PRETTYPHOTO

/*
	Sliding Labels 3.2
	
	This is the official plugin version of Sliding Labels.
	It is open source code by Tim Wright of CSSKarma.com
	Use as you see fit, I'd like it if you kept this in 
	the code, but basically share it and don't be a jerk.
	
	Support:
	http://www.csskarma.com/blog/sliding-labels-plugin
	
	Version: 2 - added textarea functionality
	Version: 3 - added axis parameter
	           - added speed parameter
	           - removed color parameter, as it should be define in the CSS
	           - added position:relative to wrapping element
	           - coverted to jQuery plugin
	Version: 3.1 - changed "children" to "find" so it works a little better with UL & fieldsets
	Version: 3.2 - Added a "className" option so you don't have to use ".slider" as the wrapper
*/
(function($){$.fn.slidinglabels=function(options){var defaults={className:"form-slider",topPosition:"5px",leftPosition:"5px",axis:"x",speed:"fast"};var options=$.extend(defaults,options);var itemwrapper=this.find("."+defaults.className+"");var labels=itemwrapper.find("label");return labels.each(function(){obj=$(this);var parent=obj.parents("."+defaults.className+"");parent.css({position:"relative"});obj.css({position:"absolute",top:defaults.topPosition,left:defaults.leftPosition,display:"inline","z-index":99});var inputval=$(this).next().val();var labelwidth=$(this).width();var labelmove=labelwidth+5+"px";var labelheight=$(this).height();if(inputval!==""){if(defaults.axis=="x"){obj.stop().animate({left:"-"+labelmove},1)}else{if(defaults.axis=="y"){obj.stop().animate({top:"-"+labelheight},1)}}}$("input, textarea").focus(function(){var label=$(this).prev("label");var width=label.width();var height=label.height();var adjust=width+5+"px";var adjustUp=height+"px";var value=$(this).val();if(value==""){if(defaults.axis=="x"){label.stop().animate({left:"-"+adjust},defaults.speed)}else{if(defaults.axis=="y"){label.stop().animate({top:"-"+adjustUp},defaults.speed)}}}else{if(defaults.axis=="x"){label.css({left:"-"+adjust})}else{if(defaults.axis=="y"){label.css({top:"-"+adjustUp})}}}}).blur(function(){var label=$(this).prev("label");var value=$(this).val();if(value==""){if(defaults.axis=="x"){label.stop().animate({left:defaults.leftPosition},defaults.speed)}else{if(defaults.axis=="y"){label.stop().animate({top:defaults.topPosition},defaults.speed)}}}})})}})(jQuery);

/*
 * jQuery Nivo Slider v1.7
 * http://nivo.dev7studios.com
 *
 * Copyright 2010, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * March 2010
 *
 * manualAdvance option added by HelloPablo (http://hellopablo.co.uk)
 */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(8($){$.1c.16=8(1O){9 5=$.22({},$.1c.16.1M,1O);O f.B(8(){9 4={e:0,h:\'\',1a:0,o:\'\',J:t,18:t,1J:t};9 3=$(f);3.1K(\'7:4\',4);3.c(\'24\',\'23\');3.q(\'1I\');3.s(\'1I\');3.1i(\'16\');9 d=3.21();d.B(8(){9 x=$(f);6(!x.I(\'N\')){6(x.I(\'a\')){x.1i(\'7-25\')}x=x.1A(\'N:1n\')}9 13=x.q();6(13==0)13=x.u(\'q\');9 11=x.s();6(11==0)11=x.u(\'s\');6(13>3.q()){3.q(13)}6(11>3.s()){3.s(11)}x.c(\'P\',\'1r\');4.1a++});6($(d[4.e]).I(\'N\')){4.h=$(d[4.e])}j{4.h=$(d[4.e]).1A(\'N:1n\')}6($(d[4.e]).I(\'a\')){$(d[4.e]).c(\'P\',\'1l\')}3.c(\'M\',\'R(\'+4.h.u(\'S\')+\') L-T\');1H(9 i=0;i<5.g;i++){9 A=1d.1X(3.q()/5.g);6(i==5.g-1){3.K($(\'<z C="7-b"></z>\').c({1R:(A*i)+\'Y\',q:(3.q()-(A*i))+\'Y\'}))}j{3.K($(\'<z C="7-b"></z>\').c({1R:(A*i)+\'Y\',q:A+\'Y\'}))}}3.K($(\'<z C="7-D"><p></p></z>\').c(\'P\',\'1r\'));6(4.h.u(\'12\')!=\'\'){$(\'.7-D p\',3).1p(4.h.u(\'12\'));$(\'.7-D\',3).1m(5.m)}9 r=0;6(!5.1b){r=1y(8(){H(3,d,5,t)},5.19)}6(5.U){3.K(\'<z C="7-U"><a C="7-1Y">20</a><a C="7-1P">27</a></z>\');6(5.1U){$(\'.7-U\',3).1S();3.1E(8(){$(\'.7-U\',3).26()},8(){$(\'.7-U\',3).1S()})}$(\'a.7-1Y\',3).1u(\'1t\',8(){6(4.J)O t;17(r);r=\'\';4.e-=2;H(3,d,5,\'1C\')});$(\'a.7-1P\',3).1u(\'1t\',8(){6(4.J)O t;17(r);r=\'\';H(3,d,5,\'1B\')})}6(5.E){9 1w=$(\'<z C="7-E"></z>\');3.K(1w);1H(9 i=0;i<d.1T;i++){1w.K(\'<a C="7-1F" 1G="\'+i+\'">\'+(i+1)+\'</a>\')}$(\'.7-E a:1W(\'+4.e+\')\',3).1i(\'1f\');$(\'.7-E a\',3).1u(\'1t\',8(){6(4.J)O t;6($(f).29(\'1f\'))O t;17(r);r=\'\';3.c(\'M\',\'R(\'+4.h.u(\'S\')+\') L-T\');4.e=$(f).u(\'1G\')-1;H(3,d,5,\'1F\')})}6(5.1D){3.1E(8(){4.18=Q;17(r);r=\'\'},8(){4.18=t;6(r==\'\'&&!5.1b){r=1y(8(){H(3,d,5,t)},5.19)}})}3.2i(\'7:V\',8(){4.J=t;$(d).B(8(){6($(f).I(\'a\')){$(f).c(\'P\',\'1r\')}});6($(d[4.e]).I(\'a\')){$(d[4.e]).c(\'P\',\'1l\')}6(r==\'\'&&!4.18&&!5.1b){r=1y(8(){H(3,d,5,t)},5.19)}5.1V.1L(f)})});8 H(3,d,5,1e){9 4=3.1K(\'7:4\');6(4.1J)O t;5.1N.1L(f);6(!1e){3.c(\'M\',\'R(\'+4.h.u(\'S\')+\') L-T\')}j{6(1e==\'1C\'){3.c(\'M\',\'R(\'+4.h.u(\'S\')+\') L-T\')}6(1e==\'1B\'){3.c(\'M\',\'R(\'+4.h.u(\'S\')+\') L-T\')}}4.e++;6(4.e==4.1a)4.e=0;6(4.e<0)4.e=(4.1a-1);6($(d[4.e]).I(\'N\')){4.h=$(d[4.e])}j{4.h=$(d[4.e]).1A(\'N:1n\')}6(5.E){$(\'.7-E a\',3).2j(\'1f\');$(\'.7-E a:1W(\'+4.e+\')\',3).1i(\'1f\')}6(4.h.u(\'12\')!=\'\'){6($(\'.7-D\',3).c(\'P\')==\'1l\'){$(\'.7-D p\',3).1Z(5.m,8(){$(f).1p(4.h.u(\'12\'));$(f).1m(5.m)})}j{$(\'.7-D p\',3).1p(4.h.u(\'12\'))}$(\'.7-D\',3).1m(5.m)}j{$(\'.7-D\',3).1Z(5.m)}9 i=0;$(\'.7-b\',3).B(8(){9 A=1d.1X(3.q()/5.g);$(f).c({s:\'G\',w:\'0\',M:\'R(\'+4.h.u(\'S\')+\') L-T -\'+((A+(i*A))-A)+\'Y 0%\'});i++});6(5.k==\'1q\'){9 1x=28 2h("1s","X","1v","W","1j","14","1z","1g");4.o=1x[1d.2f(1d.1q()*(1x.1T+1))];6(4.o==2a)4.o=\'1g\'}4.J=Q;6(5.k==\'2g\'||5.k==\'1s\'||4.o==\'1s\'||5.k==\'X\'||4.o==\'X\'){9 n=0;9 i=0;9 g=$(\'.7-b\',3);6(5.k==\'X\'||4.o==\'X\')g=$(\'.7-b\',3).10();g.B(8(){9 b=$(f);b.c(\'1k\',\'G\');6(i==5.g-1){F(8(){b.y({s:\'l%\',w:\'1.0\'},5.m,\'\',8(){3.Z(\'7:V\')})},(l+n))}j{F(8(){b.y({s:\'l%\',w:\'1.0\'},5.m)},(l+n))}n+=1h;i++})}j 6(5.k==\'2b\'||5.k==\'1v\'||4.o==\'1v\'||5.k==\'W\'||4.o==\'W\'){9 n=0;9 i=0;9 g=$(\'.7-b\',3);6(5.k==\'W\'||4.o==\'W\')g=$(\'.7-b\',3).10();g.B(8(){9 b=$(f);b.c(\'1Q\',\'G\');6(i==5.g-1){F(8(){b.y({s:\'l%\',w:\'1.0\'},5.m,\'\',8(){3.Z(\'7:V\')})},(l+n))}j{F(8(){b.y({s:\'l%\',w:\'1.0\'},5.m)},(l+n))}n+=1h;i++})}j 6(5.k==\'1j\'||5.k==\'2c\'||4.o==\'1j\'||5.k==\'14\'||4.o==\'14\'){9 n=0;9 i=0;9 v=0;9 g=$(\'.7-b\',3);6(5.k==\'14\'||4.o==\'14\')g=$(\'.7-b\',3).10();g.B(8(){9 b=$(f);6(i==0){b.c(\'1k\',\'G\');i++}j{b.c(\'1Q\',\'G\');i=0}6(v==5.g-1){F(8(){b.y({s:\'l%\',w:\'1.0\'},5.m,\'\',8(){3.Z(\'7:V\')})},(l+n))}j{F(8(){b.y({s:\'l%\',w:\'1.0\'},5.m)},(l+n))}n+=1h;v++})}j 6(5.k==\'1z\'||4.o==\'1z\'){9 n=0;9 i=0;$(\'.7-b\',3).B(8(){9 b=$(f);9 1o=b.q();b.c({1k:\'G\',s:\'l%\',q:\'G\'});6(i==5.g-1){F(8(){b.y({q:1o,w:\'1.0\'},5.m,\'\',8(){3.Z(\'7:V\')})},(l+n))}j{F(8(){b.y({q:1o,w:\'1.0\'},5.m)},(l+n))}n+=1h;i++})}j 6(5.k==\'1g\'||4.o==\'1g\'){9 i=0;$(\'.7-b\',3).B(8(){$(f).c(\'s\',\'l%\');6(i==5.g-1){$(f).y({w:\'1.0\'},(5.m*2),\'\',8(){3.Z(\'7:V\')})}j{$(f).y({w:\'1.0\'},(5.m*2))}i++})}}};$.1c.16.1M={k:\'1q\',g:15,m:2e,19:2d,U:Q,1U:Q,E:Q,1D:Q,1b:t,1N:8(){},1V:8(){}};$.1c.10=[].10})(2k);',62,145,'|||slider|vars|settings|if|nivo|function|var||slice|css|kids|currentSlide|this|slices|currentImage||else|effect|100|animSpeed|timeBuff|randAnim||width|timer|height|false|attr||opacity|child|animate|div|sliceWidth|each|class|caption|controlNav|setTimeout|0px|nivoRun|is|running|append|no|background|img|return|display|true|url|src|repeat|directionNav|animFinished|sliceUpLeft|sliceDownLeft|px|trigger|reverse|childHeight|title|childWidth|sliceUpDownLeft||nivoSlider|clearInterval|paused|pauseTime|totalSlides|manualAdvance|fn|Math|nudge|active|fade|50|addClass|sliceUpDown|top|block|fadeIn|first|origWidth|html|random|none|sliceDownRight|click|live|sliceUpRight|nivoControl|anims|setInterval|fold|find|next|prev|pauseOnHover|hover|control|rel|for|1px|stop|data|call|defaults|beforeChange|options|nextNav|bottom|left|hide|length|directionNavHide|afterChange|eq|round|prevNav|fadeOut|<|children|extend|relative|position|imageLink|show|>|new|hasClass|undefined|sliceUp|sliceUpDownRight|3000|500|floor|sliceDown|Array|bind|removeClass|jQuery'.split('|'),0,{}))

//MOLITOR SCRIPTS

this.molitorscripts = function () {

	
	//DEFINE VARIABLES
	var notitle = "#dropmenu a",
		browserName = navigator.appName;	


	//REMOVE TITLE ATTRIBUTE
	jQuery(notitle).removeAttr("title");
	
	//DEFINE VARIABLES BASED ON BROWSER BEING USED
	if (browserName != "Microsoft Internet Explorer"){
    var arrow = "#dropmenu ul li ul";	
	}
	else {
	var arrow = "";
	}
	
	//MENU
	jQuery(".menu ul.children").css("display", "none"); // Opera Fix
	jQuery(".menu li").hoverIntent(function(){
		jQuery(this).find('ul:first').slideDown(100);
		},function(){
		jQuery(this).find('ul:first').slideUp(100);
	});
	jQuery(arrow).parent().children("a").prepend("<span style='float:right;'>&rsaquo;</span>");
	
	//jQuery(".widget").corner("5px");
	
	//PRETTY PHOTO
	jQuery("a[href$='jpg'],a[href$='png'],a[href$='gif']").attr({rel: "prettyPhoto[pp_gal]"});
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal', /* fast/slow/normal */
				padding: 40, /* padding for each side of the picture */
				opacity: 0.35, /* Value betwee 0 and 1 */
				showTitle: false, /* true/false */
				allowresize: true, /* true/false */
				counter_separator_label: ' of ', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square */
				hideflash: true, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
				modal: false /* If set to true, only the close button will close the window */
	});
	
	jQuery("a.backTop").click(function(){
		jQuery("html,body").animate({scrollTop:0},700);
		return false;
	});
	
		jQuery('#searchform').slidinglabels({

        className    : 'slider', // the class you're wrapping the label & input with -> default = slider
		topPosition  : '15px',  // how far down you want each label to start
		leftPosition : '15px',  // how far left you want each label to start
		axis         : 'x',    // can take 'x' or 'y' for slide direction
		speed        : 'fast'  // can take 'fast', 'slow', or a numeric value

		});
		
		jQuery(".slider label").fadeIn(300);


}

//END MYSCRIPTS
