$(document).ready(function()
{

	$(".clients").find("li").each(function(index)
	
		{	$(this).click(function()
				{
				//alert('plop');
				$("#logoclient").fadeOut("normal",function(){$(this).html('<img src="img/clients/clients.png">')}).fadeIn();	
				//$("#logoclient").slideUp("normal",function(){$(this).html('<img src="img/clients/'+(index+1)+'.jpg">')}).slideDown();		
					}
				)
		})

}
)


$(document).ready(function()
{

		//$(".partner").hide();	
		$('.partner').hide();

}
)


$(document).ready(function()
{

    $('#tab0').hide();
	$('#tab1').hide();
	$('#tab2').hide();
	$("#productdetails").find("li").each(function(index)
	
		{	$(this).click(function()
				{
				//alert('plop');
				$('#tab0').fadeOut();
				$('#tab1').fadeOut();
				$('#tab2').fadeOut();
				$("#tab"+index).fadeIn();	
				//$("#logoclient").slideUp("normal",function(){$(this).html('<img src="img/clients/'+(index+1)+'.jpg">')}).slideDown();		
					}
				)
		})

$('#services_list p').hide();
	$('.paragraph').click(function(){
	$(this).next().slideToggle();
	return false;
	})
})

  $(function(){
        $("div.foo").carousel();
    });

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox() 
})

			

			function validate()
			{
				
				var number = document.getElementById("hostnumber").value;
				
				//test si le champs firstname est vide
				if(document.getElementById("firstname").value == "")
				{document.getElementById("firstname").style.background = "red";}
				//test si le champs lastname est vide
				if(document.getElementById("lastname").value == "")
				{document.getElementById("lastname").style.background = "red";}
				
				//test des adresses mails
				if (VerifMail()==true)
				{
					if ((document.getElementById("email").value) != (document.getElementById("email2").value))
					{document.getElementById("email2").style.background = "red";}
				}
				else{document.getElementById("email").style.background = "red";}
				
				//test le host number
				if ((number.length <9) || (isNaN(document.getElementById("hostnumber").value)))
				{document.getElementById("hostnumber").style.background = "red";}
					
			}
		
			
		$(function(){
				$("#send").click(function(){
					valid = true;
					
					//FIRSTNAME
					if($("#firstname").val() == ""){
						$("#firstname").next("#errormsg1").fadeIn().text("Firstname required");
						valid = false;
					}
					else{
						$("#firstname").next("#errormsg1").fadeOut();
					}

					//LASTNAME
					if($("#lastname").val() == ""){
					$("#lastname").next("#errormsg2").fadeIn().text("Lastname required");
					valid = false;
					}
					else{
					$("#lastname").next("#errormsg2").fadeOut();
					}
					
					//EMAIL
					if($("#email").val() == ""){
						$("#email").next("#errormsg3").fadeIn().text("Email required");
						valid = false;
					}
					else if(!$("#email").val().toLowerCase().match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$','i')){
						$("#email").next("#errormsg3").fadeIn().text("Invalid email");
						valid = false;
					} 
					else{
						$("#email").next("#errormsg3").fadeOut();
					}
					

					//EMAIL2
					if($("#email2").val() == ""){
						$("#email2").next("#errormsg4").fadeIn().text("Re-enter your email.");
						valid = false;
					}
					else if($("#email").val() != $("#email2").val()){
						$("#email2").next("#errormsg4").fadeIn().text("Enter the same email");
						valid = false;
					}
					else{
						$("#email2").next("#errormsg4").fadeOut();
					}
						
					return valid;
				});
				
				
			
			});



