function auth() {
	var email = $('#auth_email').val();
	var password = $('#auth_password').val();
	var hasError = false;
	var e_p = '';
	var e_e = '';
	$('#e_e').hide();
	$('#e_p').hide();
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	if(email == '') {
		hasError = true;
		e_e = a_e5;
	}
	if(!hasError && password == '') {
		hasError = true;
		e_p = a_e4;
	}
	if (!hasError && !emailReg.test(email)) {
		hasError = true;
		e_e = a_e2;
	}
	if(hasError == false) {
		try {
			if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
				$("body","html").css({height: "100%", width: "100%"});
				$("html").css("overflow","hidden");
				if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
					$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				}
			}else{//all others
				if(document.getElementById("TB_overlay") === null){
					$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
				}
			}
			if(tb_detectMacXFF()){
				$("#TB_overlay").addClass("TB_overlayMacFFBGHack");
			}else{
				$("#TB_overlay").addClass("TB_overlayBG");
			}
			$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");
			$('#TB_load').show();
		}
		catch(e) {
		}
		var postdata = {'user_login': email, 'user_pw': password, 'enter':1};
		$.post(auth_action, postdata, function(data){
			if (data == 'ok') {
				window.location = window.location;
				return;
			}
			if (data == 'error0') e_e = a_e6;
			if (data == 'error1') e_p = a_e3;
			if (data == 'error2') e_e = a_e1;
			if (e_e != '') {
				$('#e_e').html(e_e);
				$('#e_e').show();
			}
			if (e_p != '') {
				$('#e_p').html(e_p);
				$('#e_p').show();
			}
			tb_remove();
		});
	}
	else {
		if (e_e != '') {
			$('#e_e').html(e_e);
			$('#e_e').show();
		}
		if (e_p != '') {
			$('#e_p').html(e_p);
			$('#e_p').show();
		}
	}
}
function remind() {
	var email = $('#remind_email').val();
	var hasError = false;
	var r_e = '';
	$('#r_e').hide();
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	if(email == '') {
		hasError = true;
		r_e = r_e1;
	}
	if (!hasError && !emailReg.test(email)) {
		hasError = true;
		r_e = r_e2;
	}
	if(hasError == false) {
		try {
			if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
				$("body","html").css({height: "100%", width: "100%"});
				$("html").css("overflow","hidden");
				if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
					$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				}
			}else{//all others
				if(document.getElementById("TB_overlay") === null){
					$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
				}
			}
			if(tb_detectMacXFF()){
				$("#TB_overlay").addClass("TB_overlayMacFFBGHack");
			}else{
				$("#TB_overlay").addClass("TB_overlayBG");
			}
			$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");
			$('#TB_load').show();
		}
		catch(e) {
		}
		var postdata = {'forgotpw': email};
		$.post(remind_action, postdata, function(data){
			if (data == 'ok') {
				alert(r_s);
				block('register', 'remind');
			}
			if (data == 'error') r_e = r_e3;
			if (r_e != '') {
				$('#r_e').html(r_e);
				$('#r_e').show();
			}
			tb_remove();
		});
	}
	else {
		if (r_e != '') {
			$('#r_e').html(r_e);
			$('#r_e').show();
		}
	}
}
function register() {
	var email = $('#reg_email').val();
	var name = $('#reg_name').val();
	var phone = $('#reg_phone').val();
	var hasError = false;
	var r_e = '';
	$('#g_e').hide();
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	if(email == '') {
		hasError = true;
		r_e = g_e1;
	}
	if (!hasError && !emailReg.test(email)) {
		hasError = true;
		r_e = g_e2;
	}
	if (!hasError && (name == '' || name == g_t1)) {
		hasError = true;
		r_e = g_e3;
	}
	if (!hasError && (phone == '' || phone == g_t2)) {
		hasError = true;
		r_e = g_e4;
	}
	if(hasError == false) {
		try {
			if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
				$("body","html").css({height: "100%", width: "100%"});
				$("html").css("overflow","hidden");
				if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
					$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				}
			}else{//all others
				if(document.getElementById("TB_overlay") === null){
					$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
				}
			}
			if(tb_detectMacXFF()){
				$("#TB_overlay").addClass("TB_overlayMacFFBGHack");
			}else{
				$("#TB_overlay").addClass("TB_overlayBG");
			}
			$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");
			$('#TB_load').show();
		}
		catch(e) {
		}
		var postdata = {'email': email,'name': name, 'phone': phone, 'save':1};
		$.post(reg_action, postdata, function(data){
			if (data == 'ok') {
				window.location = window.location;
				return;
			}
			else {
				r_e = data;
			}
			if (r_e != '') {
				$('#g_e').html(r_e);
				$('#g_e').show();
			}
			tb_remove();
		});
	}
	else {
		if (r_e != '') {
			$('#g_e').html(r_e);
			$('#g_e').show();
		}
	}
}
