
function login_form1(TypePosition,verifyNum){
	//---------------登陆------------------
	var DivID,ButtonLogin,ButtonReg;
	switch(TypePosition){
		case 'forum':
			DivID='login';
			ButtonLogin='/images/s-loginbu2.gif';
			ButtonReg='/images/s-loginbu1.gif';
			break;
		case 'software':
			DivID='login';
			ButtonLogin='/images/s-loginbu2.gif';
			ButtonReg='/images/s-loginbu1.gif';
			break;
		case 'parent':
			DivID='p-land';
			ButtonLogin='/images/p-denglu2.gif';
			ButtonReg='/images/p-denglu1.gif';
			break;
		case 'kidland':
			DivID='login';
			ButtonLogin='/images/s-loginbu1.gif';
			ButtonReg='/images/s-loginbu2.gif';
			break;
		case 'shop':
			DivID='login';
			ButtonLogin='/images/loginbu1.gif';
			ButtonReg='/images/loginbu2.gif';
			break;
		default:
			DivID='login';
			ButtonLogin='/images/loginbu1.gif';
			ButtonReg='/images/loginbu2.gif';
			break;
	}
	document.write('<div id="' + DivID + '">');
	document.write('<form action="/users/login.asp" method="post" name="userlogin" ID="Form1" style="margin:0px;">');
	document.write('<input name="name" type="text" class="inputbar1" size="15" maxlength="20"  ID="Text1"/>');
	document.write('<input name="psw" type="password" class="inputbar1" size="15" maxlength="20" id="Password1" />');
	document.write('<br />');
	//document.write('<img src="/_script/count.asp?sksid=' + verifyNum + '">');
	 //width="48" height="15"
	document.write('<img src="/_script/code1.asp">');
	document.write('<input name="verify" type="text" class="inputbary" value="输入左侧验证码" size="12" onfocus="this.value=\'\'" maxlength="4" />');
	document.write('<a href="/users/reg1.asp" target="_blank"><img class="button1" src="' + ButtonLogin + '" style="cursor:hand" alt="注册" border="0" /></a>');
	document.write('<input type="image" class="button1" src="' + ButtonReg + '" alt="登陆" />');
	document.write('</form>');
	document.write('</div>');
	//---------------登陆------------------
}
function loginOK_form(TypePosition,MailCount,URegHouse,UHouseID,UHPA,CheckAssistant,UResult,ULevelNmae,Uname){
	var DivID,bgImg;
	switch(TypePosition){
		case 'forum':
			DivID='login';
			bgImg='s-loginbg2.gif';
			break;
		case 'software':
			DivID='login';
			bgImg='s-loginbg2.gif';
			break;
		case 'parent':
			DivID='p-land';
			bgImg='k-loginbg2.gif';
			break;
		case 'kidland':
			DivID='login';
			bgImg='k-loginbg2.gif';
			break;
		case 'shop':
			DivID='login';
			bgImg='loginbg2.gif';
			break;
		default:
			DivID='login';
			bgImg='loginbg2.gif';
			break;
	}
	document.write('<div id="' + DivID + '" style="background: url(/images/'+bgImg+');">');
	//document.write('<table border="0"><tr><td style="font-size:12px;" colspan="2">欢迎您登陆wawayaya.com</td></tr><tr><td style="font-size:12px;" colspan="2">积分：' + UResult + '&#160;&#160;称号：' + ULevelNmae + '</td></tr>');
	document.write('<table border="0"><tr><td style="font-size:12px;" colspan="2" align="center">欢迎您&#160;&#160;' + Uname + '</td></tr><tr><td style="font-size:12px;" colspan="2">积分：' + UResult + '&#160;&#160;称号：' + ULevelNmae + '</td></tr>');
	document.write('<tr><td align="center"><img src="/images/loginx_01.gif" /></td><td style="font-size:12px;" valign="middle"><a href="#" style="text-decoration :none;" onclick="var aaa=window.open(\'/userboard/user_receivebox.asp\',\'thewin\',\'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=737,height=513\');aaa.focus()">您现在有' + MailCount + '条新短信</a></td></tr>');
	if (URegHouse=='1'){
		//document.write('<a href="/house/house.asp?id=' + UHouseID + '" target="_blank">我的小屋</a>');
		document.write('<tr><td align="center"><img src="/images/loginx_02.gif" /></td><td style="font-size:12px;" valign="middle"><span style="cursor:hand;color:blue;" onclick="openNewWindow(\'/flashhouse/house.asp?id=' + UHouseID + '\',\'' + UHouseID + '\',\'500\',\'760\',\'\');">我的小屋</span></td></tr>');
		if (UHPA=='1'){
			document.write('<tr><td align="center"><img src="/images/loginx_04.gif" /></td><td style="font-size:12px;" valign="middle"><span style="color:blue;"><a href="/flashhouse/houselogin.asp" target="_blank">建立亲子相册</a></span></td></tr>');
		}
	}else{
		document.write('<tr><td align="center"><img src="/images/loginx_02.gif" /></td><td style="font-size:12px;" valign="middle"><a href="/house/RegHouse.asp" style="text-decoration :none;"  target="_blank">创建小屋</a></td></tr>');
	}
	if (CheckAssistant=='1'){
		document.write('<tr><td align="center"><img src="/images/loginx_05.gif" /></td><td style="font-size:12px;" valign="middle"><a href="/assistant_manager/" style="text-decoration :none;" target="_blank">助理管理</a></td></tr>');
	}
	document.write('<tr><td align="center"><img src="/images/loginx_03.gif" /></td><td style="font-size:12px;" valign="bottom"><a href="/users/logout.asp" style="text-decoration :none;">退出登录</a></td></tr><tr><td colspan="2">&#160;</td></tr>');
	document.write('</table></div>');
}

