// for sign in
function Cssinput_normalSignin(thisInputID) {
	thisInputID.className="input_normal_12px";
}

function Cssinput_focusSignin(thisInputID) {
	thisInputID.className="input_focus_12px";
}

function Cssinput_errorSignin(thisInputID) {
	thisInputID.className="input_error_12px";
}



function CheckFormSignin() {
	if (CheckVerifySigninUserID(document.getElementById("Username"),'txtIDusername')==false){
		return false;
	}
	if (CheckVerifySigninPWD(document.getElementById("Password"),'txtIDpassword')==false){
		return false;
	}
	return true;	
}


function CheckVerifySigninUserID(thisInputID,txtDivID) {
var isError="";
if (thisInputID.value==""){
	isError="yes";
//	strError=""
	strError="User ID or E-mail is required."
	}
else{
	if ((thisInputID.value.length<3)||(thisInputID.value.length>20)){
	isError="yes";
//	strError=""
	strError="User ID or E-mail is required."
	}
}
var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_.@"
for (i=0; i < thisInputID.value.length; i++){
	var CheckChar = thisInputID.value.charAt(i);
	CheckChar = CheckChar.toUpperCase();
	if (Letters.indexOf(CheckChar) == -1)
	{
	isError="yes";
//	strError=""
	strError="User ID or E-mail is unregulated."
	}
}

if (isError=="yes"){
	Cssinput_errorSignin(thisInputID);
	document.getElementById(txtDivID).innerHTML="<img src=\"../images/ico/tf_f_s.gif\" border=\"0\" align=\"absmiddle\" /><br />"+strError;
	return false;
	}
else {
	Cssinput_normalSignin(thisInputID);
	document.getElementById(txtDivID).innerHTML="<img src=\"../images/ico/tf_t_s.gif\" border=\"0\" align=\"absmiddle\" />";
	return true;
	}

}




function CheckVerifySigninPWD(thisInputID,txtDivID) {
var txtExtra="";
var isError="";
if (thisInputID.value==""){
	isError="yes";
	strError="Password information is required."
	}
else {
	if (thisInputID.value.length<3){
		isError="yes";
		strError="Required more than 3 characters."
		}
	if (thisInputID.value.length>20){
		isError="yes";
		strError="Required less than 20 characters."
		}
	}

var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
for (i=0; i < thisInputID.value.length; i++)
{
	var CheckChar = thisInputID.value.charAt(i);
	CheckChar = CheckChar.toUpperCase();
	if (Letters.indexOf(CheckChar) == -1)
	{
	isError="yes";
	strError="Password is unregulated."
	}
}

if (isError=="yes"){
	Cssinput_errorSignin(thisInputID);
	document.getElementById(txtDivID).innerHTML="<img src=\"../images/ico/tf_f_s.gif\" border=\"0\" align=\"absmiddle\" /><br />"+strError;
	return false;
	}
else {
	Cssinput_normalSignin(thisInputID);
	document.getElementById(txtDivID).innerHTML="<img src=\"../images/ico/tf_t_s.gif\" border=\"0\" align=\"absmiddle\" />";
	return true;
	}

}


