
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var div_name="";
//---------------------------------------------------------------------------------------
// Handle all the the FSCommand messages in a Flash movie
function richbanner_DoFSCommand(command, args) {
  var richbannerObj = InternetExplorer ? richbanner : document.richbanner;
  //
  // Place your code here...
  //
  if (command=="closebanner"){
  
  div_name.style.display= "none";
  }
}

//--------------------------------------------------------------------------------------

function ShowDialog(x)
{
//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)+document.body.scrollTop;
dialogLeft = (vpWidth/2) - (dialogWidth/2)+document.body.scrollLeft;


//Position the Dialog


x.style.top =dialogTop+"px";
x.style.left =dialogLeft+"px";

a = 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);
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	ttt='<SCRIPT LANGUAGE=VBScript\> \n';
	ttt+='on error resume next \n';
	ttt+='Sub richbanner_FSCommand(ByVal command, ByVal args)\n';
	ttt+='  call richbanner_DoFSCommand(command, args)\n';
	ttt+='end sub\n';
	ttt+='</SCRIPT\> \n';
	
	
	document.body.InnerHTML+=ttt;
	
}



ShowDialog(div_name);

window.onscroll = LayerPos;
window.onresize = LayerPos;
window.onMinimize = LayerPos;
window.onMaximize  = LayerPos;
}
