
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var div_name="";

//---------------------------------------------------------------------------------------
// Handle all the the FSCommand messages in a Flash movie
function setVisible(obj)
{
	obj = document.getElementById(obj);
	obj.style.display = (obj.style.display == 'block') ? 'none' : 'block';
}

//--------------------------------------------------------------------------------------

function ShowDialog(x)
{

var scrollTop = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
var scrollLeft = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;

//get viewport's width and height
vpWidth=document.body.clientWidth;
vpHeight=document.body.clientHeight;

//get dialog's width and height
dialogWidth=x.offsetWidth;
dialogHeight=x.offsetHeight;

//calculate position
dialogTop = (vpHeight/2) - (dialogHeight/2)+scrollTop;
dialogLeft = (vpWidth/2) - (dialogWidth/2)+scrollLeft;


//Position the Dialog


x.style.top =dialogTop+"px";
x.style.left =dialogLeft+"px";

x.style.display="block";

}

//-------------------------------------------------------------------------------------
function LayerPos(){
if (div_name.style.display=="block"){
ShowDialog(div_name);

}
}

//-------------------------------------------------------------------------------------
function initialize(a){
// Hook for Internet Explorer
div_name=document.getElementById(a);



window.onscroll = LayerPos;
window.onresize = LayerPos;
window.onMinimize = LayerPos;
window.onMaximize  = LayerPos;
  document.body.scrollTop=1;
  document.body.scrollTop=0;
  document.body.scrollLeft=1;
  document.body.scrollLeft=0;
 ShowDialog(div_name);
}