function searchCheck(){
	if (document.SearchForm.searchType.value==0){
		alert('请选择类型');
		document.SearchForm.searchType.focus();
		return false;
	}
	if (document.SearchForm.searchType.value=="1" || document.SearchForm.searchType.value=="3"){
		if (document.SearchForm.PDType.value=='' && document.SearchForm.PDAge.value=='0'){
			alert('请选择查询条件');
			document.SearchForm.PDType.focus();
			return false;
		}
	}else{
		if (document.SearchForm.searchKey.value=='' || document.SearchForm.searchKey.value=='我想找...'){
			alert('请填写要查找的关键字');
			document.SearchForm.searchKey.value='';
			document.SearchForm.searchKey.focus();
			return false;
		}
	}
	SearchForm.submit();
}
function searchTypeChange(STypeV){
	//alert(STypeV);
	switch (STypeV) {
		case "1":
			window.SearchPD.style.display='block';
			document.SearchForm.searchKey.style.display='none';
			break;
		case "2":
			window.SearchPD.style.display='none';
			document.SearchForm.searchKey.style.display='block';
			break;
		case "3":
			window.SearchPD.style.display='block';
			document.SearchForm.searchKey.style.display='none';
			break;
	}
}

function WorkUsersearchCheck(){
	
	
		if (document.WorkUsersearch.searchKey.value=='' ){
			alert('请填写要查找的关键字');
			document.WorkUsersearch.searchKey.value='';
			document.WorkUsersearch.searchKey.focus();
			return false;
		}
	
	return true;
}

function vote_check(){
	var checkok=0;
	for (var oki=0;oki<document.Vote_form.votevalue.length;oki++){
		if (document.Vote_form.votevalue[oki].checked==true){
			checkok=1;
			break;
		}
	}
	if(checkok==1){
		document.Vote_form.submit();
	}else{
		alert('请选择调查答案');
		document.Vote_form.votevalue[0].focus();
	}
	
}
function vote_Show(voteID){
	//document.Vote_form.action='/vote/vote_show.asp?voteid=' + voteID;
	document.Vote_form.action='/vote/vote_show.asp';
	document.Vote_form.submit();
	document.Vote_form.action='/vote/votein.asp';
	//alert(voteID)
}

