var isNav = navigator.appName.indexOf("Netscape") !=-1;
var isN6 = ((isNav) && (document.getElementById));
var isMac = navigator.appVersion.indexOf("Macintosh") !=-1;
var isIE = document.all;
var isIEPC = ((isIE) && (!(isMac)))
var Egale = '=';

if (isN6)
{
	h=".left";
	v=".top";
	dS="document.getElementById('";
	sD="').style";
	appComp = "true";
	Hauteur = "').offsetHeight";
	ECRIRE = "').innerHTML=";
	VISIBLE = ".visibility='visible'";
	fD = "')";
}
else 
{
	if (isNav)
	{
		h=".left";
		v=".top";
		dS="document.";
		sD="";
		appComp = "true";
		Hauteur = ".document.height";
		VISIBLE = ".visibility='show'";
		fD = "";
	}
	else
	{
		h=".pixelLeft";
		v=".pixelTop";
		dS="";
		sD=".style";
		appComp = "true";
		Hauteur = ".offsetHeight";
		ECRIRE = ".innerHTML=";
		VISIBLE = ".visibility='visible'";
		fD = "";
	}
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function AfficheLayer(Layer,x,y)
{
	eval(dS+Layer+sD+v+Egale+y);
	eval(dS+Layer+sD+h+Egale+x);
}

function HiLite(imgN,PathImage2,Extension)
{
		eval("document [imgN].src = \"/images/" + PathImage2 + imgN + "_" + Extension + ".gif\"");
}

function OuvreFenetre(URL,NomControle,Largeur,Hauteur,AffScrollBars)
{
	if (AffScrollBars!="no") AffScrollBars='yes';
	Top = screen.height/2-Hauteur/2 
	Gauche = screen.width/2-Largeur/2
	var popup = window.open(URL, NomControle, "toolbar=no,status=no,menubar=no,scrollbars=" + AffScrollBars + ",resizable=no,directories=no,location=no,width=" + Largeur + ",height=" + Hauteur +",top=" + Top + ",left=" + Gauche)
}

function del() {
		document.forms[0].action="del.php";
		document.forms[0].submit();
}
	


function SoumettreForm() {
		document.forms[0].action="save.php";
		document.forms[0].submit();
	}

function Popup_Message(message)
{
	if (message!='') alert(message);
}

	

function retaille()
{
	//if ((screen.width > 1024) && (screen.height > 768))
		//window.resizeTo(1024,768);
	
}

function change_alpha(alpha,ctrl)
{
	document.getElementById(ctrl).style.opacity = (alpha/100);
	document.getElementById(ctrl).style.filter = 'alpha(opacity=' + alpha + ')';
}

function popup_title(ctrl,texte,statut)
{
	eval(dS+"div_thumb"+ECRIRE+"\"<span class='rollover'>&nbsp;" + texte + "&nbsp;</span>\"");
	obj = document.getElementById(ctrl);
	//alert(findPosX(obj));
	if (statut=='on')
		AfficheLayer('div_thumb',findPosX(obj)+35,findPosY(obj)+10);
	else
		AfficheLayer('div_thumb',-500,-500);
}

$(document).ready(function(){

	$('.spaceleft').hover(
		function () {
			$('.arrowleft').fadeIn(150);
		}, 
		function () {
			$('.arrowleft').fadeOut(150);
		}
	);

	$('.spaceright').hover(
		function () {
			$('.arrowright').fadeIn(150);
		}, 
		function () {
			$('.arrowright').fadeOut(150);
		}
	);
	
});

