function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g,"");
}
function getCookie(name){
	var datas = document.cookie.split(";");
	for( var i = 0 ; i < datas.length ; i++ )
	{
		var values = trim(datas[i]).split("=",2);
		if( values[0] == name )
			return values[1];
	}
	return null;
}
function removeCookie(name,path,domain)
{
    var strCookie=name+"=";
    if(!path) path="/";
    strCookie+="; path="+path;
    if(domain) {
        strCookie+="; domain="+domain;
    }
    strCookie+="; expires=Thu,1 Jan 1970 00:00:01 UTC";
    if(getCookie(name)){
        document.cookie=strCookie;
    }
}
function mbr_init() 
{
	if( getCookie("otpw")==null ||getCookie("otpw")=="" )
	{
		document.getElementById("__logout__").style.display="none";
		document.getElementById("__login__").style.display="";
	}else{
		document.getElementById("__login__").style.display="none";
		document.getElementById("__logout__").style.display="";
	}
	setTimeout("mbr_init()",1000);
}
mbr_init();
