//MENU PRINCIPÄL

accueil_normal_image = new Image();
accueil_normal_image.src = "images/nav/accueil_n.jpg";
accueil_mouseover_image = new Image();
accueil_mouseover_image.src = "images/nav/accueil_o.jpg"; 
 
a_propos_normal_image = new Image();
a_propos_normal_image.src = "images/nav/a_propos_n.jpg";
a_propos_mouseover_image = new Image();
a_propos_mouseover_image.src = "images/nav/a_propos_o.jpg"; 

web_normal_image = new Image();
web_normal_image.src = "images/nav/web_n.jpg";
web_mouseover_image = new Image();
web_mouseover_image.src = "images/nav/web_o.jpg"; 
 
portfolio_normal_image = new Image();
portfolio_normal_image.src = "images/nav/portfolio_n.jpg";
portfolio_mouseover_image = new Image();
portfolio_mouseover_image.src = "images/nav/portfolio_o.jpg"; 
 
codems_lab_normal_image = new Image();
codems_lab_normal_image.src = "images/nav/codems_lab_n.jpg";
codems_lab_mouseover_image = new Image();
codems_lab_mouseover_image.src = "images/nav/codems_lab_o.jpg"; 

blogue_normal_image = new Image();
blogue_normal_image.src = "images/nav/blogue_n.jpg";
blogue_mouseover_image = new Image();
blogue_mouseover_image.src = "images/nav/blogue_o.jpg"; 

carriere_normal_image = new Image();
carriere_normal_image.src = "images/nav/carriere_n.jpg";
carriere_mouseover_image = new Image();
carriere_mouseover_image.src = "images/nav/carriere_o.jpg"; 

contact_normal_image = new Image();
contact_normal_image.src = "images/nav/contact_n.jpg";
contact_mouseover_image = new Image();
contact_mouseover_image.src = "images/nav/contact_o.jpg"; 

// MEDIAS SOCIAUX 

facebook_normal_image = new Image();
facebook_normal_image.src = "images/mediassociaux/facebook_n.jpg";
facebook_mouseover_image = new Image();
facebook_mouseover_image.src = "images/mediassociaux/facebook_o.jpg"; 

wordpress_normal_image = new Image();
wordpress_normal_image.src = "images/mediassociaux/wordpress_n.jpg";
wordpress_mouseover_image = new Image();
wordpress_mouseover_image.src = "images/mediassociaux/wordpress_o.jpg"; 

twitter_normal_image = new Image();
twitter_normal_image.src = "images/mediassociaux/twitter_n.jpg";
twitter_mouseover_image = new Image();
twitter_mouseover_image.src = "images/mediassociaux/twitter_o.jpg"; 

linkedin_normal_image = new Image();
linkedin_normal_image.src = "images/mediassociaux/linkedin_n.jpg";
linkedin_mouseover_image = new Image();
linkedin_mouseover_image.src = "images/mediassociaux/linkedin_o.jpg"; 

youtube_normal_image = new Image();
youtube_normal_image.src = "images/mediassociaux/youtube_n.jpg";
youtube_mouseover_image = new Image();
youtube_mouseover_image.src = "images/mediassociaux/youtube_o.jpg"

rss_normal_image = new Image();
rss_normal_image.src = "images/mediassociaux/rss_n.jpg";
rss_mouseover_image = new Image();
rss_mouseover_image.src = "images/mediassociaux/rss_o.jpg"




function swap(){ 

if (document.images){
	for (var x=0 ; x<swap.arguments.length ; x+=2) {
	
		document[swap.arguments[x]].src = eval(swap.arguments[x+1] + ".src");
		
		}
	}
}

//FORMULAIRE CONTACT

function changeMode(mode){
	
	var attribute = document.createAttribute("required");
  		 attribute.nodeValue = "true"
		 
	if(mode=="tel"){
		
		document.getElementById("tel").setAttributeNode(attribute); 		
		document.getElementById("courriel").removeAttribute('required');
		
	}else{
		
    	
		document.getElementById("courriel").setAttributeNode(attribute); 		
		document.getElementById("tel").removeAttribute('required');
		
	}
}

