/**
 * @author batdam
 */
$(document).ready(
	function () {
	 
	 $('.news_foto_wrapper a').fancybox();
	 
	 if($('#marchio_topslider').length>0) {
  	 $('#marchio_topslider').mopSlider(
  		 {
  			'w':890,
  			'h':212,
  			'sldW':890,
  			'btnW':200,
  			'itemMgn':0,
  			'indi':"",
  			'shuffle':'n',
  			'auto':'nn',
  			'type': 'paper',
  			'items': 5
  			}
  		);
	 }

	 if($('#marchio_bottomslider').length>0) {
  	 $('#marchio_bottomslider').mopSlider(
  		 {
  			'w':606,
  			'h':180,
  			'sldW':606,
  			'btnW':100,
  			'itemMgn':0,
  			'indi':"",
  			'shuffle':'n',
  			'auto':'nn',
  			'type': 'paper',
  			'items': 5
  			}
  		);
	 }
	 
	 
	 if($('.itemfiltro_sel').length>0) {
		 $('.itemfiltro_sel').append('<div class="segnalino"></div>');
	 }
	 
	 
	 $('#riv_regione, #riv_marca').click(
		 function() {
			 $( "#" + $(this).attr("id") + "_lista" ).toggle();
			 return false;
		 }
	 );

	 $('.riv_lista a').click(
			 function() {
				 var whoid = $(this).closest('.riv_lista').attr("id");
				 switch(whoid) {
				 	case "riv_regione_lista":
				 		var regione = $(this).html();
				 		$('#subsubmode').val(regione.toLowerCase());
				 		$('#item').val($(this).attr("href"));
				 		$(this).closest('.fancy_form').find('.rivenditore').html(regione);
				 		break;
				 	case "riv_marca_lista":
				 		$('#submode').val($(this).attr("href"));
				 		$(this).closest('.fancy_form').find('.rivenditore').html($(this).html());
				 		break;
				 }
				 $( "#" + whoid ).hide();
				 return false;
			 }
		 );

	}
);


function initialize() {
	var center = new google.maps.LatLng(41.668088, 12.510608);
  var latlng = new google.maps.LatLng(41.668088, 12.510608);
  var myOptions = {
    zoom: 13,
    center: center,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("map"),
      myOptions);

	var image = 'img/gmaps.png';

	var marker = new google.maps.Marker({
		position: latlng,
		title:"Coming Import Export s.r.l.",
		icon:image
	});
	
	// To add the marker to the map, call setMap();
	marker.setMap(map);  						



	var center2 = new google.maps.LatLng(45.44062, 10.78456);
  var latlng2 = new google.maps.LatLng(45.44062, 10.78456);
  var myOptions2 = {
    zoom: 13,
    center: center2,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map2 = new google.maps.Map(document.getElementById("map2"),
      myOptions2);

	var marker2 = new google.maps.Marker({
		position: latlng2,
		title:"Coming Import Export s.r.l.",
		icon:image
	});
	
	// To add the marker to the map, call setMap();
	marker2.setMap(map2);  						

}

Cufon.replace('#menu li a, .cufon, .lancio_titolo, #arearis a', {
	hover: true	
});
