function DivPopup() { this.bgdiv; this.windiv; this.addBackgroundDiv=function() { var d=document.createElement("div"); d.id="bgopaquediv"; d.style.backgroundColor="#000000"; d.style.position="absolute"; d.style.width="100%"; d.style.height="100%"; d.style.left=d.style.top=0; d.style.opacity=0.3; d.style.filter="alpha(opacity=30)"; d.style.zIndex=1000; document.body.appendChild(d); return d; }; this.addWinDiv=function(w,h) { var d=document.createElement("div"); d.id="windiv"; d.style.backgroundColor="#ffffff"; d.style.position="absolute"; d.style.width=w; d.style.height=h; d.style.marginLeft=-(w/2); d.style.marginTop=-(h/2); d.style.left="50%"; d.style.top="50%"; d.style.border="5px double black"; d.style.padding="5px"; d.style.zIndex=1001; document.body.appendChild(d); return d; }; this.render=function(w,h,htmlstr,cb) { this.bgdiv=this.addBackgroundDiv(); this.windiv=this.addWinDiv(w,h); this.windiv.innerHTML=htmlstr; this.callback=cb; }; this.close=function() { this.windiv.parentNode.removeChild(this.windiv); this.bgdiv.parentNode.removeChild(this.bgdiv); }; } // Will be used by the return stuff var alternateAddressesPopUp=new DivPopup(); var alternateAddressesArray=new Array(); function displayAlternativeAddressesPopUp(htmlAddresses) { var renderHtml="Merci de choisir une adresse:

"+htmlAddresses; renderHtml+="

choisir   fermer
"; alternateAddressesPopUp.render(400,100,renderHtml,1) } function addBackgroundDiv_() { var d=document.createElement("div"); d.id="bgopaquediv"; d.style.backgroundColor="#000000"; d.style.position="absolute"; d.style.width="100%"; d.style.height="100%"; d.style.left=d.style.top=0; d.style.opacity=0.3; d.style.filter="alpha(opacity=30)"; document.body.appendChild(d); } function addWinDiv_(w,h) { var d=document.createElement("div"); d.id="windiv"; d.style.backgroundColor="#ffffff"; d.style.position="absolute"; d.style.width=w; d.style.height=h; d.style.marginLeft=-(w/2); d.style.marginTop=-(h/2); d.style.left="50%"; d.style.top="50%"; d.style.border="5px double black"; d.style.padding="20px"; document.body.appendChild(d); }