 		/*--------------------------------------- 
			tagsphere 					*/
		
		var theInt = null;
		var $crosslink, $navthumb;
		var curclicked = 0;
		
		theInterval = function(cur){
			clearInterval(theInt);
			
			if( typeof cur != 'undefined' )
				curclicked = cur;
			
			$crosslink.removeClass("active-thumb");
			$navthumb.eq(curclicked).parent().addClass("active-thumb");
				$(".stripNav ul li a").eq(curclicked).trigger('click');
			
			theInt = setInterval(function(){
				$crosslink.removeClass("active-thumb");
				$navthumb.eq(curclicked).parent().addClass("active-thumb");
				$(".stripNav ul li a").eq(curclicked).trigger('click');
				curclicked++;
				if( 6 == curclicked )
					curclicked = 0;
				
			}, 4000);
		};
		
		/*--------------------------------------- 
			Diaporama Index 					*/
		
		$(function(){
			
			$("#main-photo-slider").codaSlider();
			
			$navthumb = $(".nav-thumb");
			$crosslink = $(".cross-link");
			
			$navthumb
			.click(function() {
				var $this = $(this);
				theInterval($this.parent().attr('href').slice(1) - 1);
				return false;
			});
			
			theInterval();
		});
	

	
	/*--------------------------------------- 
			test du fomulaire 					*/

function testform()
{
if (document.getElementById('societe2').value=="")
			{
				alert("Indiquez votre Société.");
				return false;
			}
else if (document.getElementById('societe4').value=="")
			{
				alert("Indiquez votre nom.");
				return false;
			}
else if (document.getElementById('depart').value=="")
			{
				alert("Indiquez votre département.");
				return false;
			}
else if ((document.getElementById('mail').value.indexOf('@') < 0) || (document.getElementById('mail').value.indexOf('.') < 0))
			{
				alert("Indiquez une adresse E-mail valide.");
				return false;
			}
else if (document.getElementById('tel').value=="")
			{
				alert("Indiquez votre numéro de téléphone.");
				return false;
			}
else
		{
			return true;
		}
}

/*--------------------------------------- 
			News slide 					*/

 $(function() {
	$(".newsticker-jcarousellite").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 3,
		auto:500,
		speed:3000
	});
});

/*--------------------------------------- 
			menu droppy 					*/

$(document).ready( function () {
    		$('.nav').droppy();
});

/*--------------------------------------- 
			lightbox 					*/

jQuery(document).ready(function() {
        $('.galerie a').lightBox();
    });
	
	/*--------------------------------------- 
			toggle Menu Gauche 					*/
	
$(document).ready(function(){
	
	$(".toggle_container").hide();
 
	$("h2.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
	});
	$("p.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
	});
 
});

/*--------------------------------------- 
			tagsphere 					*/

$(document).ready(function(){
		
		$('#tagsphere').tagSphere({
			height: 200,
			width: 350,
			slower: 0.65,
			radius: 75,
			timer: 50
		});
		$("#menus ul ul").hide();
    	$("#menus ul ul ul").show(); //sous-sous-menus
 
    	$("#menus div ul li a").click(function(){
			$(this).parent().parent().children("li").find("ul.montre").slideToggle("").removeClass("montre").addClass("matched");
			$(this).parent().children("ul").not(".matched").addClass("montre").slideToggle("slow");
			$(this).parent().parent().children("li").find("ul.matched").removeClass("matched");
			if ($(this).attr("href") == "#") {
				return false;
			}
    	});
		
		
 
	});
	
	
	
	function postComm(article,comm,pseudo, nb){
 
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
{
	if(xmlhttp.readyState==4)
  {
	  document.getElementById(nb).innerHTML = xmlhttp.responseText;
 
  }
}
xmlhttp.open("GET","controller.php?pseudo="+document.getElementById(pseudo).value+"&mess="+document.getElementById(comm).value+"&art="+document.getElementById(article).value,true);
xmlhttp.send(null);
}

 $(document).ready(function(){
    $("#commentForm").validate();
  });

  /*--------------------------------------- 
			Slide Menu 					*/
  
  
	$(document).ready(function(){

		$(".s1").CarouSlide({

			animType:"slide-vertical",

			autoAnim:false,

			slideTime:5000,

			animTime:800,

			alwaysNext:false

		});
		});
		

	
