

	function funcTop_bg(command, isAutoClose)
	{
	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'top_bgform', './mp_topbg_upd.php', 400, 600);
	    return;
	}
	
	function funcKindUpdate(command, isAutoClose, mc_kind_code)
	{
	   
	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_kind_code',			mc_kind_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_kind_upd.php', 300, 300);
	    return;
	}




	function funcTemplateCategoryInsert(command, isAutoClose)
	{
		alert("commonad");
	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'insert', './mc_template_division_ins.php', 300, 150);
	    return;
	}
	
	function funcTemplateCategoryUpdate(command, isAutoClose, mc_template_division_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_template_division_code',			mc_template_division_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_template_division_upd.php', 300, 150);
	    return;
	}

	


	function funcObjectCategoryInsert(command, isAutoClose)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'insert', './mc_object_division_ins.php', 300, 120);
	    return;
	}
	
	function funcObjectCategoryUpdate(command, isAutoClose, mc_object_division_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_object_division_code',			mc_object_division_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_object_division_upd.php', 300, 120);
	    return;
	}
	


	function funcTemplateTextInsert(command, isAutoClose)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'insert', './mc_template_text_ins.php', 300, 150);
	    return;
	}
	
	function funcTemplateTextUpdate(command, isAutoClose, mc_template_text_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_template_text_code',			mc_template_text_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_template_text_upd.php', 300, 150);
	    return;
	}
	
	


	function funcTemplateInsert(command, isAutoClose)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'insert', './mc_template_ins.php', 800, 500);
	    return;
	}
	
	function funcTemplateUpdate(command, isAutoClose, mc_template_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_template_code',			mc_template_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_template_upd.php', 800, 500);
	    return;
	}
	
	function funcTemplateView(command, isAutoClose, mc_template_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_template_code',			mc_template_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'view', './mc_template_view.php', 800, 500);
	    return;
	}
	
	
	


	function funcBgCategoryInsert(command, isAutoClose)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'insert', './mc_bg_division_ins.php', 300, 150);
	    return;
	}
	
	function funcBgCategoryUpdate(command, isAutoClose, mc_bg_division_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_bg_division_code',			mc_bg_division_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_bg_division_upd.php', 300, 150);
	    return;
	}
	
	


	function funcBgInsert(command, isAutoClose)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'insert', './mc_bg_ins.php', 400, 200);
	    return;
	}
	
	function funcBgUpdate(command, isAutoClose, mc_bg_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_bg_code',			mc_bg_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_bg_upd.php', 400, 200);
	    return;
	}
	
	
	


	function funcObjectInsert(command, isAutoClose)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',              command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'insert', './mc_object_ins.php', 400, 200);
	    return;
	}
	
	function funcObjectUpdate(command, isAutoClose, mc_object_code)
	{

	    var form = makeForm(command);
	    makeHidden(command, 'command',				command);
	    makeHidden(command, 'isAutoClose',          isAutoClose);
	    makeHidden(command, 'mc_object_code',			mc_object_code);
	
	
	    var search_win = funcOpenDefaultWindow(form, 'POST', 'update', './mc_object_upd.php', 400, 200);
	    return;
	}
	
	



function makeHidden(command, key, val)
{
    if(key == null || key == '' || val == null) return null;
    var form = eval("document." + command);
    if(form == null) form = makeForm(command);

    var hid_obj = eval("form." + key);
    if(hid_obj != null) {
        hid_obj.value = val;
        return hid_obj;
    }

    hid_obj = document.createElement("<INPUT type='hidden' name='" + key + "' value='" + val + "'>");
    form.appendChild(hid_obj);
    return hid_obj;
}

function makeForm(command)
{
    var retVal = eval("document." + command);
    if(retVal != null) return retVal;
    var form = document.createElement("<FORM name='" + command + "'></FORM>");
    document.body.appendChild(form);
    return makeForm(command);
}

/*
function funcOpenDefaultWindow(form,method,target, url, width, height)
{
    return funcOpenWindow(form, method, target, url, 100, 60, width, height, 'no', 'no', 'yes', 'no', 'no');
}

function funcOpenWindow(form, method,target, url,  _left, _top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
    var toolbar_str   = (toolbar   == 0 || toolbar   == 'yes') ? 'yes' : 'no';
    var menubar_str   = (menubar   == 0 || menubar   == 'yes') ? 'yes' : 'no';
    var statusbar_str = (statusbar == 0 || statusbar == 'yes') ? 'yes' : 'no';
    var scrollbar_str = (scrollbar == 0 || scrollbar == 'yes') ? 'yes' : 'no';
    var resizable_str = (resizable == 0 || resizable == 'yes') ? 'yes' : 'no';

   var opened_win =  open('about:blank', target, 'left=' + _left + ',top=' + _top + ',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status=no,scrollbars=yes,resizable=yes');
    
    if( method.toUpperCase()== 'POST') {
        form.method = 'POST' ;
    }else {
        form.method = 'GET' ;
    }

    form.action = url ;
    form.target = target;
    form.submit() ;
    opened_win.focus();

    return opened_win;
}
*/




