function CoverBody(div_color, page, width, height)
{
    this.div_color      = div_color;
    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  = width ? width :620;
    this.objInnerHeight = height ? height :300;
    this.objCloseHeight = 100;
    this.objInnerSrc    = page;

}

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       = '0';
    this.objOver.style.background   = this.div_color;
    this.objOver.style.opacity      = '0.5';
    this.objOver.style.filter       = 'alpha(opacity=50 )';

}


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        	    = "ed_quote";
    this.objInnerFrame.id        	    = "ed_quote";
    this.objInnerFrame.src              = this.InnerSrc();
    this.objInner.appendChild(this.objInnerFrame);
//    alert(this.objInnerFrame.name);

}

CoverBody.prototype.CreateClose = function ()
{
    this.objClose                   = document.createElement("div");
    this.objClose.id                = this.objCloseId;
    this.objClose.style.position    = 'absolute';
    this.objClose.style.right       = '3px';
    this.objClose.style.top         = '3px';
    this.objClose.style.zIndex      = '200';
    this.objClose.style.background  = '';
    this.objClose.onclick           = "remov()";
    this.objClose.innerHTML         ="<a href='#' onclick='remov();return false;' class='close_blue'>inchide</a>";
    this.objInner.appendChild(this.objClose);
}

CoverBody.prototype.Create = function () {
    this.CreateOver();
    this.CreateInner();
    this.CreateClose();
}

CoverBody.prototype.InnerSrc = function ()
{
    return this.objInnerSrc;

}

CoverBody.prototype.Remove = function(rel)
{
   
   try {
        this.objBody.removeChild(document.getElementById(this.objOverId));
        this.objBody.removeChild(document.getElementById(this.objInnerId));
        if (rel) {
            top.window.location.reload(false);
        }
    } catch(e) {

    }

}


