function showBox(){
    center('box');
    $('overlay').show();
    if($('box').style.height>$('overlay').style.height)
    {
    	heightValue=$('box').style.height+100;
    	heightValue=heightValue+"px";
    } else {
       	heightValue="100%";
    }

    $('overlay').style.height=heightValue;
    
    return false;
}

function hideBox(){
    $('box').hide();
    $('overlay').hide();
    return false;
}

function center(element){
    try{
        element = $(element);
    }catch(e){
        return;
    }

    var my_width  = 0;

    if ( typeof( window.innerWidth ) == 'number' ){
        my_width  = window.innerWidth;
    }else if ( document.documentElement && 
             ( document.documentElement.clientWidth ) ){
        my_width  = document.documentElement.clientWidth;
    }
    else if ( document.body &&
            ( document.body.clientWidth ) ){
        my_width  = document.body.clientWidth;
    }

    element.style.position = 'absolute';
    element.style.zIndex   = 99;

    var scrollY = 0;

    if ( document.documentElement && document.documentElement.scrollTop ){
        scrollY = document.documentElement.scrollTop;
    }else if ( document.body && document.body.scrollTop ){
        scrollY = document.body.scrollTop;
    }else if ( window.pageYOffset ){
        scrollY = window.pageYOffset;
    }else if ( window.scrollY ){
        scrollY = window.scrollY;
    }

    var elementDimensions = Element.getDimensions(element);

    var setX = ( my_width  - elementDimensions.width  ) / 2;

    setX = ( setX < 0 ) ? 0 : setX;

    element.style.left = setX + "px";

    element.style.display  = 'block';
}