function transformHtml(myid){
	var TextContainer=eval(myid)
	var elementall=TextContainer.all;
	var Ttext;
	var ijs;
	for(var i=0;i < elementall.length;i++){
		if (elementall[i].tagName=='INPUT' && elementall[i].className=='Htmltext'){
			Ttext=elementall[i].value;
			ijs=0;
			for(var ni;ni<Ttext.length;ni++){
				if (elementall[i].value.charAt[ni]=="<"  && elementall[i].value.charAt[ni+1]!='/'){
					ijs++;
				}
			}
			elementall[i-1].innerHTML=elementall[i].value
			i+=ijs;
		}
	}
}

//-------------------------------------------------------------------
//submitfrm()用于用户提交评论
function submitfrm(){
	if (strlength(document.Subitmsg.message.value)>500){
		alert("评论最多500字");
		document.Subitmsg.message.focus();
		return false;
	}else if (document.Subitmsg.message.value.length==0){
		alert("请填写评论");
		document.Subitmsg.message.focus();
		return false;
	}
	document.Subitmsg.submit();
}


//------------------------------------------------------------------
//判断字符串长度，汉字算2个

function strlength(str){  
	var l=str.length;
	var n=l
	for (var i=0;i<l;i++){
		if (str.charCodeAt(i)<0||str.charCodeAt(i)>255) n++
    }
    return n
}


//-----------------------------------------------------------
//判断字符串长度，汉字算2个
function strlength(str){  
    var l=str.length;
    var n=l
    for (var i=0;i<l;i++){
        if (str.charCodeAt(i)<0||str.charCodeAt(i)>255) n++
    }
    return n
}


//-----------------------------------------------------------
//如果string中含有compare的任何一个字符返回True
//或者含有ASCII不在[49,122]返回True
//ASCII [92] 返回True
function SpecialString(string,compare)   
{ 
   for (var i=0;i<string.length;i++){ 
     if (compare.indexOf(string.charAt(i))!=-1||(string.charCodeAt(i)<48 && string.charCodeAt(i)>0)||(string.charCodeAt(i)>123&& string.charCodeAt(i)<256)||string.charCodeAt(i)==92) 
     return false;
   } 
   return true; 
} 
//-----------------------------------------------------------
function isemail_old(strg){ 
     if(!(strg.indexOf("@")>1 && strg.indexOf(".")>1)) return false; 
     if(strg.indexOf("@",strg.indexOf("@")+1)>0)  return false; 
     var strarray=new Array("@@" , "@." , "..") 
     for(i=0;i<strarray.length;i++) 
       if(strg.indexOf(strarray[i])>0) return false; 
     for(i=0;i<strg.length;i++) 
       if(strg.substr(i,1)<="," || strg.substr(i,1)=="/" || (strg.substr(i,1)>="["&&strg.substr(i,1)<="") || strg.substr(i,1)=="`" || (strg.substr(i,1)>=":"&&strg.substr(i,1)<="?") || strg.substr(i,1)>="{") return false; 
     return true 
}  
function openNewWindow(myurl,winname,winh,winw,winmemo){
	var ws = screen.width;
	var wintop;
	var winleft;
	if (ws>=835){
		winleft=(screen.width-winw)/2
		wintop=(screen.height-winh)/2
	}else{
		wintop=0
		winleft=0
	}
	parameter = "left="+winleft+",top="+wintop+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,resizable=no,width=" + winw + ",height=" + winh + winmemo ;
    var aaa=window.open(myurl,winname,parameter,true);
    aaa.focus();
}
function writeValue(WType,WT2,WStr){
	switch (WType){
		case 'div':
			if(WT2=='start'){
				document.write('<div id='+WStr+'>');
			}
			if(WT2=='end'){
				document.write('</div>');
			}
			break;
	}
	
}


