
    var _TitleColor = '#003399';
    var _TitleSize = 20;
    var _TextColor = 'black';
    var _TextSize = 14;
    var _BorderPopupSize = 0;
    var _BorderPopupColor = '#003399';
    var _SAH = screen.availHeight;
    var _SAW = screen.availWidth;
    var _Width = 600;
    var _Height = 550;
    var _Opacity = 0.8;
    var _RePos;
    var calque,popup;
    
    function AlertPopup(width , height , title , text, loading, withoutback){
    		if(!loading) var loading = 0;
    		if(!withoutback) var withoutback = 0;
    		if(!title) var title = '';
        calque = document.createElement("DIV");
        document.body.appendChild(calque);
        calque.id = 'calque';
        calque.name = 'calque';
        calque.style.position = 'absolute';
        calque.style.top = 0 + 'px';
        calque.style.left = 0 + 'px';
        calque.style.width = '120%';
        calque.style.height = '120%';
        calque.style.backgroundColor = 'white';
        calque.style.opacity = _Opacity;
        calque.style.zIndex = 99;
        calque.style.filter = 'alpha(opacity=' + (_Opacity * 100) + ')';
        popup = document.createElement("DIV");
        document.body.appendChild(popup);
        popup.id = 'popup';
        popup.name = 'popup';
        popup.style.zIndex = 100;
        //popup.style.zIndex = 2;
        //popup.style.backgroundColor = 'white';
        popup.style.border = _BorderPopupSize + 'px solid ' + _BorderPopupColor;
        popup.style.width = width + 'px';
        popup.style.height = height + 'px';
       	var PosY = Math.round((_SAH-height)/7);
        var PosX = Math.round((_SAW-width)/2.5);
        popup.style.position = 'absolute';
        popup.style.top = PosY + 'px';
        popup.style.left = PosX + 'px';
        var data = '';
        if (withoutback == 0) {
	        data += '<table width="100%" class="txt_title_encadre" border="0" background="/resa/p/bgtab.gif" cellpadding="5" cellspacing="5">';
	      } else {
        	data += '<table width="100%" align="center" border="0" cellpadding="80" cellspacing="0">';
        } 
        data += '<tr class=txt>';
        if (loading == 0) {
        	data += '<td align="left">';
        } else {
        	data += '<td align="center">';
        }
        data += '<span style="font-size:'+ _TitleSize +'px;color:'+_TitleColor+';">';
        if (title != '') {
	        data += title +'</span></td><td align="right" valign="top">';
	      }
	      else {
  	      data += '</span></td><td align="right" valign="top">';
  	    } 
        if (loading == 0) {
        	data += '<input type="button" onclick="ClosePopup()" value="FERMER" class="aButton buttonsB" onmousedown="pushMe(this)" style="cursor:pointer;width: 139px;">';        	
      	}
        data += '</td></tr><tr class=txt><td colspan="2" align="center"><span style="font-size:'+ _TextSize +'px;color:'+_TextColor+';">';
        if (text == '') {
  				data += '</span></td></tr>';
        }
	      else {
  	      data += text +'</span></td></tr>';
  	    }
        
        data += '</table>';
        popup.innerHTML = data;
        _Width = width;
        _Height = height;
        if (document.all||document.getElementById||document.layers)
        _RePos = setInterval("RePosPopup();",20);
    }
    
    function RePosPopup(width,height){
        var PosX=document.all? document.body.scrollLeft : 
window.pageXOffset;
        var PosY=document.all? document.body.scrollTop : window.pageYOffset;
        PLg('calque').style.top = PosY + 'px';
        PLg('calque').style.left = PosX + 'px';
        PosY = Math.round((_SAH-_Height)/6) + parseInt(PosY);
        PosX = Math.round((_SAW-_Width)/2.5) + parseInt(PosX);
        PLg('popup').style.top = PosY + 'px';
        PLg('popup').style.left = PosX + 'px';
    }
    
    function ClosePopup(){
        clearTimeout(_RePos);
        document.body.removeChild(popup);
        document.body.removeChild(calque);
    }
      
