﻿	var ValidationPassed = true;
	
	function form_onsubmit(obj)
	{
	if(obj.username.value=="" || obj.username.value.length<3 || obj.username.value.length>50 )
	{
		alert("Please input effective username!");
		ValidationPassed = false;
		obj.username.focus();
		return;
	}
	if(fucPWDchk(obj.username.value)==1)
	{
		alert("Please input effective username!");
		ValidationPassed = false;
		obj.username.focus();
		return;
	}
	if(obj.password.value=="" || obj.password.value.length<3 || obj.password.value.length>50)
	{
		alert("Please input effective password!");
		ValidationPassed = false;
		obj.password.focus();
		return;
	}
		if(fucPWDchk(obj.username.value)==1)
	{
		alert("Please input effective password!");
		ValidationPassed = false;
		obj.password.focus();
		return;
	}
	ValidationPassed = true;
	return true;
	}

function submitonce(theform)
	{
		form_onsubmit(theform);
		if(ValidationPassed == false)return;
		if (document.all||document.getElementById)
		{
			for (i=0;i<theform.length;i++)
			{
				var tempobj=theform.elements[i];
				if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=true;
			}
		}
	}
function fucPWDchk(str)
{
	//var strSource ="0123456789-_!@#$%^&*()[]{}+\\|<>?,./;`~\":\'"
	var strSource ="-_!@#$%^&*()[]{}+\\|<>?,./;`~\":\'"
	var ch;
	var i;
	var temp;
	for (i=0;i<=(str.length-1);i++)
	{
		ch = str.charAt(i);
    	temp = strSource.indexOf(ch);
		if (temp==-1) 
		{
 			return 0;
		}
		else
		{
			return 1;
		} 
	}
}


function openwin(str){ 
	if(str=="password"){
		window.open('getpwd.asp','newwindow','status=no,scrollbars=auto,top=230,left=270,width=508,height=450' )
	}
	if(str=="keepsignin"){
		window.open('help/keepSignIn.html','newwindow','status=no,scrollbars=auto,top=230,left=270,width=508,height=450' )
	}
} 



