var loginformflag=false;
var loginformflag2=false;
var afterlogin="";
document.write('<script type="text\/javascript" src="/js/member_login.js"><\/script>');
document.write('<script type="text\/javascript" src="/js/prototype.js"><\/script>');
document.write('<script type="text\/javascript" src="/js/src/scriptaculous.js"><\/script>');
document.write('<script type="text\/javascript" src="/js/src/unittest.js"><\/script>');
function showMask(){
	if(loginformflag2==false){
		loginformflag2=true;
		maskobj = document.createElement('div');
		maskobj.id='loginmask';
		maskobj.style.position='absolute';
		maskobj.style.width=document.body.scrollWidth;
		maskobj.style.height=document.body.scrollHeight;
		maskobj.style.top="0px";
		maskobj.style.left="0px";
		document.body.appendChild(maskobj);
	}else{
		document.getElementById("loginmask").style.display="";
	}
}

function hideMask(){
		document.getElementById("loginmask").style.display="none";
}
function ajaxlogin(){
	afterinclude=false;
	if(loginformflag==false){
		loginformflag=true;
		tmpobj = document.createElement('div');
		tmpobj.id='ajaxloginform';
		tmpobj.style.position='absolute';
		tmpobj.style.top=(document.body.scrollTop+(document.body.clientHeight/2)-100)+"px";
		tmpobj.style.left=((document.body.clientWidth/2)-95)+"px";
		document.body.appendChild(tmpobj);
		makeRequest("/include/login.php","ajaxloginform","ajaxlogingrow","");
	}else{
		document.getElementById("ajaxloginform").style.top=(document.body.scrollTop+(document.body.clientHeight/2)-100)+"px";
		document.getElementById("ajaxloginform").style.left=((document.body.clientWidth/2)-95)+"px";
		ajaxlogingrow();
	}
}
function ajaxlogingrow(){
	showMask();
	document.getElementById("loginmask").onclick=function(){
		Effect.Shrink('ajaxloginform');
		document.getElementById("loginmask").style.display="none";
	}
	Effect.Grow('ajaxloginform');
}
function ajaxloginshrink(){
	Effect.Shrink('ajaxloginform');
	document.getElementById("loginmask").style.display="none";
}
function ajaxlogingo(){
	if(checkLogin()){
		afterinclude=true;
		ajaxstr="acc="+document.getElementById("acc").value+"&pwd="+document.getElementById("pwd").value;
		makeRequest("/member/member_login_ajax.php","","ajaxloginCallback","");
	}	
}
function ajaxloginCallback(t){
	if(t=="ok"){
		if(afterlogin==""){
			document.location.reload();
		}else{
			Effect.Shrink('ajaxloginform');
			eval(afterlogin);
		}
	}else if(t!=""){
		alert(t);
	}
}