2    //Copyright(C) 1999 DeNA Co,,Ltd. All rights reserved.

    function isIE() {
        if (navigator.appName.toLowerCase().indexOf('microsoft') > -1) {
           return true;
        }
        return false;
    }

    function useIEunescape() {
        if (navigator.appName.toLowerCase().indexOf('microsoft') > -1) {
            return true;
        } else {
            if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
                return true;
            }
        }
        return false;   // NN 4.x, NN 6.x, NN7.x(J)
    }

    function useIEunescapeLike() {
        // returns true if the browser must use unescape_likeIE(), false otherwise.
        if (navigator.userAgent.toLowerCase().indexOf('safari') > -1) {
            return true;
        }
        return false;
    }

    // unescape %uHHHH to string samely as IE's unescape();
    //   for browsers that cannot use their own unescape().
    function unescape_likeIE(value) {
        var t = value.split('%u');
        if (t.length > 1) {
            var s = [ ];
            for (var i = 1; i < t.length; i++) {
                s[i] = String.fromCharCode(parseInt(t[i], 16));
            }
            value = s.join('');
            return value;
        }
    }

    function getValueFromCookie(key) {
        var cookies = document.cookie;
        var cValue = '';
        var index   = cookies.indexOf(key);
        if (index > -1) {
            if (cookies.indexOf(';',index) > 0) {
                cValue =  cookies.substring(
                              cookies.indexOf('=',index) + 1, cookies.indexOf(';',index));
            } else {
                cValue =  cookies.substring(
                              cookies.indexOf('=',index) + 1, cookies.length);
            }
        }
        return cValue;
    }
    
    function toEscape(encodeStr) {
        var retStr = '';
        for (var i=0; i<encodeStr.length; i++) {
            var c = encodeStr.charAt(i);
            if (c == '+') {
                retStr += '%20';
            } else {
                retStr += c;
            }
        }
        return retStr;        
    }
        
    function getNickName() {
        var encodeStr = getValueFromCookie('A_NICKNAME');
        if (getValueFromCookie('A_USERSTATUS').length > 0) {

            if (useIEunescapeLike()) {
                // for browsers that cannot use their own unescape()
                return unescape_likeIE(encodeStr.substring(
                           encodeStr.indexOf('%u'), encodeStr.length));
            }

            if (useIEunescape()) {
                return unescape(encodeStr.substring(
                           encodeStr.indexOf('%u'), encodeStr.length));
            } else {
                return unescape(toEscape(encodeStr.substring(0,encodeStr.indexOf('%u')))); 
            }
        } else {
            return '';
        }
    }

        function isLogin() {
        if (getValueFromCookie('A_USERSTATUS').length > 0) {
            return true;
        } else {
            return false;
        }
    }

    function showNickName() {
        var name = getNickName();
	if (name.length > 0) {
            document.write(name + "さん、ようこそ！<BR>");
	} else {
	    document.write("ゲストさん、ようこそ！<BR>");
	}
	return;
    }

    function showLoginIcon() {
	if (isLogin()) {
            document.write("<a href=/dap/sv/Logout?><img src=/image/logout.gif width=115 height=32 border=0 ALT=サインアウト></a>");
	} else {
	    document.write("<a href=/dap/sv/Login?><img src=/image/login.gif width=115 height=32 border=0 ALT=サインイン></a>");
	}
	return; 
    }

function jump_aURL(f)
{
        param = f.options[f.selectedIndex].value;
        if (param != "") {
                location = "%prop.http.server.path_BID%" + param;
        }
}
function jump_rURL(f)
{
        param = f.options[f.selectedIndex].value;
        if (param != "") {
                location = param;
        }
}
