//var $j = jQuery.noConflict();


jQuery(document).ready(function(){
	
/*	jQuery(function(){ 
    jQuery("#onglets .onglet").not(":first").hide(); 
	jQuery("#onglets li:first").addClass("actif");
    jQuery("#onglets .onglet:first").addClass("actif");
    jQuery("#onglets ul a").click(function(){ 
       jQuery("#onglets ul a").parent("li").removeClass("actif"); 
        jQuery("#onglets .onglet").hide(); 
        jQuery(this.hash).show(); 
        jQuery(this).blur().parent("li").addClass("actif"); 
        return false; 
    }); 
}); 
	
jQuery(function(){ 
    if((window.location.hash) && (jQuery("#onglets").children(window.location.hash).length)) 
    { 
        jQuery("#onglets .onglet").hide(); 
        jQuery(window.location.hash).show(); 
    	jQuery("#onglets ul a").parent("li").removeClass("actif"); 
		jQuery(window.location.hash).blur().parent("li").addClass("actif"); 
		alert(window.location.hash);
    } 
    else 
    { 
        jQuery("#onglets .onglet").not(":first").hide(); 
    } 
	 
}); */


	jQuery(function(){ 
    jQuery("#onglets .onglet").not(":first").hide(); 
	jQuery("#onglets li:first").addClass("actif");
	jQuery("#listehaut li:first").addClass("actif");
    jQuery("#onglets .onglet:first").addClass("actif");
    jQuery("#onglets ul a").click(function(){ 
       jQuery("#onglets ul a").parent("li").removeClass("actif"); 
	   jQuery("#listehaut ul a").parent("li").removeClass("actif"); 
        jQuery("#onglets .onglet").hide(); 
        jQuery(this.hash).show(); 
	    jQuery("a[href="+this.hash+"h]").click().parent("li").addClass("actif"); 
        jQuery(this).blur().parent("li").addClass("actif"); 
        return true; 
    });
	
	jQuery("#listehaut ul a").click(function(){ 
    	jQuery("#onglets ul a").parent("li").removeClass("actif"); 
		jQuery("#listehaut ul a").parent("li").removeClass("actif"); 
      	jQuery("#onglets .onglet").hide(); 
		var idonglet = this.hash.substr(0,9);
		//alert(idonglet ); 
        jQuery(idonglet).show(); 
	    jQuery("a[href="+idonglet+"]").blur().parent("li").addClass("actif"); 
        jQuery(this).blur().parent("li").addClass("actif"); 
        return true; 
    });
}); 

jQuery(function(){ 
    if((window.location.hash) && (jQuery("#onglets").children(window.location.hash).length)) 
    { 
        jQuery("#onglets .onglet").hide(); 
        jQuery(window.location.hash).show(); 
    	jQuery("#onglets ul a").parent("li").removeClass("actif"); 
		 jQuery("a[href="+window.location.hash+"]").click().parent("li").addClass("actif"); 
    } 
    else 
    { 
        jQuery("#onglets .onglet").not(":first").hide(); 
    } 
	 
}); 

jQuery('#mainOn').show();
jQuery('#mainOff').hide();

jQuery('#addOff').show();
jQuery('#addOn').hide();



jQuery('#mainOff').click( function ()  {
		jQuery('#mainOff').hide();
		jQuery("#mainOn").show();
		jQuery('#addOn').hide();
		jQuery("#addOff").show();
		unloadCoucheCommune ();
	});
	

jQuery('#addOff').click( function ()  {
		jQuery('#addOff').hide();
		jQuery("#addOn").show();
		jQuery('#mainOn').hide();
		jQuery("#mainOff").show();
		loadCoucheCommune();
		if (jQuery.browser.msie) {  
       	alert('Cliquez sur la carte pour saisir une observation');
   		}  else {
		jQuery.prompt('Cliquez sur la carte pour saisir une observation');}
	});




});


