var photo_aff=new Array(15);
var cheninPh="photos/";
var extPh=".jpg";
var iphoto_aff_nb=11;
photo_aff[0]="BB01";
photo_aff[1]="BB02";
photo_aff[2]="BB03";
photo_aff[3]="BB04";
photo_aff[4]="BB05";
photo_aff[5]="BB06";
photo_aff[6]="BB07";
photo_aff[7]="BB08";
photo_aff[8]="BB09";
photo_aff[9]="BB10";
photo_aff[10]="BB11";
photo_aff[11]="BB12";
photo_aff[12]="BB13";
photo_aff[13]="BB14";
photo_aff[14]="BB15";


function affichage(sens)
{		
var icourant = document.getElementsByName('iph_courant')[0];
var img1 = document.getElementById('image_1'); 	
var img2 = document.getElementById('image_2'); 	
var img3 = document.getElementById('image_3'); 	
var img4 = document.getElementById('image_4'); 						
			
	var tmp_icourant=0;
	tmp_icourant=parseInt(icourant.value);	
	if (sens=="1")
	{
		icourant=tmp_icourant+1;					
	}
	else
	{
		icourant=tmp_icourant-1;					
	}
	
	if (icourant==iphoto_aff_nb) // Cache le bouton av
	{
		cache_bt_av();
	}
	else
	{
		visible_bt_av();
	}
	
	if (icourant=="0")
	{
		cache_bt_ar();
	}
	else
	{
		visible_bt_ar();
	}
	document.getElementsByName('iph_courant')[0].value=icourant;
			
	img1.src=cheninPh+photo_aff[0+icourant]+extPh;
	img2.src=cheninPh+photo_aff[1+icourant]+extPh;
	img3.src=cheninPh+photo_aff[2+icourant]+extPh;
	img4.src=cheninPh+photo_aff[3+icourant]+extPh;	
}
function affichage_grandPhoto(img1x)
{
var img_grandPhoto= document.getElementById('grand_photo');	
var iretire_extention = extPh.length;
var itaille_chaine = img1x.src.length;
var iresult=itaille_chaine-iretire_extention;

	str_garder=img1x.src.substr(0,iresult);
	img_grandPhoto.src=str_garder+"g"+extPh;		
}

function cache_bt_av ()// fonction pour cache le bouton av
{	  if (nc6) {	 document.getElementById("bt_av").style.visibility = "hidden";	}
		if (nc4) {	document.bt_av.visibility = "hidden";	}
		if (ie4)  { bt_av.style.visibility = "hidden"; 	}	
}
function visible_bt_av ()//fonction visible le bouton av
{	  if (nc6){	document.getElementById("bt_av").style.visibility = "visible";	}
		if (nc4){ document.bt_av.visibility = "visible"; }
		if (ie4){ bt_av.style.visibility = "visible"; }	
}
function cache_bt_ar ()// fonction pour cache le bouton ar
{	  if (nc6) {	 document.getElementById("bt_ar").style.visibility = "hidden";document.getElementById("bt_ar2").style.visibility = "hidden";	}
		if (nc4) {	document.bt_ar.visibility = "hidden"; document.bt_ar2.visibility = "hidden";	}
		if (ie4)  { bt_ar.style.visibility = "hidden"; bt_ar2.style.visibility = "hidden";	}	
}
function visible_bt_ar ()//fonction visible le bouton ar
{	  if (nc6){	document.getElementById("bt_ar").style.visibility = "visible";document.getElementById("bt_ar2").style.visibility = "visible";	}
		if (nc4){ document.bt_ar.visibility = "visible";document.bt_ar2.visibility = "visible"; }
		if (ie4){ bt_ar.style.visibility = "visible";bt_ar2.style.visibility = "visible"; }	
}

function ar(){ affichage("0");	}
function av(){ affichage("1");	}

function recuper_ph1() { affichage_grandPhoto(document.getElementById('image_1')); }
function recuper_ph2() { affichage_grandPhoto(document.getElementById('image_2')); }
function recuper_ph3() { affichage_grandPhoto(document.getElementById('image_3')); }
function recuper_ph4() { affichage_grandPhoto(document.getElementById('image_4')); }
