function goToPage(namePage){
	window.location.href=namePage; 
}

//Hide the notice bar
function hideNotice(){
	document.getElementById("sliderNotice").className = "notice1to0";
}

//Hide the pager container
function hidePager(){
	document.getElementById("pagerContainer").className = "opacity1t0sec3";
}

//Show the pager container
function showPager(){
	document.getElementById("pagerContainer").className = "opacity0t1sec3";
}

//When the page is loaded, we hide the navigation bar on screen top
function hideURLbar(){
	window.scrollTo(0,1);
}


//Load an external HTML file in a div
function loadDiv(divLoad,url){
	//At first we request the html file
	var xhr_object = null;	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function(){
		if(xhr_object.readyState==4){
			document.getElementById(divLoad).innerHTML = xhr_object.responseText;					
		}
	}
	xhr_object.send(null);	
}	


function updateOrientation(){
	switch(window.orientation){
		case 0: orient = "portrait"; 
			break;
		case -90: orient = "landscape"; 
			break;
		case 90: orient = "landscape"; 
			break;
		case 180: orient = "portrait"; 
			break;
		}
	document.body.setAttribute("orient", orient);
}


/*
* This function allow to combine a navigation by submenu and by slidings on the content
* (used in showroom.php, acc.php, feat.php, spec.php, works with slide.js or slideLite.js)
*/
function switchTo(goTo){
	if(goTo!=dCurrent){ //If user do not click on the actual button.
		if(goTo>dCurrent){//If user click on a button after the current position.
			var i=0; 
			var diff=goTo-dCurrent; //We determinate the number of divs to slide.
			while(i<diff){
				var delai=i*1000; //According to the number of slides, we set the delay for sliding each div.
				setTimeout("arrows('Right')",delai);
				i++;
			} 			
		}else{
			var i=0; 
			var diff=dCurrent-goTo;
			while(i<diff){
				var delai=i*1000;
				setTimeout("arrows('Left')",delai);
				i++;
			} 	
		}
	}
}