document.write('<link rel="stylesheet" href="js/system.css" type="text/css" media="screen"/>');
document.write('<link rel="stylesheet" href="js/jquery-ui-1.7.1.custom/css/smoothness/jquery-ui-1.7.1.custom.css" type="text/css" media="screen"/>');
document.write('<script type="text/javascript" src="js/jquery-ui-1.7.1.custom/js/jquery-1.3.2.min.js"></script>');
document.write('<script type="text/javascript" src="js/jquery-ui-1.7.1.custom/js/jquery-ui-1.7.1.custom.min.js"></script>');
document.write('<script type="text/javascript" src="js/jquery-ui-1.7.1.custom/development-bundle/ui/i18n/ui.datepicker-zh-CN.js"></script>');

function fnInitDatepicker(strID)
{
    var objQ = $('#' + strID);
    objQ.css('width', '100px');
    objQ.datepicker({dateFormat: 'yy-mm-dd', changeMonth:true, changeYear:true});
}

function fnAppendDialog(strHtml)
{
    $(document.body).append(strHtml);
}

function fnInitDialog(strDivID, strTitle, iWidth, iHeight)
{
    $("#" + strDivID).dialog({
        modal:true,
        title:strTitle,
        resizable:true,
        draggable:$.browser.msie ? false : true,
        bgiframe:true,
        height:iHeight,
        width:iWidth,
        dialogClass:"cls_dialog_border"
    }).bind('dialogclose', function(event, ui){
        /*
        $(this).parent('div').parent('div').empty();
        $("body div:last").replaceWith('');
        */
        $("#" + strDivID).replaceWith('');
    });
}

function fnCloseDialog(strDivID)
{
    $("#" + strDivID).dialog('close');
}
