
function showBox(id){
	//jQuery("#freedays_construction").html('<img src="/lib/i/loadingAnimation.gif">');
	jQuery('#overlay').show();
	//jQuery('#box').show();
	jQuery('#box').css('display', 'block');
	
	//get_dialog_params(id);
    return false;
}

function hideBox(){
    //$('#box').hide();
    jQuery('#overlay').css('display', 'none');
    jQuery('#box').css('display', 'none');
	//jQuery('#overlay').hide();
    return false;
}

function center_dialog(objid){
   
    var my_width  = 0;
    var my_height = 0;

    if ( typeof( window.innerWidth ) == 'number' ){
        my_width  = window.innerWidth;
        my_height = window.innerHeight;
    }else if ( document.documentElement  && 
             ( document.documentElement.clientWidth ||
               document.documentElement.clientHeight ) ){
        my_width  = document.documentElement.clientWidth;
        my_height = document.documentElement.clientHeight;
    }
    else if ( document.body  && 
            ( document.body.clientWidth || document.body.clientHeight ) ){
        my_width  = document.body.clientWidth;
        my_height = document.body.clientHeight;
    }
	$(objid).css('position','absolute');
	$(objid).css('zIndex','10001');

    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 setX = ( my_width  - $(objid).width()  ) / 2;
    var setY = ( my_height - $(objid).height() ) / 2 + scrollY;

    setX = ( setX < 0 ) ? 0 : setX;
    setY = ( setY < 0 ) ? 0 : setY;

	
	$(objid).css('left',setX);
	$(objid).css('top',setY);
	$(objid).css('display','block');

    
}

