hs.graphicsDir = 'scripts/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.showCredits = false;
//hs.dimmingOpacity = 0.75;

// Add the controlbar
hs.addSlideshow({
	slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: 0.75,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});


//jQuery Color Animations
//Copyright 2007 John Resig
//Released under the MIT and GPL licenses.
(function(d){d.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,b){d.fx.step[b]=function(a){if(a.state==0){a.start=getColor(a.elem,b);a.end=getRGB(a.end)}a.elem.style[b]="rgb("+[Math.max(Math.min(parseInt((a.pos*(a.end[0]-a.start[0]))+a.start[0]),255),0),Math.max(Math.min(parseInt((a.pos*(a.end[1]-a.start[1]))+a.start[1]),255),0),Math.max(Math.min(parseInt((a.pos*(a.end[2]-a.start[2]))+a.start[2]),255),0)].join(",")+")"}});function getRGB(a){var b;if(a&&a.constructor==Array&&a.length==3)return a;if(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])];if(b=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a))return[parseFloat(b[1])*2.55,parseFloat(b[2])*2.55,parseFloat(b[3])*2.55];if(b=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a))return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)];if(b=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a))return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)];return e[d.trim(a).toLowerCase()]}function getColor(a,b){var c;do{c=d.curCSS(a,b);if(c!=''&&c!='transparent'||d.nodeName(a,"body"))break;b="backgroundColor"}while(a=a.parentNode);return getRGB(c)};var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
$(document).ready(function() {

		// Expand Panel
		$("#open").click(function(){
			$("div#panel").slideDown("slow"); // panel = login
		});	
		
		// Collapse Panel
		$("#close").click(function(){			
			$("div#panel").slideUp("slow");				
		});	
		
		// Switch buttons from "Login" / "coord" to "Close Panel" on click
		$("#toggle a").click(function () {
			$("#toggle a").toggle();
		});		


		
});

$(function(){
// liens haut
	$(".lien_haut").hover(function(){
		$(this).stop().animate({
			color:"#cc3333"
		},300);
	}, function(){
		$(this).stop().animate({
			color:"#666"
		},300);
	});

// liens menu
	$(".lien_menu").hover(function(){
		$(this).stop().animate({
			backgroundColor:"#959d9c"
		},300);
	}, function(){
		$(this).stop().animate({
			backgroundColor:"#acb2b1"
		},300);
	});
	
});





	jQuery().ready(function(){

		if (document.getElementById("mycarousel")!=null)
		{
			jQuery('#mycarousel').jcarousel({
				auto: 2,
				wrap: 'last',
				initCallback: mycarousel_initCallback,
				scroll: 1
			});	
		}

					jQuery("#criteres").addClass("active");
					jQuery("#gg_map").removeClass("active");
					jQuery("#estimation").removeClass("active");
					
					jQuery("div.criteres").fadeIn();
					jQuery("div.gg_map").fadeOut();
					jQuery("div.estimation").fadeOut();
					
					
					jQuery("div.criteres").css("left", "0");
					jQuery("div.gg_map").css("left", "10000");
					jQuery("div.estimation").css("left", "10000");	

		jQuery(".menu > li").click(function(e){
			switch(e.target.id){
				case "criteres":
					//change status & style menu
					jQuery("#criteres").addClass("active");
					jQuery("#gg_map").removeClass("active");
					jQuery("#estimation").removeClass("active");
					
					jQuery("div.criteres").fadeIn();
					jQuery("div.gg_map").fadeOut();
					jQuery("div.estimation").fadeOut();
					
					
					jQuery("div.criteres").css("left", "0");
					jQuery("div.gg_map").css("left", "10000");
					jQuery("div.estimation").css("left", "10000");
					document.quick_find.map_polygone.value = save_polygone_site();
										

				break;
				case "gg_map":

					jQuery("#gg_map").addClass("active");
					jQuery("#criteres").removeClass("active");
					jQuery("#estimation").removeClass("active");
					jQuery("div.gg_map").fadeIn();
					jQuery("div.criteres").fadeOut();
					jQuery("div.estimation").fadeOut();

					jQuery("div.criteres").css("left", "10000");
					jQuery("div.gg_map").css("left", "0");
					jQuery("div.estimation").css("left", "10000");					
					// carto
					initialize_v3();
					
				break;
				case "estimation":
					jQuery("#criteres").removeClass("active");
					jQuery("#gg_map").removeClass("active");
					jQuery("#estimation").addClass("active");
					jQuery("div.estimation").fadeIn();
					jQuery("div.gg_map").fadeOut();
					jQuery("div.criteres").fadeOut();
					
					jQuery("div.criteres").css("left", "10000");
					jQuery("div.gg_map").css("left", "10000");
					jQuery("div.estimation").css("left", "0");
					
				break;
			}
			return false;
		});
	
	});



	function mycarousel_initCallback(carousel)
	{
		// Disable autoscrolling if the user clicks the prev or next button.
		carousel.buttonNext.bind('click', function() {
			carousel.startAuto(0);
		});

		carousel.buttonPrev.bind('click', function() {
			carousel.startAuto(0);
		});

		// Pause autoscrolling if the user moves with the cursor over the clip.
		carousel.clip.hover(function() {
			carousel.stopAuto();
		}, function() {
			carousel.startAuto();
		});
	};


