//	Auteur 			: Dauvergne François-xavier
//	Mail 			: fxd@multi-hardware.com
//	Date de création 	: 23/07/2002
//	Modifié le 		: 23/07/2002 par Dauvergne François-xavier
//	Version 		: V1.0		
var site_aspi = false;

function changerStyleCellule(id,id2,test){
	objet = findObjet(id);
	if(test == 'on'){
		changerClasse(id,'celluleOn'); 
		changerStyle(id2,'color','#636973');
	}
	else{
		changerClasse(id,'celluleOut'); 
		changerStyle(id2,'color','#ffffff');
	}
}

function changerStyle(id,dest,valeur){
	objet = findObjet(id);
	switch(dest){
		case 'color':
			objet.style.color = valeur;
	}
}

function changerClasse(id,classe){
	objet = findObjet(id);
	objet.className = classe;
}

function changerImage(cible,source){
	findObjet(cible).src = source;
}

function OpenPopUp(Name, URL, width, height, barre, top, left)
{
	if(barre)barre = "yes";
	else barre = "no";
	if(top) top2 = top;
	else top2 = "50";
	if(left) left2 = left ;
	else left2 = "100";
	var wndopt = "width="+width+",height="+height+",top="+top2+",left="+left2+",toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=" + barre;
	NewWin = window.open(URL, Name, wndopt);
}

function redirect(lien,dest,n)
{
	if(dest)
		parent.frames[dest].location = lien;
	else if(n == "true")
		window.open(lien);
	else
		document.location.href = lien;
}

function confirmation(phrase,URL,dest)
{
	if(confirm(phrase))
		redirect(URL,dest);
}

function findObjet(id)
{
	objet = document.all?document.all[id]:document.getElementById(id);
	return objet;
}

// à virer apres develeoppement
function propriete(obj,nom)
{
	i = 0;
	resultat = "";
	for (i in obj)
	{
		resultat += nom + "." + i + " = " + obj[i] + "<br>";
	}
	document.write(resultat);
}

function setPointer(theRow, theAction, theDefaultClass, thePointerClass, theMarkClass)
{
    // 3. Gets the current class...
    var currentClass = null;
    var newClass     = null;
    currentClass = theRow.className;

    // 4. Defines the new class
    // 4.1 Current class is the default one
    if (currentClass == ''
        || currentClass.toLowerCase() == theDefaultClass.toLowerCase()) {
        if (theAction == 'over' && thePointerClass != '') {
            newClass = thePointerClass;
        }
        else if (theAction == 'click' && theMarkClass != '') {
            newClass = theMarkClass;
        }
    }
    // 4.1.2 Current class is the pointer one
    else if (currentClass.toLowerCase() == thePointerClass.toLowerCase()) {
        if (theAction == 'out') {
            newClass = theDefaultClass;
        }
        else if (theAction == 'click' && theMarkClass != '') {
            newClass = theMarkClass;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentClass.toLowerCase() == theMarkClass.toLowerCase()) {
        if (theAction == 'click') {
            newClass = (thePointerClass != '')
                     ? thePointerClass
                     : theDefaultClass;
        }
    } // end 4

    // 5. Sets the new class...
    if (newClass) {
        theRow.className = newClass;
    } // end 5

    return true;
}


function hideshow(div,imgname,path){
	var img = document.all[imgname]; 
	var state = document.all[div].style.display; 
	if (state=='') {
		document.all[div].style.display = 'none' ;
		img.src = path + "images/nodeclosed.gif";
	}
	else{
	 	document.all[div].style.display = '' ;
		img.src = path + "images/nodeopened.gif";
	}
	
}

