<? require_once("ajax.inc.php"); ?> <div class="SFIABDialog" id="SFIABDialog" style="position: absolute; visibility: hidden;"> <div class="SFIABDialogInner" id="SFIABDialogInner"></div> </div> <div id="FadeScreenDiv" style="visibility: hidden; top: 0px; left: 0px;"></div> <script type="text/javascript"> var SFIABDialogGrowWidth=0; var SFIABDialogGrowHeight=0; var SFIABDialogFinalWidth=100; var SFIABDialogFinalHeight=100; var SFIABDialogGrowWidthStep=0; var SFIABDialogGrowHeightStep=0; var SFIABDialogGrowTime=0; //0 means no animation, i dont know why i coded the animation thing to begin with, who knows, maybe we'll want it somewhere at some point var SFIABDialogGrowSteps=5; var SFIABDialogInnerPre='<form id="SFIABDialogForm" method="post" action="<?=$_SERVER['PHP_SELF']?>">'; var SFIABDialogInnerPost='<table width="100%"><tr><td style="width: 50%; text-align: center;"><input onclick="return SFIABDialogSubmit()" type="submit" value="<?=i18n("Save")?>"></td><td style="text-align: center;"><input onclick="return SFIABDialogCancel()" type="button" value="<?=i18n("Cancel")?>"></td></tr></table></form>'; function SFIABDialog(e, url, width, height) { var posx = 0; var posy = 0; //get this going while we do the other stuff SFIABDialogFill(url); if(!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } var d=document.getElementById('SFIABDialog'); var di=document.getElementById('SFIABDialogInner'); var fs=document.getElementById('FadeScreenDiv'); fs.style.visibility="visible"; d.style.top=posy+'px'; d.style.left=posx+'px'; di.style.visibility='hidden'; if(SFIABDialogGrowTime==0) { d.style.visibility='visible'; d.style.width=width+"px"; d.style.height=height+"px"; } else { //expand it in over time... SFIABDialogGrowWidth=1; SFIABDialogGrowHeight=1; //set the final width&&height SFIABDialogFinalWidth=width; SFIABDialogFinalHeight=height; //set the steps SFIABDialogGrowWidthStep=Math.round(width/SFIABDialogGrowSteps); SFIABDialogGrowHeightStep=Math.round(height/SFIABDialogGrowSteps); //set the size to start us off, and go visible d.style.width=SFIABDialogGrowWidth+"px"; d.style.height=SFIABDialogGrowHeight+"px"; d.style.visibility='visible'; //startup the timer setTimeout('growDialog()',Math.round(SFIABDialogGrowTime/SFIABDialogGrowSteps)); } return false; } function growDialog() { SFIABDialogGrowWidth+=SFIABDialogGrowWidthStep; SFIABDialogGrowHeight+=SFIABDialogGrowHeightStep; if(SFIABDialogGrowWidth>SFIABDialogFinalWidth) SFIABDialogGrowWidth=SFIABDialogFinalWidth; if(SFIABDialogGrowHeight>SFIABDialogFinalHeight) SFIABDialogGrowHeight=SFIABDialogFinalHeight; var d=document.getElementById('SFIABDialog'); d.style.width=SFIABDialogGrowWidth+"px"; d.style.height=SFIABDialogGrowHeight+"px"; if(SFIABDialogGrowWidth<SFIABDialogFinalWidth || SFIABDialogGrowHeight<SFIABDialogFinalHeight) { setTimeout('growDialog()',Math.round(SFIABDialogGrowTime/SFIABDialogGrowSteps)); } else { var di=document.getElementById('SFIABDialogInner'); di.style.visibility="visible"; } } function SFIABDialogFill(url) { var d=document.getElementById('SFIABDialogInner'); d.innerHTML=""; d.style.visibility='hidden'; http.open("GET",url,true); http.onreadystatechange=SFIABDialogFillResponse; http.send(null); } function SFIABDialogFillResponse() { try { if(http.readyState==4) { var di=document.getElementById('SFIABDialogInner'); var objhtml=http.responseText; di.innerHTML=SFIABDialogInnerPre+objhtml+SFIABDialogInnerPost; di.style.visibility='visible'; } } catch (e) { } } function SFIABDialogSubmit() { //we let it submit the form, which reloads the page return true; } function SFIABDialogCancel() { var d=document.getElementById('SFIABDialog'); var di=document.getElementById('SFIABDialogInner'); var fs=document.getElementById('FadeScreenDiv'); fs.style.visibility="hidden"; d.style.visibility="hidden"; di.style.visibility="hidden"; return false; } </script>