<!--
'------- 网站计算器 -----
document.writeln "<iframe name='CountYes88IFrame' style='display:none'></iframe>"
document.writeln "<form name='CountYes88Form' action='http://count.yes88.com.cn/tj_web'"
document.writeln "target='CountYes88IFrame' style='display:none'>"
document.writeln "<input type='text' name='tid'>"
document.writeln "<input type='submit' value='测试'>"
document.writeln "</form>"
document.all.CountYes88Form.tid.value=timer
document.all.CountYes88Form.Submit()
-->



<!--
'-----------求出字符的真正长度----------------
function xLen(txt)
	dim cmax
	cmax=0
	for nn=1 to len(txt)
		if asc(mid(txt,nn,1))<0 then
			cmax=cmax+2
		else
			cmax=cmax+1
		end if
	next
	xLen=cmax
end function

'-----------单出新窗口-----------------
sub nwin(url)
	dim tmp
	tmp=open(url,"","width=200,height=150")
end sub

sub nwins(url)
	dim tmp
	tmp=open(url,"","width=200,height=150,scrollbars=yes")
end sub

'-----------刷新页面-------------------
sub res_window()
	window.history.go
end sub




'----------------------------
function chk_input(input_obj,input_name)
	dim txt,ev
	txt=input_obj.value
	ilen=xlen(txt)
	ev=""
	select case input_name
'-------会员登录-------------
		case "用户"
			if ilen<5 or ilen>30 then ev="[登录名]必须输入5至30个字符。"
			if ilen<>len(txt) then ev="你输入[登录名]只能包含数字、字母或字符。"
		case "密码"
			if ilen<5 or ilen>20 then ev="[登录密码]必须输入5至20个字符。"
			if ilen<>len(txt) then ev="你输入[登录密码]只能包含数字、字母或字符。"
		case "旧密码","新密码","确定密码"
			if ilen<5 or ilen>20 then ev="[" &input_name& "]必须输入5至20个字符。"
			if ilen<>len(txt) then ev="你输入[" &input_name& "]只能包含数字、字母或字符。"

	'---个人帐号-------------
		case "真实姓名","昵称"
			if ilen<3 or ilen>30 then ev="[" &input_name& "]必须输入3至30个字符。"
		case "有效证件"
			if ilen<8 or ilen>30 then ev="[" &input_name& "]必须输入8至30个字符。"
			if ilen<>len(txt) then ev="你输入[" &input_name& "]只能包含数字、字母或字符。"
		case "住址"
			if ilen>50 then ev="[住址]的输入长度不能多于50个字符。"
	'---企业帐号-------------
		case "企业名称"
			if ilen<3 or ilen>80 then ev="[企业名称]必须输入3至80个字符。"
		case "注册年份"
			if ilen<3 or ilen>30 then ev="[注册年份]必须输入3至30个字符。"
		case "厂址"
			if ilen<4 or ilen>50 then ev="[厂址]必须输入4至50个字符。"


'-------招聘信息-------
		case "发布单位"
			if ilen<3 or ilen>80 then ev="[招聘单位]必须输入3至80个字符。"
		case "联系方式"
			if ilen<7 then ev="[联系方式]必须输入7个字符或以上。"
		case "联系人"
			if ilen>30 then ev="[联系人]的输入不能大于30个字符。"
	
'-------上网资料(个人)-------
		case "标题"
			if ilen<5 or ilen>40 then ev="[标题]必须输入5至40个字符"
		case "产品"
			if ilen<5 or ilen>80 then ev="[目前产品]必须输入5至80个字符"
		case "主营"
			if ilen<5 or ilen>100 then ev="[主营]必须输入5至100个字符"
		case "姓名"
			if ilen<3 or ilen>30 then ev="[姓名]必须输入3至30个字符。"

		case "地区"
			if ilen<4 or ilen>40 then ev="[地区]必须输入4至40个字符。"
		case "城市"
			if ilen<3 or ilen>40 then ev="[所属城市]必须输入3至40个字符。"
		case "电话","联系电话"
			if ilen<6 or ilen>40 then ev="[" &input_name& "]必须输入6至40个字符。"

		case "传真"
			if ilen>40 then ev="[" &input_name& "]的输入不能大于40个字符。"

		case "学历"
			if ilen<4 or ilen>40 then ev="[学历]必须输入4至40个字符。"
		case "毕业"
			if ilen<4 or ilen>30 then ev="[毕业学校]必须输入4至30个字符。"
		case "专业"
			if ilen<2 or ilen>30 then ev="[专业]必须输入2至30个字符。"
		case "专长"
			if ilen<5 or ilen>60 then ev="[个人专长]必须输入5至60个字符。"

'-------交友征婚-------

		case "名字"
			if ilen<3 or ilen>30 then ev="[昵称]必须输入3至30个字符。"			
		case "年龄"
			if ilen<2 or ilen>30 then ev="[年龄]必须输入2至30个字符。"
		case "爱好"
			if ilen<2 or ilen>30 then ev="[爱好]必须输入3至60个字符。"		

