// JavaScript windowDiv class
function windowDiv(name)
{
    // DIV object element
	this.c = document.getElementById( name);
    // Wait time property
    this.waitTime = 6000;
    // from top
	this.centrato = true;
    this.removeTopMargin = 0;
	this.marginTop = 0;
	this.marginLeft = 0;
	this.marginRight = 0;
	this.marginBottom = 0;
	
    // set position
    this.setPosition = function()
    {
        this.c.style.width = this.c.offsetWidth;
        this.c.style.height = this.c.offsetHeight;
        if( this.centrato)
		{
			this.c.style.top = "50%";
        	this.c.style.left = "50%";
		}
		else
		{
			this.c.style.top = 0;
        	this.c.style.left = 0;
		}
		this.c.style.marginTop = ( !this.marginTop) ? (0 - (( this.c.offsetHeight / 2) - this.removeTopMargin)) + "px" : this.marginTop;
		this.c.style.marginLeft = ( !this.marginLeft) ? (0 - ( this.c.offsetWidth / 2)) + "px" : this.marginLeft;
		this.marginRight = "0px";
        this.marginBottom = "0px";
		//alert( this.c.Width);
    }
    
    // hide method
    this.hide = function()
    {
        this.c.style.visibility = 'hidden';
    }
    
    // show method
    this.show = function()
    {      
		if( this.centrato)
        	this.setPosition();
        var	self = this;
    	this.c.style.visibility = 'visible';
    	setTimeout( function() { self.hide(); }, this.waitTime);
    }
}
