/*
**  Utilisation de la librairie jQuery
**  http://docs.jquery.com/Downloading_jQuery#Download_jQuery
*/

jQuery.noConflict();
jQuery(function($) {
	$("#nav > li").hover(function () {
		$(this)
		  .find('a').toggleClass('active').end()
		  .find('.item').toggle();		
	});

	$('#rechercheExpo').change(function () {
    var elementSelect = $(this);
	  var elementSelectedValue = $(this).val();
	  
    $.ajax({
      type: "get",
      url: '/frontend_dev.php/recherche/retourneExposant?theme=' + elementSelectedValue,
      cache: false,
      success: function(html) {
        $('#rechercheRaison').html(html);
      }
    });
	});
	
	$('#rechercheExpo1').change(function () {
    var elementSelect = $(this);
	  var elementSelectedValue = $(this).val();
	  
    $.ajax({
      type: "get",
      url: '/frontend_dev.php/recherche/retourneExposant?theme=' + elementSelectedValue,
      cache: false,
      success: function(html) {
        $('#rechercheRaison1').html(html);
      }
    });
	});
    
    $('#webSite').hide();
    
    

		function initialize() {
			if (GBrowserIsCompatible()) {
				var map = new GMap2(document.getElementById("map_canvas"));
				//var pts = new GLatLng(43.1740234371524, 5.6075119972229);
				var pts = new GLatLng(43.177897, 5.612194);
				
				map.setCenter(pts, 17);
				map.addOverlay(new GMarker(pts));
				map.setUIToDefault();
			}
		}
		
		if($('#map_canvas').length) {
			initialize();
		}


})
