/*function regenerate(){
	window.location.reload();
}*/

/*function regenerate2(){
	if (ns4){
		document.slidemenubar.left=((parseInt(slidemenu_width)-parseInt(slidemenu_reveal))*-1);
		document.slidemenubar.visibility="show";
		setTimeout("window.onresize=regenerate",400);
	}
}*/

// MENU GAUCHE

function pull(){
if (window.drawit)
clearInterval(drawit);
pullit=setInterval("pullengine()",10)
};

function draw(){
	clearInterval(pullit);
	drawit=setInterval("drawengine()",10);
}

function pullengine(){
	if ((ie4||ns6)&&parseInt(themenu.left)<rightboundary){
		clip2 = clip2-5;
		themenu.left=parseInt(themenu.left)+5+"px";
		document.getElementById('slidemenubar').style.clip = "rect(0,"+clip_origin1+","+(hauteur+2)+","+clip2+")";
	/*}else if(ns4&&themenu.left<rightboundary){
		themenu.left+=5;*/
	}else if (window.pullit){
		themenu.left=-1;
		clip2 = 1;
		document.getElementById('slidemenubar').style.clip = "rect(0,"+clip_origin1+","+(hauteur+2)+","+clip2+")";
		clearInterval(pullit);
	}
}

function drawengine(){
	if(themenu.left == -1){themenu.left = 0;}
	
	if ((ie4||ns6)&&parseInt(themenu.left)>leftboundary){
		clip2 = clip2+5;
		themenu.left=parseInt(themenu.left)-5+"px";
		document.getElementById('slidemenubar').style.clip = "rect(0,"+clip_origin1+","+(hauteur+2)+","+clip2+")";
	}/*else if(ns4&&themenu.left>leftboundary){
		themenu.left-=5;
	}*/else if (window.drawit){
		themenu.left=leftboundary;
		clip2 = clip_origin2;
		document.getElementById('slidemenubar').style.clip = "rect(0,"+clip_origin1+","+(hauteur+2)+","+clip2+")";
		clearInterval(drawit);
	}
}

// MENU HAUT 1
function pull_menu1(){
if (window.drawit_menu1)
clearInterval(drawit_menu1);
pullit_menu1=setInterval("pullengine_menu1()",10)
};

function draw_menu1(){
	clearInterval(pullit_menu1);
	drawit_menu1=setInterval("drawengine_menu1()",10);
}

function pullengine_menu1(){
	if ((ie4||ns6)&&parseInt(themenu1.top)<bottomboundary_menu1){
		clip2menu1 = clip2menu1-5;
		themenu1.top=parseInt(themenu1.top)+5+"px";
		document.getElementById('menu1').style.clip = "rect("+clip2menu1+","+hauteur1+","+clipmenu1_origin1+",0)";
	}else if (window.pullit_menu1){
		themenu1.top=-1;
		clip2menu1 = 1;
		document.getElementById('menu1').style.clip = "rect("+clip2menu1+","+hauteur1+","+clipmenu1_origin1+",0)";
		clearInterval(pullit_menu1);
	}
}

function drawengine_menu1(){
	if(themenu1.top == -1){themenu1.top = 0;clip2menu1 = 1;}
	
	if ((ie4||ns6)&&parseInt(themenu1.top)>topboundary_menu1){
		clip2menu1 = clip2menu1+5;
		themenu1.top=parseInt(themenu1.top)-5+"px";
		document.getElementById('menu1').style.clip = "rect("+clip2menu1+","+hauteur1+","+clipmenu1_origin1+",0)";
	}else if (window.drawit_menu1){
		themenu1.top=topboundary_menu1;
		clip2menu1 = clipmenu1_origin2;
		document.getElementById('menu1').style.clip = "rect("+clip2menu1+","+hauteur1+","+clipmenu1_origin1+",0)";
		clearInterval(drawit_menu1);
	}
}

// MENU BAS
function pull_menu2(){
if (window.drawit_menu2)
clearInterval(drawit_menu2);
pullit_menu2=setInterval("pullengine_menu2()",10)
};

