// JavaScript Document
// login.js
//
// DAMART - 09/02/2007

// variable et fonction sp?cifique a la page des coordonnees
var popUpMDP, popUpAdresse, popUpFond, prefixe;

window.onload = function(){
	popUpFond = new fx.Opacity('popUpFond');
}

function afficheModMDP(text){
  popUpFond = new fx.Opacity('popUpFond');
  popUpMDP= new fx.Opacity('modifPass');
  //switchListeCombo(0);
  afficheFauxPopup('modifPass','popUpFond', 200, popUpMDP, popUpFond, text);
  document.getElementById('popUpFond').style.width = "100%";
  //document.getElementById('popUpFond').style.height = document.getElementById('body').offsetHeight+"px";
}

function fermerModMDP(){
  fermerFauxPopUp(popUpMDP, popUpFond);
  //switchListeCombo(1);
}

function afficheFauxPopup(elt, eltprin, valtop, fader1, fader2, text){
	scrolling=Position.realOffset($(elt))[1];
	$(elt).style.top=(scrolling)+valtop;
	fader1.now=0;
	fader1.toggle();
	fader2.now=0;
	fader2.custom(0, 0.35);
	$(eltprin).style.left=0;
	$(eltprin).style.top=0;
	//$(eltprin).style.height=document.body.scrollHeight;
	
	//document.getElementById('text').innerHTML = text;
}

function fermerFauxPopUp(fader1, fader2){
	if(fader1.now>0 && fader2.now>0){
		fader1.custom(fader1.now, 0);
		fader2.custom(fader2.now, 0);
	}
}

//Ajout de fonctions pour calque de modification de ligne
function display(action, idPopUp){
	//if(action == "update_line"){
		popUpFond = new fx.Opacity('popUpFond');
		document.getElementById('popUpFond').style.height = document.getElementById('container').offsetHeight+"px";
		document.getElementById('popUpFond').style.width = "100%";
		var popUpMDP = idPopUp;
		afficheModModifLigne(idPopUp);
		document.getElementById(idPopUp).style.display="block";
	//}
}

//Ajout de fonctions pour calque de suppression de ligne
function display2(action, idPopUp, product){
	if(action == "delete_lines_confirmation"){
		popUpFond = new fx.Opacity('popUpFond');
		afficheModModifLigne(idPopUp);
	}
}

function afficheModModifLigne(text){
  popUpMDP= new fx.Opacity(text);
  //switchListeCombo(0);
  afficheFauxPopup(text,'popUpFond', 200, popUpMDP, popUpFond, text);
}

