var galerie=new Array();
var toile=new Array();
var txthtm=new Array();
function initialiser()
{
 	galerie[1]=new creer_galerie("structure",18);
 	galerie[2]=new creer_galerie("wakeboard",12);
 	galerie[3]=new creer_galerie("insolite",11);
	toile[1]=new creer_toile(1,1,"Slalom on the lake of Leucate",500,350);
	toile[2]=new creer_toile(1,2,"Start in water-skiing accompanied with an instructor",500,350);
	toile[3]=new creer_toile(1,3,"The kneeboard it is fun",500,350);
	toile[4]=new creer_toile(1,4,"Slalomski on the Mediterranean Sea",500,350);
	toile[5]=new creer_toile(1,5,"One of the most beautiful site of the Pyrénées-Orientales",500,350);
	toile[6]=new creer_toile(1,6,"Waterskiing lesson",500,350);
	toile[7]=new creer_toile(1,7,"A safety boat comes to look for you in case of fall",500,350);
	toile[8]=new creer_toile(1,8,"What of better than to sip a drink under the hut?",500,350);
	toile[9]=new creer_toile(1,9,"The wakeboard professional version",500,350);
	toile[10]=new creer_toile(1,10,"The children enjoy themselves at the edge of the beach",500,350);
	toile[11]=new creer_toile(1,11,"The bar overhangs the lake of Leucate",500,350);
	toile[12]=new creer_toile(1,12,"The lift is close to the Mediterranean Sea",500,350);
	toile[13]=new creer_toile(1,13,"Water-skiing in family",500,350);
	toile[14]=new creer_toile(1,14,"The lift of the South of France",500,350);
	toile[15]=new creer_toile(1,15,"Idleness on the terrace of the lift",500,350);
	toile[16]=new creer_toile(1,16,"The restaurant proposes salads and grills",500,350);
	toile[17]=new creer_toile(1,17,"Holidays with strong sensations",500,350);
	toile[18]=new creer_toile(1,18,"Pontoon of the lift under the sun",500,350);
	toile[19]=new creer_toile(2,1,"The wakeboard according to Julien Taboulet alias &rsquo;Wesh-Wesh&rsquo;",500,350);
	toile[20]=new creer_toile(2,2,"Slide on the wake park",500,350);
	toile[21]=new creer_toile(2,3,"Enormous railey in sunset",500,350);
	toile[22]=new creer_toile(2,4,"Edge of wake level with the water",500,350);
	toile[23]=new creer_toile(2,5,"Backroll on the kicker",500,350);
	toile[24]=new creer_toile(2,6,"The wake rider on the Mediterranean Sea",500,350);
	toile[25]=new creer_toile(2,7,"The glide of the wake",500,350);
	toile[26]=new creer_toile(2,8,"Very air trick on the kicker in wakeboard",500,350);
	toile[27]=new creer_toile(2,9,"Tricks of wakeboard close to the snowboard",500,350);
	toile[28]=new creer_toile(2,10,"&rsquo;Kum&rsquo; wake style",500,350);
	toile[29]=new creer_toile(2,11,"The wake power 10",500,350);
	toile[30]=new creer_toile(2,12,"A not identified flying wakeboarder",500,350);
	toile[31]=new creer_toile(3,1,"A wake rookie",500,350);
	toile[32]=new creer_toile(3,2,"The magic style of a prorider",500,350);
	toile[33]=new creer_toile(3,3,"Wakeboard vs kneeboard",500,350);
	toile[34]=new creer_toile(3,4,"Jump of wake on lift",500,350);
	toile[35]=new creer_toile(3,5,"The style of &rsquo;Boudu&rsquo; in wake skate",500,350);
	toile[36]=new creer_toile(3,6,"End of session of Théo",500,350);
	toile[37]=new creer_toile(3,7,"Original learning of the kneeboard",500,350);
	toile[38]=new creer_toile(3,8,"Hard water sports !!",500,350);
	toile[39]=new creer_toile(3,9,"The enjoyment of the glide",500,350);
	toile[40]=new creer_toile(3,10,"A little of air relaxation",500,350);
	toile[41]=new creer_toile(3,11,"Wake Crash-Test",500,350);
}
function creer_galerie(nom, nbtoiles)
{
 	this.nom=nom;
	this.nbtoiles=nbtoiles;
}
function creer_toile(gale, nume, titr, pixx, pixy)
{
 	this.gale=gale;
	this.nume=nume;
	this.titr=titr;
	this.pixx=pixx;
	this.pixy=pixy;
}
function choix_galerie(choix)
{
 	var temp=1;
	var lign=1;
	for(var i=1;i<toile.length;i++)
	{
	 	if(toile[i].gale==choix)
		{
		 	var code="";
			var image="pho_";
			var vignette="./images/vig_";
			var refer=galerie[choix].nom+" - photo "+toile[i].nume;
			image+=galerie[choix].nom+toile[i].nume+".jpg";
			vignette+=galerie[choix].nom+toile[i].nume+".jpg";
			code="<li><a href=\"#interne\" onclick=\"javascript:affiche_img('"+image+"',"+toile[i].pixx+","+toile[i].pixy+",'"+toile[i].titr+"');\">";
			code+="<img src=\""+vignette+"\" title=\"enlarge : "+refer+"\"/></a></li>";
			txthtm[temp]=code;
			temp++;
		}
	}
	afficher_galerie();
}
function afficher_galerie()
{
 	var code="";
 	for(var i=1;i<txthtm.length;i++)
	{
		code+=txthtm[i];
	}
	document.getElementById("galerie").innerHTML=code;
}
function affiche_img(nom_image,taillex,tailley,titre,ligne)
{
	var chemin = "./images/"+nom_image;
	var bt_taillex = taillex+60;
	if (bt_taillex<300)
	{
	 	bt_taillex=300;
	}
	var bt_tailley = tailley+50;
	if (bt_tailley<300)
	{
	 	bt_tailley=300;
	}
	var margex_img = (bt_taillex-taillex)/2;
	document.getElementById("bt_aff_photo").style.height=bt_tailley+"px";
	document.getElementById("bt_aff_photo").style.width=bt_taillex+"px";
	//document.getElementById("bt_aff_photo").style.left=(ecranx-bt_taillex)/2+"px";
	document.getElementById("bt_aff_photo").style.marginLeft="20%";
	document.getElementById("bt_aff_photo").style.marginTop="15%";
	if (taillex>tailley)
	{
	 	var posy_bt=275+(ligne*75);
	}
	else {
		var posy_bt=125+(ligne*100);
	}
	posy_bt=23;
	//document.getElementById("bt_aff_photo").style.top=posy_bt+"%";
	document.getElementById("bt_aff_photo").style.visibility="visible";
	document.getElementById("bt_aff_photo").innerHTML="<img src='"+chemin+"' style='margin-left:"+margex_img+"px;'/><h3>"+titre+"</h3>";
}
function enleve_img()
{
	document.getElementById("bt_aff_photo").style.visibility="hidden";
	document.getElementById("bt_aff_photo").style.height="0px";
	document.getElementById("bt_aff_photo").style.width="0px";
}
