<!--

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if ( ( browserName == "Netscape" && browserVer >= 3 ) || ( browserName == "Microsoft Internet Explorer" && browserVer >= 4 ) ) {
        RollVersion = "yes";
} else {
        RollVersion = "no";
}
if ( browserName == "Netscape" && browserVer >= 3 ) {
        FocusVersion = "yes";
} else {
        FocusVersion = "no";
}

function PopFrameUrl(url,w,h) {
	var theparam = 'dependent=yes,z-lock=yes,titlebar=1,location=0,toolbar=no,directories=no,menubar=0,resizable=0,scrollbars=0,status=0,width=' + w + ',height=' + h;
	var pagezikmetalpop = window.open(url,'zikmetal',theparam);
	pagezikmetalpop.focus();
}

function PopFrameUrlNav(url,w,h) {
	var theparam = 'dependent=yes,z-lock=yes,titlebar=1,location=0,toolbar=no,directories=no,menubar=0,resizable=0,scrollbars=1,status=0,width=' + w + ',height=' + h;
	var pagezikmetalpop = window.open(url,'zikmetal',theparam);
	pagezikmetalpop.focus();
}

function PopFrameUrl_nav_centre(url,w,h) {
	
    var top = (screen.height - h) / 2;
    var left = (screen.width - w) / 2;
	var theparam = 'top=' + top + ',left=' + left + 'dependent=yes,z-lock=yes,titlebar=1,location=0,toolbar=no,directories=no,menubar=0,resizable=1,scrollbars=1,status=0,width=' + w + ',height=' + h;
	var pageviewerpop_nav = window.open(url,'freeviewer_nav',theparam);
	pageviewerpop_nav.focus();
}

function confirm_delete(page) {
	confirmation = confirm('Etes-vous sûr de vouloir supprimer cet élément ?');
	if (confirmation) {
		window.location.replace(page);
	}
}

function confirm_valider(page) {
	confirmation = confirm('Etes-vous sûr de vouloir valider ?');
	if (confirmation) {
		window.location.replace(page);
	}
}

function favoris() {
 if ( navigator.appName != 'Microsoft Internet Explorer' ){
          window.sidebar.addPanel("Moteur de recherche French-Spider","http://www.spider-fr.com/","");
     }
  else {
        window.external.AddFavorite("http://www.spider-fr.com/","Moteur de recherche French-Spider");
    }
 }
 
 function multiClass(eltId) {
	arrLinkId = new Array('_0','_1','_2','_3');
	intNbLinkElt = new Number(arrLinkId.length);
	arrClassLink = new Array('current','ghost');
	strContent = new String()
	for (i=0; i<intNbLinkElt; i++) {
		strContent = "menu"+arrLinkId[i];
		if ( arrLinkId[i] == eltId ) {
			document.getElementById(arrLinkId[i]).className = arrClassLink[0];
			document.getElementById(strContent).className = 'on content';
		} else {
			document.getElementById(arrLinkId[i]).className = arrClassLink[1];
			document.getElementById(strContent).className = 'off content';
		}
	}	
}

function getXhr(){
    var xhr = null; 
	if(window.XMLHttpRequest) // Firefox et autres
		xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ // Internet Explorer 
		try {
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
			    xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
	}
	else { // XMLHttpRequest non supporté par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   xhr = false; 
	} 
    return xhr
}
			
function gestion_fav(id_element,is_ajout){
	var xhr = getXhr();
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
		// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
		if(xhr.readyState == 4 && xhr.status == 200){
			leselect = xhr.responseText;
			// On se sert de innerHTML pour rajouter les options a la liste
			document.getElementById('liste').innerHTML = leselect;
		}
	}

	// Ici on va voir comment faire du post
	xhr.open("POST","http://www.spider-fr.com/raccourci.php",true);
	// ne pas oublier ça pour le post
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	// ne pas oublier de poster les arguments
	// ici, l'id
	if (is_ajout == true) {
		xhr.send("id="+id_element);
	} else {
		xhr.send("action=delete&id="+id_element);
	}
}

//-->
