
function memoirechemin(codeRubrique,codeSousRubrique)
{
	//parent.VO_MenuDroite.memoire.chemininternaute_nompage.value=document.body.name;
	//parent.VO_MenuDroite.memoire.rubrique_code.value=codeRubrique;
	//parent.VO_MenuDroite.memoire.sousrubrique_code.value=codeSousRubrique;
	//parent.VO_MenuDroite.afficheNavigation();
}


/*if (document.layers)
{
    window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
    window.onmousedown=rightclick;
    window.onmouseup=rightclick;

    function rightclick(e)
	{
    	if (e.which == 3) {
    		// Put right mouse code here
    		alert('Source indisponible.');
    		return false;
    	}
   	 	else {
        	return true;
        }
    }
}
if (document.all)
{
	function click()
	{
		if (event.button==2) {
			alert('Source indisponible.');
			return false;
		}
		if (event.button==3) {
			alert('Source indisponible');
			return false;
		}
	}
    document.onmousedown=click
}
*/

function configMenu(ID, DEFINE_FICHIER_NAME, MODE_COMPORTEMENT, HIDE_NIVEAU1_ARTICLES, DEFINE_RUBRIQUE, NOM_PAGE, obj)
{
	//alert(""+NOM_PAGE);
	var popConfigMenu = window.open("../avipi/composants/configMenu.php?ID="+ID+"&DEFINE_FICHIER_NAME="+DEFINE_FICHIER_NAME+"&MODE_COMPORTEMENT="+MODE_COMPORTEMENT+"&HIDE_NIVEAU1_ARTICLES="+HIDE_NIVEAU1_ARTICLES+"&DEFINE_RUBRIQUE="+DEFINE_RUBRIQUE+"&NOM_PAGE="+NOM_PAGE,"configMenu","Width=800px,Height=500px,scrollbars=0,status=0");
	popConfigMenu.focus(); 
}

function afficherFormIP()
{
	popNewsLetter = window.open("../ip_verification_formulaire.php","IP","Width=400px,Height=220px,scrollbars=0,status=0");
}

function HomePage(aUrlSite, obj)
{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage(aUrlSite);
}

function addPageToMyFavorite(aPageUrl, aPageName) {
	
	qtitle = ""+aPageName;

	if( window.sidebar && window.sidebar.addPanel ) {
		//Gecko (Netscape 6 etc.) - add to Sidebar
		window.sidebar.addPanel(qtitle, aPageUrl, '' );
	} else if( window.external && ( navigator.platform == 'Win32' || ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) ) {
		//IE Win32 or iCab - 
		window.external.AddFavorite(aPageUrl,qtitle);
	} else if( window.opera && window.print ) {
		//Opera 6+ - add as sidebar panel to Hotlist
		return true;
	} else if( document.layers ) {
		//NS4 & Escape - tell them how to add a bookmark quickly (adds current page,
		//not target page)
		window.alert( 'Please click OK then press Ctrl+D to create a bookmark' );
	} else {
		//other browsers - tell them to add a bookmark (adds current page, not target page)
		window.alert( 'Please use your browser\'s bookmarking facility to create a bookmark' );
	}
	return false;
}

function showNumeroPage(the_form, numeroPage)
{
	if (typeof(document.forms[the_form].action_formulaire) != 'undefined') {
		eval ("document.forms[the_form]."+the_form+"numero_page.value=numeroPage");
		document.forms[the_form].submit();
	}
	return true;
}

function setNombreOccurenceParPage(the_form)
{
	if (typeof(document.forms[the_form].action_formulaire) != 'undefined') {
		//document.forms[the_form].occurences_par_pages.value=nombreOccurence;
		document.forms[the_form].submit();
	}
	return true;
}

function order(the_form, champTable, champOrdre)
{
	if (typeof(document.forms[the_form].action_formulaire) != 'undefined') {
		document.forms[the_form].ordre_critere.value=champTable;
		document.forms[the_form].ordre_valeur.value=champOrdre;
		document.forms[the_form].submit();
	}
	//articles_afficher.action_formulaire.value='suppression';
	//articles_afficher.submit();
	return true;
}

// ************************************************************
// POUR LE ALT EN DYNAMIQUE HTML - PAR LE STUDIO - ATOS ORIGIN
// ************************************************************

// 1] D?tection du navigateur
	var ns4=(document.layers)? true:false;
	var ns6=(document.getElementById)? true:false;
	var ie4=(document.all)? true:false;
	var ie5=false;
	if(ie4){
		if((navigator.userAgent.indexOf('MSIE 5')> 0)||(navigator.userAgent.indexOf('MSIE 6')> 0)){
			ie5=true;
		}
		if(ns6){
			ns6=false;
		}
	}

