
// KONQUEROR HACK
if(window.navigator.appName.indexOf('Konqueror')!=-1) document.write('<TABLE border=0 cellpadding=0 cellspacing=0 style="height:100%;width:5%"><tr><td>&nbsp;</td></TR></TABLE>')

// Def. var

var NS4 =	(document.layers) ? 1 : 0
var IE4 =	(document.all) ? 1 : 0
var milieu =	ecranL() / 2

var nb_clic = 0	// Nb clic sur la page
var tab_mouv = new Array() //objets en mouvement


function ecrisds(lay,texte) {
// Hack MOZ mais pas K-meleon firstChild.nodeValue
	if (NS4) {		document.layers[lay].document.write(texte); document.layers[lay].document.close() }
	else if (IE4) document.all[lay].innerHTML=texte
	else {
		var a = window.innerWidth-window.innerWidth
		document.getElementById(lay).innerHTML=texte
	}
}

function clic() { nb_clic++; }

function interceptclic() {
   if (document.addEventListener)
	document.addEventListener("click",clic,false);
   else if (NS4) {
	document.captureEvents(Event.MOUSEDOWN)
	document.onmousedown = clic
   }
   else
	document.onmousedown = clic
}
interceptclic()

function ecranL() { return (IE4) ? document.body.clientWidth : window.innerWidth }
function ecranH() { return (IE4) ? document.body.clientHeight : window.innerHeight }

function montre( lay ) { // affiche un objet caché
        if ( NS4 )	document.layers[lay].visibility = "show"
        else if ( IE4 )	document.all[lay].style.visibility = "visible"
        else		document.getElementById(lay).style.visibility = "visible"
}

function cache( lay ) { // cache un objet affiché
        if ( NS4 )	document.layers[lay].visibility = "hide"
        else if ( IE4 ) document.all[lay].style.visibility = "hidden"
        else		document.getElementById(lay).style.visibility = "hidden"
}

function attente( fonc , pause ) { // Lance une fct apres un temps donné
        pause--
	if ( nb_clic > 0 ) pause = 0
        if ( pause > 0 ) setTimeout( 'attente( "' + fonc + '",' + pause + ')' , 100 )
        else eval( fonc )
}

function positionne( nom , x , y ) { // Positionne un objet dans l'écran
        if ( NS4 ) {
                document.layers[nom].left = parseInt(x)
                document.layers[nom].top = parseInt(y)
        } else if ( IE4 ) {
                document.all[nom].style.pixelLeft = parseInt(x)
                document.all[nom].style.pixelTop = parseInt(y)
        } else {
                document.getElementById(nom).style.left = parseInt(x)
                document.getElementById(nom).style.top = parseInt(y)
        }
}


function stopmove( nom ) { // Stop le mouvement d'un objet
	clearTimeout(tab_mouv[nom])
}

function move( x , y , x1 , y1 , pasx , pasy , nom , delai ) { // Bouge un objet dans l'écran
        montre( nom )
	positionne( nom , x , y )
        if ( ( pasx*(x1-x-pasx) >= 0 ) || ( pasy*(y1-y-pasy) >= 0 ) ) {
                x += ( pasx*(x1-x-pasx) >= 0 ) ? pasx : 0 ;
                y += ( pasy*(y1-y-pasy) >= 0 ) ? pasy : 0 ;
                tab_mouv[nom] = setTimeout( 'move( ' + x + ',' + y + ',' + x1 + ',' + y1 + ',' + pasx + ',' + pasy + ',"' + nom + '","' + delai + '" )' , delai );
        }
}


function chrgimg() { // Preload des images
	for ( var i = 0 ; i < chrgimg.arguments.length ; i ++) {
		eval(chrgimg.arguments[i]+" = new Image()");
		eval(chrgimg.arguments[i]+".src = chrgimg.arguments[i] + '.' + chrgimg.arguments[i+1]");
	}
}