//HEADER SLIDE SHOW

/*	$(document).ready(function() {
		$('.imageHeader').cycle({
			 speed: 8000,
			 continuous:1
		});
	});*/
	
	
//TOP REALISATION MANAGER

var positionGauche = 1;

			  
var pos=new Array();
pos[1]=new Array();
pos[1]["left"]=0;
pos[1]["top"]=0;
pos[1]["width"]=118;
pos[1]["height"]=102;
pos[1]["z-index"]=5;

pos[2]=new Array();
pos[2]["left"]=100;
pos[2]["top"]=-10;
pos[2]["width"]=147;
pos[2]["height"]=127;
pos[2]["z-index"]=9;

pos[3]=new Array();
pos[3]["left"]=220;
pos[3]["top"]=-20;
pos[3]["width"]=180;
pos[3]["height"]=155;
pos[3]["z-index"]=10;

pos[4]=new Array();
pos[4]["left"]=380;
pos[4]["top"]=-10;
pos[4]["width"]=147;
pos[4]["height"]=127;
pos[4]["z-index"]=8;

pos[5]=new Array();
pos[5]["left"]=510;
pos[5]["top"]=0;
pos[5]["width"]=117;
pos[5]["height"]=102;
pos[5]["z-index"]=4;

var vitesse=1000;		  
var posToGo;
var animationEnCour=false;

$(document).ready(function() {	
	
/*	$(".topRealisations").click(function(){
		anim();
	});
	

	*/
setInterval(function() {
		 anim();
	}, 4000);
		
	
	


$(".portfolioRealisation").click(
function()
{
    window.open($(this).attr("title"));
});


$(".portfolioRealisationAdmin").click(
function()
{
	
    window.location.href=($(this).attr("title"));
});




$(".topRealisations").click(
function()
{
    window.location =($(this).attr("title"));
});









function anim(){
	if(animationEnCour==false){
		 
		animationEnCour=true;
		
		switch(positionGauche){
			case 1:posToGo=5;break;
			case 2:posToGo=4;break;
			case 3:posToGo=3;break
			case 4:posToGo=2;break
			case 5:posToGo=1;break
		}	
	
	


	for(var re=1;re<=5;re++){	
		
		switch(re){
			case 1:id="#un";break;
			case 2:id="#deux";break;
			case 3:id="#trois";;break;
			case 4:id="#quatre";break;
			case 5:id="#cinq";break;
		}
		

			$(id).parent().animate({left: pos[posToGo]["left"],top:pos[posToGo]["top"]}, vitesse ); 					
			$(id).animate({width: pos[posToGo]["width"],height:pos[posToGo]["height"]}, vitesse , function() {
    			animationEnCour=false
 			 });
			 
			$(id).parent().css({'z-index':+pos[posToGo]["z-index"]});	
	
	
						

				animationEnCour=false
			if(posToGo!=5){		
				posToGo++;
			}else{							 
				posToGo=1		
			}
		
	
		
	
		
	}


	if(positionGauche==5){
		positionGauche=1;
	}else{
		positionGauche+=1;  
	}
   }
		  
}
		
		

	
	$("#un").css({'width':'118px',"height":"102px"});	
	$("#un").parent().css({'left':'0px','top':'0px','z-index':'6'});	
	
	$("#deux").css({'width':'147px',"height":"127px"});
	$("#deux").parent().css({'left':'100px','top':'-10px','z-index':'9'});
	
	
	$("#trois").css({'width':'180px',"height":"155px"});
	$("#trois").parent().css({'left':'220px','top':'-20px','z-index':'10'});
	
	
	$("#quatre").css({'width':'147px',"height":"127px"});
	$("#quatre").parent().css({'left':'380px','top':'-10px','z-index':'8'});
	
	$("#cinq").css({'width':'118px',"height":"102px"});
	$("#cinq").parent().css({'left':'510px','top':'0px','z-index':'7'});
	
	

});

