function GetXmlHttpObject(){
	var xmlHttp;
	try{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e){
		try{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
if(document.images){
	loading = new Image; 
	loading.src = "img/loading.gif";
	imageloading = new Image; 
	imageloading.src = "img/imagepreloader.gif";
	rmt = new Image; 
	rmt.src = "img/rmt.jpg";
}
numberscroll = 0;
loadportfoliostate = false;
numbermorphopacity = 0;

function loadframe(page, obj){
	xmlHttp = GetXmlHttpObject();
	var url = "loader.php?page=" +page+ "&obj=" +obj+ "";
	
	xmlHttp.onreadystatechange=pageloaderstatus;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
	
	function pageloaderstatus(){ 
		if (xmlHttp.readyState == 1){
			document.getElementById("loading").style.display = "block";
		}
		if (xmlHttp.readyState == 4){
			document.getElementById("loading").style.display = "none";
			document.getElementById("frame").innerHTML = xmlHttp.responseText;
		}
	}
}
function mouseover(obj){ 
	var id = obj.id;
	obj.src = "img/" +id+ "true.jpg";
}
function mouseout(obj){ 
	var id = obj.id;
	obj.src = "img/" +id+ ".jpg";
}
function loadportfolio(){
	if(loadportfoliostate == false){
		document.getElementById("notes").style.display = "none";
		document.getElementById("coordonnees").style.display = "none";
		document.getElementById("container").style.display = "block";
		numberscroll = numberscroll + 5;
		document.getElementById("portfoliomenu").style.height = numberscroll + "px";
		timeoutloadportfolio = setTimeout('loadportfolio();', 5);
		if(numberscroll == 75){
			clearTimeout(timeoutloadportfolio);
			loadportfoliostate = true;
		}
	}
	else if(loadportfoliostate == true){
		numberscroll = numberscroll - 5;
		document.getElementById("portfoliomenu").style.height = numberscroll + "px";
		timeoutloadportfolio = setTimeout('loadportfolio();', 5);
		if(numberscroll == 0){
			clearTimeout(timeoutloadportfolio);
			loadportfoliostate = false;
		}
	}
}
function loadnotes(){
	document.getElementById("container").style.display = "none";
	document.getElementById("coordonnees").style.display = "none";
	document.getElementById("notes").style.display = "block";
	if(loadportfoliostate == true){
		loadportfolio();
	}
}
function loadcoordonnees(){
	document.getElementById("container").style.display = "none";
	document.getElementById("notes").style.display = "none";
	document.getElementById("coordonnees").style.display = "block";
	if(loadportfoliostate == true){
		loadportfolio();
	}
}
function imagepreloader(image){
	document.getElementById("image").src = "img/imagepreloader.gif";
	if(document.images){
		imagepreload = new Image; 
		imagepreload.src = image;
	}
	document.getElementById("image").src = image;
}