
// remap jQuery to $
(function($){
})(this.jQuery);


// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};


// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);


/**
* Fullscreenr - lightweight full screen background jquery plugin
* By Jan Schneiders
* Version 1.0
* www.nanotux.com
**/
(function($){	
	$.fn.fullscreenr = function(options) {
		if(options.height === undefined) alert('Please supply the background image height, default values will now be used. These may be very inaccurate.');
		if(options.width === undefined) alert('Please supply the background image width, default values will now be used. These may be very inaccurate.');
		if(options.bgID === undefined) alert('Please supply the background image ID, default #bgimg will now be used.');
		var defaults = { width: 1280,  height: 1024, bgID: 'bgimg' };
		var options = $.extend({}, defaults, options); 
		$(document).ready(function() { $(options.bgID).fullscreenrResizer(options);	});
		$(window).bind("resize", function() { $(options.bgID).fullscreenrResizer(options); });		
		return this; 		
	};	
	$.fn.fullscreenrResizer = function(options) {
		// Set bg size
		var ratio = options.height / options.width;
		// Get browser window size
		var browserwidth = $(window).width();
		var browserheight = $(window).height();
		// Scale the image
		if ((browserheight/browserwidth) > ratio){
		    $(this).height(browserheight);
		    $(this).width(browserheight / ratio);
		} else {
		    $(this).width(browserwidth);
		    $(this).height(browserwidth * ratio);
		}
		// Center the image
		$(this).css('left', (browserwidth - $(this).width())/2);
		$(this).css('top', (browserheight - $(this).height())/2);
		return this; 		
	};
})(jQuery);


/**
* uBillboard
* http://webdevkit.net/ubillboard
**/
(function(d){d.fn.uBillboard=function(a){function q(b,c){b=b*c;for(i=0;i<b;i++)p(i,f,a.speed,Math.round(Math.random()*a.speed))}function r(b,c){b=b*c;for(i=0;i<b;i++)p(i,f,a.speed,i*70)}function s(b,c){var e=0;for(i=0;i<c;i++)for(j=0;j<b;j++){p(j*c+i,f,a.speed,e*70);e++}}function t(b,c,e){switch(b){case 1:q(c,e);break;case 2:r(c,e);break;case 3:s(c,e);break}}a=d.extend({speed:600,delay:3E3,width:"940px",height:"376px",effect:"cycle",square_resolution:94,load_check_interval:100,description_opacity:0.6,
	loader_image:"images/loading.gif"},a);var f,m,z=[],g=[],k=0,n=1,o=1,u=Math.ceil(parseInt(a.width)/a.square_resolution),v=Math.ceil(parseInt(a.height)/a.square_resolution),p=function(b,c,e,h){function l(){jQuery(".square"+b,c).stop().animate({opacity:1},e)}setTimeout(l,h)},A=function(b,c){f.css({"background-image":"url("+g[k].src+")","background-position":"0px 0px"});d("div",f).css({"background-image":"url("+g[n].src+")",opacity:"0"});switch(a.effect){case "async":q(b,c);break;case "horizontal":r(b,
	c);break;case "vertical":s(b,c);break;case "random":var e=Math.round(Math.random()*2+1);t(e,b,c);break;case "cycle":default:t(o,b,c)}if(o==3)o=1;else o++;if(g.length-1==k)k=0;else k++;if(g.length-1==n)n=0;else n++;d(f).unbind("click").click(function(){window.location=g[k].url});d(m).animate({top:a.height},{duration:300,complete:function(){if(g[k].alt!=""){d(this).text(g[k].alt);d(m).animate({top:parseInt(a.height)-43+"px"},{duration:300})}}})};return this.each(function(){function b(h,l,w){function B(){if(g[0].el.complete){f.css({"background-image":"url("+
	g[0].src+")"});clearInterval(h);h=setInterval(function(){A(l,w)},a.delay+a.speed)}else b(h,l,w)}setTimeout(B,a.load_check_interval)}f=d(this);if(!(d("img",f).size()<2)){f.css({"background-image":"url("+a.loader_image+")","background-position":"center center","background-repeat":"no-repeat",width:a.width,height:a.height,overflow:"hidden",margin:"auto",position:"relative",cursor:"pointer"});d("img",f).each(function(h,l){h="#";if(d(l).parent().is("a"))h=d(l).parent().attr("href");g.push({src:d(this).attr("src"),
	el:this,url:h,alt:d(this).attr("alt")});d(this).detach()});m=d('<span class="description">'+g[0].alt+"</span>");m.css({display:"block",opacity:a.description_opacity,position:"absolute",zIndex:1E3,height:"17px",width:parseInt(a.width)-20+"px",color:"white",textAlign:"center",padding:"13px 20px",background:"black",top:a.height});f.append(m);var c=0;for(y=0;y<v;y++)for(x=0;x<u;x++){var e=document.createElement("div");e.style.backgroundPosition=-x*a.square_resolution+"px "+-y*a.square_resolution+"px";
	e.style.left=x*a.square_resolution+"px";e.style.top=y*a.square_resolution+"px";d(e).addClass("square"+c);f.append(e);z.push(e.id);c++}d("div",f).css({"background-repeat":"no-repeat",opacity:"0",width:a.square_resolution+"px",height:a.square_resolution+"px",position:"absolute","z-index":1});if(g[0].alt!=""){d(this).text();d(m).animate({top:parseInt(a.height)-43+"px"},{duration:300})}b(void 0,v,u)}})}})(jQuery);