function draw_menu2(){
	clearInterval(pullit_menu2);
	drawit_menu2=setInterval("drawengine_menu2()",10);
}

function pullengine_menu2(){
	if ((ie4||ns6)&&parseInt(themenu2.top)>topboundary_menu2){
		clip2menu2 = clip2menu2+5;
		themenu2.top=parseInt(themenu2.top)-5+"px";
		document.getElementById('menu2').style.clip = "rect(0,"+hauteur2+","+clip2menu2+",0)";
	}else if (window.pullit_menu2){
		themenu2.top=topboundary_menu2;
		clip2menu2 = 155;
		document.getElementById('menu2').style.clip = "rect(0,"+hauteur2+","+clip2menu2+",0)";
		clearInterval(pullit_menu2);
	}
}

function drawengine_menu2(){
	if(themenu2.top == topboundary_menu2){clip2menu2 = clip2menu2-1;}
	
	if ((ie4||ns6)&&parseInt(themenu2.top)<bottomboundary_menu2){
		clip2menu2 = clip2menu2-5;
		themenu2.top=parseInt(themenu2.top)+5+"px";
		document.getElementById('menu2').style.clip = "rect(0,"+hauteur2+","+clip2menu2+",0)";
	}else if (window.drawit_menu2){
		themenu2.top=bottomboundary_menu2;
		clip2menu2 = clipmenu2_origin2;
		document.getElementById('menu2').style.clip = "rect(0,"+hauteur2+","+clip2menu2+",0)";
		clearInterval(drawit_menu2);
	}
}

// MENU PANIER
function pull_menu3(){
if (window.drawit_menu3)
clearInterval(drawit_menu3);
pullit_menu3=setInterval("pullengine_menu3()",10);
}

function draw_menu3(){
	clearInterval(pullit_menu3);
	drawit_menu3=setInterval("drawengine_menu3()",10);
}

function pullengine_menu3(){
	if ((ie4||ns6)&&parseInt(themenu3.top)>topboundary_menu3){
		clip2menu3 = clip2menu3+15;
		themenu3.top=parseInt(themenu3.top)-15+"px";
		document.getElementById('menu3').style.clip = "rect(0,"+hauteur3+","+clip2menu3+",0)";
	}else if (window.pullit_menu3){
		themenu3.top=topboundary_menu3;
		clip2menu3 = 421;
		document.getElementById('menu3').style.clip = "rect(0,"+hauteur3+","+clip2menu3+",0)";
		clearInterval(pullit_menu3);
	}
}

function drawengine_menu3(){
	if(themenu3.top == topboundary_menu3){clip2menu3 = clip2menu3-1;}
	
	if ((ie4||ns6)&&parseInt(themenu3.top)<bottomboundary_menu3){
		clip2menu3 = clip2menu3-15;
		themenu3.top=parseInt(themenu3.top)+15+"px";
		document.getElementById('menu3').style.clip = "rect(0,"+hauteur3+","+clip2menu3+",0)";
	}else if (window.drawit_menu3){
		themenu3.top=bottomboundary_menu3;
		clip2menu3 = clipmenu3_origin2;
		document.getElementById('menu3').style.clip = "rect(0,"+hauteur3+","+clip2menu3+",0)";
		clearInterval(drawit_menu3);
	}
}

function resetPosition(){
	/*var pos_left = (largeur_fenetre() - document.getElementById('container').offsetWidth) / 2;
	
	//decalage scroller droite
	if(ns6 == 0){
		pos_left -= 10;
	}
	if(hauteur_fenetre() < document.body.offsetHeight){
		pos_left -= 8;
	}
	
	pos_left=0;
	
	if(pos_left < 0){pos_left = 0;}
	document.getElementById('slidemenubar2').style.left = (parseInt(slidemenu_width)-parseInt(slidemenu_reveal))*-1 + pos_left + "px";
	decalage = pos_left;*/
}

function largeur_fenetre()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
}

function hauteur_fenetre()
{
 if (window.innerHeight) return window.innerHeight  ;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else return 0;
}