function CoverBody(id , page)
{
	var pages = new Array();
    pages['game'] = "/game.php?id=";
	pages['print'] = "quick-p.php?id=";
	pages['contact'] = "comentariu.php?id=";
	
	
    this.div_color      = '#5C758E';
    this.page_size      = PageSize.getPageSize();
    this.page_scrool    = PageSize.getPageScroll();
    this.objBody        = document.getElementsByTagName("body").item(0);
    this.objOverId      = "over";
    this.objCloseId     = "close";
    this.objInnerId     = "inner";
    this.objInnerWidth  = 670;
    this.objInnerHeight = 520;
    this.objCloseHeight = 100;
    this.objInnerSrc = pages[page]+ id;
}

CoverBody.prototype.CreateOver = function ()
{
    this.objOver                    = document.createElement("div");
    this.objOver.id                 = this.objOverId;
    this.objOver.name               = this.objOverId;
    this.objOver.style.position     = 'absolute';
    this.objOver.style.top          = '0';
    this.objOver.style.left         = '0';
    this.objOver.style.zIndex       = '99';
    this.objOver.style.width        = '100%';
    this.objBody.insertBefore(this.objOver, this.objBody.firstChild);
    this.objOver.style.height       = (this.page_size[1] + 'px');
    this.objOver.style.display      = 'block';
    this.objOver.style.border       = '0px;';
    this.objOver.style.background   = this.div_color;
    this.objOver.style.opacity      = '0.25';
    this.objOver.style.filter       = 'alpha(opacity=25 )';

}

CoverBody.prototype.CreateInner = function()
{
    this.objInner                   = document.createElement("div");
    this.objInner.id                = this.objInnerId;
    this.objInner.style.position    = 'absolute';
    this.objInner.style.zIndex      = '100';
    this.objInner.style.background  = '#ffffff';
    this.objInner.style.border      = "none";
    this.objBody.appendChild(this.objInner);
    this.objInner.style.top         = (this.page_scrool[1] + ((this.page_size[3]  - this.objInnerHeight) / 2) + 'px');
    this.objInner.style.left        = (((this.page_size[0] -  this.objInnerWidth) / 2) + 'px');


    this.objInnerFrame                  = document.createElement("iframe");
    this.objInnerFrame.style.width      = this.objInnerWidth+ "px";
    this.objInnerFrame.style.height     = this.objInnerHeight + "px";
    this.objInnerFrame.frameBorder      = "0";
    this.objInnerFrame.border           = "0";
    this.objInnerFrame.scrolling        = "no";
    this.objInnerFrame.name        	 = "rec";
    this.objInnerFrame.id        	 = "rec";
    this.objInnerFrame.src              = this.InnerSrc();
    this.objInner.appendChild(this.objInnerFrame);
}

CoverBody.prototype.CreateClose = function ()
{
    this.objClose                   = document.createElement("div");
    this.objClose.id                = this.objCloseId;
    this.objClose.style.position    = 'absolute';
    this.objClose.style.right       = '5px';
    this.objClose.style.top         = '8px';
    this.objClose.style.zIndex      = '200';
    this.objClose.style.background  = '';
    this.objClose.onclick           = "remov()";
    this.objClose.innerHTML         ="<div style='margin:3px 10px 0 0;'><a href='#' onclick='remov();return false;'><img src='/images/cover/close.gif' /></a></div>";
    this.objInner.appendChild(this.objClose);
}

CoverBody.prototype.CreateRefresh = function ()
{
    this.objRefresh                   = document.createElement("div");
    this.objRefresh.id                = this.objCloseId;
    this.objRefresh.style.position    = 'absolute';
    this.objRefresh.style.right       = '40px';
    this.objRefresh.style.top         = '8px';
    this.objRefresh.style.zIndex      = '200';
    this.objRefresh.style.background  = '#ffffff';
    this.objRefresh.onclick           = "remov()";
    this.objRefresh.innerHTML         ="<div ><a href='#' onclick='refresh();return false;'>Refresh</a></div>";
    this.objInner.appendChild(this.objRefresh);


}

CoverBody.prototype.Create = function () {
    this.CreateOver();
    this.CreateInner();
    this.CreateClose();
}

CoverBody.prototype.InnerSrc = function ()
{
    return this.objInnerSrc;
}

CoverBody.prototype.Remove = function()
{
   var objOver = document.getElementById(this.objOverId)
   var objInner= document.getElementById(this.objInnerId);
    try {
        this.objBody.removeChild(objOver);
        this.objBody.removeChild(objInner);
    } catch(e) {

    }
}

function repport_abuz( id , page) {
    cvr = new CoverBody( id , page);
    cvr.Create();
    return false;
}

function remov()
{
    cvr.Remove();
}