/* jQuery Carousel 0.9.8
Copyright 2010 Thomas Lanciaux and Pierre Bertet.
This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/
(function(g){g.fn.carousel=function(q){var q=g.extend({direction:"horizontal",loop:false,dispItems:1,pagination:false,paginationPosition:"inside",nextBtn:'<input type="button" value="Next" />',prevBtn:'<input type="button" value="Previous" />',btnsPosition:"inside",nextBtnInsert:"insertAfter",prevBtnInsert:"insertBefore",nextBtnInsertFn:false,prevBtnInsertFn:false,autoSlide:false,autoSlideInterval:3000,delayAutoSlide:false,combinedClasses:false,effect:"slide",slideEasing:"swing",animSpeed:300,equalWidths:"true",verticalMargin:0,callback:function(){},useAddress:false,adressIdentifier:"carousel",tabLabel:function(r){return r}
,showEmptyItems:true,ajaxMode:false,ajaxUrl:"",stopSlideBtn:false,stopSlideTextPause:"Pause",stopSlideTextPlay:"Play"},q);if(q.btnsPosition=="outside"){q.prevBtnInsert="insertBefore";q.nextBtnInsert="insertAfter"}q.delayAutoSlide=0+q.delayAutoSlide;return this.each(function(){var r={$elts:{},params:q,launchOnLoad:[]};r.$elts.carousel=g(this).addClass("js");r.$elts.content=g(this).children().css({position:"absolute",top:0});r.$elts.wrap=r.$elts.content.wrap('<div class="carousel-wrap"></div>').parent().css({overflow:"hidden",position:"relative"});r.steps={first:0,count:r.$elts.content.children().length};r.$elts.loader=g('<div class="loader"></div>').css({position:"absolute"});
r.steps.last=r.steps.count-1;if(r.params.pagination){o(r)}if(g.isFunction(r.params.prevBtnInsertFn)){r.$elts.prevBtn=r.params.prevBtnInsertFn(r.$elts)}else{if(q.btnsPosition=="outside"){r.$elts.prevBtn=g(q.prevBtn)[q.prevBtnInsert](r.$elts.carousel)}else{r.$elts.prevBtn=g(q.prevBtn)[q.prevBtnInsert](r.$elts.wrap)}}if(g.isFunction(r.params.nextBtnInsertFn)){r.$elts.nextBtn=r.params.nextBtnInsertFn(r.$elts)}else{if(q.btnsPosition=="outside"){r.$elts.nextBtn=g(q.nextBtn)[q.nextBtnInsert](r.$elts.carousel)}else{r.$elts.nextBtn=g(q.nextBtn)[q.nextBtnInsert](r.$elts.wrap)}}r.$elts.nextBtn.addClass("carousel-control next carousel-next");r.$elts.prevBtn.addClass("carousel-control previous carousel-previous");r.lastItemsToLoad;
d(r);r.$elts.carousel.attr("tabindex",0).add(r.$elts.carousel.children()).bind({focus:function(s){g(document).bind("keypress",function(t){switch(t.keyCode){case 39:r.$elts.nextBtn.click();break;case 37:r.$elts.prevBtn.click();break}switch(t.charCode){case 110:r.$elts.nextBtn.click();break;case 112:r.$elts.prevBtn.click();break}})},blur:function(){g(document).unbind("keypress")}});n(r);g(function(){c(r);g.each(r.launchOnLoad,function(s,t){t()});if(r.params.autoSlide){f(r)}if(q.stopSlideBtn==true){r.$elts.stopSlideBtn=g('<button type="button" class="slide-control play">'+q.stopSlideTextPause+"</button>");a(r)}})})};function c(s){var t=s.$elts.content.children();var r=0;t.each(function(){$item=g(this);
$itemHeight=$item.outerHeight();if($itemHeight>r){r=$itemHeight}});if(s.params.verticalMargin>0){r=r+s.params.verticalMargin}t.height(r);var q=s.$elts.content.children(":first");s.itemWidth=q.outerWidth();if(s.params.direction=="vertical"){s.contentWidth=s.itemWidth}else{if(s.params.equalWidths){s.contentWidth=s.itemWidth*s.steps.count}else{s.contentWidth=(function(){var u=0;s.$elts.content.children().each(function(){u+=g(this).outerWidth()});return u})()}}s.$elts.content.width(s.contentWidth);s.itemHeight=r;if(s.params.direction=="vertical"){s.$elts.content.css({height:s.itemHeight*s.steps.count+"px"});s.$elts.content.parent().css({height:s.itemHeight*s.params.dispItems+"px"})}
else{s.$elts.content.parent().css({height:s.itemHeight+"px"})}i(s)}function d(q){q.$elts.nextBtn.add(q.$elts.prevBtn).bind("enable",function(){var r=g(this).unbind("click").bind("click",function(){if(q.params.ajaxMode&&r.is(".next")&&b(q)==(p(q)-1)&&!q.lastItemsToLoad){h(q);q.$elts.content.ajaxSuccess(function(){})}else{e(q,j(q,(r.is(".next")?"next":"prev")));if(q.params.stopSlideBtn==true){q.$elts.stopSlideBtn.trigger("pause")}else{m(q)}}}).removeClass("disabled").removeAttr("disabled");if(q.params.combinedClasses){r.removeClass("next-disabled previous-disabled").removeAttr("disabled")}}).bind("disable",function(){var r=g(this).unbind("click").addClass("disabled").attr("disabled","disabled");
if(q.params.combinedClasses){if(r.is(".next")){r.addClass("next-disabled")}else{if(r.is(".previous")){r.addClass("previous-disabled")}}}}).hover(function(){g(this).toggleClass("hover")})}function o(q){q.$elts.pagination=g('<div class="center-wrap"><div class="carousel-pagination"><p></p></div></div>')[((q.params.paginationPosition=="outside")?"insertAfter":"appendTo")](q.$elts.carousel).find("p");q.$elts.paginationBtns=g([]);q.$elts.content.find("li").each(function(r){if(r%q.params.dispItems==0){k(q,r)}})}function k(r,q){if(r.params.pagination){r.$elts.paginationBtns=r.$elts.paginationBtns.add(g('<a role="button"><span>'+r.params.tabLabel(r.$elts.paginationBtns.length+1)+"</span></a>").data("firstStep",q)).appendTo(r.$elts.pagination);
r.$elts.paginationBtns.slice(0,1).addClass("active");r.$elts.paginationBtns.click(function(s){e(r,g(this).data("firstStep"));if(r.params.stopSlideBtn==true){r.$elts.stopSlideBtn.trigger("pause")}else{m(r)}})}}function n(q){if(q.params.useAddress&&g.isFunction(g.fn.address)){g.address.init(function(s){var r=g.address.pathNames();if(r[0]===q.params.adressIdentifier&&!!r[1]){e(q,r[1]-1)}else{g.address.value("/"+q.params.adressIdentifier+"/1")}}).change(function(s){var r=g.address.pathNames();if(r[0]===q.params.adressIdentifier&&!!r[1]){e(q,r[1]-1)}})}else{q.params.useAddress=false}}function e(q,r){q.params.callback(r);l(q,r);q.steps.first=r;i(q);if(q.params.useAddress){g.address.value("/"+q.params.adressIdentifier+"/"+(r+1))}}
function j(r,q){if(q=="prev"){if(!r.params.showEmptyItems){if(r.steps.first==0){return((r.params.loop)?(r.steps.count-r.params.dispItems):false)}else{return Math.max(0,r.steps.first-r.params.dispItems)}}else{if((r.steps.first-r.params.dispItems)>=0){return r.steps.first-r.params.dispItems}else{return((r.params.loop)?(r.steps.count-r.params.dispItems):false)}}}else{if(q=="next"){if((r.steps.first+r.params.dispItems)<r.steps.count){if(!r.params.showEmptyItems){return Math.min(r.steps.first+r.params.dispItems,r.steps.count-r.params.dispItems)}else{return r.steps.first+r.params.dispItems}}else{return((r.params.loop)?0:false)}}}}function l(q,r){switch(q.params.effect){case"no":if(q.params.direction=="vertical"){q.$elts.content.css("top",-(q.itemHeight*r)+"px")}
else{q.$elts.content.css("left",-(q.itemWidth*r)+"px")}break;case"fade":if(q.params.direction=="vertical"){q.$elts.content.hide().css("top",-(q.itemHeight*r)+"px").fadeIn(q.params.animSpeed)}else{q.$elts.content.hide().css("left",-(q.itemWidth*r)+"px").fadeIn(q.params.animSpeed)}break;default:if(q.params.direction=="vertical"){q.$elts.content.stop().animate({top:-(q.itemHeight*r)+"px"},q.params.animSpeed,q.params.slideEasing)}else{q.$elts.content.stop().animate({left:-(q.itemWidth*r)+"px"},q.params.animSpeed,q.params.slideEasing)}break}}function i(q){if(j(q,"prev")!==false){q.$elts.prevBtn.trigger("enable")}else{q.$elts.prevBtn.trigger("disable")}if(j(q,"next")!==false){q.$elts.nextBtn.trigger("enable")}else{q.$elts.nextBtn.trigger("disable")}
if(q.params.pagination){q.$elts.paginationBtns.removeClass("active").filter(function(){return(g(this).data("firstStep")==q.steps.first)}).addClass("active")}}function f(q){q.delayAutoSlide=window.setTimeout(function(){q.autoSlideInterval=window.setInterval(function(){e(q,j(q,"next"))},q.params.autoSlideInterval)},q.params.delayAutoSlide)}function m(q){window.clearTimeout(q.delayAutoSlide);window.clearInterval(q.autoSlideInterval);q.params.delayAutoSlide=0}function a(r){var q=r.$elts.stopSlideBtn;q.bind({play:function(){f(r);q.removeClass("pause").addClass("play").html(r.params.stopSlideTextPause)},pause:function(){m(r);q.removeClass("play").addClass("pause").html(r.params.stopSlideTextPlay)}});q.click(function(s){if(q.is(".play")){q.trigger("pause")}
else{if(q.is(".pause")){q.trigger("play")}}});q.prependTo(r.$elts.wrap)}function p(q){return q.$elts.pagination.children().length}function b(q){return q.steps.first/q.params.dispItems}function h(q){q.$elts.carousel.prepend(q.$elts.loader);g.ajax({url:q.params.ajaxUrl,dataType:"json",success:function(r){q.lastItemsToLoad=r.bLastItemsToLoad;g(q.$elts.content).append(r.shtml);q.steps={first:q.steps.first+q.params.dispItems,count:q.$elts.content.children().length};q.steps.last=q.steps.count-1;c(q);k(q,q.steps.first);e(q,q.steps.first);if(q.params.stopSlideBtn==true){q.$elts.stopSlideBtn.trigger("pause")}else{m(q)}q.$elts.loader.remove()}})}})(jQuery);

/* jQuery Carousel 0.9.8
Copyright 2010 Thomas Lanciaux and Pierre Bertet.
This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/
(function(g){g.fn.carousel=function(q){var q=g.extend({direction:"horizontal",loop:false,dispItems:1,pagination:false,paginationPosition:"inside",nextBtn:'<input type="button" value="Next" />',prevBtn:'<input type="button" value="Previous" />',btnsPosition:"inside",nextBtnInsert:"insertAfter",prevBtnInsert:"insertBefore",nextBtnInsertFn:false,prevBtnInsertFn:false,autoSlide:false,autoSlideInterval:3000,delayAutoSlide:false,combinedClasses:false,effect:"slide",slideEasing:"swing",animSpeed:300,equalWidths:"true",verticalMargin:0,callback:function(){},useAddress:false,adressIdentifier:"carousel",tabLabel:function(r){return r},showEmptyItems:true,ajaxMode:false,ajaxUrl:"",stopSlideBtn:false,stopSlideTextPause:"Pause",stopSlideTextPlay:"Play"},q);if(q.btnsPosition=="outside"){q.prevBtnInsert="insertBefore";q.nextBtnInsert="insertAfter"}q.delayAutoSlide=0+q.delayAutoSlide;return this.each(function(){var r={$elts:{},params:q,launchOnLoad:[]};r.$elts.carousel=g(this).addClass("js");r.$elts.content=g(this).children().css({position:"absolute",top:0});r.$elts.wrap=r.$elts.content.wrap('<div class="carousel-wrap"></div>').parent().css({overflow:"hidden",position:"relative"});r.steps={first:0,count:r.$elts.content.children().length};r.$elts.loader=g('<div class="loader"></div>').css({position:"absolute"});r.steps.last=r.steps.count-1;if(r.params.pagination){o(r)}if(g.isFunction(r.params.prevBtnInsertFn)){r.$elts.prevBtn=r.params.prevBtnInsertFn(r.$elts)}else{if(q.btnsPosition=="outside"){r.$elts.prevBtn=g(q.prevBtn)[q.prevBtnInsert](r.$elts.carousel)}else{r.$elts.prevBtn=g(q.prevBtn)[q.prevBtnInsert](r.$elts.wrap)}}if(g.isFunction(r.params.nextBtnInsertFn)){r.$elts.nextBtn=r.params.nextBtnInsertFn(r.$elts)}else{if(q.btnsPosition=="outside"){r.$elts.nextBtn=g(q.nextBtn)[q.nextBtnInsert](r.$elts.carousel)}else{r.$elts.nextBtn=g(q.nextBtn)[q.nextBtnInsert](r.$elts.wrap)}}r.$elts.nextBtn.addClass("carousel-control next carousel-next");r.$elts.prevBtn.addClass("carousel-control previous carousel-previous");r.lastItemsToLoad;d(r);r.$elts.carousel.attr("tabindex",0).add(r.$elts.carousel.children()).bind({focus:function(s){g(document).bind("keypress",function(t){switch(t.keyCode){case 39:r.$elts.nextBtn.click();break;case 37:r.$elts.prevBtn.click();break}switch(t.charCode){case 110:r.$elts.nextBtn.click();break;case 112:r.$elts.prevBtn.click();break}})},blur:function(){g(document).unbind("keypress")}});n(r);g(function(){c(r);g.each(r.launchOnLoad,function(s,t){t()});if(r.params.autoSlide){f(r)}if(q.stopSlideBtn==true){r.$elts.stopSlideBtn=g('<button type="button" class="slide-control play">'+q.stopSlideTextPause+"</button>");a(r)}})})};function c(s){var t=s.$elts.content.children();var r=0;t.each(function(){$item=g(this);$itemHeight=$item.outerHeight();if($itemHeight>r){r=$itemHeight}});if(s.params.verticalMargin>0){r=r+s.params.verticalMargin}t.height(r);var q=s.$elts.content.children(":first");s.itemWidth=q.outerWidth();if(s.params.direction=="vertical"){s.contentWidth=s.itemWidth}else{if(s.params.equalWidths){s.contentWidth=s.itemWidth*s.steps.count}else{s.contentWidth=(function(){var u=0;s.$elts.content.children().each(function(){u+=g(this).outerWidth()});return u})()}}s.$elts.content.width(s.contentWidth);s.itemHeight=r;if(s.params.direction=="vertical"){s.$elts.content.css({height:s.itemHeight*s.steps.count+"px"});s.$elts.content.parent().css({height:s.itemHeight*s.params.dispItems+"px"})}else{s.$elts.content.parent().css({height:s.itemHeight+"px"})}i(s)}function d(q){q.$elts.nextBtn.add(q.$elts.prevBtn).bind("enable",function(){var r=g(this).unbind("click").bind("click",function(){if(q.params.ajaxMode&&r.is(".next")&&b(q)==(p(q)-1)&&!q.lastItemsToLoad){h(q);q.$elts.content.ajaxSuccess(function(){})}else{e(q,j(q,(r.is(".next")?"next":"prev")));if(q.params.stopSlideBtn==true){q.$elts.stopSlideBtn.trigger("pause")}else{m(q)}}}).removeClass("disabled").removeAttr("disabled");if(q.params.combinedClasses){r.removeClass("next-disabled previous-disabled").removeAttr("disabled")}}).bind("disable",function(){var r=g(this).unbind("click").addClass("disabled").attr("disabled","disabled");if(q.params.combinedClasses){if(r.is(".next")){r.addClass("next-disabled")}else{if(r.is(".previous")){r.addClass("previous-disabled")}}}}).hover(function(){g(this).toggleClass("hover")})}function o(q){q.$elts.pagination=g('<div class="center-wrap"><div class="carousel-pagination"><p></p></div></div>')[((q.params.paginationPosition=="outside")?"insertAfter":"appendTo")](q.$elts.carousel).find("p");q.$elts.paginationBtns=g([]);q.$elts.content.find("li").each(function(r){if(r%q.params.dispItems==0){k(q,r)}})}function k(r,q){if(r.params.pagination){r.$elts.paginationBtns=r.$elts.paginationBtns.add(g('<a role="button"><span>'+r.params.tabLabel(r.$elts.paginationBtns.length+1)+"</span></a>").data("firstStep",q)).appendTo(r.$elts.pagination);r.$elts.paginationBtns.slice(0,1).addClass("active");r.$elts.paginationBtns.click(function(s){e(r,g(this).data("firstStep"));if(r.params.stopSlideBtn==true){r.$elts.stopSlideBtn.trigger("pause")}else{m(r)}})}}function n(q){if(q.params.useAddress&&g.isFunction(g.fn.address)){g.address.init(function(s){var r=g.address.pathNames();if(r[0]===q.params.adressIdentifier&&!!r[1]){e(q,r[1]-1)}else{g.address.value("/"+q.params.adressIdentifier+"/1")}}).change(function(s){var r=g.address.pathNames();if(r[0]===q.params.adressIdentifier&&!!r[1]){e(q,r[1]-1)}})}else{q.params.useAddress=false}}function e(q,r){q.params.callback(r);l(q,r);q.steps.first=r;i(q);if(q.params.useAddress){g.address.value("/"+q.params.adressIdentifier+"/"+(r+1))}}function j(r,q){if(q=="prev"){if(!r.params.showEmptyItems){if(r.steps.first==0){return((r.params.loop)?(r.steps.count-r.params.dispItems):false)}else{return Math.max(0,r.steps.first-r.params.dispItems)}}else{if((r.steps.first-r.params.dispItems)>=0){return r.steps.first-r.params.dispItems}else{return((r.params.loop)?(r.steps.count-r.params.dispItems):false)}}}else{if(q=="next"){if((r.steps.first+r.params.dispItems)<r.steps.count){if(!r.params.showEmptyItems){return Math.min(r.steps.first+r.params.dispItems,r.steps.count-r.params.dispItems)}else{return r.steps.first+r.params.dispItems}}else{return((r.params.loop)?0:false)}}}}function l(q,r){switch(q.params.effect){case"no":if(q.params.direction=="vertical"){q.$elts.content.css("top",-(q.itemHeight*r)+"px")}else{q.$elts.content.css("left",-(q.itemWidth*r)+"px")}break;case"fade":if(q.params.direction=="vertical"){q.$elts.content.hide().css("top",-(q.itemHeight*r)+"px").fadeIn(q.params.animSpeed)}else{q.$elts.content.hide().css("left",-(q.itemWidth*r)+"px").fadeIn(q.params.animSpeed)}break;default:if(q.params.direction=="vertical"){q.$elts.content.stop().animate({top:-(q.itemHeight*r)+"px"},q.params.animSpeed,q.params.slideEasing)}else{q.$elts.content.stop().animate({left:-(q.itemWidth*r)+"px"},q.params.animSpeed,q.params.slideEasing)}break}}function i(q){if(j(q,"prev")!==false){q.$elts.prevBtn.trigger("enable")}else{q.$elts.prevBtn.trigger("disable")}if(j(q,"next")!==false){q.$elts.nextBtn.trigger("enable")}else{q.$elts.nextBtn.trigger("disable")}if(q.params.pagination){q.$elts.paginationBtns.removeClass("active").filter(function(){return(g(this).data("firstStep")==q.steps.first)}).addClass("active")}}function f(q){q.delayAutoSlide=window.setTimeout(function(){q.autoSlideInterval=window.setInterval(function(){e(q,j(q,"next"))},q.params.autoSlideInterval)},q.params.delayAutoSlide)}function m(q){window.clearTimeout(q.delayAutoSlide);window.clearInterval(q.autoSlideInterval);q.params.delayAutoSlide=0}function a(r){var q=r.$elts.stopSlideBtn;q.bind({play:function(){f(r);q.removeClass("pause").addClass("play").html(r.params.stopSlideTextPause)},pause:function(){m(r);q.removeClass("play").addClass("pause").html(r.params.stopSlideTextPlay)}});q.click(function(s){if(q.is(".play")){q.trigger("pause")}else{if(q.is(".pause")){q.trigger("play")}}});q.prependTo(r.$elts.wrap)}function p(q){return q.$elts.pagination.children().length}function b(q){return q.steps.first/q.params.dispItems}function h(q){q.$elts.carousel.prepend(q.$elts.loader);g.ajax({url:q.params.ajaxUrl,dataType:"json",success:function(r){q.lastItemsToLoad=r.bLastItemsToLoad;g(q.$elts.content).append(r.shtml);q.steps={first:q.steps.first+q.params.dispItems,count:q.$elts.content.children().length};q.steps.last=q.steps.count-1;c(q);k(q,q.steps.first);e(q,q.steps.first);if(q.params.stopSlideBtn==true){q.$elts.stopSlideBtn.trigger("pause")}else{m(q)}q.$elts.loader.remove()}})}})(jQuery);
                
                
                /*
 *  GMAP3 Plugin for JQuery 
 *  Version   : 3.2
 *  Date      : May 10, 2011
 *  Licence   : GPL v3 : http://www.gnu.org/licenses/gpl.html  
 *  Author    : DEMONTE Jean-Baptiste
 *  Contact   : jbdemonte@gmail.com
 *  Web site  : http://gmap3.net
 *   
 *  Copyright (c) 2010-2011 Jean-Baptiste DEMONTE
 *  All rights reserved.
 *   
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 * 
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   - Redistributions in binary form must reproduce the above 
 *     copyright notice, this list of conditions and the following 
 *     disclaimer in the documentation and/or other materials provided 
 *     with the distribution.
 *   - Neither the name of the author nor the names of its contributors 
 *     may be used to endorse or promote products derived from this 
 *     software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 * POSSIBILITY OF SUCH DAMAGE.
 */
 (function(d){function c(){var f={};this.init=function(g){if(!f[g]){f[g]=[]}};this.empty=function(h){var g;if(!f[h]){return true}for(g in f[h]){if(f[h][g]){return false}}return true};this.add=function(h,g){this.init(h);f[h].push(g)};this.addNext=function(m,h){var l=[],j=0,g;this.init(m);for(g in f[m]){if(j==1){l.push(h)}l.push(f[m][g]);j++}if(j<2){l.push(h)}f[m]=l};this.get=function(h){var g;if(f[h]){for(g in f[h]){if(f[h][g]){return f[h][g]}}}return false};this.ack=function(h){var g;if(f[h]){for(g in f[h]){if(f[h][g]){delete f[h][g];break}}if(this.empty(h)){delete f[h]}}}}function b(){var j=[],g=[],i=[],f=[],h=false,l;this.events=function(){for(var m=0;m<arguments.length;m++){g.push(arguments[m])}};this.startRedraw=function(){if(!h){h=true;return true}return false};this.endRedraw=function(){h=false};this.redraw=function(){var n,m=[],o=this;for(n=0;n<arguments.length;n++){m.push(arguments[n])}if(this.startRedraw){l.apply(o,m);this.endRedraw()}else{setTimeout(function(){o.redraw.apply(o,m)},50)}};this.setRedraw=function(m){l=m};this.store=function(m){i.push(m)};this.free=function(){for(k in g){google.maps.event.removeListener(g[k])}g=[];this.freeDom()};this.freeDom=function(){var n,m;for(n in i){if(typeof(i[n].setMap)==="function"){i[n].setMap(null)}if(typeof(i[n].remove)==="function"){i[n].remove()}delete i[n]}i=[]};this.add=function(n,m){j.push([n.lat(),n.lng(),m])};this.get=function(m){return j[m]};this.clusters=function(N,o,n){var q=N.getProjection(),F=q.fromLatLngToPoint(new google.maps.LatLng(N.getBounds().getNorthEast().lat(),N.getBounds().getSouthWest().lng())),J,H,m,E,C,B,G,w,A=N.getZoom(),s={},M={},I={},v=[],K,L,r,O,D,u=N.getBounds();D=[];for(J in j){if(!u.contains(new google.maps.LatLng(j[J][0],j[J][1]))){continue}E=q.fromLatLngToPoint(new google.maps.LatLng(j[J][0],j[J][1]));s[J]=[Math.floor((E.x-F.x)*Math.pow(2,A)),Math.floor((E.y-F.y)*Math.pow(2,A))];D.push(J)}if(!n){if(f.length==D.length){L=false;for(G in f){L=true;for(w in D){if(f[G]==D[w]){L=false;break}}if(L){break}}if(!L){return false}}}f=D;D=[];for(J in s){C=s[J][0];B=s[J][1];if(!(C in M)){M[C]={}}if(!(B in M[C])){M[C][B]=J;I[J]={};D.push(J)}I[M[C][B]][J]=true}o=Math.pow(o,2);delete (M);G=0;while(1){while((G<D.length)&&!(D[G] in I)){G++}if(G==D.length){break}J=D[G];r=s[J][0];O=s[J][1];M=null;do{K={lat:0,lng:0,idx:[]};for(w=G;w<D.length;w++){if(!(D[w] in I)){continue}H=D[w];if(Math.pow(r-s[H][0],2)+Math.pow(O-s[H][1],2)<=o){for(m in I[H]){K.lat+=j[m][0];K.lng+=j[m][1];K.idx.push(m)}}}K.lat/=K.idx.length;K.lng/=K.idx.length;if(!M){L=K.idx.length>1;M=K}else{L=K.idx.length>M.idx.length;if(L){M=K}}if(L){E=q.fromLatLngToPoint(new google.maps.LatLng(M.lat,M.lng));r=Math.floor((E.x-F.x)*Math.pow(2,A));O=Math.floor((E.y-F.y)*Math.pow(2,A))}}while(L);for(w in M.idx){if(M.idx[w] in I){delete (I[M.idx[w]])}}v.push(M)}return v}}var e={_ids:{},_properties:["events","onces","options","apply","callback","data","tag"],_default:{verbose:false,unit:"mi",init:{mapTypeId:google.maps.MapTypeId.ROADMAP,center:[46.578498,2.457275],zoom:2}},_running:{},_stack:new c(),_init:function(f,g){if(!this._ids[g]){this._ids[g]={$this:f,styles:{},stored:{},map:null}}},_plan:function(h,i,g){var f;this._init(h,i);for(f in g){this._stack.add(i,g[f])}this._run(i)},_isDirect:function(i,f){var h=this._ival(f,"action"),g={distance:true,earthradius:true,get:true};return h in g},_direct:function(h,f){var g=this._ival(f,"action");if(g.substr(0,1)==":"){g=g.substr(1)}return this[g](h,d.extend({},this._default[g],f.args?f.args:f))},_planNext:function(h,f){var g=this._jObject(h);this._init(g,h);this._stack.addNext(h,f)},_end:function(f){delete this._running[f];this._stack.ack(f);this._run(f)},_run:function(g){if(this._running[g]){return}var f=this._stack.get(g);if(!f){return}this._running[g]=true;this._proceed(g,f)},_geocoder:null,_getGeocoder:function(){if(!this._geocoder){this._geocoder=new google.maps.Geocoder()}return this._geocoder},_directionsService:null,_getDirectionsService:function(){if(!this._directionsService){this._directionsService=new google.maps.DirectionsService()}return this._directionsService},_elevationService:null,_getElevationService:function(){if(!this._elevationService){this._elevationService=new google.maps.ElevationService()}return this._elevationService},_maxZoomService:null,_getMaxZoomService:function(){if(!this._maxZoomService){this._maxZoomService=new google.maps.MaxZoomService()}return this._maxZoomService},_getMap:function(f){return this._ids[f].map},_setMap:function(g,f){this._ids[g].map=f},_jObject:function(f){return this._ids[f].$this},_addStyle:function(h,f,g){this._ids[h].styles[f]=g},_getStyles:function(f){return this._ids[f].styles},_getStyle:function(g,f){return this._ids[g].styles[f]},_styleExist:function(g,f){return this._ids[g]&&this._ids[g].styles[f]},_getDirectionRenderer:function(f){return this._getStored(f,"directionrenderer")},_exist:function(f){return this._ids[f].map?true:false},_getStored:function(l,h,i,g){if(!this._ids[l].stored[h]||!this._ids[l].stored[h].length){return null}var f=0,j=i?-1:1;end=i?-1:this._ids[l].stored[h].length;while(f!=end){if(this._ids[l].stored[h][f]){if(g!==undefined){if((t[f].tag===undefined)||(g.indexOf(t[f].tag)!=-1)){continue}}return this._ids[l].stored[h][f].obj}f+=j}return null},_getStoredId:function(g,f){f=f.split("-");if((f.length==2)&&this._ids[g].stored[f[0]]&&this._ids[g].stored[f[0]][f[1]]){return this._ids[g].stored[f[0]][f[1]].obj}return null},_store:function(i,g,h,f){g=g.toLowerCase();if(!this._ids[i].stored[g]){this._ids[i].stored[g]=new Array()}this._ids[i].stored[g].push({obj:h,tag:this._ival(f,"tag")});return g+"-"+(this._ids[i].stored[g].length-1)},_unstore:function(l,i,g,h){var f,j=this._ids[l].stored[i];if(!j){return false}if(g!==undefined){if(h){for(f=j.length-1;f>=0;f--){if((j[f]!==undefined)&&(j[f].tag!==undefined)&&(g.indexOf(j[f].tag)!=-1)){break}}}else{for(f=0;f<j.length;f++){if((j[f]!==undefined)&&(j[f].tag!==undefined)&&(g.indexOf(j[f].tag)!=-1)){break}}}}else{f=h?j.length-1:0}if(!(f in j)){return false}if(typeof(j[f].obj.setMap)==="function"){j[f].obj.setMap(null)}if(typeof(j[f].obj.remove)==="function"){j[f].obj.remove()}if(typeof(j[f].obj.free)==="function"){j[f].obj.free()}delete j[f].obj;if(g!==undefined){this._ids[l].stored[i]=this._rmFromArray(j,f)}else{if(h){j.pop()}else{j.shift()}}return true},_clear:function(p,l,j,m,f){var g,o,h;if(!l||!l.length){l=[];for(g in this._ids[p].stored){l.push(g)}}else{l=this._array(l)}for(g in l){o=l[g].toLowerCase();if(!this._ids[p].stored[o]){continue}if(j){this._unstore(p,o,f,true)}else{if(m){this._unstore(p,o,f,false)}else{while(this._unstore(p,o,f,false)){}}}}},_autoInit:function(g){var f,h=g.substr(0,1),i=["init","geolatlng","getlatlng","getroute","getelevation","addstyledmap","setdefault","destroy"];if(!g){return true}for(f in i){if(i[f]==g){return false}}return true},_proceed:function(g,i){i=i||{};var j=this._ival(i,"action")||"init",h=j.toLowerCase(),o=true,m=this._ival(i,"target"),n=this._ival(i,"args"),f,l;if(!this._exist(g)&&this._autoInit(h)){this.init(g,d.extend({},this._default.init,i.args&&i.args.map?i.args.map:i.map?i.map:{}),true)}if(!m&&!n&&(typeof(this[h])==="function")){this[h](g,d.extend({},this._default[h],i.args?i.args:i))}else{if(m&&(typeof(m)==="object")){if(typeof(m[j])==="function"){l=m[j].apply(m,i.args?i.args:[])}else{o=false}}else{f=this._getMap(g);if(typeof(f[j])==="function"){l=f[j].apply(f,i.args?i.args:[])}else{o=false}}if(!o&&this._default.verbose){alert("unknown action : "+j)}this._callback(g,l,i);this._end(g)}},_call:function(){if(arguments.length<2){return}if(!this._exist(arguments[0])){return}var g,l=arguments[0],j=arguments[1],h=this._getMap(l),f=[];if(typeof(h[j])!=="function"){return}for(g=2;g<arguments.length;g++){f.push(arguments[g])}return h[j].apply(h,f)},_array:function(h){var g,f=[];if(h!==undefined){if(typeof(h)==="object"){for(g in h){f.push(h[g])}}else{f.push(h)}}return f},_rmFromArray:function(f,h){var g,i=new Array();for(g in f){if(g!=h){i.push(f[g])}}return i},_subcall:function(i,f,h){var g={};if(!f.map){return}if(!h){h=this._ival(f.map,"latlng")}if(!this._exist(i)){if(h){g={center:h}}this.init(i,d.extend({},f.map,g),true)}else{if(f.map.center&&h){this._call(i,"setCenter",h)}if(f.map.zoom!==undefined){this._call(i,"setZoom",f.map.zoom)}if(f.map.mapTypeId!==undefined){this._call(i,"setMapTypeId",f.map.mapTypeId)}}},_attachEvent:function(o,i,g,n,m,j){var l=this,h=this._jObject(o);google.maps.event["addListener"+(j?"Once":"")](i,g,function(f){n.apply(h,[i,f,m])})},_attachEvents:function(i,h,f){var g;if(!f){return}if(f.events){for(g in f.events){if(typeof(f.events[g])==="function"){this._attachEvent(i,h,g,f.events[g],f.data,false)}}}if(f.onces){for(g in f.onces){if(typeof(f.onces[g])==="function"){this._attachEvent(i,h,g,f.onces[g],f.data,true)}}}},_callback:function(i,g,f){var h,j;if(typeof(f.callback)==="function"){j=typeof(i)==="number"?this._jObject(i):i;f.callback.apply(j,[g])}else{if(typeof(f.callback)==="object"){for(h in f.callback){if(!j){j=typeof(i)==="number"?this._jObject(i):i}if(typeof(f.callback[h])==="function"){f.callback[h].apply(j,[g])}}}}},_manageEnd:function(l,i,f,g){var h,j;if(i&&(typeof(i)==="object")){this._attachEvents(l,i,f);for(h in f.apply){j=f.apply[h];if(!j.action){continue}if(typeof(i[j.action])!=="function"){continue}if(j.args){i[j.action].apply(i,j.args)}else{i[j.action]()}}}if(!g){this._callback(l,i,f);this._end(l)}},_isNumeric:function(f){return(typeof(f)==="number"||typeof(f)==="string")&&f!==""&&!isNaN(f)},_latLng:function(j,n,h){var f,l={},g=0,m=n?j:null;if(!j||(typeof(j)==="string")){return m}if(j.latLng){return this._latLng(j.latLng)}if(typeof(j.lat)==="function"){return j}else{if(this._isNumeric(j.lat)){return new google.maps.LatLng(j.lat,j.lng)}else{if(!h){for(f in j){if(!this._isNumeric(j[f])){return m}l[g?"lng":"lat"]=j[f];if(g){break}g++}if(g){return new google.maps.LatLng(l.lat,l.lng)}}}}return m},_count:function(g){var f,h=0;for(f in g){h++}return h},_latLngBounds:function(q,g,j){var o,h,l,r,m,s,p,f,n;if(!q){return null}o=j?q:null;if(typeof(q.getCenter)==="function"){return q}h=this._count(q);if(h==2){if(q.ne&&q.sw){l=this._latLng(q.ne);r=this._latLng(q.sw)}else{for(m in q){if(!l){l=this._latLng(q[m])}else{r=this._latLng(q[m])}}}if(r&&l){return new google.maps.LatLngBounds(r,l)}return o}else{if(h==4){s=["n","e","s","w"];p=true;for(n in s){p&=this._isNumeric(q[s[n]])}if(p){return new google.maps.LatLngBounds(this._latLng([q.s,q.w]),this._latLng([q.n,q.e]))}if(g){n=0;f={};for(m in q){if(!this._isNumeric(q[m])){return o}f[s[n]]=q[m];n++}return new google.maps.LatLngBounds(this._latLng([f.s,f.w]),this._latLng([f.n,f.e]))}}}return o},_ikey:function(g,h){h=h.toLowerCase();for(var f in g){if(f.toLowerCase()==h){return f}}return false},_ival:function(g,h,i){var f=this._ikey(g,h);if(f){return g[f]}return i},_hasKey:function(g,h){var i,f;if(!g||!h){return false}for(i in g){i=i.toLowerCase();for(f in h){if(i==h[f]){return true}}}return false},_extractObject:function(g,f,i){if(this._hasKey(g,this._properties)||this._hasKey(g,f)){var h,j,l,i={};for(h in this._properties){j=this._properties[h];l=this._ikey(g,j);i[j]=l?g[l]:{}}for(h in f){j=f[h];l=this._ikey(g,j);if(l){i[j]=g[l]}}return i}else{i.options={};for(h in g){if(h=="action"){continue}i.options[h]=g[h]}return i}},_object:function(g,l,h,j){var n=this._ikey(l,g),i,f={},o=["map"],m="callback";f[m]=this._ival(l,m);if(n){return this._extractObject(l[n],h,f)}for(n in j){o.push(j[n])}if(!this._hasKey(l,o)){f=this._extractObject(l,h,f)}for(n in this._properties){i=this._properties[n];if(!f[i]){f[i]={}}}return f},_resolveLatLng:function(g,h,f,n){var o=this._ival(h,"address"),m,j,l=this,i;if(o){i=function(q,p){if(p==google.maps.GeocoderStatus.OK){l[f](g,h,n?q:q[0].geometry.location)}else{if(l._default.verbose){alert("Geocode error : "+p)}l[f](g,h,false)}};if(typeof(o)==="object"){j=o}else{j={address:o};m=this._ival(h,"region");if(m){j.region=m}}this._getGeocoder().geocode(j,i)}else{this[f](g,h,this._latLng(h,false,true))}},destroy:function(i,f){var g,h;if(this._ids[i]){this._clear(i);this._ids[i].$this.empty();if(this._ids[i].bl){delete this._ids[i].bl}for(g in this._ids[i].styles){delete this._ids[i].styles[g]}delete this._ids[i].map;h=this._jObject(i);delete this._ids[i];this._callback(h,null,f)}this._end(i)},init:function(h,j,m){var i,f,g,p,l,n;if((h=="")||(this._exist(h))){return this._end(h)}i=this._object("map",j);if((typeof(i.options.center)==="boolean")&&i.options.center){return false}f=d.extend({},this._default.init,i.options);if(!f.center){f.center=[this._default.init.center.lat,this._default.init.center.lng]}f.center=this._latLng(f.center);n=this._jObject(h);this._setMap(h,new google.maps.Map(n.get(0),f));g=this._getMap(h);p=this._getStyles(h);for(l in p){g.mapTypes.set(l,p[l])}this._manageEnd(h,g,i,m);return true},getlatlng:function(g,f){this._resolveLatLng(g,f,"_getLatLng",true)},_getLatLng:function(h,f,g){this._manageEnd(h,g,f)},getaddress:function(n,g){var m,j=this._jObject(n),i=this._latLng(g,false,true),h=this._ival(g,"address"),l=i?{latLng:i}:(h?(typeof(h)==="string"?{address:h}:h):null),f=this._ival(g,"callback");if(l&&f&&typeof(f)==="function"){m=function(q,o){var p=o==google.maps.GeocoderStatus.OK?q:false;f.apply(j,[p,o])};this._getGeocoder().geocode(l,m)}this._end(n)},getroute:function(j,g){var i,h=this._jObject(j),f=this._ival(g,"callback");if((typeof(f)==="function")&&g.options){g.options.origin=this._latLng(g.options.origin,true);g.options.destination=this._latLng(g.options.destination,true);i=function(n,l){var m=l==google.maps.DirectionsStatus.OK?n:false;f.apply(h,[m,l])};this._getDirectionsService().route(g.options,i)}this._end(j)},getelevation:function(f,h){var p,g,l,j,q,o,m=[],n=this._jObject(f),i=this._ival(h,"callback"),g=this._ival(h,"latlng");if(i&&typeof(i)==="function"){p=function(u,r){var s=r==google.maps.ElevationStatus.OK?u:false;i.apply(n,[s,r])};if(g){m.push(this._latLng(g))}else{l=this._ival(h,"locations");if(l){for(j in l){m.push(this._latLng(l[j]))}}}if(m.length){this._getElevationService().getElevationForLocations({locations:m},p)}else{q=this._ival(h,"path");o=this._ival(h,"samples");if(q&&o){for(j in q){m.push(this._latLng(q[j]))}if(m.length){this._getElevationService().getElevationAlongPath({path:m,samples:o},p)}}}}this._end(f)},addmarker:function(g,f){this._resolveLatLng(g,f,"_addMarker")},_addMarker:function(f,l,j,p){var m,r,q,i="marker",h="infowindow",g=this._object(i,l,["to"]);if(!p){if(!j){this._manageEnd(f,false,g);return}this._subcall(f,l,j)}else{if(!j){return}}if(g.to){q=this._getStoredId(f,g.to);m=q&&(typeof(q.add)==="function");if(m){q.add(j,l);if(typeof(q.redraw)==="function"){q.redraw()}}if(!p){this._manageEnd(f,m,g)}}else{g.options.position=j;g.options.map=this._getMap(f);m=new google.maps.Marker(g.options);if(l[h]){r=this._object(h,l[h],["open"]);if((r.open===undefined)||r.open){r.apply=this._array(r.apply);r.apply.unshift({action:"open",args:[this._getMap(f),m]})}r.action="add"+h;this._planNext(f,r)}if(!p){this._store(f,i,m,g);this._manageEnd(f,m,g)}}return m},addmarkers:function(g,f){if(this._ival(f,"clusters")){this._addclusteredmarkers(g,f)}else{this._addmarkers(g,f)}},_addmarkers:function(p,f){var l,h,i,g,j=[],m="marker",j=this._ival(f,"markers");this._subcall(p,f);if(!j||(typeof(j)!=="object")){return this._end(p)}l=this._object(m,f,["to"]);if(l.to){to=this._getStoredId(p,l.to);mk=to&&(typeof(to.add)==="function");if(mk){for(h in j){i=this._latLng(j[h]);if(!i){continue}to.add(i,j[h])}if(typeof(to.redraw)==="function"){to.redraw()}}this._manageEnd(p,mk,l)}else{l.options.map=this._getMap(p);for(h in j){i=this._latLng(j[h]);if(!i){continue}l.options.position=i;g=new google.maps.Marker(l.options);j.push(g);l.data=j[h].data;this._store(p,m,g,l);this._manageEnd(p,g,l,true)}this._callback(p,j,f);this._end(p)}},getscale:function(l,f,g){var i=this._getMap(l),h=i.getZoom(),j=[77.86446203412031,45.42785688110077,16.22073057585689,6.879509682822463,3.5034960477802986,1.8034610362879133,0.9127181102723314,0.4598746767146186,0.23053567913908649,0.11545247438886701,0.05775371939320953,0.02881647975962874,0.014414070716531696,0.007207618499622224,0.003603886381819732,0.0018015948787526636,0.0009008246767800296,0.0004504160086085826,0.00022520761796505933,0.00011260535432642144,0.00005630113180858676];scale=j[h];if(!g){this._callback(l,scale,f);this._end(l)}return scale},_addclusteredmarkers:function(f,h){var l,i,g,o,p,n=this,m=this._ival(h,"radius"),j=this._ival(h,"markers"),q=this._ival(h,"clusters");if(!this._getMap(f).getBounds()){google.maps.event.addListenerOnce(this._getMap(f),"bounds_changed",function(){n._addclusteredmarkers(f,h)});return}if(typeof(m)==="number"){l=new b();for(i in j){g=this._latLng(j[i]);l.add(g,j[i])}p=this._initClusters(f,h,l,m,q)}this._callback(f,p,h);this._end(f)},_initClusters:function(m,g,h,f,j){var i=this,l=this._getMap(m);h.setRedraw(function(o){var n=h.clusters(l,f,o);if(n){clusters=n;h.freeDom();i._displayClusters(m,g,h,clusters,j)}});h.events(google.maps.event.addListener(l,"zoom_changed",function(){h.redraw(true)}),google.maps.event.addListener(l,"bounds_changed",function(){h.redraw()}));h.redraw();return this._store(m,"cluster",h,g)},_displayClusters:function(f,h,p,s,w){var r,j,o,g,l,n,v,q=this._ival(h,"cluster")||{},u=this._ival(h,"marker")||h;for(r in s){v=s[r];l=false;if(v.idx.length>1){g=0;for(j in w){if((j>g)&&(j<=v.idx.length)){g=j}}if(w[g]){q={options:{content:w[g].content.replace("CLUSTER_COUNT",v.idx.length),offset:{x:-this._ival(w[g],"width")/2,y:-this._ival(w[g],"height")/2}},data:{latLng:this._latLng(v)}};n=this._addOverlay(f,q,this._latLng(v),true);this._attachEvents(f,n,q);p.store(n);l=true}}if(!l){v.dom=[];for(o in v.idx){g=p.get(v.idx[o]);u.latLng=this._latLng(g);u.data=g[2].data;if(u.latLng){n=this._addMarker(f,u,u.latLng,true);this._attachEvents(f,n,u);p.store(n)}}}}},addinfowindow:function(g,f){this._resolveLatLng(g,f,"_addInfoWindow")},_addInfoWindow:function(m,f,h){var j,i,g=[],l="infowindow";this._subcall(m,f,h);j=this._object(l,f,["open","anchor"]);if(h){j.options.position=h}i=new google.maps.InfoWindow(j.options);if((j.open===undefined)||j.open){j.apply=this._array(j.apply);g.push(this._getMap(m));if(j.anchor){g.push(j.anchor)}j.apply.unshift({action:"open",args:g})}this._store(m,l,i,j);this._manageEnd(m,i,j)},addpolyline:function(g,f){this._addPoly(g,f,"Polyline","path")},addpolygon:function(g,f){this._addPoly(g,f,"Polygon","paths")},_addPoly:function(p,f,j,m){var g,h,l,n=this._object(j.toLowerCase(),f,[m]);if(n[m]){n.options[m]=[];h=0;for(g in n[m]){n.options[m][h++]=this._latLng(n[m][g])}}l=new google.maps[j](n.options);l.setMap(this._getMap(p));this._store(p,j.toLowerCase(),l,n);this._manageEnd(p,l,n)},addcircle:function(g,f){this._resolveLatLng(g,f,"_addCircle")},_addCircle:function(l,f,g){var j,i="circle",h=this._object(i,f);if(!g){g=this._latLng(h.options.center)}if(!g){return this._manageEnd(l,false,h)}this._subcall(l,f,g);h.options.center=g;h.options.map=this._getMap(l);j=new google.maps.Circle(h.options);this._store(l,i,j,h);this._manageEnd(l,j,h)},addrectangle:function(g,f){this._resolveLatLng(g,f,"_addRectangle")},_addRectangle:function(l,f,h){var g,j="rectangle",i=this._object(j,f);i.options.bounds=this._latLngBounds(i.options.bounds,true);if(!i.options.bounds){return this._manageEnd(l,false,i)}this._subcall(l,f,i.options.bounds.getCenter());i.options.map=this._getMap(l);g=new google.maps.Rectangle(i.options);this._store(l,j,g,i);this._manageEnd(l,g,i)},addoverlay:function(g,f){this._resolveLatLng(g,f,"_addOverlay")},_addOverlay:function(p,g,l,h){var i,n=this._object("overlay",g),j=d.extend({pane:"floatPane",content:"",offset:{x:0,y:0}},n.options);m.prototype=new google.maps.OverlayView();function m(o,f,q){this.opts_=o;this.$div_=null;this.latLng_=f;this.map_=q;this.setMap(q)}m.prototype.onAdd=function(){var o,f=d("<div></div>");f.css("border","none").css("borderWidth","0px").css("position","absolute");f.append(d(this.opts_.content));this.$div_=f;o=this.getPanes();if(o[this.opts_.pane]){d(o[this.opts_.pane]).append(this.$div_)}};m.prototype.draw=function(){if(!this.$div_){return}var o,f=this.getProjection();o=f.fromLatLngToDivPixel(this.latLng_);this.$div_.css("left",(o.x+this.opts_.offset.x)+"px").css("top",(o.y+this.opts_.offset.y)+"px")};m.prototype.onRemove=function(){this.$div_.remove();this.$div_=null};m.prototype.hide=function(){if(this.$div_){this.$div_.hide()}};m.prototype.show=function(){if(this.$div_){this.$div_.show()}};m.prototype.toggle=function(){if(this.$div_){if(this.$div_.is(":visible")){this.show()}else{this.hide()}}};m.prototype.toggleDOM=function(){if(!this.$div_){return}if(this.getMap()){this.setMap(null)}else{this.setMap(this.map_)}};i=new m(j,l,this._getMap(p));if(!h){this._store(p,"overlay",i,n);this._manageEnd(p,i,n)}return i},addfixpanel:function(p,g){var m="fixpanel",j=this._object(m,g),f=0,l=0,i,h;if(j.options.content){i=d(j.options.content);if(j.options.left!==undefined){f=j.options.left}else{if(j.options.right!==undefined){f=this._jObject(p).width()-i.width()-j.options.right}else{if(j.options.center){f=(this._jObject(p).width()-i.width())/2}}}if(j.options.top!==undefined){l=j.options.top}else{if(j.options.bottom!==undefined){l=this._jObject(p).height()-i.height()-j.options.bottom}else{if(j.options.middle){l=(this._jObject(p).height()-i.height())/2}}}h=d("<div></div>").css("position","absolute").css("top",l+"px").css("left",f+"px").css("z-index","1000").append(j.options.content);this._jObject(p).first().prepend(h);this._attachEvents(p,this._getMap(p),j);this._store(p,m,h,j);this._callback(p,h,j)}this._end(p)},adddirectionsrenderer:function(l,f,g){var j="directionrenderer",h,i=this._object(j,f,["panelId"]);this._clear(l,j);i.options.map=this._getMap(l);h=new google.maps.DirectionsRenderer(i.options);if(i.panelId){h.setPanel(document.getElementById(i.panelId))}this._store(l,j,h,i);this._manageEnd(l,h,i,g)},setdirectionspanel:function(i,f){var g,h=this._object("directionpanel",f,["id"]);if(h.id){g=this._getDirectionRenderer(i);g.setPanel(document.getElementById(h.id))}this._manageEnd(i,g,h)},setdirections:function(i,f){var g,h=this._object("directions",f);if(f){h.options.directions=f.directions?f.directions:(f.options&&f.options.directions?f.options.directions:null)}if(h.options.directions){g=this._getDirectionRenderer(i);if(!g){this.adddirectionsrenderer(i,h,true);g=this._getDirectionRenderer(i)}else{g.setDirections(h.options.directions)}}this._manageEnd(i,g,h)},setstreetview:function(i,f){var h=this._object("streetview",f,["id"]),g;if(h.options.position){h.options.position=this._latLng(h.options.position)}g=new google.maps.StreetViewPanorama(document.getElementById(h.id),h.options);this._getMap(i).setStreetView(g);this._manageEnd(i,g,h)},addkmllayer:function(i,g){var f,h=this._object("kmllayer",g,["url"]);h.options.map=this._getMap(i);f=new google.maps.KmlLayer(h.url,h.options);this._manageEnd(i,f,g)},addtrafficlayer:function(j,f){var i="trafficlayer",h=this._object(i,f),g=this._getStored(j,i);if(!g){g=new google.maps.TrafficLayer();g.setMap(this._getMap(j));this._store(j,i,g,h)}this._manageEnd(j,g,h)},addbicyclinglayer:function(j,f){var i="bicyclinglayer",g=this._object(i,f),h=this._getStored(j,i);if(!h){h=new google.maps.BicyclingLayer();h.setMap(this._getMap(j));this._store(j,i,h,g)}this._manageEnd(j,h,g)},addgroundoverlay:function(j,f){var i="groundoverlay",h=this._object(i,f,["bounds","url"]),g;h.bounds=this._latLngBounds(h.bounds);if(h.bounds&&h.url){g=new google.maps.GroundOverlay(h.url,h.bounds);g.setMap(this._getMap(j));this._store(j,i,g,h)}this._manageEnd(j,g,h)},geolatlng:function(j,g){var i,f=this._ival(g,"callback"),h=this._jObject(j);if(typeof(f)==="function"){if(navigator.geolocation){browserSupportFlag=true;navigator.geolocation.getCurrentPosition(function(l){var m=new google.maps.LatLng(l.coords.latitude,l.coords.longitude);f.apply(h,[m])},function(){var l=false;f.apply(h,[l])})}else{if(google.gears){browserSupportFlag=true;i=google.gears.factory.create("beta.geolocation");i.getCurrentPosition(function(l){var m=new google.maps.LatLng(l.latitude,l.longitude);f.apply(h,[m])},function(){out=false;f.apply(h,[out])})}else{out=false;f.apply(h,[out])}}}this._end(j)},addstyledmap:function(j,f,g){var i=this._object("styledmap",f,["id","style"]),h;if(i.style&&i.id&&!this._styleExist(j,i.id)){h=new google.maps.StyledMapType(i.style,i.options);this._addStyle(j,i.id,h);if(this._getMap(j)){this._getMap(j).mapTypes.set(i.id,h)}}this._manageEnd(j,h,i,g)},setstyledmap:function(i,f){var h=this._object("styledmap",f,["id","style"]),g;if(h.id){this.addstyledmap(i,h,true);g=this._getStyle(i,h.id);if(g){this._getMap(i).setMapTypeId(h.id);this._callback(i,g,f)}}this._manageEnd(i,g,h)},clear:function(l,g){var i=this._array(this._ival(g,"list")),h=this._ival(g,"last",false),j=this._ival(g,"first",false),f=this._ival(g,"tag");if(f!==undefined){f=this._array(f)}this._clear(l,i,h,j,f);this._end(l)},get:function(n,g){var i=this._ival(g,"name")||"map",m=this._ival(g,"first"),j=this._ival(g,"all"),f=this._ival(g,"tag"),l,h;i=i.toLowerCase();if(f!==undefined){f=this._array(f)}if(i=="map"){return this._getMap(n)}if(m){return this._getStored(n,i,false,f)}else{if(j){l=new Array();if(this._ids[n].stored[i]){for(h in this._ids[n].stored[i]){if(f!==undefined){if((this._ids[n].stored[i][h].tag===undefined)||(f.indexOf(this._ids[n].stored[i][h].tag)!=-1)){continue}}if(this._ids[n].stored[i][h]){l.push(this._ids[n].stored[i][h].obj)}}}return l}else{return this._getStored(n,i,true,f)}}},earthradius:function(f){f=f?f:this._default.unit;return(typeof(f)==="string"&&(f.toLowerCase()==="km"))?6371:3959},distance:function(i,j){var s=this._ival(j,"unit"),r=this._latLng(this._ival(j,"a")),q=this._latLng(this._ival(j,"b")),o,n,m,l,p;if(r&&q){o=(Math.PI*r.lat()/180);n=(Math.PI*r.lng()/180);m=(Math.PI*q.lat()/180);l=(Math.PI*q.lng()/180);p=this.earthradius(s)*Math.acos(Math.min(Math.cos(o)*Math.cos(m)*Math.cos(n)*Math.cos(l)+Math.cos(o)*Math.sin(n)*Math.cos(m)*Math.sin(l)+Math.sin(o)*Math.sin(m),1))}return p},getmaxzoom:function(g,f){this._resolveLatLng(g,f,"_getMaxZoom")},_getMaxZoom:function(l,g,h){var j,i=this._jObject(l),f=this._ival(g,"callback");if(f&&typeof(f)==="function"){j=function(m){var n=m.status==google.maps.MaxZoomStatus.OK?m.zoom:false;f.apply(i,[n,m.status])};this._getMaxZoomService().getMaxZoomAtLatLng(h,j)}this._end(l)},setdefault:function(i,f,g){for(var h in f){if(typeof(this._default[h])==="object"){this._default[h]=jQuery.extend({},this._default[h],f[h])}else{this._default[h]=f[h]}}if(!g){this._end(i)}}};var a=0;d.fn.gmap3=function(){var g,j,f=[],h=[],l=true;for(j=0;j<arguments.length;j++){g=arguments[j]||{};if(typeof(g)==="string"){g={action:g}}if(g.action&&(g.action.substr(0,1)==":")){g.action=g.action.substr(1)}f.push(g)}if(!f.length){f.push({})}d.each(this,function(){var i;$this=d(this),i=$this.data("id");l=false;if(!i){i=++a;$this.data("id",i)}if(f.length==1){if(e._isDirect(i,f[0])){h.push(e._direct(i,f[0]))}else{res=e._plan($this,i,f);if(res){for(j in res){h.push(res[j])}}}}else{e._plan($this,i,f)}});if(h.length){if(h.length===1){return h[0]}else{return h}}if(l&&(arguments.length==2)&&(typeof(arguments[0])==="string")&&(arguments[0].toLowerCase()==="setdefault")){e.setdefault(0,arguments[1],true)}return this}}(jQuery));
                
