var modal_callback = null; // the modal_callback should return TRUE if the supplied data is correct, FALSE otherwise function showModalInit(callback){ $('modal_mask').style.height = document.body.scrollHeight + "px"; $('modal_mask').style.width = document.body.scrollWidth + "px"; $('modal_mask').style.zIndex = 9999997; //9999998 is the modal dialogue $('modal_mask').className = "modal_mask"; $('modal').style.height = document.body.scrollHeight + "px"; $('modal').style.width = document.body.scrollWidth + "px"; $('modal').style.zIndex = 9999998; //9999999 is the blocker modal_callback = callback; } function hideModal(){ $('modal').style.zIndex = -1; $('modal').style.cursor = ''; $('modal').innerHTML = ''; $('modal_mask').style.zIndex = -1; $('modal_mask').className = ''; modal_callback = null; } // modals v.2 var modal_callbacks = new Array(); var modals = 0; function createModalLayer(callback){ modals++; // increasing the layer modal_callbacks[modals] = callback; // setting the callback for this layer var modalmask_name = 'modalmask_'+modals; // new MASK DIV name var modal_name = 'modal_'+modals; // new MODAL DIV name // create the mask layer $('modal').innerHTML += "
"; $(modalmask_name).style.height = document.body.scrollHeight + "px"; $(modalmask_name).style.width = document.body.scrollWidth + "px"; // create the modal(content) layer $('modal').innerHTML += ""; $(modal_name).style.height = document.body.scrollHeight + "px"; $(modal_name).style.width = document.body.scrollWidth + "px"; return modals; } function removeTopModalLayer(){ if(modals == 0){ return } var modalmask_name = 'modalmask_'+modals; // new MASK DIV name var modal_name = 'modal_'+modals; // new MODAL DIV name // create the mask layer $('modal').removeChild($(modalmask_name)); $('modal').removeChild($(modal_name)); modal_callbacks[modals] = null; modals--; if(modals == 0){ hideModal() } } function createModalFrame(p){ var ww = p.width || 360; var hh = p.height || 200; var ll = p.left || 200; var bgc = p.bgc || "#a00"; var brdc = p.brdc || "#f00"; var ss = p.scrolls || "hidden"; var ttl = p.title || ""; var tt = p.top || 50; var pp = p.parent; var bb = p.brd || 5; var bs = p.brds || "solid"; var cp = p.pcont || false; var sh = document.createElement('div'); sh.style.width = ((ww+20+bb*2)*1)+"px"; sh.style.height = ((hh+20+bb*2)*1)+"px"; sh.style.left = (ll-10)+"px"; sh.style.top = (tt-10)+"px"; sh.style.position = "absolute"; sh.style.opacity = 0.3; sh.style.filter = "Alpha(opacity=30)"; sh.innerHTML = ""+cont+"