var x=0; var y=0;

if (ns4) { document.captureEvents(Event.MOUSEMOVE); }
document.onmousemove = foncAlt;

// 1bis] D?tection de la r?solution
if (screen.width >= 800 && !ns4) {
  var scraper=true;
} else {
  var scraper=false;
}


// 2] Mouvement de la souris - Grand public
function showAlt(txt) {
	var coulBord = "#000000";
	var coulFond = "#ffffdd";
	var coulTxt = "#000000";
	
	contenu = '<table style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; border: '+coulBord+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; -moz-opacity:0.75; filter: alpha (opacity=75); background-color: '+coulFond+'" border="0" cellspacing="1" cellpadding="1"><tr><td nowrap><font style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: '+coulTxt+'">';
	contenu=contenu+unescape(txt)+'</font></td></tr></table> '; 
	longueur = getTailleDiv(unescape(txt));
	creaAlt(contenu);
}

function getTailleDiv(txt) {
	var result =0;
	var re = new RegExp ('<br>', 'gi') ;
	var textetmp= txt.replace(re,'<BR>');
	var re2 = new RegExp ('?', 'gi') ;
	var texte= textetmp.replace(re2,'e');
	var lignes = texte.split("<BR>");
	for (i=0;i< lignes.length;i++) {
		if (lignes[i].length> result) {
			result=lignes[i].length;
		}
	}
	return result*5;
}

// 2bis] Mouvement de la souris - Pro
function showPro(txt) {
	var coulBord = "#FFC60A";
	var coulFond = "#FFEBAA";
	var coulTxt = "#000000";
	contenu = '<table width="245" style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; border: '+coulBord+'; border-style: solid; border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; background-color: '+coulFond+'" border="0" cellspacing="1" cellpadding="4"><tr><td><font style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: '+coulTxt+'">'+unescape(txt)+'</font></td></tr></table> ';
	creaAlt(contenu);
}

function showPubAlt(txt) {
	var coulBord = "#000000";
	var coulFond = "#FFFFFF";
	var coulTxt = "#000000";
	contenu = '<table width="140" style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; border: '+coulBord+'; border-style: solid; border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; background-color: '+coulFond+'" border="0" cellspacing="1" cellpadding="4"><tr><td><font style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: '+coulTxt+'">'+txt+'</font></td></tr></table> ';
	creaAlt(contenu);
}
var longueur=0;
// 3] Cr?ation du contenu du layer
function creaAlt(contenu) {
	if (ie4 || ie5) {
		if (longueur) {
			x=  window.ALTdHTML.style.left.substr(0,window.ALTdHTML.style.left.indexOf("px"))*1;

			if (x  > document.body.clientWidth- (longueur)) {
				if (x-longueur <0) {
					window.ALTdHTML.style.left=0;
				} else {
					window.ALTdHTML.style.left=x-longueur;
				}
				
			}
		}
		window.ALTdHTML.innerHTML=contenu;
		window.ALTdHTML.style.visibility='visible';
	}
  if (ns4) {
		document.layers["ALTdHTML"].document.write(contenu);
		document.layers["ALTdHTML"].document.close();
		document.layers.ALTdHTML.visibility='show';
	}
  if (ns6) {
		if (longueur) {
			x=  document.getElementById("ALTdHTML").style.left.substr(0,document.getElementById("ALTdHTML").style.left.indexOf("px"))*1;

			if (x  > document.body.clientWidth- (longueur)) {
				if (x-longueur <0) {
					document.getElementById("ALTdHTML").style.left=0;
				} else {
					document.getElementById("ALTdHTML").style.left=x-longueur;
				}
				
			}
		}
		document.getElementById("ALTdHTML").innerHTML=contenu;
		document.getElementById("ALTdHTML").style.visibility='visible';
		
  }
}
LIMIT =160;
// 4] Positionner le layer
function foncAlt(evt) {

	if (ie4 || ie5) {
		x=event.clientX+document.body.scrollLeft; y=event.clientY+document.body.scrollTop;
		window.ALTdHTML.style.left=x+10;
		if (longueur) {
			x=  window.ALTdHTML.style.left.substr(0,window.ALTdHTML.style.left.indexOf("px"))*1;

			if (x  > document.body.clientWidth- (longueur)) {
				if (x-longueur <0) {
					window.ALTdHTML.style.left=0;
				} else {
					window.ALTdHTML.style.left=x-longueur;
				}
				
			}
		}
	  	window.ALTdHTML.style.top=y+14;
	}
	if (ns4) {
		x = (navigator.appName.substring(0,3) == "Net") ? evt.pageX : event.x+document.body.scrollLeft;
		y = (navigator.appName.substring(0,3) == "Net") ? evt.pageY : event.y+document.body.scrollTop;
		document.layers.ALTdHTML.left=x+10;
		document.layers.ALTdHTML.top=y+14;
	}
	if (ns6) {
		x=evt.clientX+document.body.scrollLeft; y=evt.clientY+document.body.scrollTop;
	  	document.getElementById("ALTdHTML").style.left=x+10;
	  	if (longueur) {
			x=  document.getElementById("ALTdHTML").style.left.substr(0,document.getElementById("ALTdHTML").style.left.indexOf("px"))*1;

			if (x  > document.body.clientWidth- (longueur)) {
				if (x-longueur <0) {
					document.getElementById("ALTdHTML").style.left=0;
				} else {
					document.getElementById("ALTdHTML").style.left=x-longueur;
				}
				
			}
		}
	  	document.getElementById("ALTdHTML").style.top=y+14;
	}
}