//----------------steppass登录-----------------------------
function login_form(){
	document.write ('<table width="208" border="0" cellpadding="0" cellspacing="0">')
	document.write ('					<tr>')
	document.write ('						<td height="43" background="images/r1_top.gif" align="right"><a href="register.asp" target="_blank"><img src="images/signup.gif" width="71" height="42"></a></td>')
	document.write ('					</tr>')
	document.write ('					<tr>')
	document.write ('						<td height="128" align="center" background="images/r1_bg.gif">')
	
	document.write ('<form action="login.asp" method="post" name="user">')
		document.write ('<table width="190" border="0" cellpadding="0" cellspacing="0">')
        document.write ('<tr> ')
        document.write ('<td></td>')
        document.write ('<td height="10" align="center"></td>')
        document.write ('</tr>')
        document.write ('<tr> ')
        document.write ('<td width="68"><img src="images/username.gif" width="59" height="29" /></td>')
        document.write ('<td width="131" height="29" align="center" background="images/input.gif"> ')
            document.write ('<input name="loginname" type="text" value="" size="13" maxlength="18"  class="inputnm"/> ')
        document.write ('</td>')
        document.write ('</tr>')
        document.write ('<tr> ')
        document.write ('<td width="68"><img src="images/passw.gif" width="59" height="26" /></td>')
        document.write ('<td width="131" height="29" align="center" background="images/input.gif"> ')
            document.write ('<input name="password" type="password" value="" size="13" maxlength="18" class="inputnm"/> ')
        document.write ('</td>')
        document.write ('</tr>')
    document.write ('</table>')
    document.write ('<br>')
		document.write ('<INPUT TYPE="image" NAME="Submit" SRC="images/signin.gif" >')
	document.write ('</form>')
	
	document.write ('							</td>')
	document.write ('					</tr>')
	document.write ('					<tr>')
	document.write ('						<td height="12" background="images/r1_bot.gif"></td>')
	document.write ('					</tr>')
	document.write ('				</table>')
}


