
// ::::::::: I M A G E S O N ::  N E W  M E D I A  :::::::
// :::: // Frédéric.caron ::::: copyright  2002 :: :::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns6 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()
if (!is.min) {alert('please upgrade your browser');}
if (navigator.appVersion.indexOf("Mac") != -1) is+="mac";

function popwin(filename,widsiz,heisiz)
{
window.open(filename,'win'+ widsiz +'','scrollbars=0,toolbar=0,location=0,status=0,width=' + widsiz + ',height=' + heisiz + ',copyhistory=0,resizable=0,left=0 top=0 menubar=0');
}

function noflash() { popwin('noflash.htm',740,400) }

function shake4() {
        if (is.ns || is.ie) {
                for (i = 12; i > 0; i--) {
                for (z = 8; z > 0; z--) {
                        self.moveBy(0,i);
                        self.moveBy(i,0);
                        self.moveBy(0,-i);
                        self.moveBy(-i,0);
                } }
        }
self.close();
}
function showvote(path)
{
popx = screen.height/2
popy = screen.width/2;
miniwin = window.open('showvote.asp?vote='+ path +'','votewin','scrollbars=0,toolbar=0,location=0,status=0,width=320,height=240,copyhistory=0,resizable=0,left='+popy+' top='+popx+' menubar=0');
miniwin.location.href = "showvote.asp?vote="+ path 
miniwin.focus();
}

lastID = 0
function init(imgID){
if (document.images) {
	if (is.ie) eval('SID' + lastID).style.color = "#666666"
	document.images['dynimg'].src = "photo/" + curpath + "/" + listphoto[imgID];
	nuimg = imgID;
	lastID = nuimg
		if (is.ie) eval('SID' + nuimg).style.color = "#FFCC00"
		else highlight(imgID)
	}
}
function swapimg(stat){
if (document.images) {
	if (stat == "avance"){
		if (nuimg == (cnt - 1)){nuimg = 0}
		else nuimg = nuimg + 1}
	if (stat == "recule"){
		if (nuimg == 0){nuimg = (cnt-1)}
		else nuimg = nuimg - 1}
		init(nuimg)
	}
}
function sendinfo()
{
location.href = "vote.asp?pathID=photo/" + curpath + "/&voteID=" + listphoto[nuimg];
}
function printnumb(imgID)
{
	if (imgID < 10) return "0" + imgID;
	else return imgID;
}
function calcx(imgID)
{
	if(is.ns4) return ((imgID % 4)*15) + 644;

	if (is.ns6) return ((Math.floor(imgID%4))*17) + 635;
}
function calcy(imgID)
{
	if(is.ns4) return ((Math.floor(imgID/4))*15) + 95;

	if (is.ns6) return ((Math.floor(imgID/4))*15) + 92;
}

function highlight(imgID)
{
	if(is.ns4)
	{
 	document.layers.highlight.left = calcx(imgID);
 	document.layers.highlight.top = calcy(imgID);
 	document.layers.highlight.document.open() ;
 	document.layers.highlight.document.write("<font class='posin'>" + printnumb(imgID) + "</font>") ;
 	document.layers.highlight.document.close() ;
	}
	if (is.ns6)
	{
 	document.getElementsByTagName("DIV").highlight.style.left = calcx(imgID);
 	document.getElementsByTagName("DIV").highlight.style.top = calcy(imgID);
	document.getElementsByTagName("DIV").highlight.innerHTML = "<font class='posin'>" + printnumb(imgID) + "</font>";
	}
}
function putinfo(mp3ID)
{ 
document.subinfo.mp3.value = mp3ID
document.subinfo.submit();
}