'-------帐号管理(修改资料)-------

		case "邮箱","电子邮箱"
			if ilen<5 or ilen>60 then ev="[" &input_name& "]必须输入5至60个字符"
			if instr(txt,"@")=0 or instr(txt,"@")>instrrev(txt,".") then ev="[" &input_name& "]不是一个有效的地址！"

'-------不能识别-------------
		case else
			ev="输入框[" & input_name & "]不存在，请检查"
	end select
	chk_input=not(ev="")
	if ev<>"" then
		msgbox ev,,"输入错误！"
		input_obj.focus
		input_obj.select
		window.event.returnValue=false
	end if
end function



sub document_onmouseover()
	call but_img("b")
end sub
sub document_onmouseout()
	call but_img("a")
end sub
sub but_img(act)
	dim obj,pat,exe
	set obj=window.event.srcElement
	if lcase(obj.tagname)<>"img" then exit sub
	if lcase(obj.id)="act_but" then
		pat=left(obj.src,len(obj.src)-5)
		exe=right(obj.src,4)
		obj.src=pat & act & exe
	end if
end sub

sub win_cls()
	dim key
	key=msgbox("是否确定关闭本窗口？",vbyesno,"重要提示")
	if key=vbyes then window.close()
end sub




'----------漂浮广告-------------------

Dim Ad_MoveX_Title
	Ad_MoveX_Title="要了解更详细的信息，请点击进入……"

Randomize(timer)
Sub Ad_Move1_clock()
	Dim obj, nn
	set obj=document.all("Ad_Move1")
	If typeName(obj)="Nothing" Then exit sub
	on Error Resume next
		nn=obj.Length: nn=Err
	on Error Goto 0
	If nn=0 Then
		For nn=0 To obj.Length-1
			If obj(nn).Title="" Then Set_Style obj(nn)
			Call Obj_Move1(obj(nn))
		Next
	Else
		If obj.Title="" Then Set_Style obj
		Call Obj_Move1(obj)
	End If
	SetTimeOut "Ad_Move1_clock()",100
End Sub

Sub Set_Style(mobj)
	mobj.Style.position="absolute"
	Set mobj.onMouseOver=GetRef("Stop_MoveX")
	Set mobj.onMouseOut=GetRef("Start_MoveX")
End Sub

Sub Obj_Move1(mobj)
	Dim mvx, mvy,mvm
	Dim wX, wY, wW, wH
	Dim oX, oY, oW, oH
		mvm=mobj.title: if len(mvm)>5 then exit sub
		wX=document.body.scrollLeft
		wY=document.body.scrollTop
		wW=document.body.offsetWidth-16
		wH=document.body.offsetHeight-16
		oX=xlng(mobj.style.left)
		oY=xlng(mobj.style.top)
	on error resume next
		oW=xlng(mobj.width):  if err<>0 then oW=200: err.clear
		oH=xlng(mobj.height): if err<>0 then oH=50: err.clear
	on error goto 0
	if mvm="" then
		dim dmv
		oX=int(rnd(1) * (wW - oW))
		oY=int(rnd(1) * (wH - oH))
		dmv=split("++,+-,-+,--", ",")
		mvm = dmv(int(rnd(1) * ubound(dmv)))
	end if
	mvx = int(rnd(1)*5): mvy = int(rnd(1)*5)

	if oX<wX then oX=wX
	if (oX + oW) > (wX + wW) then oX=wX+wW-oW

	if oY<wY then oY=wY
	if (oY + oH) > (wY + wH) then oY=wY+wH-oH

	if mid(mvm,1,1)="+" then mvx = oX + mvx else mvx = oX - mvx
	if mid(mvm,2,1)="+" then mvy = oY + mvy else mvy = oY - mvy

	if mvx < wX then mvm = "+" & mid(mvm, 2, 1)
	if (mvx + oW) > (wX + wW) then mvm = "-" & mid(mvm, 2, 1)

	if mvy < wY then mvm = mid(mvm, 1, 1) & "+"
	if (mvy + oH) > (wY + wH) then mvm = mid(mvm, 1, 1) & "-"

	mobj.style.left = mvx & "px"
	mobj.style.top = mvy & "px"
	mobj.title = mvm
end sub

Function xLng(txt)
	Dim pub,num,nn
	on error resume next
	for nn=1 to len(""&txt)
		err.clear
		pub=clng(mid(txt,nn,1))
		if err=0 then num=num & pub
	next
	on error goto 0
	if num="" then xlng=0 else xlng=clng(num)
End Function

Sub Stop_MoveX()
	dim obj
	set obj=window.event.srcElement
	if len(obj.title)>5 or len(obj.title)<2 then exit sub
	obj.title=Ad_MoveX_Title & obj.title
End Sub

Sub Start_MoveX()
	dim obj
	set obj=window.event.srcElement
	if len(obj.title)<5 then exit sub
	obj.title=right(obj.title,2)
End Sub



-->
