<!--
var tampon;

//Fonction permettant de changer une variable de session de nom 'nom' par la valeur 'valeur'
//Si le formulaire form est préciser, il est posté
function chgSession(nom, valeur, form)
{
	if(document.getElementById("iframe_session"))
		document.getElementById("iframe_session").contentWindow.location="../_include/sessions.asp?nomvariable="+nom+"&valeurvariable="+valeur;
	if(form)
		form.submit();
}

//Validation de formulaire
function isInteger(s)
{
	return /^\d+$/.test(s);
}

//changement de couleurs séléction/déselection liste
/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;

/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
	var theCells = null;

	// 1. Pointer and mark feature are disabled or the browser can't get the
	//    row -> exits
	if ((thePointerColor == '' && theMarkColor == '')
		|| typeof(theRow.style) == 'undefined') {
		return false;
	}

	// 2. Gets the current color...
	var domDetect    = null;
	var currentColor = null;
	var newColor     = null;
	// 2.1 ... with DOM compatible browsers except Opera that does not return
	//         valid values with "getAttribute"
	if (typeof(window.opera) == 'undefined'
		&& typeof(theRow.getAttribute) != 'undefined') {
		currentColor = theRow.getAttribute('bgcolor');
		domDetect    = true;
	}
	// 2.2 ... with other browsers
	else {
		currentColor = theRow.style.backgroundColor;
		domDetect    = false;
	} // end 2

	// 3. Defines the new color
	// 3.1 Current color is the default one
	if (currentColor == ''
		|| currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
		if (theAction == 'over' && thePointerColor != '') {
			newColor              = thePointerColor;
		}
		else if (theAction == 'click' && theMarkColor != '') {
			newColor              = theMarkColor;
			marked_row[theRowNum] = true;
	}}
	// 3.1.2 Current color is the pointer one
	else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
			&& (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
		if (theAction == 'out') {
			newColor              = theDefaultColor;
		}
		else if (theAction == 'click' && theMarkColor != '') {
			newColor              = theMarkColor;
			marked_row[theRowNum] = true;
	}}
	// 3.1.3 Current color is the marker one
	else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
		if (theAction == 'click') {
			newColor              = (thePointerColor != '')
								  ? thePointerColor
								  : theDefaultColor;
			marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
								  ? true
								  : null;
	}} // end 3

	// 4. Sets the new color...
	if (newColor) {
		var c = null;
		// 4.1 ... with DOM compatible browsers except Opera
		if (domDetect) {
			theRow.setAttribute('bgcolor', newColor, 0);
		}
		// 4.2 ... with other browsers
		else {
			theRow.style.backgroundColor = newColor;
	}} // end 4

	return true;
} // end of the 'setPointer()' function

function upload (objet, fichier) {
	if (objet!='')
	{
		window.open("../download/SelectFile.asp?file="+fichier+"&object="+objet,"UPLOAD","width=800,height=600,left=0,top=0,scrollbars=yes,resizable=no");
	}	
	else
	{																				
		window.open("../download/SelectFile.asp","UPLOAD","width=800,height=600,left=0,top=0,scrollbars=yes,resizable=no");
	}
}

function ajouter() {
	chgSession("CURRENT_ID", -1);
	document.location = "fiche.asp";
}

function supprimer(texteSuppression){
  if(confirm("Supprimer ce" + texteSuppression + " ?"))
  {
    document.f.operation.value = "SUPPRIMER";
	document.f.action = "maj_fiche.asp";
	document.f.submit();
  }
}

function valider(){
	if(typeof(window["tinyMCE"]) != "undefined")
		tinyMCE.triggerSave();
	if(typeof(window["_valider"]) != "undefined")
		_valider();
 	document.f.submit();
}

function findPosX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
		while(1) 
		{
		  curleft += obj.offsetLeft;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.x)
		curleft += obj.x;
	return curleft;
	}
	
function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
		  curtop += obj.offsetTop;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
}

var xhr = null;

function get_xhr() 
{
    if (window.XMLHttpRequest)
        xhr = new XMLHttpRequest();
	else if (window.ActiveXObject) 
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	else
		alert("La requête ne peut être effectué car votre navigateur ne supporte pas XMLHTTPRequest.");
}

function PositionneDivSurMouse(e, nomdiv, decalagex, decalagey)
{
	var NavEvent,x_mouse,y_mouse;
	NavEvent=window.event||e;
	x_mouse=NavEvent.clientX||NavEvent.x||NavEvent.pageX;
	y_mouse=NavEvent.clientY||NavEvent.y||NavEvent.pageY;
	if (e.clientX || e.clientY)
	{
		x_mouse = x_mouse + document.body.scrollLeft + document.documentElement.scrollLeft;
  		y_mouse = y_mouse + document.body.scrollTop + document.documentElement.scrollTop;
	}	
	document.getElementById(nomdiv).style.top = y_mouse + decalagey;
	document.getElementById(nomdiv).style.left = x_mouse + decalagex;
 }
 
lastScrollY=0;
function MoveBanniere(Obj){
  Labanniere=document.getElementById(Obj);
  diffY=document.body.scrollTop-91;
  if(diffY<0) diffY=0;
  if (!document.body.scrollTop) diffY=document.documentElement.scrollTop;
 
  if(diffY != lastScrollY){
    percent=0.1 * (diffY-lastScrollY);
 
    if(percent>0) { percent=Math.ceil(percent); }
    else          { percent=Math.floor(percent); }
 
    Labanniere.style.top = parseInt(Labanniere.style.top) + percent + "px";
    lastScrollY += percent;
  }
}
function wait(){
action=window.setInterval("MoveBanniere('MenuCommande')",10);
}
window.setTimeout("wait();",500);



function maj_rss()
{
    window.open("../RSS/maj_rss.asp","MajRSS","width=300,height=200,scrollbars=no,resizable=no");
}

function export_abonnes()
{
    window.open("../newsletter/export_abonnes.asp","ExportAbonnes","width=300,height=200,scrollbars=no,resizable=no");
}


function RePositionneSommaire()
{
var menu_commande = document.getElementById("MenuCommande");
if(menu_commande) menu_commande.style.left = (findPosX(document.getElementById("logoCFK")) + ((227 - 227) / 2)) + "px";
	//logo MW + largeur du logo - largeur du menu de commande
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//-->