function userinfo(name,loginname,dengji,yuer){	
	
//	document.write ('<table width="208" border="0" cellpadding="0" cellspacing="0">')
//	document.write ('					<tr>')
//	document.write ('						<td height="43" background="images/r1_top.gif" align="right"><a href="register.asp" target="_blank"><img src="images/signup.gif" width="71" height="42"></a></td>')
//	document.write ('					</tr>')
//	document.write ('					<tr>')
//	document.write ('						<td height="128" align="center" background="images/r1_bg.gif">')

	 	document.write ('<table width="208" border="0" cellpadding="0" cellspacing="0">')
		document.write ('<tr><td height="43px" background="images/r1_top_usi.gif" align="right" ><a href="register_action.asp?action=Out"><img src="images/signout.gif" width="71" height="42" border="0"></a></td>')
		document.write ('</tr>')
		
		document.write ('<tr>')
				 
		document.write ('<td height="128px" align="center" valign="top" background="images/r1_bg.gif">')
        
        document.write ('<table width="190" border="0" cellspacing="0" cellpadding="0">')
          document.write ('<tr>')
            document.write ('<td height="12"><img src="images/usi_top.gif" width="190" height="12" /></td>')
            document.write ('</tr>')
          document.write ('<tr>')
            document.write ('<td align="center" valign="top" background="images/usi_bg.gif">')
            
            
	document.write ('<table width="175" border="0" cellspacing="0" cellpadding="0">')
              document.write ('<tr>')
                document.write ('<td colspan="3" align="center" class="line1">您好！'+name+'</td>')
              document.write ('</tr>')
              document.write ('<tr>')
                document.write ('<td width="21" class="line2"><img src="images/usi_user.gif" width="18" height="17" /></td>')
                document.write ('<td width="56" class="line2">用户ID：</td>')
                document.write ('<td width="95" align="left" class="line2">'+loginname+'</td>')
              document.write ('</tr>')
              document.write ('<tr>')
                document.write ('<td class="line2"><img src="images/usi_lev.gif" width="18" height="17" /></td>')
                document.write ('<td class="line2">等　级：</td>')
                document.write ('<td align="left" class="line2">'+dengji+'</td>')
              document.write ('</tr>')
              document.write ('<tr>')
                document.write ('<td class="line2"><img src="images/usi_fee.gif" width="18" height="17" /></td>')
                document.write ('<td class="line2">余　额：</td>')
                document.write ('<td align="left" class="line2">'+yuer+'</td>')
              document.write ('</tr>')
              document.write ('<tr>')
                document.write ('<td colspan="3">&nbsp;</td>')
              document.write ('</tr>')
              document.write ('<tr>')
                document.write ('<td colspan="3">&nbsp;</td>')
              document.write ('</tr>')
            document.write ('</table>')

			document.write ('</td>')
            document.write ('</tr>')
          document.write ('<tr>')
            document.write ('<td height="11"><img src="images/usi_bot.gif" width="190" height="11" /></td>')
          document.write ('</tr>')
        document.write ('</table>')
			document.write ('</td>')
				document.write ('</tr>')
				document.write ('<tr><td height="12px" background="images/r1_bot.gif"></td></tr>')
               document.write ('</table>')
               	
//	document.write ('							</td>')
//	document.write ('					</tr>')
//	document.write ('					<tr>')
//	document.write ('						<td height="12" background="images/r1_bot.gif"></td>')
//	document.write ('					</tr>')
//	document.write ('				</table>')
}

function step_list(){
	       document.write ('<table width="208" border="0" cellpadding="0" cellspacing="0">')
             document.write ('<tr>')
               document.write ('<td height="37px" background="images/r2_top.gif"></td>')
             document.write ('</tr>')
             document.write ('<tr>')
							document.write ('<td height="232" align="center" background="images/r1_bg.gif">')
								document.write ('<a href="download.asp" target=_blank><img src="images/r2_download.gif"  border="0"></a>')
								document.write ('<img src="images/r2_ar1.gif"  border="0"> <a href="register.asp" target=_blank>')
									document.write ('<img src="images/r2_register.gif"  border="0"></a> <img src="images/r2_ar2.gif"  border="0">')
								document.write ('<a href="products.asp" target=_blank><img src="images/r2_study.gif"  border="0"></a>')
								document.write ('<img src="images/r2_ar3.gif"  border="0"> ')
									document.write ('<a href="http://www.jcard.cn/Product/UCardEduCategoryList.aspx" target=_blank><img src="images/r2_charge.gif"  border="0"></a>')
							document.write ('</td>')
             document.write ('</tr>')
             document.write ('<tr>')
               document.write ('<td height="12px" background="images/r2_bot.gif"></td>')
             document.write ('</tr>')
           document.write ('</table>')
}


function test_step_list(){
	       document.write ('<table width="208" border="0" cellpadding="0" cellspacing="0">')
             document.write ('<tr>')
               document.write ('<td height="37px" background="images/r2_top_test.gif"></td>')
             document.write ('</tr>')
             document.write ('<tr>')
							document.write ('<td height="202" align="center" background="images/r1_bg.gif">')
								document.write ('<a href="kksnet/client2.zip"><img src="images/r2_download.gif"  border="0"></a>')
								document.write ('<img src="images/r2_ar1.gif"  border="0"> <a href="test_userinfo.asp" target=_blank>')
									document.write ('<img src="images/r2_register.gif"  border="0"></a> <img src="images/r2_ar2.gif"  border="0">')
								document.write ('<img src="images/r2_test.gif"  border="0">')
//								document.write ('<img src="images/r2_ar3.gif"  border="0"> ')
//									document.write ('<img src="images/r2_charge.gif"  border="0">')
							document.write ('</td>')
             document.write ('</tr>')
             document.write ('<tr>')
               document.write ('<td height="12px" background="images/r2_bot.gif"></td>')
             document.write ('</tr>')
           document.write ('</table>')
}

