// JavaScript Document
var map;
function initialize()
 {
 var latlng = new google.maps.LatLng(47.754329,7.336807);
var stylez = [
    {
      featureType: "all",
      elementType: "all",
      stylers: [
        { saturation: -100 } // <-- THIS
      ]
    }
];



var myOptions = {
 zoom:12,
                center : new google.maps.LatLng(47.754329,7.336807),
                mapTypeId: google.maps.MapTypeId.ROADMAP,
				disableDefaultUI: true,
             	draggable: true,
                streetViewControl : false,
                scrollwheel: false,
				 disableDefaultUI: true,
				  mapTypeControlOptions: {
         mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'tehgrayz']
    }
 
};

map = new google.maps.Map(document.getElementById("map"), myOptions);
var icones = new google.maps.Marker({
		map: map,
		position: latlng,
		visible: false
	});
var image = 'http://www.vitrinesdemulhouse.com/wp-content/themes/VDM/images/map_bulle.png';
var mapType = new google.maps.StyledMapType(stylez, { name:"Grayscale" });  
map.mapTypes.set('tehgrayz', mapType);
map.setMapTypeId('tehgrayz');
  var myLatLng = new google.maps.LatLng(47.754329,7.336807);
  var beachMarker = new google.maps.Marker({
      position: myLatLng,
      map: map,
      icon: image });
}

$(document).ready(function(){
initialize();
 $(".topMenuAction").click( function() {
        if ($("#openCloseIdentifier").is(":hidden")) {
            $("#slider").animate({
                marginTop: "-530px"
                }, 500 );
            $("#topMenuImage").html('<img src="http://www.vitrinesdemulhouse.com/wp-content/themes/VDM/images/contactOpen.png"/>');
            $("#openCloseIdentifier").show();
        } else {
            $("#slider").animate({
                marginTop: "0px"
                }, 500 );
            $("#topMenuImage").html('<img src="http://www.vitrinesdemulhouse.com/wp-content/themes/VDM/images/contactClose.png"/>');
            $("#openCloseIdentifier").hide();
        }
    });
	$('#content_works ul li').hover(function() {
$("img", this).fadeTo("fast", 0.5 ); 
$("div.info", this).css({ opacity:0, visibility:'visible'}).fadeTo("fast", 1);
} , 
function() {
$("img", this).stop().fadeTo("fast", 1).show();
$("div.info", this).stop().fadeTo("fast", 0).show();
});
$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
		
		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;
		
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
$("#content_works img, #works_detail_content img, div.news_img img").createLoader();
});
