	function img1(numero)
	{
		//alert(numero);
		var imgWidth = 117;
		var imgMarginRight = 8;
		var affichePicture=1;
		var totalMargin = 0;

		var totalPx = nbPicture*(imgWidth+imgMarginRight) + totalMargin;
		//alert(totalPx);
		document.getElementById("affichage_img"+numero).style.width= totalPx + "px";
		//alert(document.getElementById('affichage_img').style.width);
	}
	
	function pages(adress){
	
		window.open(adress,"_self");	
	}
	function clearAllImgs(totalImages,itemID)
	{
		
		for (var a=1; a<=totalImages; a++)
			{
				document.getElementById("id"+itemID+a).style.display = 'none';
			}
	}
	function afficherImage(id,totalImages,itemID)
	{

		clearAllImgs(totalImages,itemID);		
		document.getElementById("id"+itemID+id).style.display = 'block';
		/*document.getElementById('img_centre').src = image;
		document.getElementById('img_centre').alt = imageName;
		document.getElementById('img_centre').title = imageName;
		*/
	}
	function changeImg(id,totalImages,itemID)
	{
		clearAllImgs(totalImages,itemID);
		document.getElementById("id"+itemID+id).style.display = 'block';
	}
	
	function openDesc(id)
	{
		if(document.getElementById(id).style.display == 'block')
		{
			document.getElementById(id).style.display = 'none';
		}
		else
		{
			document.getElementById(id).style.display = 'block';
		}
	}
	function retourneImage()
	{
		/*
		if(location.href.indexOf('#') != -1 && location.href.indexOf('&') != -1 && location.href.indexOf('#id') == -1)
		{
		var lesrc = location.href.substring(location.href.indexOf('#') +1, location.href.indexOf('&'));
		var leEt = location.href.substring(location.href.indexOf('&') +1, location.href.length);
		var lesrc = lesrc.toString();
		clearAllImgs(leEt);	
		//var lesrc = document.getElementById(id).src;

		var leId = "id"+document.images[''+lesrc].id;
		document.getElementById(leId).style.display = 'block';
		}
		else if(location.href.indexOf('#id') != -1)
		{
			var leId = location.href.substring(location.href.indexOf('#') +1, location.href.indexOf('&'));
			var leEt = location.href.substring(location.href.indexOf('&') +1, location.href.length);
			
			clearAllImgs(leEt);	
			document.getElementById(leId).style.display = 'block';
		}
		else if(location.href.indexOf('photos') != -1)
		{
	
			document.getElementById("id1").style.display = 'block';
		}
		*/
		if(location.href.indexOf('#id') != -1)
		{
			var leStartId = location.href.substring(location.href.indexOf('#id') +3, location.href.indexOf('pos'));
			var itemID = location.href.substring(location.href.indexOf('pos') +3, location.href.indexOf('&'));
			var leEt = location.href.substring(location.href.indexOf('&') +1, location.href.length);
			
			
			clearAllImgs(leEt,leStartId);	
			document.getElementById('id'+leStartId+itemID).style.display = 'block';
		}
		else if(location.href.indexOf('photos') != -1)
		{
			//document.getElementById("id1").style.display = 'block';
		}
	}
	
	/* Hébergement */
	//var total_hebergement = 21;
	var base = "http://localhost/chezrainville/photos/";

	
	function clearAllDivs(type,totalItems)
	{
		//document.getElementById("chaletstart").style.display = 'none';
		//alert(type);
		for (var a=1; a<=totalItems; a++)
		{				
			document.getElementById(type+a).style.display = 'none';
		}
	}
	function aff_hebergement(type,id,totalItems)
	{		
		clearAllDivs(type,totalItems);
		
		if(type == 'chalet_small')
		{
			var theLeft = 0;
			var theTop = 0;
			switch(id)
			{
				case 1:
				theLeft = 210;
				theTop = 100;
				break;
				case 2:
				theLeft = 88;
				theTop = 259;
				break;
				case 3:
				theLeft = 124;
				theTop = 267;
				break;
				case 4:
				theLeft = 171;
				theTop = 274;
				break;
				case 5:
				theLeft = 167;
				theTop = 237;
				break;
				case 6:
				theLeft = 142;
				theTop = 216;
				break;
				case 7:
				theLeft = 194;
				theTop = 216;
				break;
				case 8:
				theLeft = 218;
				theTop = 274;
				break;
				
			}
			theTop = theTop - 225;
			//alert(document.getElementById(type+id).style.left);
			
			document.getElementById(type+id).style.left = theLeft + 'px';
			document.getElementById(type+id).style.top = theTop + 'px';
			document.getElementById(type+id).style.display = 'block';
		}
		else
		{
			clearAllDivs('chalet_small',totalItems);
			document.getElementById(type+id).style.display = 'inline';
		}

	}
	function hebergement_img(image,alt,num)
	{			
		image_src = base + "gros_img_chalet/" + image + ".jpg";
		document.getElementById('heb_big_img'+num).src = image_src;		
		document.getElementById('heb_big_img'+num).alt = alt;
		document.getElementById('heb_big_img'+num).title = alt;
	}