
// FONCTION POUR AJAX
var xhr = null; 
function getXhr(){
	if(window.XMLHttpRequest)xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ 
		try{
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}else{
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest, veuillez le mettre à jour..."); 
		xhr = false; 
	} 
}



// POUR LE TOP MENU EN CSS : pour affichage correct sous IE6 du menu déroulant (IE7 n'a pas besoin de ce hack)
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



// POUR L'OUVERTURE AUTOMATIQUE DES SELECT
function ListeSelect(url,haut,gauche,largeur,hauteur,options){
	window.open(url,"","top="+haut+",left="+gauche+",width="+largeur+",height="+hauteur+","+options);
}



// POUR LES POPUPS
function popup(page) {
   Window=window.open(page, "pop", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=650,height=400");
} 

function popup2(page,width,height) {
   Window=window.open(page, "pop", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+width+",height="+height+"");
} 

function popup3(page,width,height) {
   Window=window.open(page, "pop", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width="+width+",height="+height+"");
} 


// POUR SAUTER LE CURSEUR
function autotab(original,destination){ 
	if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
	destination.focus()
}


// POUR OUVRIR LES CATALOGUES INTERACTIFS
function openPublishBox(Url) {
Window = window.open(Url,'publishBoxF','top=1,left=1,width='+screen.availWidth+',height='+screen.availHeight+',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no');
}