// 5] Effacer le layer
function hideAlt() {
	if (ie4 || ie5) {
		window.ALTdHTML.style.visibility='hidden';
		window.ALTdHTML.innerHTML="";
		longueur=0;
	}else if (ns4) {
		document.layers.ALTdHTML.visibility='hide';
		document.layers["ALTdHTML"].document.write("");
		document.layers["ALTdHTML"].document.close();
	}else if (ns6) {
		document.getElementById("ALTdHTML").style.visibility='hidden';
		document.getElementById("ALTdHTML").innerHTML="";
		longueur=0;
	}
}



var selectArrayIMG = new Array();  // Variable globale sous forme de tableau dans laquelle sont stock?es les champs IMG
var selectArrayA = new Array();

function initializeADMIN() {
	// IMAGES
	// ------
	var selects = document.getElementsByTagName("img"); 
	selectArrayIMG = new Array(selects.length);   				//on fixe la taille de notre variable globale en fonction du nombre de liste qu'elle va recevoir
   	for(var i = 0; i < selects.length; i++){
		
		// Ev?nements
		// ----------
		selectArrayIMG[i] = selects[i].cloneNode(true);
		selects[i].attachEvent("onmouseover",function(){showPro('<b>IMAGE</b><br>Ajouter une PopUp Zoom<br>');});
		/*var w = ""+selects[i].width;
		var h = ""+selects[i].height;
		var s = ""+selects[i].src;
		selects[i].attachEvent("onclick",function(){load(w, h, s);*/
		selects[i].attachEvent("onmouseout",function(){hideAlt();});
	}
	
	
		
	// A
	// -
	var tagsA = document.getElementsByTagName("a"); 
	selectArrayA = new Array(tagsA.length);   				//on fixe la taille de notre variable globale en fonction du nombre de liste qu'elle va recevoir
   	
	var lTargetLibelle = "";
	var lTargetValue = "";
	var lTarget = "";
	
	for(var i = 0; i < tagsA.length; i++){
		lTarget = "";
		// Target du Lien
		// --------------
		lTargetLibelle = "";
		lTargetValue = "";
		/*if (selects[i].onclick!=undefined && selects[i].onclick!=null)
			alert(""+selects[i].onclick);
		*/
		lTarget=""+tagsA[i].target;
			/*if (lTarget!='')
				alert(""+tagsA[i].target+tagsA[i].href);*/
			if (eval(tagsA[i].target=='_self'))
				lTargetValue = "fen?tre actuelle";
			else if (eval(tagsA[i].target=='_blank'))
				lTargetValue = "nouvelle fen?tre";
		
		if (lTargetValue!='')
			lTargetLibelle = "Cible : "+lTargetValue;
			
		
		// Ev?nements
		// ----------
		selectArrayA[i] = tagsA[i].cloneNode(true);
		
		tagsA[i].attachEvent("onmouseover",function(){showPro('<b>LIEN</b><br>'+lTargetLibelle+'<br>');});
		/*var w = ""+selects[i].width;
		var h = ""+selects[i].height;
		var s = ""+selects[i].src;
		selects[i].attachEvent("onclick",function(){load(w, h, s);*/
		tagsA[i].attachEvent("onmouseout",function(){hideAlt();});
		
	}               
}

function load(img_width, img_height, img_src){ 
l=parseInt(img_width)+20+"px";
L=parseInt(img_height)+20+"px";
win2=window.open(img_src,'image','width='+l+',height='+L);
win2.focus();
}

function showDestinataires(type, id_categorie)
{
	popSelectionner = window.open("../../../avipi/membres/admin/utilisateurs_afficher.php?origine="+type+"&id_categorie="+id_categorie,"Destinataires","Width=600px,Height=400px,scrollbars=1,status=0");
	popSelectionner.focus();
}





