// JavaScript Document
function openbag(id) { 
      window.open("welcome.asp?hw_id="+id,"","height=450,width=450,left=200,top=0,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	  } 
	  
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function FORM1_onsubmit()                                  
{                                  
	if (chkitem(document.FORM1.uid.value)==0)                                  
	{                                  
		alert("请输入正确的会员帐号。");                                  
		document.FORM1.uid.focus();                                  
		return false;                                  
	}                                  
	if ((document.FORM1.uid.value=='') || (chkspc(document.FORM1.uid.value)==0)|| (chkspc(document.FORM1.uid.value)==2))                                  
	{                                  
		alert("请将会员帐号填写完整,且不能使用空格！");                                  
		document.FORM1.uid.focus();                                  
		return false;                                  
	}                                  
	if (chkitem(document.FORM1.pwd.value)==0)                                  
	{                                  
		alert("请将填写密码！");                                  
		document.FORM1.pwd.focus();                                  
		return false;                                  
	}                                  
                                  
	if ( fucCheckLength(document.FORM1.uid.value) != document.FORM1.uid.value.length )                                  
	{                                  
		alert("会员帐号请不要使用中文！");                                  
		document.FORM1.uid.focus();                                  
		return false;                                  
	}                                  
	if ( fucCheckLength(document.FORM1.uid.value) <4 )                                  
	{                                  
		alert("会员帐号必须至少4位");                                  
		document.FORM1.uid.focus();                                  
		return false;                                  
	}                                  
                                  
} 

function winopen(url)                    
     {                    
        window.open(url,"search","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=yes,width=640,height=450,top=200,left=100");                    
      }

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function chksafe(a)
{	
	return 1;
	
}

function chkspc(a)
{
	var i=a.length;
	var j = 0;
	var k = 0;
	while (k<i)
	{
		if (a.charAt(k) != " ")
			j = j+1;
		k = k+1;
	}
	if (j==0)
	{
		return 0;
	}
	
	if (i!=j)
	{ return 2; }
	else
	{
		return 1;
	}
}

function fucCheckLength(strTemp)
{
	var i,sum;
	sum=0;
	for(i=0;i<strTemp.length;i++)
	{
		if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
			sum=sum+1;
		else
			sum=sum+2;
	}
	return sum;
}

function chkitem(str)
{	
	var strSource ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
  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;
    }
  }
  if (strSource.indexOf(ch)==-1)
  {
    return 0;
  }
  else
  {
    return 1;
  } 
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function postdata(num){
form1.page.value=num;
form1.submit()
}