i10020 = new Image; i10020.src = "images/erreur/bg_ok_from.png";
i10021 = new Image; i10021.src = "images/erreur/bg_ok_mid.png";
i10022 = new Image; i10022.src = "images/erreur/bg_ok_to.png";
i10023 = new Image; i10023.src = "images/erreur/bg_error_from.png";
i10024 = new Image; i10024.src = "images/erreur/bg_error_mid.png";
i10025 = new Image; i10025.src = "images/erreur/bg_error_to.png";

$(document).ready( function (){
    $("#layerScreenError").hide();
    $("#layerScreenError").animate({opacity: 0.0},0,function(){$(this).hide();});
    $("#layerScreenMsgError").animate({opacity: 0.0},0,function(){$(this).hide();});
});


/* ERREURS */
// variable globale - gère le calque écran erreur
var layerinOutErr = 0;

// fonction de gestion d'erreur - (inOut =1: Affiche, =0: Désaffiche)
function LayerScreenError(inOut)
{
  // Affiche si le calque écran n'est pas déjà affiché
  if ( inOut==1 && layerinOutErr==0 )
  {
    // indique que le calque écran est utilisé
    layerinOutErr=1;
    $("#layerScreenError").show(); $("#layerScreenError").animate({opacity: 0.7},150,function() { layerinOutErr=0; });
    $("#layerScreenMsgError").show(); $("#layerScreenMsgError").animate({opacity: 1.0},150,function() { layerinOutErr=0; });
  }
  
  // Maintient l'affichage si le calque est déjà affiché sinon l'affiche
  if ( inOut==0 && layerinOutErr==0 )
  {
    $("#layerScreenError").animate({opacity: 0.0},600,function(){$(this).hide();});
    $("#layerScreenMsgError").animate({opacity: 0.0},600,function(){$(this).hide();});
  }
}

// fonction de gestion d'erreur - (ok, error)
function LayerScreenErrorCustom(style, text)
{
  switch (style)
  {
    case "ok": document.getElementById("layerScreenMsgError").innerHTML = '<div class="section_ok_from"></div><div class="section_ok_content">'+text+'<br /><div align="center"><input type="button" value="Retour" onclick="LayerScreenError(0);" /></div></div><div class="section_ok_to"></div>'; break;
    case "error": document.getElementById("layerScreenMsgError").innerHTML = '<div class="section_error_from"></div><div class="section_error_content">'+text+'<br /><div align="center"><input type="button" value="Retour" onclick="LayerScreenError(0);" /></div></div><div class="section_error_to"></div>'; break;
  }
}
