
var submitFlg = 0;

function submitfrm(action, proc, cmd)
{

    var frms = document.mainfrm;
    frms.action = action;
    frms.target = "_self";  //add
    frms.prc.value = proc;
    frms.cmd.value = cmd;
    frms.submit();
    submitfrm = blockIt;
    return false;
}

function selectfrm(action, proc, cmd, sid)
{
    var frms = document.mainfrm;
    frms.sid.value = sid;
    submitfrm(action, proc, cmd);
}

function pagefrm(action, proc, cmd, pno)
{
    var frms = document.mainfrm;
    frms.pno.value = pno;
    submitfrm(action, proc, cmd);
}

function submitFormEx(action, proc, cmd)
{
    var frms = document.forms[0];
    frms.action = action;
    frms.prc.value = proc;
    frms.cmd.value = cmd;
    frms.submit();
    submitFormEx = blockIt;
    return false;
}

function getfrm(action, proc, cmd)
{
    var frms = document.mainfrm;
    frms.action = action;
    frms.target = "_self";  //add
    frms.prc.value = proc;
    frms.cmd.value = cmd;
    frms.method = "get";
    frms.submit();
}

function blockIt()
{
    return false;
}

function setImgInfo(id, w, h)
{
    var img = document.getElementById(id);

    img.width = w;
    img.height = h;
}

function openWinZoom(id)
{
    var i = new Image();
    var img = document.getElementById(id);
    i.src = img.src;
    var x = (screen.width - 620)/2;
    var y = (screen.height - 620)/2;
    var pop_win = window.open('','popup','width=620,height=640,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=' + x + ',top=' + y);

    pop_win.window.document.open();
    pop_win.window.document.write('<html>'
                                  + '<head><title>IMAGE</title></head>'
                                  + '<body style="margin:0;padding:0;border:0;">'
                                  + '<div align="center">'
                                  + '<a href="#" onClick="window.close();"><img src="'+i.src+'" alt="" border=0 /></a>'
                                  + '<br /><br />'
                                  + '<a href="#" onClick="window.close();"><img src="../images/products/close.gif" alt="" border="0" /></a>'
                                  + '</div align="center">'
                                  + '</body>'
                                  + '</html>'
                                  );
    pop_win.window.document.close();
    pop_win.window.focus();
}

function markLine(id)
{
    deleteLine();

    var img = document.getElementById(id);
    if (img != null) {
        img.src = 'images/detail_color_mo.gif';
    }
}

function deleteLine()
{
    for(i=0;i<10;i++) {
        var img = document.getElementById("colorm" + i);
        if (img != null) {
            img.src = 'images/detail_color_st.gif';
        }
    }

}
