function visibilite(thingId)
{
	var targetElement;
	targetElement = document.getElementById(thingId) ;
	if (targetElement.style.display == "none")
	{
		targetElement.style.display = "" ;
	} else {
		targetElement.style.display = "none" ;
	}
}

//===== Popup Centree =====//
var win=null;
function openfenetre(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-60)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}
//===== change url avec liste select =====//
function changeLocation(box) {
	val = box.options[box.selectedIndex].value;
	window.location=(val);
	return true;
}

//===== ecrit dans un div =====//
function writediv(iddiv,texte) {
	document.getElementById(iddiv).innerHTML = texte;
}

//===== fonction file interroge un fichier en methode get et retourne la réponse =====//
function file(fichier){
	if(window.XMLHttpRequest) // FIREFOX
  	xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
  	xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
  	return(false);
	xhr_object.open("GET", fichier, false);
	xhr_object.send(null);
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}

//===== Verification du pseudo du membre (via fonction file (ajax)) =====//
function getsubcat(cat) {
	texte = file('includes/ajax.php?action=getsubcat&cat=' + escape(cat));
	document.getElementById('subcat').innerHTML=texte;
}
