
function showDialog(popup,veil)
{
  
if(document.getElementById ){
var x = document.getElementById(popup);
var y = document.getElementById(veil);

//get viewport's width and height
var myWidth = 0, myHeight = 0;
 if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth-16;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } 

vpWidth=myWidth;
vpHeight=myHeight;


//get scroll
var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }


scrollX= scrOfX;
scrollY=scrOfY;



//get Document Height
 var docHeight;
if (document.compatMode && document.compatMode != 'BackCompat') {
docHeight = document.documentElement.scrollHeight;
}
else if (document.body && typeof document.body.scrollHeight !=
'undefined') {
docHeight = document.body.scrollHeight;
}


//get dialog's width and height
dialogWidth=x.offsetWidth;
dialogHeight=x.offsetHeight;

//calculate position
dialogTop = (vpHeight/2) - (dialogHeight/2)+(scrollY);
dialogLeft = (vpWidth/2) - (dialogWidth/2);

//Position the Dialog
x.style.top =dialogTop+"px";
x.style.left =dialogLeft+"px";
y.style.height =docHeight+"px";

}
}