// JavaScript Document
var nom_site = 'web-13';
var dom_site = nom_site + '.com';
var chaine = ""+location;
if ( chaine.search('/localhost/') == -1 ) {
	var urlSite = 'http://www.' + dom_site;
}
else {
	var urlSite = 'http://localhost/' + 'web-13'; //nom_site;
}
if ( chaine.search('/administration/') != -1 ) {
	var urlSite = urlSite + '/administration';
}
function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function sendData(param, page, mydiv) {
	if(document.all) {
		//Internet Explorer
		var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
	}//fin if
	else {
		   //Mozilla
		var XhrObj = new XMLHttpRequest();
	}//fin else
    //définition de l'endroit d'affichage:
	var content = document.getElementById(mydiv);
	XhrObj.open("POST", page);
	//Ok pour la page cible
	XhrObj.onreadystatechange = function() {
		if (XhrObj.readyState == 4 && XhrObj.status == 200)
		content.innerHTML = XhrObj.responseText ;
	}
	XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	XhrObj.send(param);
}//fin fonction SendData

<!--Gestion popups
var infoShow;
function createInfoShow(urlInfo,width,height) {
	var containerWidth = getWindowWidth();
	var positionX = ((containerWidth / 2) - (width /2 ));
	var containerHeight = getWindowHeight();
	var positionY = ((containerHeight / 2) - (height /2 ));
	infoShow = window.open(urlSite + '/info.php' + urlInfo,'infoShow','scrollbars=yes,width=' + width + ',height=' + height + ',screenX=0,screenY=0,top=' + positionY + ',left=' + positionX);
	//infoShow = window.open('info.php' + urlInfo,'infoShow','scrollbars=yes,width=' + width + ',height=' + height + ',screenX=0,screenY=0,top=10,left=10');
}
function info(url,width,height)
{
	if(typeof(infoShow)!="undefined")
	{
		if(infoShow.closed!=true)
			infoShow.close();
	}
	var urlInfo  = '?info=' + url;
	createInfoShow(urlInfo,width,height);
}
function closeInfoShow()
{
	if(typeof(infoShow)!="undefined")
	{
		if(infoShow.closed!=true)
			infoShow.close();
	}
}
//-->
<!--Alerte suppression
function supp(texte,lien) {
	if (confirm(texte))
		window.location=lien;
}
//fin alerte suppression-->
function JumpSelect(targ,adresse,selObj,restore){ 
  eval(targ+".location='"+adresse+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function createWindow(url,width,height) {
	var containerWidth = getWindowWidth();
	var positionX = ((containerWidth / 2) - (width /2 ));
	var containerHeight = getWindowHeight();
	var positionY = ((containerHeight / 2) - (height /2 ));
	window.open(url,'infoShow','scrollbars=yes,width=' + width + ',height=' + height + ',screenX=0,screenY=0,top=' + positionY + ',left=' + positionX);
}
