// JavaScript Document
<!--
var urlvar = new Array();
if ( window.location.search != "") {
	var longueur = window.location.search.length - 1;
	var data = window.location.search.substr(1,longueur);
    var	donnees = data.split("&");
    var urlvarnum = new Array();
    for (var i=0; i < donnees.length; i++) {
    	position = donnees[i].indexOf("=");
    		variable = donnees[i].substr(0,position);
    		pos = position + 1;
    		valeur = decodeURI(donnees[i].substr(pos,donnees[i].length));
    		while (valeur.search(/\+/) != -1)
    			valeur = valeur.replace(/\+/," ");
    		urlvar[variable] = valeur;
    		urlvarnum[i] = valeur;
    	}
} 

function showIt(imageJpg,nomGroupe)
{
	var toDisplay="http://users.skynet.be/rsdcstudio/image.html?image="+imageJpg.src+"&groupe="+nomGroupe;
	window.open(toDisplay);
	return false;
}

function showPochette(imageJpg,nomGroupe)
{
	var toDisplay="http://users.skynet.be/rsdcstudio/image.html?image=realisations/"+imageJpg+"&groupe="+nomGroupe;
	window.open(toDisplay);
	return false;
}

function showGroup(number,nbrPhotos,nomGroupe)
{
	var toDisplay="http://users.skynet.be/rsdcstudio/realisations/"+number+".html?numero="+number+"&groupe="+nomGroupe+"&nbrPhotos="+nbrPhotos;
	window.open(toDisplay);
	return false;
}
function resizes(img,long,haut,bord)
{
	img.width=long;
	img.height=haut;
	img.border=bord;
	
}
function displayMiniature(nbrPhotos,numero,groupe)
{
	var toWrite;
	var src=numero+"/Pochette/"+numero+".jpg";
	var largeurCalcul=0;
	var hauteur=100;
	var largeurMoins=0;
	document.getElementById('pochette').src=src;
	document.getElementById('pochette').alt="Pochette non fournie";
	document.getElementById('pochette').width=120;
	document.getElementById('pochette').height=120;
	document.getElementById('pochette').onClick= new Function("showPochette(src,groupe);");
	var img = new Image();
	
	for (var i=1;i<nbrPhotos;i++)
	{
		img.src=numero+"/Photos/"+numero+"-"+i+".jpg";
		largeurCalcul=Math.ceil((img.width/img.height)*hauteur);
		largeurCalcul=Math.ceil((img.width/img.height)*hauteur);
		if (isNaN(largeurCalcul))
			largeurCalcul=hauteur;
		largeurMoins=largeurCalcul-8
		//alert(largeurCalcul);
		toWrite="<img style='cursor:pointer;' src='"+numero+"/Photos/"+numero+"-"+i+".jpg' id='img"+i+"' border='2' alt='Photo'"+i+"' width='"+largeurCalcul+"' height='"+hauteur+"' onMouseOver='resizes(this,"+largeurMoins+","+hauteur+",6);' onMouseOut='resizes(this,"+largeurCalcul+","+(hauteur-8)+",2);' onClick=\"showIt(this,'"+groupe+"') ;\" >";
		//alert(img.height+" "+img.width+"\n"+toWrite);
document.write(toWrite);
		if (!(i%4))
			document.write("<br><br>");
	}
}

function affichePh(nbrPhotos,dir,titre)
{
	var toWrite;
	for (var i=1;i<=nbrPhotos;i++)
	{
		if(i<10)
			zero="0";
		else
			zero="";
		
		toWrite="<img style='cursor:pointer;' src='images/"+dir+"/"+zero+i+".jpg' alt='img"+i+"' border='2' width='64' height='42' onMouseOver='resizes(this,60,38,4);' onMouseOut='resizes(this,64,42,2);' onClick=\"showIt(this,'"+titre+"');\" >";
		document.write(toWrite);
		if (!(i%7))
			document.write("<br><br>");
	}
}

function affichePhName(nomPhoto,dir,nom)
{
	var toWrite;		
	toWrite="<img style='cursor:pointer;' src='images/"+dir+"/"+nomPhoto+".jpg' alt='img"+nomPhoto+"' border='2' width='64' height='42' onMouseOver='resizes(this,60,38,4);' onMouseOut='resizes(this,64,42,2);' onClick=\"showIt(this,'"+nom+"');\" >";
	document.write(toWrite);
}

function afficheCeci(Photo,nom)
{
	var toWrite;		
	toWrite="<img style='cursor:pointer;' src='"+Photo+".jpg' alt='"+Photo+"' border='2' width='64' height='42' onMouseOver='resizes(this,60,38,4);' onMouseOut='resizes(this,64,42,2);' onClick=\"showIt(this,'"+nom+"');\" >";
	document.write(toWrite);
}
function joueMorceau(titre,ouinon)
{
	var thissound=document.getElementById(titre);
	if(ouinon==true)
		thissound.Play();
	else
		thissound.Stop();
}

//-->
