var diapo=1;
var posim;
var ImaFlag=new Array();
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else {var expires = "";}
	document.cookie = name+"="+value+expires+"; path=/";
}

function visi(nr){
	if (document.layers)
	{
		vista = (document.layers[nr].visibility == 'hide') ? 'show' : 'hide'
		document.layers[nr].visibility = vista;
	}
	else if (document.all)
	{
		vista = (document.all[nr].style.visibility == 'hidden') ? 'visible'	: 'hidden';
		document.all[nr].style.visibility = vista;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.visibility == 'hidden') ? 'visible' : 'hidden';
		document.getElementById(nr).style.visibility = vista;

	}
}

function blocking(nr){
	if (document.layers)
	{
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		posim = (document.layers[nr].display == 'none') ? 1 : 2;
		document.layers[nr].display = current;
	}
	else if (document.all)
	{
		current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
		posim = (document.all[nr].display == 'none') ? 1 : 2;
		document.all[nr].style.display = current;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		posim= (document.getElementById(nr).style.display == 'none') ? 1: 2;
                document.getElementById(nr).style.display = vista;
	}
}

function show(no,rub,prod) {
	window.open('../comite/db/add.cgi?no='+no+'&rub='+rub+'&prod='+prod,'_blank','toolbar=0,location=0,directories=0,status=1,scrollbars=yes,resizable=1,copyhistory=0,menuBar=0,width=950,height=580');
}
function add(prod,ref,nb,listin) {
	window.open('../comite/db/add.cgi?listin='+listin+'&prod='+prod+'&ref='+ref+'&nrb='+nb,'_blank','toolbar=0,location=0,directories=0,status=0,scrollbars=yes,resizable=1,copyhistory=0,menuBar=0,width=850,height=780');
}

function chImage(tddef,img){
        newImage = "url(images/" + img + ")";

        if (document.getElementById){
                document.getElementById(tddef).style.backgroundImage = newImage;
        }
        else if (document.all){
                document.all(tddef).style.backgroundImage = newImage;
        }
        else if (document.layers){
        document.layers(tddef).style.backgroundImage = newImage;
        }

}
var posI=new Array();
function chImagedirect(tddef,psim){
        if (posI[psim]==1){
                newImage="images/plus.gif";
                posI[psim]=2;
        }
        else{
                newImage="images/moins.gif";
                posI[psim]=1;
        }
        Ima=document.images[tddef];
        Ima.src=newImage;
}

function confdel(file,name,msg,lk){
        if (confirm(msg)==1){
                window.location.href=lk;
        }
}
function confirm_lk(msg,lk){
        if (confirm(msg)==1){
                window.location.href=lk;
        }
}
texte2 = '...transfert...                                       ';
x = texte2.length-1;
place = 0;
var fields= new Array('attente','manageid','manageid2');
function addInput() { 
var parent2 = document.getElementById('managit')
  if (document.layers) {
    var parent=document.layers["manageid"];
    }
  if (document.all) {
    var parent=document.all["manageid"];
  }
  else if (document.getElementById) {
    var parent=document.getElementById("manageid");
  }
var element = null;
try { // IE
    element = document.createElement('<input type="file" name="file" size="28" onClick="addInput()">');
    } 
catch (e) { // W3C
    element = document.createElement("input");
    element.setAttribute("type", "file");
    element.setAttribute("name", "file");
    element.setAttribute("size", "28");
    element.setAttribute("onClick", "addInput()");
    }
parent.appendChild(element);
}

function otop(lk){
        top.otop.location.href=lk;
}
function changeImage(im,num){
        top.liste_f.document.images[im].src=(top.liste_f.document.images[im].src.match("images/flagg.gif"))?"images/flagr.gif":"images/flagg.gif";
        ImaFlag[num]=(top.liste_f.document.images[im].src.match("images/flagg.gif"))?"images/flagg.gif":"images/flagr.gif";
}