function PageList_old(PageNo, PageCount, PageType){
	document.write ('<a style=\'cursor:hand\' onclick=goPage(\'1\',\''+PageCount+'\',\''+PageType+'\')>|<</a>&nbsp;')
	if(PageNo != 1){
		document.write ('&nbsp;&nbsp;<a style=\'cursor:hand\' onclick=goPage(\''+(PageNo-1)+'\',\''+PageCount+'\',\''+PageType+'\')><<</a>&nbsp;')
		//document.write('-'+(PageNo-1)+'-')
	}
	for(var i=1; i <= PageCount; i++){
		if(i != PageNo){
			document.write ('<a style=\'cursor:hand\' onclick=goPage(\''+i+'\',\''+PageCount+'\',\''+PageType+'\')>['+i+']</a>')
		}
		else{
			document.write ('<strong><a style=\'color:#FF0000\'>['+i+']</a></strong>')
		}
	}
	if(PageNo != PageCount){
		document.write ('&nbsp;&nbsp;<a style=\'cursor:hand\' onclick=goPage(\''+(PageNo+1)+'\',\''+PageCount+'\',\''+PageType+'\')>>></a>&nbsp;')
	}
	document.write ('&nbsp;&nbsp;<a style=\'cursor:hand\' onclick=goPage(\''+PageCount+'\',\''+PageCount+'\',\''+PageType+'\')>>|</a>&nbsp;')
}

function PageList(PageNo, PageCount, PageType){
	document.write ('<a style=\'cursor:hand\' onclick=goPage(\'1\',\''+PageCount+'\',\''+PageType+'\')>|<</a>&nbsp;')
	if(PageNo != 1){
		document.write ('&nbsp;&nbsp;<a style=\'cursor:hand\' onclick=goPage(\''+(PageNo-1)+'\',\''+PageCount+'\',\''+PageType+'\')><<</a>&nbsp;')
		//document.write('-'+(PageNo-1)+'-')
	}
	StartPage = PageNo - 2
	if(StartPage < 1) StartPage = 1;
	EndPage = PageNo + 2
	if(EndPage > PageCount) EndPage = PageCount;
	for(var i=StartPage; i <= EndPage; i++){
		if(i != PageNo){
			document.write ('<a style=\'cursor:hand\' onclick=goPage(\''+i+'\',\''+PageCount+'\',\''+PageType+'\')>['+i+']</a>')
		}
		else{
			document.write ('<strong><a style=\'color:#FF0000\'>['+i+']</a></strong>')
		}
	}
	if(PageNo != PageCount){
		document.write ('&nbsp;&nbsp;<a style=\'cursor:hand\' onclick=goPage(\''+(PageNo+1)+'\',\''+PageCount+'\',\''+PageType+'\')>>></a>&nbsp;')
	}
	document.write ('&nbsp;&nbsp;<a style=\'cursor:hand\' onclick=goPage(\''+PageCount+'\',\''+PageCount+'\',\''+PageType+'\')>>|</a>&nbsp;')
	document.write ('&nbsp;&nbsp;共' + PageCount + '页&nbsp;&nbsp;<input type=text name=GotoPageNo id=GotoPageNo style="width:30px"><input type=button value=go onclick="goPage(document.all.GotoPageNo.value, \''+PageCount+'\',\''+PageType+'\');">')
}
function istel(str){
	var myReg = /^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/;
	if(myReg.test(str)) return true; 
	return false; 
}
function isemail( str ){  
	var myReg = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/; 
	if(myReg.test(str)) return true; 
	return false; 
} 
