function loadContent(urlVal,pageWidth) 
{
   
    $jq("#mainbody_sub").html('');
    $jq.ajax({
        url: urlVal,
        success: function(data) {
            $jq("#mainbody_sub").html('');
            $jq("#mainbody_sub").html(data);
        }
    });
    
    if(pageWidth) curpageWidth=pageWidth;else curpageWidth=600;
    $jq("#mainbody_sub").dialog({
        bgiframe: true,
        closeOnEscape: false,
        width:curpageWidth,
        position: 'top'
    });

    
    //    $('#mainbody_sub').fadeIn('slow');
    var maskHeight = parseInt($jq(document).height(), 10)+parseInt(document.getElementById('mainbody_sub').offsetHeight, 10) ;
    var maskWidth = $jq(window).width();

    //Set height and width to mask to fill up the whole screen
    
    $jq('#mask').css({
        'width':maskWidth,
        'height':maskHeight
    });

    if(jQuery.browser.msie){
        if((jQuery.browser.version)<=6.0)
        {
            $jq('#mask').css({
                position:"absolute"
            });
            $jq('#mask').css({
                'width':maskWidth,
                'height':parseInt(maskHeight, 10)+ parseInt($jq("#mainbody_sub").width(), 10)
            });
        }
        else{
            $jq('#mask').css({
                position:"fixed"
            });
        }
    }
    else
    {
        $jq('#mask').css({
            position:"fixed"
        });
    }  
    
    $jq('#mask').show();
     
}

function closeContent()
{
    //$('#mainbody_sub').remove();
    $jq('#mainbody_sub').hide();
    $jq('#mainbody_sub').dialog('destroy');
    $jq('#mask').hide();

}




//
function clearDisplayMainBox()
{
    $("#resultBoxMain").html('');
    $('#resultBoxMain').hide();
}
function clearDisplayBox()
{
    $("#resultBox").html('');
    $('#resultBox').hide();
}

function increaseMainDivHeight()
{
    if(jQuery.browser.msie){
        if((jQuery.browser.version)<=6.0)
        {
            var maskHeight = parseInt($(document).height(),10) ;
            var maskWidth = $(window).width();

            //Set height and width to mask to fill up the whole screen
            $('#mask').css({
                'width':maskWidth,
                'height':parseInt(maskHeight, 10)+ parseInt($("#mainbody_sub").width(), 10)
            });
        }
    }
}

