/***********************************************/
/*                         Détection du navigateur                              */
/***********************************************/
var nav=navigator.appName.substring(0, 3);
var ver=navigator.appVersion.substring(0, 1);
var NETSCAPE=(nav=='Net');
var IE=(nav=='Mic');


if (document.documentElement && document.documentElement.clientWidth && navigator.appVersion.indexOf('Safari')==-1)
	var docRef=document.documentElement;
else
	var docRef=document.body;

if (IE)
{
	var clientWidth=window.innerWidth;
	var clientHeight=window.innerHeight;
}
else
{
	var clientWidth=screen.width;
	var clientHeight=screen.height;
}


function addFavoris()
{
	var titre_site="DroliX.com";
	var url_site="http://www.drolix.com";
	
	if (IE && ver>=4) // Internet Explorer
		window.external.AddFavorite(url_site, titre_site);
	else // Mozilla, etc
		window.sidebar.addPanel(titre_site, url_site, "");
}

/***********************************************/
/*                                    Anti Frames                                     */
/***********************************************/
if (top.frames.length!=0)
	top.location=self.document.location;


function out(idSite)
{
	(new Image()).src='/cgi/out.php?id_site='+idSite;
	return true;
}

/**
	* @param1 id: ID de l'élément à afficher ou cacher
	* @param2 visible: indique si l'élément est visible ou pas au début
*/
function montrerCacher(id, visible)
{
	var display=null;
	var e=document.getElementById(id);
	
	if (!e.style.display) // si l'élément n'a pas encore de style
	{
		if (visible) // il était affiché donc on le cache
			display='none';
		else // on l'affiche
			display='block';
	}
	else // on a déjà changé son style
	{
		if (e.style.display=='none') // il était caché, on l'affiche
			display='block';
		else // on le cache
			display='none';
	}
	
	e.style.display=display;
}

/***********************************************/
/*                                 XMLHttpRequest                                 */
/***********************************************/
// états possibles d'un XMLHttpRequest
var READY_STATE_UNINITIALIZED=0;
var READY_STATE_LOADING=1;
var READY_STATE_LOADED=2;
var READY_STATE_INTERACTIVE=3;
var READY_STATE_COMPLETE=4;

// création d'un objet XMLHttpRequest
function getXMLHttpRequest()
{
	var xhr=null;
	
	if (window.XMLHttpRequest) // Mozilla, Safari
		xhr=new XMLHttpRequest();
	else if (typeof ActiveXObject!="undefined") // Internet Explorer
		xhr=new ActiveXObject("Microsoft.XMLHTTP");
	
	return xhr;
}