function menu_verti() {
/*
* collapsor (1.1) // 2009.02.27 // <http://plugins.jquery.com/project/collapsor>
* 
* REQUIRES jQuery 1.2.3+ <http://jquery.com/>
* 
* Copyright (c) 2008 TrafficBroker <http://www.trafficbroker.co.uk>
* Licensed under GPL and MIT licenses
* 
* collapsor opens and closes sublevel elements, like a collapsable menu
*
* We need to select the clickable elements that trigger the opening action of the sublevels: $('#menu ul li a').collapsor();
* The sublevel element must be in the same level than the triggers
*
* Sample Configuration:
* $('ul a').collapsor();
* 
* Config Options:
* openClass: Class added to the element when is open // Default: 'open'
* sublevelElement: Element that must open or close // Default: 'ul'
* closeOthers: Close other elements when opening // Default: false
* speed: Speed for the opening animation // Default: 500
* easing: Easing for the opening animation. Other than 'swing' or 'linear' must be provided by plugin // Default: 'swing'
* 
* We can override the defaults with:
* $.fn.collapsor.defaults.speed = 1000;
* 
* @param  settings  An object with configuration options
* @author    Jesus Carrera <jesus.carrera@trafficbroker.co.uk>
*/
(function($) {
$.fn.collapsor = function(settings) {
	// override default settings
	settings = $.extend({}, $.fn.collapsor.defaults, settings);
	var triggers = this;
	// for each element
	return this.each(function() {
	  if ($(this).find('+ ' + settings.sublevelElement).length ) {
      $(this).addClass(settings.activeClass);
    }
		// occult the collapsing elements
		$(this).find('+ ' + settings.sublevelElement).hide();
		//show the opened
		if($(this).hasClass(settings.openClass)){
			$(this).find('+ ' + settings.sublevelElement).show();
		}
		// event handling
	  $(this).click(function() {
			// if the new active have sublevels
			if ($(this).next().is(settings.sublevelElement)){
				// blur and add the open class to the clicked
				$(this).blur().toggleClass(settings.openClass);
				// close others
				if (settings.closeOthers == true) {				  
				  $(this).parent().parent().children().find('.'+settings.openClass).not(this).removeClass(settings.openClass).next().animate({height:'toggle', opacity:'toggle'}, settings.speed, settings.easing);
				}
				// toggle the clicked
				$(this).next().animate({height:'toggle', opacity:'toggle'}, settings.speed, settings.easing);
				return false;
			}
	   });
	});
};
// default settings
$.fn.collapsor.defaults = {
	openClass:'open',
	activeClass: 'afficherSousMenu',
	sublevelElement: 'ul',
	closeOthers: true,
	speed: 500,
	easing: 'swing'
};
})(jQuery);

$("a", "ul#navigation").collapsor();  
$("a","ul#navigationIntranet").collapsor();  
}

function changepass()
	{
	$('#passuser').show();
	$('#passuserfalse').remove();
	$('#passuser').focus();
	}
function changepassConnxion()
	{
	$('#passuser2').show();
	$('#passuserfalse2').remove();
	$('#passuser2').focus();
	}

$(document).ready(function(){
	if($("ul#navigation").length!=0)
		{
		menu_verti("a","ul#navigation");
		}
	if($("ul#navigationIntranet").length!=0)
		{
		menu_verti("a","ul#navigationIntranet");
		}
	if($("a[rel='imgRealisation']").length!=0)
		{
		$("a[rel='imgRealisation']").colorbox();
		}
	if($("a.grande_image").length!=0)
		{
		$("a.grande_image").colorbox();
		}
	
	if($(".centre .legende").length!=0)
		{
		$(".centre .legende").each(function(){
			var altImage = $(this).attr("alt");
			var srcImage = $(this).attr("src");
			var classImage = $(this).attr("class");
			var lageurImage = $(this).width();
			$(this).after("<span style=\"width:"+lageurImage+"px;display: block;\" class=\""+classImage+"\"><img src=\""+srcImage+"\" alt=\""+altImage+"\" /><br /><span class=\"texteLegende\">"+ altImage +"</span></span>");
			$(this).hide();
			});
		}
	if($(".popup").length!=0)
		{
		$(".popup").colorbox({width:"850px", height:"800px", iframe:true});
		}
	
	});
	
function selectDepartement()
	{
	departement = $("#departement").attr("value");
	if(departement!="")
		{
		$("#listVille").show();
		$.post("modules/ani_modules/carto/select_ville.php",{idDepartement:departement,provenance:'ajax'},function success(data)
			{
			$("#listVille").html(data);
			});
		}
	else
		{
		$("#listVille").hide();
		}
	}

function cotroleForm()
	{
	departement = $("#departement").attr("value");
	ville = $("#ville").attr("value");
	if(departement=="")
		{
		alert("Veuillez sélectionner un département !");
		return false;
		}
	if(ville=="")
		{
		alert("Veuillez sélectionner une ville !");
		return false;
		}
	return true;
	}
