/* 2010 Hubsoft.com && SebringCreative.com (written by Jason Sebring, mail@jasonsebring.com) - Dual licensed under the MIT and GPL licenses. */
(function($){$.fn.dumbCrossFade=function(settings){var publicAccessorLabel='dumbCrossFade.publicAccessor';var configLabel='dumbCrossFade.config';if(typeof(this.data(publicAccessorLabel))!=='undefined'&&this.data(publicAccessorLabel)!==null){var pa=this.data(publicAccessorLabel);var cg=this.data(configLabel);var args=Array.prototype.slice.apply(arguments);if(args.length>0){if(typeof(args[0])==='object'){if(settings)$.extend(cg,settings);var args=Array.prototype.slice.apply(arguments);if(args.length>1){args=args.slice(1,args.length);}else{pa.start();return this;}}if(arguments.length===1){pa[arguments[0]]();}else if(arguments.length>1){var args=Array.prototype.slice.apply(arguments);args=args.slice(1,args.length);pa[arguments[0]].apply(this,args);}}return this;}var config={'slideType':'slidehorizontal','index':0,'showTime':5000,'transitionTime':1000,'doHoverPause':true,'maxZIndex':100,'slideChange':null,'direction':'forward','fadeInOut':false},timeOut=null,itemArray=[],blockAnimation=false,lastIndexRequest=-1,$self=this
$window=$(window),$body=$('body');if(settings)$.extend(config,settings);function cancelSlideShow(){if(timeOut!==null){window.clearTimeout(timeOut);timeOut=null;}}function doSlideShowNow(){if(blockAnimation){if(arguments.length>0){lastIndexRequest=arguments[0];}return;}var currentIndex=config.index;var nextIndex=(arguments.length>0)?arguments[0]:(config.index>=itemArray.length-1)?0:config.index+1;if(config.direction==='backward'){if(currentIndex===0){nextIndex=itemArray.length-1;}else{nextIndex=currentIndex-1;}}if(currentIndex==nextIndex){return;}var $f=itemArray[currentIndex].show(),$n=itemArray[nextIndex];blockAnimation=true;doneF=function(){$f.hide();if(config.fadeInOut){$f.css({'opacity':'1.0'});$n.css({'opacity':'1.0'});}blockAnimation=false;if(lastIndexRequest!=-1){doSlideShowNow(lastIndexRequest);lastIndexRequest=-1;}};$f.css('z-index',(config.maxZIndex-1)+'');$n.css('z-index',config.maxZIndex+'');switch(config.slideType){case'slidehorizontal':var pos=$f.position(),width=$f.width(),adjustX='-='+width;if(config.direction==='forward'){$n.css({'left':(parseInt(pos.left)+width)+'px'});}else{$n.css({'left':(parseInt(pos.left)-width)+'px'});adjustX='+='+width;}if(config.fadeInOut){$n.css({'opacity':'0','display':'block'});$f.animate({'left':adjustX,'opacity':'0'},config.transitionTime,'swing');$n.animate({'left':adjustX,'opacity':'1.0'},config.transitionTime,'swing',doneF);}else{$n.show();$f.animate({'left':adjustX},config.transitionTime,'swing');$n.animate({'left':adjustX},config.transitionTime,'swing',doneF);}break;case'slidevertical':var pos=$f.position(),height=$f.height(),adjustY='-='+height;if(config.direction==='forward'){$n.css({'top':(parseInt(pos.top)+height)+'px','display':'block'});}else{$n.css({'top':(parseInt(pos.top)-height)+'px','display':'block'});adjustY='+='+height;}if(config.fadeInOut){$n.css({'opacity':'0','display':'block'});$f.animate({'top':adjustY,'opacity':'0'},config.transitionTime,'swing');$n.animate({'top':adjustY,'opacity':'1.0'},config.transitionTime,'swing',doneF);}else{$n.show();$f.animate({'top':adjustY},config.transitionTime);$n.animate({'top':adjustY},config.transitionTime,doneF);}break;case'fade':$n.fadeIn(config.transitionTime,doneF);break;}if(config.slideChange!==null){config.slideChange(nextIndex);}config.index=nextIndex;}function doSlideShow(){cancelSlideShow();timeOut=window.setTimeout(function(){doSlideShowNow();doSlideShow();},config.showTime);}$self.each(function(){(itemArray.length===config.index)?$(this).show():$(this).hide();if(itemArray.length===0){if(config.doHoverPause){$(this).parent().hover(function(){cancelSlideShow();},function(){cancelSlideShow();doSlideShow();});}}itemArray[itemArray.length]=$(this);});var publicAccessor={'jump':function(index){cancelSlideShow();doSlideShowNow(index);return publicAccessor;},'start':function(){$self.children().hide();itemArray[config.index].show();config.direction='forward';doSlideShow();},'stop':function(){cancelSlideShow();},'next':function(){config.direction='forward';cancelSlideShow();doSlideShowNow();},'previous':function(){config.direction='backward';cancelSlideShow();doSlideShowNow();}};this.data(publicAccessorLabel,publicAccessor);this.data(configLabel,config);doSlideShow();return this;};})(jQuery);

/*
 * jQuery HoverPulse Plugin by M. Alsup
 * Examples and docs at: http://malsup.com/jquery/hoverpulse/
 * Dual licensed under the MIT and GPL
 * Requires: jQuery v1.2.6 or later
 * @version: 1.01  26-FEB-2009
 */

(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:  ('-6px'), 
				left: ('-2px'), 
				height: (h+5*opts.size)+'px', 
				width:	(w+6*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: 150,
	zIndexActive: 100,
	zIndexNormal: 1
};

})(jQuery);

$(document).ready(function() {
    $('.pinpoints ul li a img').hoverpulse({
        size: 1,  // number of pixels to pulse element (in each direction)
        speed: 300 // speed of the animation 
    });
   
});
$(function() {
	$('#slideshow .photo img').dumbCrossFade({'slideType':'fade', 'showTime':5600, 'transitionTime':1400});
});

 $(function () {
        $('.map').each(function () {
            var distance = 10;
            var time = 350;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger1', this);
            var info = $('.bubble-1', this).css('opacity', 0);


            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        top: 4,
                        left: 2,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
             
        });
        $('.map').each(function () {
            var distance = 10;
            var time = 350;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger2', this);
            var info = $('.bubble-2', this).css('opacity', 0);


            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        top: 4,
                        left: 2,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
             
        });
        $('.map').each(function () {
            var distance = 10;
            var time = 350;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger3', this);
            var info = $('.bubble-3', this).css('opacity', 0);


            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        top: 4,
                        left: 2,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
             
        });
        
        
        $('.map').each(function () {
            var distance = 10;
            var time = 350;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger5', this);
            var info = $('.bubble-5', this).css('opacity', 0);


            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        top: 4,
                        left: 2,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
             
        });
		
		
        
        $('.map').each(function () {
            var distance = 10;
            var time = 350;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger8', this);
            var info = $('.bubble-8', this).css('opacity', 0);


            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        top: 4,
                        left: 2,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
             
        });
        
        $('.map').each(function () {
            var distance = 10;
            var time = 350;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger4', this);
            var info = $('.bubble-4', this).css('opacity', 0);


            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        top: 4,
                        left: 2,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
             
        });
        
    });

