var scrollFlag=false;
var sens="";

function getMouseX() {
	if (scrollFlag) {
		var obj=document.getElementById('viewPhoto');
		if (sens=="left") {
			obj.scrollLeft-=15;
		}
		if (sens=="right") {
			obj.scrollLeft+=15;
		}
		setTimeout("getMouseX()",50);
	}
}

function scrollPhoto(commande,value) {
	if (commande=="start") {
		scrollFlag=true;
		sens=value;
		getMouseX();
	} else {
		scrollFlag=false;
		sens="";
	}	
}

var fenetre=null;
function afficheImage(url,width,height) {
	if (fenetre!=null) {
		fenetre.close();
	}
	fenetre=window.open('/affichePhoto.php?url='+url,'','resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=yes,width='+width+',height='+height);
}

function ouvrir(url) {
	if (fenetre!=null) {
		fenetre.close();
	}
	width=750;
	height=250;
	fenetre=window.open(url,'','resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes,width='+width+',height='+height+',top='+((screen.height-height)/2)+',left='+((screen.width-width)/2));
}

function ouvrirPresta(url,titre,fenetre) {
        if (fenetre==null) {
            var fenetre=false;
        }
        if (!fenetre) {
            var ppp=new popup();
            ppp.title=titre;
            ppp.contenu=requestSelect(url);
            ppp.affiche();
        } else {
            window.open(url,'','');
        }
}