<!--

'window.moveTo 1,1
'window.resizeTo window.screen.width,window.screen.height-30


'-----------求出字符的真正长度----------------
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 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 OrderForGoods(id)
	Dim shpWin,url
	url="/css/dd_glpt/xx_text.asp?xid="&id& "&tim="&timer
	set shpWin=window.open(url,"Shopping","width=520,height=400,scrollbars=yes")
 on error resume next
	window.event.returnvalue=false
	shpWin.Focus
 on error goto 0
End Sub
'------------------------------------------------------

'-----------打开产品详细信息窗口--------------
sub OpenGoodsWin(id,act)
	Dim gdsWin,url,onm
	onm="GoodsInfo_" & id
	select case act
		case 1
			url="/wy_swqy/xx_cpzl/cp_text.asp?xid=" &id& "&tim=" &timer
		case 2
			url="/wy_swqy/xx_cpzl/cx_text.asp?xid=" &id& "&tim=" &timer
		case 3
			url="/wy_flgg/xx_flgg/xx_text.asp?xid=" &id& "&tim=" &timer			
	end select
	set gdsWin=window.open(url,onm,"width=620,height=480,scrollbars=yes")
 on error resume next
	window.event.returnvalue=false
	gdsWin.Focus
 on error goto 0
end sub
'---------------------------------------------

'-----------打开产品详细信息窗口--------------
sub OpenUserMMCWin(ccs)
	Dim mmcWin,url,onm
	onm="UserMMC"
	if ccs="产品库" then
		url="/wy_swqy/xx_mmc/cp_main.asp?tim=" &timer
	else
		url="/wy_swqy/xx_mmc/xx_main.asp?ccs=" &ccs& "&tim=" &timer
	end if
	set mmcWin=window.open(url,onm,"width=620,height=480,scrollbars=yes,status=yes")
 on error resume next
	window.event.returnvalue=false
	mmcWin.Focus
 on error goto 0
end sub
'---------------------------------------------

'-------------------令背景图片移动---------------------
Dim MoveBackLeft,MoveBackTop
	MoveBackLeft=0
	MoveBackTop=0
Sub MoveBackImage()
	MoveBackLeft=MoveBackLeft+1
	MoveBackTop=MoveBackTop+2
	Document.Body.style.BackgroundPosition=MoveBackLeft & " " & MoveBackTop
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

'------- 网站计算器 -----
'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()

-->