FDS’s Blog

2009年7月30日

用ASP做在线升级文件

Filed under: ASP — 标签: — FDS @ 11:40

用ASP做在线升级文件的方法,方便用户升级。

<%
Rem #####################################################################################
Rem ## 在线升级类声明
Class Cls_oUpdate
  Rem #################################################################
  Rem ## 描述: ASP 在线升级类
  Rem ## 版本: 1.0.0
  Rem ## 作者: 萧月痕
  Rem ## MSN:  xiaoyuehen(at)msn.com
  Rem ## 请将(at)以 @ 替换
  Rem ## 版权: 既然共享, 就无所谓版权了. 但必须限于网络传播, 不得用于传统媒体!
  Rem ## 如果您能保留这些说明信息, 本人更加感谢!
  Rem ## 如果您有更好的代码优化, 相关改进, 请记得告诉我, 非常谢谢!
  Rem #################################################################
  Public LocalVersion, LastVersion, FileType
  Public UrlVersion, UrlUpdate, UpdateLocalPath, Info
  Public UrlHistory
  Private sstrVersionList, sarrVersionList, sintLocalVersion, sstrLocalVersion
  Private sstrLogContent, sstrHistoryContent, sstrUrlUpdate, sstrUrlLocal
  Rem #################################################################
  Private Sub Class_Initialize()
   Rem ## 版本信息完整URL, 以 http:// 起头
   Rem ## 例: http://localhost/software/Version.htm
   UrlVersion     = “”
  
   Rem ## 升级URL, 以 http:// 起头, /结尾
   Rem ## 例: http://localhost/software/
   UrlUpdate     = “”
  
   Rem ## 本地更新目录, 以 / 起头, /结尾. 以 / 起头是为当前站点更新.防止写到其他目录.
   Rem ## 程序将检测目录是否存在, 不存在则自动创建
   UpdateLocalPath  = “/”
  
   Rem ## 生成的软件历史文件
   UrlHistory     = “history.htm”
  
   Rem ## 最后的提示信息
   Info        = “”
  
   Rem ## 当前版本
   LocalVersion    = “1.0.0″
  
   Rem ## 最新版本
   LastVersion    = “1.0.0″
  
   Rem ## 各版本信息文件后缀名
   FileType      = “.asp”
  End Sub
  Rem #################################################################
 
  Rem #################################################################
  Private Sub Class_Terminate()
 
  End Sub
  Rem #################################################################
  Rem ## 执行升级动作
  Rem #################################################################
  Public function doUpdate()
   doUpdate = False
  
   UrlVersion    = Trim(UrlVersion)
   UrlUpdate    = Trim(UrlUpdate)
  
   Rem ## 升级网址检测
   If (Left(UrlVersion, 7) <> “http://”) Or (Left(UrlUpdate, 7) <> “http://”) Then
    Info = “版本检测网址为空, 升级网址为空或格式错误(#1)”
    Exit function
   End If
  
   If Right(UrlUpdate, 1) <> “/” Then
    sstrUrlUpdate = UrlUpdate & “/”
   Else
    sstrUrlUpdate = UrlUpdate
   End If
  
   If Right(UpdateLocalPath, 1) <> “/” Then
    sstrUrlLocal = UpdateLocalPath & “/”
   Else
    sstrUrlLocal = UpdateLocalPath
   End If  
  
   Rem ## 当前版本信息(数字)
   sstrLocalVersion = LocalVersion
   sintLocalVersion = Replace(sstrLocalVersion, “.”, “”)
   sintLocalVersion = toNum(sintLocalVersion, 0)
  
   Rem ## 版本检测(初始化版本信息, 并进行比较)
   If IsLastVersion Then Exit function
  
   Rem ## 开始升级
   doUpdate = NowUpdate()
   LastVersion = sstrLocalVersion
  End function
  Rem #################################################################
 
  Rem ## 检测是否为最新版本
  Rem #################################################################
   Private function IsLastVersion()
    Rem ## 初始化版本信息(初始化 sarrVersionList 数组)
    If iniVersionList Then
     Rem ## 若成功, 则比较版本
     Dim i
     IsLastVersion = True
     For i = 0 to UBound(sarrVersionList)
      If sarrVersionList(i) > sintLocalVersion Then
       Rem ## 若有最新版本, 则退出循环
       IsLastVersion = False
       Info = “已经是最新版本!”
       Exit For
      End If
     Next
    Else
     Rem ## 否则返回出错信息
     IsLastVersion = True
     Info = “获取版本信息时出错!(#2)”
    End If  
   End function
  Rem #################################################################
  Rem ## 检测是否为最新版本
  Rem #################################################################
   Private function iniVersionList()
    iniVersionList = False
   
    Dim strVersion
    strVersion = getVersionList()
   
    Rem ## 若返回值为空, 则初始化失败
    If strVersion = “” Then
     Info = “出错…….”
     Exit function
    End If
   
    sstrVersionList = Replace(strVersion, ” “, “”)
    sarrVersionList = Split(sstrVersionList, vbCrLf)
   
    iniVersionList = True
   End function
  Rem #################################################################
  Rem ## 检测是否为最新版本
  Rem #################################################################
   Private function getVersionList()
    getVersionList = GetContent(UrlVersion)
   End function
  Rem #################################################################
  Rem ## 开始更新
  Rem #################################################################
   Private function NowUpdate()
    Dim i
    For i = UBound(sarrVersionList) to 0 step -1
     Call doUpdateVersion(sarrVersionList(i))
    Next
    Info = “升级完成! <a href=”“” & sstrUrlLocal & UrlHistory & “”“>查看</a>”
   End function
  Rem #################################################################
 
  Rem ## 更新版本内容
  Rem #################################################################
   Private function doUpdateVersion(strVer)
    doUpdateVersion = False
   
    Dim intVer
    intVer = toNum(Replace(strVer, “.”, “”), 0)
   
    Rem ## 若将更新的版本小于当前版本, 则退出更新
    If intVer <= sintLocalVersion Then
     Exit function
    End If
   
    Dim strFileListContent, arrFileList, strUrlUpdate  
    strUrlUpdate = sstrUrlUpdate & intVer & FileType
   
    strFileListContent = GetContent(strUrlUpdate)
   
    If strFileListContent = “” Then
     Exit function
    End If
   
    Rem ## 更新当前版本号
    sintLocalVersion = intVer
    sstrLocalVersion = strVer
   
    Dim i, arrTmp
    Rem ## 获取更新文件列表
    arrFileList = Split(strFileListContent, vbCrLf)
   
    Rem ## 更新日志
    sstrLogContent = “”
    sstrLogContent = sstrLogContent & strVer & “:” & vbCrLf
   
    Rem ## 开始更新
    For i = 0 to UBound(arrFileList)
     Rem ## 更新格式: 版本号/文件.htm|目的文件
     arrTmp = Split(arrFileList(i), “|”)
     sstrLogContent = sstrLogContent & vbTab & arrTmp(1)
     Call doUpdateFile(intVer & “/” & arrTmp(0), arrTmp(1))    
    Next
   
    Rem ## 写入日志文件
    sstrLogContent = sstrLogContent & Now() & vbCrLf
    response.Write(“<pre>” & sstrLogContent & “</pre>”)
    Call sDoCreateFile(Server.MapPath(sstrUrlLocal & “Log” & intVer & “.htm”), _
                                          “<pre>” & sstrLogContent & “</pre>”)
    Call sDoAppendFile(Server.MapPath(sstrUrlLocal & UrlHistory), “<pre>” & _
                                          strVer & “_______” & Now() & “</pre>” & vbCrLf)
   End function
  Rem #################################################################
 
  Rem ## 更新文件
  Rem #################################################################
   Private function doUpdateFile(strSourceFile, strTargetFile)
    Dim strContent
    strContent = GetContent(sstrUrlUpdate & strSourceFile)
   
    Rem ## 更新并写入日志
    If sDoCreateFile(Server.MapPath(sstrUrlLocal & strTargetFile), strContent) Then    
     sstrLogContent = sstrLogContent & “  成功” & vbCrLf
    Else
     sstrLogContent = sstrLogContent & “  失败” & vbCrLf
    End If
   End function
  Rem #################################################################
  Rem ## 远程获得内容
  Rem #################################################################
   Private function GetContent(strUrl)
    GetContent = “”
   
    Dim oXhttp, strContent
    Set oXhttp = Server.CreateObject(“Microsoft.XMLHTTP”)
    ‘On Error Resume Next
    With oXhttp
     .Open “GET”, strUrl, False, “”, “”
     .Send
     If .readystate <> 4 Then Exit function
     strContent = .Responsebody
    
     strContent = sBytesToBstr(strContent)
    End With
   
    Set oXhttp = Nothing
    If Err.Number <> 0 Then
     response.Write(Err.Description)
     Err.Clear
     Exit function
    End If
   
    GetContent = strContent
   End function
  Rem #################################################################
  Rem #################################################################
  Rem ## 编码转换 2进制 => 字符串
   Private function sBytesToBstr(vIn)
    dim objStream
    set objStream = Server.CreateObject(“adodb.stream”)
    objStream.Type    = 1
    objStream.Mode    = 3
    objStream.Open
    objStream.Write vIn
   
    objStream.Position  = 0
    objStream.Type    = 2
    objStream.Charset  = “GB2312″
    sBytesToBstr     = objStream.ReadText
    objStream.Close
    set objStream    = nothing
   End function
  Rem #################################################################
  Rem #################################################################
  Rem ## 编码转换 2进制 => 字符串
   Private function sDoCreateFile(strFileName, ByRef strContent)
    sDoCreateFile = False
    Dim strPath
    strPath = Left(strFileName, InstrRev(strFileName, “\”, -1, 1))
    Rem ## 检测路径及文件名有效性
    If Not(CreateDir(strPath)) Then Exit function
    ‘If Not(CheckFileName(strFileName)) Then Exit function
   
    ‘response.Write(strFileName)
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Dim fso, f
    Set fso = CreateObject(“Scripting.FileSystemObject”)
    Set f = fso.OpenTextFile(strFileName, ForWriting, True)
    f.Write strContent
    f.Close
    Set fso = nothing
    Set f = nothing
    sDoCreateFile = True
   End function
  Rem #################################################################
  Rem #################################################################
  Rem ## 编码转换 2进制 => 字符串
   Private function sDoAppendFile(strFileName, ByRef strContent)
    sDoAppendFile = False
    Dim strPath
    strPath = Left(strFileName, InstrRev(strFileName, “\”, -1, 1))
    Rem ## 检测路径及文件名有效性
    If Not(CreateDir(strPath)) Then Exit function
    ‘If Not(CheckFileName(strFileName)) Then Exit function
   
    ‘response.Write(strFileName)
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Dim fso, f
    Set fso = CreateObject(“Scripting.FileSystemObject”)
    Set f = fso.OpenTextFile(strFileName, ForAppending, True)
    f.Write strContent
    f.Close
    Set fso = nothing
    Set f = nothing
    sDoAppendFile = True
   End function
  Rem #################################################################
  Rem ## 建立目录的程序,如果有多级目录,则一级一级的创建
  Rem #################################################################
   Private function CreateDir(ByVal strLocalPath)
    Dim i, strPath, objFolder, tmpPath, tmptPath
    Dim arrPathList, intLevel
   
    ‘On Error Resume Next
    strPath     = Replace(strLocalPath, “\”, “/”)
    Set objFolder  = server.CreateObject(“Scripting.FileSystemObject”)
    arrPathList   = Split(strPath, “/”)
    intLevel     = UBound(arrPathList)
   
    For I = 0 To intLevel
     If I = 0 Then
      tmptPath = arrPathList(0) & “/”
     Else
      tmptPath = tmptPath & arrPathList(I) & “/”
     End If
     tmpPath = Left(tmptPath, Len(tmptPath) - 1)
     If Not objFolder.FolderExists(tmpPath) Then objFolder.CreateFolder tmpPath
    Next
   
    Set objFolder = Nothing
    If Err.Number <> 0 Then
     CreateDir = False
     Err.Clear
    Else
     CreateDir = True
    End If
   End function
  Rem #################################################################
  Rem ## 长整数转换
  Rem #################################################################
   Private function toNum(s, default)
    If IsNumeric(s) and s <> “” then
     toNum = CLng(s)
    Else
     toNum = default
    End If
   End function
  Rem #################################################################
End Class
Rem #####################################################################################
%>

ASP实现图片上传

Filed under: ASP — 标签:, — FDS @ 11:22

用纯ASP代码来实现图片的上传以及保存到数据库的功能(顺便也实现显示数据库中的图片到网页上的功能)。
  首先我们先来熟悉一下将要使用的对象方法。我们用来获取上一个页面传递过来的数据一般是使用Request对象。同样的,我们也可以使用Request对象来获取上传上来的文件数据,使用的方法是Request.BinaryRead()。而我们要从数据库中读出来图片的数据显示到网页上面要用到的方法是:
Request.BinaryWrite()。在我们得到了图片的数据,要保存到数据库中的时候,不可以直接
使用Insert语句对数据库进行操作,而是要使用ADO的AppendChunk方法,同样的,读出数据库
中的图片数据,要使用GetChunk方法。各个方法的具体语法如下:
*Request.BinaryRead语法:
variant=Request.BinaryRead(count)
参数
variant
返回值保存着从客户端读取到数据。
count
指明要从客户端读取的数据量大小,这个值小于或者等于使用方法Request.TotalBytes得到的
数据量。
*Request.BinaryWrite语法:
Request.BinaryWritedata
参数
data
要写入到客户端浏览器中的数据包。
*Request.TotalBytes语法:
variant=Request.TotalBytes
参数
variant
返回从客户端读取到数据量的字节数。
*AppendChunk语法
将数据追加到大型文本、二进制数据Field或Parameter对象。
object.AppendChunkData
参数
objectField或Parameter对象
Data变体型,包含追加到对象中的数据。
说明
使用Field或Parameter对象的AppendChunk方法可将长二进制或字符数
  据填写到对象中。在系统内存有限的情况下,可以使用AppendChunk方法对长整型值进行
部分而非全部的操作。
*GetChunk语法
返回大型文本或二进制数据Field对象的全部或部分内容。
variable=field.GetChunk(Size)
返回值
返回变体型。
参数
Size长整型表达式,等于所要检索的字节或字符数。
说明
  使用Field对象的GetChunk方法检索其部分或全部长二进制或字符数据。在系统内存有限
的情况下,可使用GetChunk方法处理部分而非全部的长整型值。
GetChunk调用返回的数据将赋给“变量”。如果Size大于剩余的数据,则
GetChunk仅返回剩余的数据而无需用空白填充“变量”。如果字段为空,则
GetChunk方法返回Null。
  每个后续的GetChunk调用将检索从前一次GetChunk调用停止处开始的数据。但是,如果从
一个字段检索数据然后在当前记录中设置或读取另一个字段的值,ADO将认为已从第一个字段
中检索出数据。如果在第一个字段上再次调用GetChunk方法,ADO将把调用解释为新的GetChu
nk操作并从记录的起始处开始读取。如果其他Recordset对象不是首个Recordset对象的副本,
则访问其中的字段不会破坏GetChunk操作。
如果Field对象的Attributes属性中的adFldLong位设置为True,则可以对该字段使用GetChun
k方法。
如果在Field对象上使用Getchunk方法时没有当前记录,将产生错误3021(无当前记录)。
  接下来,我们就要来设计我们的数据库了,作为测试我们的数据库结构如下(access200
0):

字段名称    类型    描述
  id   自动编号   主键值
    img          OLE对象   用来保存图片数据 

对于在MSSQLServer7中,对应的结构如下:
字段名称    类型    描述
  id    int(Identity)        主键值
     img      image             用来保存图片数据 

现在开始正式编写我们的纯ASP代码上传部分了,首先,我们有一个提供给用户的上传界面
,可以让用户选择要上传的图片。代码如下
(upload.htm):
<html>
<body>
<center>
<form name=”mainForm” enctype=”multipart/form-data” action=”process.asp” method=p
ost>
  <inputtype=filename=mefile><br>
  <inputtype=submitname=okvalue=”OK”>
</form>
</center>
</body>
</html>
注意enctype=”multipart/form-data”,一定要在Form中有这个属性,否则,将无法得到上传
上来的数据。接下来,我们要在process.asp中对从浏览器中获取的数据进行必要的处理,因
为我们在process.asp中获取到的数据不仅仅包含了我们想要的上传上来的图片的数据,也包
含了其他的无用的信息,我们需要剔除冗余数据,并将处理过的图片数据保存到数据库中,这
里我们以access2000为例。具体代码如下(process.asp):
<%
response.buffer=true
formsize=request.totalbytes
formdata=request.binaryread(formsize)
bncrlf=chrB(13)&chrB(10)
divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1)
datastart=instrb(formdata,bncrlf&bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
mydata=midb(formdata,datastart,dataend)
setconnGraph=server.CreateObject(“ADODB.connection”)
connGraph.ConnectionString=”driver={MicrosoftAccessDriver(*.mdb)};DBQ=”&server.Ma
pPath(“images.mdb”)&”;uid=;PWD=;”
connGraph.Open
setrec=server.createobject(“ADODB.recordset”)
rec.Open”SELECT*FROM[images]whereidisnull”,connGraph,1,3
rec.addnew
rec(“img”).appendchunkmydata
rec.update
rec.close
setrec=nothing
setconnGraph=nothing
%>
好了,这下我们就把上传来的图片保存到了名为images.mdb的数据库中了,剩下的工作就是要
将数据库中的图片数据显示到网页上面了。一般在HTML中,显示图片都是使用<IMG>标签
,也就是<IMGSRC=”图片路径”>,但是我们的图片是保存到了数据库中,“图片路径”是什么
呢?呵呵,其实这个SRC属性除了指定路径外,也可以这样使用哦:
<IMGSRC=”showimg.asp?id=xxx”>
所以,我们所要做的就是在showimg.asp中从数据库中读出来符合条件的
数据,并返回到SRC属性中就可以了,具体代码如下(showimg.asp):
<%
setconnGraph=server.CreateObject(“ADODB.connection”)
connGraph.ConnectionString=”driver={MicrosoftAccessDriver(*.mdb)};DBQ=”&
server.MapPath(“images.mdb”)&”;uid=;PWD=;”
connGraph.Open
setrec=server.createobject(“ADODB.recordset”)
strsql=”selectimgfromimageswhereid=”&trim(request(“id”))
rec.openstrsql,connGraph,1,1
Response.ContentType=”image/*”
Response.BinaryWriterec(“img”).getChunk(7500000)
rec.close
setrec=nothing
setconnGraph=nothing
%>
注意在输出到浏览器之前一定要指定Response.ContentType=”image/*”,
以便正常显示图片。
最后要注意的地方是,我的process.asp中作的处理没有考虑到第一页(upload.htm)中还有其
他数据,比如<INPUT type=tesxt name=userid>等等,如果有这些项目,你的process.asp就
要注意处理掉不必要的数据。

php访问查询mysql数据的三种方法

Filed under: PHP — 标签: — FDS @ 11:17

1. $row = mysql_fetch_row($result);
返回一个规则的数组$row,$row[0]是第一个元素,$row[1]是第二个元素,依次类推…
mysql_num_fields($result) 返回结果的元素个数。

2. $row = mysql_fetch_array($result);

返回一个数组$row. 举例如下:
表结构如下:

username | password
————————————-
bourbon | abc
berber | efg

第一次运行运行 $row = mysql_fetch_array($result) 则结果如下:

$row[0] = $row["username"] = “bourbon”
$row[1] = $row["password"] = “abc”

第一次运行运行 $row = mysql_fetch_array($result) 则结果如下:

$row[0] = $row["username"] = “berber”
$row[1] = $row["password"] = “efg”

3. $row = mysql_fetch_object($result);

返回一个对象描述行. 如上例
第一次运行运行$row = mysql_fetch_object($result) 则结果如下:

$row->username = “bourbon”
$row->password = “abc”

第二次运行运行$row = mysql_fetch_object($result) 则结果如下:
$row->username = “berber”
$row->password = “efg”

在Asp程序中取得表单所有内容的方法

Filed under: ASP — 标签: — FDS @ 11:12

在Asp中如何得到所有表单的名称跟对应的值。其实,这个问题很简单,但是可能还是有很多人不知道该怎么做,所以特地写下来,仅供参考。在Asp程序中,用来获得客户端数据的对象是 Request,这个对象给我们提供了很多的方法以及属性。比如,有这样一个Form,

<FORM METHOD=POST name=cqq ACTION=”">
 <INPUT TYPE=”text” NAME=”username”>
 <INPUT TYPE=”text” NAME=”password”>
 <INPUT TYPE=”checkbox” NAME=”sex” value=”male”>
 <INPUT TYPE=”checkbox” NAME=”sex” value=”female”>
 <INPUT TYPE=”submit”>
 </FORM>

         如果我们要取得 username 中的值,我们可以这样写:Request.Form(“username”)

 这个大家都会,其实这个Form是一个集合,也就是说表单中的所有的内容都存放在这个集合

当中,我们要取得某个元素的值,只需要在Request.Form() 这里制定元素的名称就可以了,比如

上面的username。

          那么,我们要取得集合中所有的值呢?  那很简单,什么都不用跟就是了,直接写Request.Form

就得到了集合中所有元素的名称跟值。  下面是一个对集合操作的语句:

<%
For each obj in Request.Form
     Response.write obj & ” ” & Request.Form(obj) &  ” <br>”
Next
%>

2009年6月24日

asp开发中textarea一些问题

Filed under: ASP — FDS @ 12:12

使用SQL SERVER的[导入]功能,便可将access数据转换,但要注意原来的’自增字段’需要修改,将相应字段标识修改为‘是’(原来的备注字段也会自动转化为ntext).

由于新闻的添加,修改都是通过使用textarea,首先为了能保留输入内容的格式,在处理添加的页面加入

<%
Function SqlStr( data )
SqlStr = “‘” & Replace( data, “‘”, “”” ) & “‘”
End Function
Function  coder(str)
Dim  i
If  IsNull(str)  Then  :  coder=”"  :  Exit  Function  :  End  If
For  i  =  1  to  Len(str)
Select  case  mid(str,i,1)
Case  “<”          :  coder  =  coder  &”&lt;”
Case  “>”          :  coder  =  coder  &”&gt;”
Case  “&”          :  coder  =  coder  &”&amp;”
Case  chr(9)    :  coder  =  coder  &”&nbsp;&nbsp;”
Case  VBCrLf    :  coder  =  coder  &”<br>”
Case  chr(32)  :  coder  =  coder  &”&nbsp;”
Case  chr(34)  :  coder  =  coder  &”&quot;”
Case  chr(39)  :  coder  =  coder  &”&#39;”
Case  Else        :  coder  =  coder  &  mid(str,i,1)
End  Select
Next
End  Function

content=request(“content”)’正文
content=replace(content,”&nbsp;”,” “)   ‘此处处理是因为修改页面所加入空格会被转化为&nbsp; ,在此先过滤
content=coder(content)

%>

在修改页面

<%

rs.Open sql, conn, adOpenStatic
content=rs(“正文”) ‘此处一定要写,倘若直接在textarea处写

‘<textarea rows=”7″ name=”t” cols=”47″ ><%=rs(“正文”) %></textarea >“则无法显示(我就被此处

‘困了好久,还以为长字段不能使用ntext而只能使用text或varchar呢)

%>

在显示页面

<%

rs.Open sql, conn, adOpenStatic
content=rs(“content”)   ‘一定先放到变量中,否则可能无法显示
content=replace(content,vbcrlf,”<br>”+vbcrlf)   ‘经过此处处理,可显示出正确的段落格式

%>

2009年5月11日

ASP控制每页打印行数的方法

Filed under: ASP — 标签:, , — FDS @ 18:12

在日常工作中,打印文档经常要使用,但是网页打印起来大部分都是不能控制的,这里分享一个用 ASP控制每页打印行数的方法。也许对你有一点点的启发哦!<%
pagenum=55′指定打印行数
%>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<TITLE>销售利润明细报表打印</TITLE>
<style type=”text/css”>
td {font-size:9pt; color:#000000}
A{text-decoration:none}
A:hover{color:#FF0000;text-decoration:derline}
.break{page-break-before:always}
</style>
</HEAD>
<script language=”javascript”>
window.print()
</script>
<BODY style=”border:none” topmargin=”0″ leftmargin=”6″ onload=”javascrpt:pagesetup_default();”>
<script language=”VbScript”>
dim hkey_root,hkey_path,hkey_key
hkey_root=”HKEY_CURRENT_USER”
hkey_path=”\Software\Microsoft\Internet Explorer\PageSetup”
function pagesetup_default()
    on error resume next
    Set RegWsh = CreateObject(“WScript.Shell”)
    hkey_key=”\header”   
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,”&b页&p/&P”
    hkey_key=”\footer”
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,”"
end function
</script>

<%
kdname1=trim(request(“kdname1″))
kdname2=trim(request(“kdname2″))
keyword1=trim(request(“keyword1″))
keyword2=trim(request(“keyword2″))

 if keyword1<>”" then
 today=keyword1
 else
 if kdname1=”" then
 today=year(date())&”-”&month(date())
 else
 today=kdname1&”至”&kdname2
 end if
 end if
%>
  <table border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center” width=”740″  height=”30″>
    <tr>
      <td align=”center”>销售利润汇总报表</td>
    </tr>
  </table>

<% 
 strSQL=”select autoid,sellautoid,productxili,productname,productsize,productnum,productdan,productjia,chaoshi,tiaoma,youhui,fukuan,moncount1,gongshang,lirun1,username,indate,fudate from sell where officename=’”&trim(request.cookies(“Myoffice”))&”‘ and monthjie=’0′ and (year(indate)=year(getdate()) and month(indate)=month(getdate())) and zhuofei is null order by autoid desc”            
 set rs1=server.createobject(“adodb.recordset”)             
 rs1.open strSQL,conn,1,1
%>              
  <table border=”1″ cellspacing=”0″ cellpadding=”0″ align=”center” style=”border-collapse: collapse”  bordercolor=”#000000″ width=”740″>            
    <tr>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”70″ >销售单号</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”168″ >商品名称(规格)</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”121″ >客户</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”30″ >数量</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”24″ >单位</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”50″ >销售价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”23″ >折%</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”52″ >进货价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”55″ >小计</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”45″ >利润</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”25″ >付款</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”61″ >销售日期</td>            
    </tr>
  </table>
<%            
  moncount2=0            
  moncount5=0            
  Do while not rs1.eof 
%>
<table border=”1″ cellpadding=”0″ cellspacing=”0″ width=”740″ align=”center” style=”border-collapse:collapse; font-size:10pt;color:#000000″ bordercolor=”#000000″>
<%
for i=1 to pagenum
if not rs1.eof then
  if trim(rs1(“fukuan”))=”欠款” then            
  moncount6=Csng(rs1(“lirun1″))            
  moncount5=moncount5+moncount6            
  else            
  moncount3=Csng(rs1(“lirun1″))            
  moncount2=moncount2+moncount3            
  end if 
%>     
    <tr>            
      <td height=”18″ width=”70″>&nbsp;<%=rs1(“sellautoid”)%></td>            
      <td height=”18″ width=”168″><%=Decode(rs1(“productname”))%>&nbsp;<%=rs1(“productsize”)%></td>            
      <td height=”18″ width=”121″><%=left(rs1(“gongshang”),9)%></td>           
      <td height=”18″ width=”30″ align=”center”><%=rs1(“productnum”)%></td>           
      <td height=”18″ width=”24″ align=”center”><%=rs1(“productdan”)%></td>           
      <td height=”18″ width=”50″ align=”right”><%=formatNumber(rs1(“chaoshi”),varnum,-1)%></td>           
      <td height=”18″ width=”23″ align=”center”><%=rs1(“youhui”)%></td>           
      <td height=”18″ width=”52″ align=”right”><%=formatNumber(rs1(“productjia”),varnum,-1)%></td>           
      <td height=”18″ width=”55″ align=”right”><%=formatNumber(rs1(“moncount1″),varnum,-1)%></td>           
      <td height=”18″ width=”45″ align=”right”><%=formatNumber(rs1(“lirun1″),varnum,-1)%></td>           
      <td align=”center” height=”18″ width=”25″><%if trim(rs1(“fukuan”))=”欠款” then%><font color=blue><%=rs1(“fukuan”)%></font><%else%><%=rs1(“fukuan”)%><%end if%></td>           
      <td height=”18″ width=”61″><%=rs1(“indate”)%></td>           
    </tr>
<%
rs1.movenext
end if
next
%>
</table>
<%
if not rs1.eof and i=pagenum+1 then ‘添加分页标记
%>
  <div class=”break”>&nbsp;</div>
  <table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”740″ height=”12″ align=”center”><tr><td height=”12″></td></tr></table>
  <table border=”1″ cellspacing=”0″ cellpadding=”0″ align=”center” width=”740″ style=”border-collapse: collapse”  bordercolor=”#000000″>
    <tr>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”70″ >销售单号</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”168″ >商品名称(规格)</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”121″ >客户</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”30″ >数量</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”24″ >单位</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”50″ >销售价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”23″ >折%</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”52″ >进货价</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”55″ >小计</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”45″ >利润</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”25″ >付款</td>            
      <td align=”center” height=”20″ bgcolor=”#BDCBEE” width=”61″ >销售日期</td>            
    </tr>
<%
end if
loop
rs1.close    
set rs1=nothing    
%> 
</table> 
  <table border=”1″ cellpadding=”0″ cellspacing=”0″ width=”740″ height=”20″ align=”center” style=”border-collapse: collapse”  bordercolor=”#000000″>
    <tr>           
       <td><font color=”#FF0000″><b>现金利润:</b></font><b><%=formatNumber(moncount2,varnum,-1)%></b>&nbsp;&nbsp;&nbsp;<%if moncount5<>”" then%><b><font color=”#FF0000″>欠款利润</font>:<%=formatNumber(moncount5,varnum,-1)%></b><%end if%>&nbsp;&nbsp;&nbsp;<%if moncount5<>”" then%><b><font color=”#FF0000″>毛利合计:</font><%=formatNumber(moncount5+moncount2,varnum,-1)%></b><%end if%></td>           
     </tr>  
   </table>           
<%
end if
conn.close
set conn=nothing
%> 

</BODY>
</HTML>

2009年5月4日

初识“微软ISA认证”

Filed under: 计算机考试 — 标签: — FDS @ 18:05

【简 介】
随着网络安全行业的升温,微软继思科成功推出安全认证专家(CCSP)后,又新增两门安全类专业方向的认证–MCSA: Security和MCSE: Security,继此,又推出ISA认证。   function goforum(){ var ff=document.all.forum.options[document.all.forum.selectedIndex].value; window.location.href=ff; return false; } 它是针对那些部署和管理部门级应用程序、组件、Web或桌面系统客户端及网络安全服务的专业人员而提供的。其工作角色涵盖了从需求实现到解决方案建立、部署与维护在内的各种任务。大家也许对它还比较陌生,下面我们进行一下简单的介绍:

业界评论

微软ISA(Internet Security and Acceleration ) SERVER 2000软件,是微软推出的防火墙服务器软件,堪称网络安全与速度的完美结合。目前,业界使用这个软件的企业越来越多通过这门认证,可得到MCP(产品专家)证书。

认识ISA

ISA Server通过集成一个可扩展的多层企业级防火墙和一个可伸缩的高性能Web缓存,从而实现合二为一的网络安全和加速服务器。

ISA Server有很强的自定义和扩展性。它包括一个综合的软件开发包(SDK)和应用程序接口 (API),方便本地合作伙伴能够快速、方便地为企业扩展其安全和缓存解决方案。

ISA Server能够帮助企业发布Exchange和IIS,同时,还集成了入侵检测功能、H.323(关守)等模块。

关于考试

考试号:70-227

考试科目(中文) :安装、配置和管理微软Internet安全和加速(ISA)服务器2000企业版

考试题数:50道题

考试时间:170分钟

满分:1000

2009年4月13日

3个步骤来实现asp模块化分页

Filed under: ASP — 标签: — FDS @ 22:40

 通过3个步骤来实现模块化分页,1、查询语句块,2、显示记录块,3、输出分页效果

1、查询语句块

<%
取得当前文件名
temp = Split(request.ServerVariables(“URL”), “/”)
fy = temp(UBound(temp))
set rs=server.createobject(“adodb.recordset”)
if not isempty(request(“page”)) then  
pagecount=cint(request(“page”))  
else  
pagecount=1  
end if
sql=”select  查询语句”
rs.open sql,conn,1,1
rs.pagesize=10  分页记录数
if pagecount>rs.pagecount or pagecount<=0 then             
pagecount=1             
end if            
if rs.eof and rs.bof then%>

<div align=”center” class=”001″><br>
对不起,没有符合搜索条件的记录!<br>
</div>

2、显示记录块

<%
else
rs.AbsolutePage=pagecount
do while not rs.eof %>

显示的记录

<% i=i+2                                                                                                 
rs.movenext                                                                                                 
if i>=rs.PageSize then exit do
loop                                                                   
%>

3、输出分页效果
<table width=”778″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
  <tr align=”center”>
    <% if rs.pagecount=1 then %>
    <td height=”35″ colspan=”4″ class=001><font color=”#000000″>共有[<font color="#ff0000"><%=rs.recordcount%></font>]条信息 当前显示第 <font color=”red”>1~<%=rs.recordcount%></font>条</font></td>
  </tr>
  <tr>
    <%else%>
    <td width=”19%” height=”35″ align=”center” valign=”middle” class=001><font color=”#000000″>
      <% page_start=(pagecount-1)*rs.pagesize
            if pagecount=1 then page_start=1
      page_end=rs.pagesize*pagecount
      if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if%>
      共有[<font color="#ff0000"><%=rs.recordcount%></font>]信息</font></td>
    <td width=”58%” height=”30″ align=”center” class=”fy”><font color=”#000000″>
          <%
    if pagecount>5 and pagecount< rs.PageCount-5 and rs.pagecount>10 then
    qizu=pagecount-4
    min=pagecount+5
    response.write “<a href=”&source&”?page=1&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>首页</font></a>&nbsp;”
    response.write “<a href=”&source&”?page=”+cstr(pagecount-1)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>上一页</font></a>&nbsp;”                                                    
    for ipage=qizu to min
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    response.write “<a href=”&source&”?page=”+cstr(pagecount+1)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>下一页</font></a>&nbsp;”
    response.write “<a href=”&source&”?page=”+cstr(rs.PageCount)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>尾页</font></a>”
    end if
    if rs.PageCount<11 then
    for ipage=1 to rs.PageCount
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    end if
    if pagecount < 6 and rs.PageCount>10 then
    for ipage=1 to 10
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    response.write “<a href=”&source&”?page=”+cstr(rs.PageCount)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>尾页</font></a>”
    end if
    if pagecount>rs.PageCount-6 and rs.PageCount>10 then
    response.write “<a href=”&source&”?page=1&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&title=”&title&”&cityid=”&cityid&”><font color=’0000BE’>首页</font></a>&nbsp;”  
    for ipage=rs.PageCount-9 to rs.PageCount
             if ipage<>pagecount then
             response.write “<a href=”&source&”?page=”+cstr(ipage)+”&sortid=”&sortid&”&typeid=”&typeid&”&qylb=”&qylb&”&cityid=”&cityid&”><font color=’0000BE’>”+cstr(ipage)+”</font></a>&nbsp;”
             else
             response.write “<font color=’#FF0000′>”&ipage&”</font> “                                               
             end if
    next
    end if
             %>
    </font></td><form name=go2to form method=Post action=<%=fy%>> 
    <td width=”13%” align=”center” valign=”middle” class=”fy”>                                         
   <input type=’hidden’ name=’sortid’ value=”<%=sortid%>”><input type=’hidden’ name=’typeid’ value=”<%=typeid%>”><input type=’hidden’ name=’qylb’ value=”<%=qylb%>”><input type=’hidden’ name=’title’ value=”<%title%>”><input type=’hidden’ name=’cityid’ value=”<%=cityid%>”><font color=’000064′> 转到第<input type=’text’ name=’page’ size=2 maxLength=3>
   页</font>                              
   </td>
    <td width=”10%” align=”center” valign=”middle” class=”fy”><input name=”image” type=’image’ onClick=check() value=’确 定’ src=’http://edu.chinaz.com/Get/Program/images/button_h.jpg’></td>
    </form>
  <tr>
    <td height=”20″ colspan=”6″ valign=”bottom”><font color=”#000000″>&nbsp; </font></td>
  </tr>
  <% end if %>
  <% end if %>
</table>

2009年4月2日

用ASP实现在服务器自动在线解压RAR文件

Filed under: ASP — FDS @ 09:58

文件打包以后,在服务器自动在线解压RAR文件,这样可以大量的减少上传文件的时间。也很方便!这里分享一个用ASP实现在服务器自动在线解压RAR文件的方法。

<%

dim ylj,ywj,Mlpath,Shell,rarcomm,RetCode,cmd,comm,fso

Mlpath=”E:\page\mian\”    ‘存放RAR.EXE和CMD.EXE的路径

ylj=Server.mappath(“mian”)&”\”  ‘解压文件后所放的路径

ywj=Server.mappath(“mian\apathy.rar”)  ‘要解压的RAR文件

Set Shell = Server.CreateObject(“WScript.Shell”)

rarcomm= “E:\page\mian\cmd.exe /c “&Mlpath&”rar.exe x -t -o+ -p- ”

cmd=rarcomm&ywj&” “&ylj

RetCode = Shell.Run(cmd,1, True)

%>

就是用Server.CreateObject(“WScript.Shell”)来执行CMD.EXE来运行RAR.EXE文件来解压RAR文件的。

2009年3月24日

JS弹出菜单纵向/横向效果

Filed under: HTML,JAVASCRIPT — 标签: — FDS @ 17:05

JS弹出菜单效果,包括纵向和横向的。以下是实现方法。

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<HEAD>
<TITLE></TITLE>
</HEAD>

<BODY background=”img/back.gif” leftMargin=0 topMargin=0>
<script language=”JavaScript”>
<!–
function mmLoadMenus() {
 if (window.mm_menu_1008171701_0) return;
 window.mm_menu_1008171701_0 = new Menu(“root”,71,18,”",12,”#FFFFFF”,”#FFFFFF”,”#FF9900″,”#CC0000″,”center”,”middle”,3,0,400,-5,7,true,false,true,0,true,true);/* 后面三个TRUE如果是FALSE就是横向*/
 mm_menu_1008171701_0.addMenuItem(“40头镀铝机”,”location=’111.asp’”);
 mm_menu_1008171701_0.addMenuItem(“30头镀铝机”,”location=’222.asp’”);
 mm_menu_1008171701_0.addMenuItem(“20头镀铝机”,”location=’333.asp’”);
 mm_menu_1008171701_0.hideOnMouseOut=true;
 mm_menu_1008171701_0.bgColor=’#555555′;
 mm_menu_1008171701_0.menuBorder=6;
 mm_menu_1008171701_0.menuLiteBgColor=’#FFFFFF’;
 mm_menu_1008171701_0.menuBorderBgColor=’#777777′;
 mm_menu_1008171701_0.writeMenus();
} // mmLoadMenus()
//–>
</script>
<script language=”JavaScript”>
/**
 * mm_menu 20MAR2002 Version 6.0
 * Andy Finnell, March 2002
 * Copyright (c) 2000-2002 Macromedia, Inc.
 *
 * based on menu.js
 * by gary smith, July 1997
 * Copyright (c) 1997-1999 Netscape Communications Corp.
 *
 * Netscape grants you a royalty free license to use or modify this
 * software provided that this copyright notice appears on all copies.
 * This software is provided “AS IS,” without a warranty of any kind.
 */
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah)
{
 this.version = “020320 [Menu; mm_menu.js]“;
 this.type = “Menu”;
 this.menuWidth = mw;
 this.menuItemHeight = mh;
 this.fontSize = fs;
 this.fontWeight = “plain”;
 this.fontFamily = fnt;
 this.fontColor = fclr;
 this.fontColorHilite = fhclr;
 this.bgColor = “#555555″;
 this.menuBorder = 1;
 this.menuBgOpaque=opq;
 this.menuItemBorder = 1;
 this.menuItemIndent = idt;
 this.menuItemBgColor = bg;
 this.menuItemVAlign = valgn;
 this.menuItemHAlign = halgn;
 this.menuItemPadding = pad;
 this.menuItemSpacing = space;
 this.menuLiteBgColor = “#ffffff”;
 this.menuBorderBgColor = “#777777″;
 this.menuHiliteBgColor = bgh;
 this.menuContainerBgColor = “#cccccc”;
 this.childMenuIcon = “arrows.gif”;
 this.submenuXOffset = sx;
 this.submenuYOffset = sy;
 this.submenuRelativeToItem = srel;
 this.vertical = vert;
 this.items = new Array();
 this.actions = new Array();
 this.childMenus = new Array();
 this.hideOnMouseOut = true;
 this.hideTimeout = to;
 this.addMenuItem = addMenuItem;
 this.writeMenus = writeMenus;
 this.MM_showMenu = MM_showMenu;
 this.onMenuItemOver = onMenuItemOver;
 this.onMenuItemAction = onMenuItemAction;
 this.hideMenu = hideMenu;
 this.hideChildMenu = hideChildMenu;
 if (!window.menus) window.menus = new Array();
 this.label = ” ” + label;
 window.menus[this.label] = this;
 window.menus[window.menus.length] = this;
 if (!window.activeMenus) window.activeMenus = new Array();
}

function addMenuItem(label, action) {
 this.items[this.items.length] = label;
 this.actions[this.actions.length] = action;
}

function FIND(item) {
 if( window.mmIsOpera ) return(document.getElementById(item));
 if (document.all) return(document.all[item]);
 if (document.getElementById) return(document.getElementById(item));
 return(false);
}

function writeMenus(container) {
 if (window.triedToWriteMenus) return;
 var agt = navigator.userAgent.toLowerCase();
 window.mmIsOpera = agt.indexOf(“opera”) != -1;
 if (!container && document.layers) {
  window.delayWriteMenus = this.writeMenus;
  var timer = setTimeout(‘delayWriteMenus()’, 500);
  container = new Layer(100);
  clearTimeout(timer);
 } else if (document.all || document.hasChildNodes || window.mmIsOpera) {
  document.writeln(‘<span id=”menuContainer”></span>’);
  container = FIND(“menuContainer”);
 }

 window.mmHideMenuTimer = null;
 if (!container) return; 
 window.triedToWriteMenus = true;
 container.isContainer = true;
 container.menus = new Array();
 for (var i=0; i<window.menus.length; i++)
  container.menus[i] = window.menus[i];
 window.menus.length = 0;
 var countMenus = 0;
 var countItems = 0;
 var top = 0;
 var content = ”;
 var lrs = false;
 var theStat = “”;
 var tsc = 0;
 if (document.layers) lrs = true;
 for (var i=0; i<container.menus.length; i++, countMenus++) {
  var menu = container.menus[i];
  if (menu.bgImageUp || !menu.menuBgOpaque) {
   menu.menuBorder = 0;
   menu.menuItemBorder = 0;
  }
  if (lrs) {
   var menuLayer = new Layer(100, container);
   var lite = new Layer(100, menuLayer);
   lite.top = menu.menuBorder;
   lite.left = menu.menuBorder;
   var body = new Layer(100, lite);
   body.top = menu.menuBorder;
   body.left = menu.menuBorder;
  } else {
   content += ”+
   ’<div id=”menuLayer’+ countMenus +’” style=”filter:Alpha(Opacity=90);position:absolute;z-index:1;left:10px;top:’+ (i * 100) +’px;visibility:hidden;color:’ +  menu.menuBorderBgColor + ‘;”>\n’+
   ’  <div id=”menuLite’+ countMenus +’” style=”position:absolute;z-index:1;left:’+ menu.menuBorder +’px;top:’+ menu.menuBorder +’px;visibility:hide;” onmouseout=”mouseoutMenu();”>\n’+
   ’  <div id=”menuFg’+ countMenus +’” style=”position:absolute;left:’+ menu.menuBorder +’px;top:’+ menu.menuBorder +’px;visibility:hide;”>\n’+
   ”;
  }
  var x=i;
  for (var i=0; i<menu.items.length; i++) {
   var item = menu.items[i];
   var childMenu = false;
   var defaultHeight = menu.fontSize+2*menu.menuItemPadding;
   if (item.label) {
    item = item.label;
    childMenu = true;
   }
   menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
   var itemProps = ”;
   if( menu.fontFamily != ” ) itemProps += ‘font-family:’ + menu.fontFamily +’;';
   itemProps += ‘font-weight:’ + menu.fontWeight + ‘;fontSize:’ + menu.fontSize + ‘px;’;
   if (menu.fontStyle) itemProps += ‘font-style:’ + menu.fontStyle + ‘;’;
   if (document.all || window.mmIsOpera)
    itemProps += ‘font-size:’ + menu.fontSize + ‘px;” onmouseover=”onMenuItemOver(null,this);” onclick=”onMenuItemAction(null,this);’;
   else if (!document.layers) {
    itemProps += ‘font-size:’ + menu.fontSize + ‘px;’;
   }
   var l;
   if (lrs) {
    var lw = menu.menuWidth;
    if( menu.menuItemHAlign == ‘right’ ) lw -= menu.menuItemPadding;
    l = new Layer(lw,body);
   }
   var itemLeft = 0;
   var itemTop = i*menu.menuItemHeight;
   if( !menu.vertical ) {
    itemLeft = i*menu.menuWidth;
    itemTop = 0;
   }
   var dTag = ‘<div id=”menuItem’+ countItems +’” style=”position:absolute;left:’ + itemLeft + ‘px;top:’+ itemTop +’px;’+ itemProps +’”>’;
   var dClose = ‘</div>’
   if (menu.bgImageUp) dTag = ‘<div id=”menuItem’+ countItems +’” style=”background:url(‘+menu.bgImageUp+’);position:absolute;left:’ + itemLeft + ‘px;top:’+ itemTop +’px;’+ itemProps +’”>’;

   var left = 0, top = 0, right = 0, bottom = 0;
   left = 1 + menu.menuItemPadding + menu.menuItemIndent;
   right = left + menu.menuWidth – 2*menu.menuItemPadding – menu.menuItemIndent;
   if( menu.menuItemVAlign == ‘top’ ) top = menu.menuItemPadding;
   if( menu.menuItemVAlign == ‘bottom’ ) top = menu.menuItemHeight-menu.fontSize-1-menu.menuItemPadding;
   if( menu.menuItemVAlign == ‘middle’ ) top = ((menu.menuItemHeight/2)-(menu.fontSize/2)-1);
   bottom = menu.menuItemHeight – 2*menu.menuItemPadding;
   var textProps = ‘position:absolute;left:’ + left + ‘px;top:’ + top + ‘px;’;
   if (lrs) {
    textProps +=itemProps + ‘right:’ + right + ‘;bottom:’ + bottom + ‘;’;
    dTag = “”;
    dClose = “”;
   }
   
   if(document.all && !window.mmIsOpera) {
    item = ‘<div align=”‘ + menu.menuItemHAlign + ‘”>’ + item + ‘</div>’;
   } else if (lrs) {
    item = ‘<div style=”text-align:’ + menu.menuItemHAlign + ‘;”>’ + item + ‘</div>’;
   } else {
    var hitem = null;
    if( menu.menuItemHAlign != ‘left’ ) {
     if(window.mmIsOpera) {
      var operaWidth = menu.menuItemHAlign == ‘center’ ? -(menu.menuWidth-2*menu.menuItemPadding) : (menu.menuWidth-6*menu.menuItemPadding);
      hitem = ‘<div id=”menuItemHilite’ + countItems + ‘Shim” style=”position:absolute;top:1px;left:’ + menu.menuItemPadding + ‘px;width:’ + operaWidth + ‘px;text-align:’
       + menu.menuItemHAlign + ‘;visibility:visible;”>’ + item + ‘</div>’;
      item = ‘<div id=”menuItemText’ + countItems + ‘Shim” style=”position:absolute;top:1px;left:’ + menu.menuItemPadding + ‘px;width:’ + operaWidth + ‘px;text-align:’
       + menu.menuItemHAlign + ‘;visibility:visible;”>’ + item + ‘</div>’;
     } else {
      hitem = ‘<div id=”menuItemHilite’ + countItems + ‘Shim” style=”position:absolute;top:1px;left:1px;right:-’ + (left+menu.menuWidth-3*menu.menuItemPadding) + ‘px;text-align:’
       + menu.menuItemHAlign + ‘;visibility:visible;”>’ + item + ‘</div>’;
      item = ‘<div id=”menuItemText’ + countItems + ‘Shim” style=”position:absolute;top:1px;left:1px;right:-’ + (left+menu.menuWidth-3*menu.menuItemPadding) + ‘px;text-align:’
       + menu.menuItemHAlign + ‘;visibility:visible;”>’ + item + ‘</div>’;
     }
    } else hitem = null;
   }
   if(document.all && !window.mmIsOpera) item = ‘<div id=”menuItemShim’ + countItems + ‘” style=”position:absolute;left:0px;top:0px;”>’ + item + ‘</div>’;
   var dText = ‘<div id=”menuItemText’+ countItems +’” style=”‘ + textProps + ‘color:’+ menu.fontColor +’;”>’+ item +’&nbsp</div>\n’
      + ‘<div id=”menuItemHilite’+ countItems +’” style=”‘ + textProps + ‘color:’+ menu.fontColorHilite +’;visibility:hidden;”>’
      + (hitem||item) +’&nbsp</div>’;
   if (childMenu) content += ( dTag + dText + ‘<div id=”childMenu’+ countItems +’” style=”position:absolute;left:0px;top:3px;”><img src=”‘+ menu.childMenuIcon +’”></div>\n’ + dClose);
   else content += ( dTag + dText + dClose);
   if (lrs) {
    l.document.open(“text/html”);
    l.document.writeln(content);
    l.document.close(); 
    content = ”;
    theStat += “-”;
    tsc++;
    if (tsc > 50) {
     tsc = 0;
     theStat = “”;
    }
    status = theStat;
   }
   countItems++; 
  }
  if (lrs) {
   var focusItem = new Layer(100, body);
   focusItem.visiblity=”hidden”;
   focusItem.document.open(“text/html”);
   focusItem.document.writeln(“&nbsp;”);
   focusItem.document.close(); 
  } else {
    content += ‘   <div id=”focusItem’+ countMenus +’” style=”position:absolute;left:0px;top:0px;visibility:hide;” onclick=”onMenuItemAction(null,this);”>&nbsp;</div>\n’;
    content += ‘   </div>\n  </div>\n</div>\n’;
  }
  i=x;
 }
 if (document.layers) {  
  container.clip.width = window.innerWidth;
  container.clip.height = window.innerHeight;
  container.onmouseout = mouseoutMenu;
  container.menuContainerBgColor = this.menuContainerBgColor;
  for (var i=0; i<container.document.layers.length; i++) {
   proto = container.menus[i];
   var menu = container.document.layers[i];
   container.menus[i].menuLayer = menu;
   container.menus[i].menuLayer.Menu = container.menus[i];
   container.menus[i].menuLayer.Menu.container = container;
   var body = menu.document.layers[0].document.layers[0];
   body.clip.width = proto.menuWidth || body.clip.width;
   body.clip.height = proto.menuHeight || body.clip.height;
   for (var n=0; n<body.document.layers.length-1; n++) {
    var l = body.document.layers[n];
    l.Menu = container.menus[i];
    l.menuHiliteBgColor = proto.menuHiliteBgColor;
    l.document.bgColor = proto.menuItemBgColor;
    l.saveColor = proto.menuItemBgColor;
    l.onmouseover = proto.onMenuItemOver;
    l.onclick = proto.onMenuItemAction;
    l.mmaction = container.menus[i].actions[n];
    l.focusItem = body.document.layers[body.document.layers.length-1];
    l.clip.width = proto.menuWidth || body.clip.width;
    l.clip.height = proto.menuItemHeight || l.clip.height;
    if (n>0) {
     if( l.Menu.vertical ) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder + proto.menuItemSpacing;
     else l.left = body.document.layers[n-1].left + body.document.layers[n-1].clip.width + proto.menuItemBorder + proto.menuItemSpacing;
    }
    l.hilite = l.document.layers[1];
    if (proto.bgImageUp) l.background.src = proto.bgImageUp;
    l.document.layers[1].isHilite = true;
    if (l.document.layers.length > 2) {
     l.childMenu = container.menus[i].items[n].menuLayer;
     l.document.layers[2].left = l.clip.width -13;
     l.document.layers[2].top = (l.clip.height / 2) -4;
     l.document.layers[2].clip.left += 3;
     l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
    }
   }
   if( proto.menuBgOpaque ) body.document.bgColor = proto.bgColor;
   if( proto.vertical ) {
    body.clip.width  = l.clip.width +proto.menuBorder;
    body.clip.height = l.top + l.clip.height +proto.menuBorder;
   } else {
    body.clip.height  = l.clip.height +proto.menuBorder;
    body.clip.width = l.left + l.clip.width  +proto.menuBorder;
    if( body.clip.width > window.innerWidth ) body.clip.width = window.innerWidth;
   }
   var focusItem = body.document.layers[n];
   focusItem.clip.width = body.clip.width;
   focusItem.Menu = l.Menu;
   focusItem.top = -30;
            focusItem.captureEvents(Event.MOUSEDOWN);
            focusItem.onmousedown = onMenuItemDown;
   if( proto.menuBgOpaque ) menu.document.bgColor = proto.menuBorderBgColor;
   var lite = menu.document.layers[0];
   if( proto.menuBgOpaque ) lite.document.bgColor = proto.menuLiteBgColor;
   lite.clip.width = body.clip.width +1;
   lite.clip.height = body.clip.height +1;
   menu.clip.width = body.clip.width + (proto.menuBorder * 3) ;
   menu.clip.height = body.clip.height + (proto.menuBorder * 3);
  }
 } else {
  if ((!document.all) && (container.hasChildNodes) && !window.mmIsOpera) {
   container.innerHTML=content;
  } else {
   container.document.open(“text/html”);
   container.document.writeln(content);
   container.document.close(); 
  }
  if (!FIND(“menuLayer0″)) return;
  var menuCount = 0;
  for (var x=0; x<container.menus.length; x++) {
   var menuLayer = FIND(“menuLayer” + x);
   container.menus[x].menuLayer = “menuLayer” + x;
   menuLayer.Menu = container.menus[x];
   menuLayer.Menu.container = “menuLayer” + x;
   menuLayer.style.zindex = 1;
      var s = menuLayer.style;
   s.pixeltop = -300;
   s.pixelleft = -300;
   s.top = ‘-300px’;
   s.left = ‘-300px’;

   var menu = container.menus[x];
   menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
   if( menu.menuBgOpaque ) menuLayer.style.backgroundColor = menu.menuBorderBgColor;
   var top = 0;
   var left = 0;
   menu.menuItemLayers = new Array();
   for (var i=0; i<container.menus[x].items.length; i++) {
    var l = FIND(“menuItem” + menuCount);
    l.Menu = container.menus[x];
    l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;
    if (l.addEventListener || window.mmIsOpera) {
     l.style.width = menu.menuItemWidth + ‘px’;
     l.style.height = menu.menuItemHeight + ‘px’;
     l.style.pixelWidth = menu.menuItemWidth;
     l.style.pixelHeight = menu.menuItemHeight;
     l.style.top = top + ‘px’;
     l.style.left = left + ‘px’;
     if(l.addEventListener) {
      l.addEventListener(“mouseover”, onMenuItemOver, false);
      l.addEventListener(“click”, onMenuItemAction, false);
      l.addEventListener(“mouseout”, mouseoutMenu, false);
     }
     if( menu.menuItemHAlign != ‘left’ ) {
      l.hiliteShim = FIND(“menuItemHilite” + menuCount + “Shim”);
      l.hiliteShim.style.visibility = “inherit”;
      l.textShim = FIND(“menuItemText” + menuCount + “Shim”);
      l.hiliteShim.style.pixelWidth = menu.menuItemWidth – 2*menu.menuItemPadding – menu.menuItemIndent;
      l.hiliteShim.style.width = l.hiliteShim.style.pixelWidth;
      l.textShim.style.pixelWidth = menu.menuItemWidth – 2*menu.menuItemPadding – menu.menuItemIndent;
      l.textShim.style.width = l.textShim.style.pixelWidth; 
     }
    } else {
     l.style.pixelWidth = menu.menuItemWidth;
     l.style.pixelHeight = menu.menuItemHeight;
     l.style.pixelTop = top;
     l.style.pixelLeft = left;
     if( menu.menuItemHAlign != ‘left’ ) {
      var shim = FIND(“menuItemShim” + menuCount);
      shim[0].style.pixelWidth = menu.menuItemWidth – 2*menu.menuItemPadding – menu.menuItemIndent;
      shim[1].style.pixelWidth = menu.menuItemWidth – 2*menu.menuItemPadding – menu.menuItemIndent;
      shim[0].style.width = shim[0].style.pixelWidth + ‘px’;
      shim[1].style.width = shim[1].style.pixelWidth + ‘px’;
     }
    }
    if( menu.vertical ) top = top + menu.menuItemHeight+menu.menuItemBorder+menu.menuItemSpacing;
    else left = left + menu.menuItemWidth+menu.menuItemBorder+menu.menuItemSpacing;
    l.style.fontSize = menu.fontSize + ‘px’;
    l.style.backgroundColor = menu.menuItemBgColor;
    l.style.visibility = “inherit”;
    l.saveColor = menu.menuItemBgColor;
    l.menuHiliteBgColor = menu.menuHiliteBgColor;
    l.mmaction = container.menus[x].actions[i];
    l.hilite = FIND(“menuItemHilite” + menuCount);
    l.focusItem = FIND(“focusItem” + x);
    l.focusItem.style.pixelTop = -30;
    l.focusItem.style.top = ‘-30px’;
    var childItem = FIND(“childMenu” + menuCount);
    if (childItem) {
     l.childMenu = container.menus[x].items[i].menuLayer;
     childItem.style.pixelLeft = menu.menuItemWidth -11;
     childItem.style.left = childItem.style.pixelLeft + ‘px’;
     childItem.style.pixelTop = (menu.menuItemHeight /2) -4;
     childItem.style.top = childItem.style.pixelTop + ‘px’;
     l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
    }
    l.style.cursor = “hand”;
    menuCount++;
   }
   if( menu.vertical ) {
    menu.menuHeight = top-1-menu.menuItemSpacing;
    menu.menuWidth = menu.menuItemWidth;
   } else {
    menu.menuHeight = menu.menuItemHeight;
    menu.menuWidth = left-1-menu.menuItemSpacing;
   }

   var lite = FIND(“menuLite” + x);
   var s = lite.style;
   s.pixelHeight = menu.menuHeight +(menu.menuBorder * 2);
   s.height = s.pixelHeight + ‘px’;
   s.pixelWidth = menu.menuWidth + (menu.menuBorder * 2);
   s.width = s.pixelWidth + ‘px’;
   if( menu.menuBgOpaque ) s.backgroundColor = menu.menuLiteBgColor;

   var body = FIND(“menuFg” + x);
   s = body.style;
   s.pixelHeight = menu.menuHeight + menu.menuBorder;
   s.height = s.pixelHeight + ‘px’;
   s.pixelWidth = menu.menuWidth + menu.menuBorder;
   s.width = s.pixelWidth + ‘px’;
   if( menu.menuBgOpaque ) s.backgroundColor = menu.bgColor;

   s = menuLayer.style;
   s.pixelWidth  = menu.menuWidth + (menu.menuBorder * 4);
   s.width = s.pixelWidth + ‘px’;
   s.pixelHeight  = menu.menuHeight+(menu.menuBorder*4);
   s.height = s.pixelHeight + ‘px’;
  }
 }
 if (document.captureEvents) document.captureEvents(Event.MOUSEUP);
 if (document.addEventListener) document.addEventListener(“mouseup”, onMenuItemOver, false);
 if (document.layers && window.innerWidth) {
  window.onresize = NS4resize;
  window.NS4sIW = window.innerWidth;
  window.NS4sIH = window.innerHeight;
  setTimeout(“NS4resize()”,500);
 }
 document.onmouseup = mouseupMenu;
 window.mmWroteMenu = true;
 status = “”;
}

function NS4resize() {
 if (NS4sIW != window.innerWidth || NS4sIH != window.innerHeight) window.location.reload();
}

function onMenuItemOver(e, l) {
 MM_clearTimeout();
 l = l || this;
 a = window.ActiveMenuItem;
 if (document.layers) {
  if (a) {
   a.document.bgColor = a.saveColor;
   if (a.hilite) a.hilite.visibility = “hidden”;
   if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
   a.focusItem.top = -100;
   a.clicked = false;
  }
  if (l.hilite) {
   l.document.bgColor = l.menuHiliteBgColor;
   l.zIndex = 1;
   l.hilite.visibility = “inherit”;
   l.hilite.zIndex = 2;
   l.document.layers[1].zIndex = 1;
   l.focusItem.zIndex = this.zIndex +2;
  }
  if (l.Menu.bgImageOver) l.background.src = l.Menu.bgImageOver;
  l.focusItem.top = this.top;
  l.focusItem.left = this.left;
  l.focusItem.clip.width = l.clip.width;
  l.focusItem.clip.height = l.clip.height;
  l.Menu.hideChildMenu(l);
 } else if (l.style && l.Menu) {
  if (a) {
   a.style.backgroundColor = a.saveColor;
   if (a.hilite) a.hilite.style.visibility = “hidden”;
   if (a.hiliteShim) a.hiliteShim.style.visibility = “inherit”;
   if (a.Menu.bgImageUp) a.style.background = “url(” + a.Menu.bgImageUp +”)”;;
  }
  l.style.backgroundColor = l.menuHiliteBgColor;
  l.zIndex = 1;
  if (l.Menu.bgImageOver) l.style.background = “url(” + l.Menu.bgImageOver +”)”;
  if (l.hilite) {
   l.hilite.style.visibility = “inherit”;
   if( l.hiliteShim ) l.hiliteShim.style.visibility = “visible”;
  }
  l.focusItem.style.pixelTop = l.style.pixelTop;
  l.focusItem.style.top = l.focusItem.style.pixelTop + ‘px’;
  l.focusItem.style.pixelLeft = l.style.pixelLeft;
  l.focusItem.style.left = l.focusItem.style.pixelLeft + ‘px’;
  l.focusItem.style.zIndex = l.zIndex +1;
  l.Menu.hideChildMenu(l);
 } else return;
 window.ActiveMenuItem = l;
}

function onMenuItemAction(e, l) {
 l = window.ActiveMenuItem;
 if (!l) return;
 hideActiveMenus();
 if (l.mmaction) eval(“” + l.mmaction);
 window.ActiveMenuItem = 0;
}

function MM_clearTimeout() {
 if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
 mmHideMenuTimer = null;
 mmDHFlag = false;
}

function MM_startTimeout() {
 if( window.ActiveMenu ) {
  mmStart = new Date();
  mmDHFlag = true;
  mmHideMenuTimer = setTimeout(“mmDoHide()”, window.ActiveMenu.Menu.hideTimeout);
 }
}

function mmDoHide() {
 if (!mmDHFlag || !window.ActiveMenu) return;
 var elapsed = new Date() – mmStart;
 var timeout = window.ActiveMenu.Menu.hideTimeout;
 if (elapsed < timeout) {
  mmHideMenuTimer = setTimeout(“mmDoHide()”, timeout+100-elapsed);
  return;
 }
 mmDHFlag = false;
 hideActiveMenus();
 window.ActiveMenuItem = 0;
}

function MM_showMenu(menu, x, y, child, imgname) {
 if (!window.mmWroteMenu) return;
 MM_clearTimeout();
 if (menu) {
  var obj = FIND(imgname) || document.images[imgname] || document.links[imgname] || document.anchors[imgname];
  x = moveXbySlicePos (x, obj);
  y = moveYbySlicePos (y, obj);
 }
 if (document.layers) {
  if (menu) {
   var l = menu.menuLayer || menu;
   l.top = l.left = 1;
   hideActiveMenus();
   if (this.visibility) l = this;
   window.ActiveMenu = l;
  } else {
   var l = child;
  }
  if (!l) return;
  for (var i=0; i<l.layers.length; i++) {      
   if (!l.layers[i].isHilite) l.layers[i].visibility = “inherit”;
   if (l.layers[i].document.layers.length > 0) MM_showMenu(null, “relative”, “relative”, l.layers[i]);
  }
  if (l.parentLayer) {
   if (x != “relative”) l.parentLayer.left = x || window.pageX || 0;
   if (l.parentLayer.left + l.clip.width > window.innerWidth) l.parentLayer.left -= (l.parentLayer.left + l.clip.width – window.innerWidth);
   if (y != “relative”) l.parentLayer.top = y || window.pageY || 0;
   if (l.parentLayer.isContainer) {
    l.Menu.xOffset = window.pageXOffset;
    l.Menu.yOffset = window.pageYOffset;
    l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;
    l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;
    if (l.parentLayer.menuContainerBgColor && l.Menu.menuBgOpaque ) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
   }
  }
  l.visibility = “inherit”;
  if (l.Menu) l.Menu.container.visibility = “inherit”;
 } else if (FIND(“menuItem0″)) {
  var l = menu.menuLayer || menu; 
  hideActiveMenus();
  if (typeof(l) == “string”) l = FIND(l);
  window.ActiveMenu = l;
  var s = l.style;
  s.visibility = “inherit”;
  if (x != “relative”) {
   s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
   s.left = s.pixelLeft + ‘px’;
  }
  if (y != “relative”) {
   s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
   s.top = s.pixelTop + ‘px’;
  }
  l.Menu.xOffset = document.body.scrollLeft;
  l.Menu.yOffset = document.body.scrollTop;
 }
 if (menu) window.activeMenus[window.activeMenus.length] = l;
 MM_clearTimeout();
}

function onMenuItemDown(e, l) {
 var a = window.ActiveMenuItem;
 if (document.layers && a) {
  a.eX = e.pageX;
  a.eY = e.pageY;
  a.clicked = true;
    }
}

function mouseupMenu(e) {
 hideMenu(true, e);
 hideActiveMenus();
 return true;
}
function getExplorerVersion() {
 var ieVers = parseFloat(navigator.appVersion);
 if( navigator.appName != ‘Microsoft Internet Explorer’ ) return ieVers;
 var tempVers = navigator.appVersion;
 var i = tempVers.indexOf( ‘MSIE ‘ );
 if( i >= 0 ) {
  tempVers = tempVers.substring( i+5 );
  ieVers = parseFloat( tempVers );
 }
 return ieVers;
}

function mouseoutMenu() {
 if ((navigator.appName == “Microsoft Internet Explorer”) && (getExplorerVersion() < 4.5))
  return true;
 hideMenu(false, false);
 return true;
}

function hideMenu(mouseup, e) {
 var a = window.ActiveMenuItem;
 if (a && document.layers) {
  a.document.bgColor = a.saveColor;
  a.focusItem.top = -30;
  if (a.hilite) a.hilite.visibility = “hidden”;
  if (mouseup && a.mmaction && a.clicked && window.ActiveMenu) {
    if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) {
    setTimeout(‘window.ActiveMenu.Menu.onMenuItemAction();’, 500);
   }
  }
  a.clicked = false;
  if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
 } else if (window.ActiveMenu && FIND(“menuItem0″)) {
  if (a) {
   a.style.backgroundColor = a.saveColor;
   if (a.hilite) a.hilite.style.visibility = “hidden”;
   if (a.hiliteShim) a.hiliteShim.style.visibility = “inherit”;
   if (a.Menu.bgImageUp) a.style.background = “url(” + a.Menu.bgImageUp +”)”;
  }
 }
 if (!mouseup && window.ActiveMenu) {
  if (window.ActiveMenu.Menu) {
   if (window.ActiveMenu.Menu.hideOnMouseOut) MM_startTimeout();
   return(true);
  }
 }
 return(true);
}

function hideChildMenu(hcmLayer) {
 MM_clearTimeout();
 var l = hcmLayer;
 for (var i=0; i < l.Menu.childMenus.length; i++) {
  var theLayer = l.Menu.childMenus[i];
  if (document.layers) theLayer.visibility = “hidden”;
  else {
   theLayer = FIND(theLayer);
   theLayer.style.visibility = “hidden”;
   if( theLayer.Menu.menuItemHAlign != ‘left’ ) {
    for(var j = 0; j < theLayer.Menu.menuItemLayers.length; j++) {
     var itemLayer = theLayer.Menu.menuItemLayers[j];
     if(itemLayer.textShim) itemLayer.textShim.style.visibility = “inherit”;
    }
   }
  }
  theLayer.Menu.hideChildMenu(theLayer);
 }
 if (l.childMenu) {
  var childMenu = l.childMenu;
  if (document.layers) {
   l.Menu.MM_showMenu(null,null,null,childMenu.layers[0]);
   childMenu.zIndex = l.parentLayer.zIndex +1;
   childMenu.top = l.Menu.menuLayer.top + l.Menu.submenuYOffset;
   if( l.Menu.vertical ) {
    if( l.Menu.submenuRelativeToItem ) childMenu.top += l.top + l.parentLayer.top;
    childMenu.left = l.parentLayer.left + l.parentLayer.clip.width – (2*l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
   } else {
    childMenu.top += l.top + l.parentLayer.top; 
    if( l.Menu.submenuRelativeToItem ) childMenu.left = l.Menu.menuLayer.left + l.left + l.clip.width + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
    else childMenu.left = l.parentLayer.left + l.parentLayer.clip.width – (2*l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
   }
   if( childMenu.left < l.Menu.container.clip.left ) l.Menu.container.clip.left = childMenu.left;
   var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left;
   if (w > l.Menu.container.clip.width)  l.Menu.container.clip.width = w;
   var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top;
   if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h;
   l.document.layers[1].zIndex = 0;
   childMenu.visibility = “inherit”;
  } else if (FIND(“menuItem0″)) {
   childMenu = FIND(l.childMenu);
   var menuLayer = FIND(l.Menu.menuLayer);
   var s = childMenu.style;
   s.zIndex = menuLayer.style.zIndex+1;
   if (document.all || window.mmIsOpera) {
    s.pixelTop = menuLayer.style.pixelTop + l.Menu.submenuYOffset;
    if( l.Menu.vertical ) {
     if( l.Menu.submenuRelativeToItem ) s.pixelTop += l.style.pixelTop;
     s.pixelLeft = l.style.pixelWidth + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
     s.left = s.pixelLeft + ‘px’;
    } else {
     s.pixelTop += l.style.pixelTop;
     if( l.Menu.submenuRelativeToItem ) s.pixelLeft = menuLayer.style.pixelLeft + l.style.pixelLeft + l.style.pixelWidth + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
     else s.pixelLeft = (menuLayer.style.pixelWidth-4*l.Menu.menuBorder) + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
     s.left = s.pixelLeft + ‘px’;
    }
   } else {
    var top = parseInt(menuLayer.style.top) + l.Menu.submenuYOffset;
    var left = 0;
    if( l.Menu.vertical ) {
     if( l.Menu.submenuRelativeToItem ) top += parseInt(l.style.top);
     left = (parseInt(menuLayer.style.width)-4*l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
    } else {
     top += parseInt(l.style.top);
     if( l.Menu.submenuRelativeToItem ) left = parseInt(menuLayer.style.left) + parseInt(l.style.left) + parseInt(l.style.width) + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
     else left = (parseInt(menuLayer.style.width)-4*l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
    }
    s.top = top + ‘px’;
    s.left = left + ‘px’;
   }
   childMenu.style.visibility = “inherit”;
  } else return;
  window.activeMenus[window.activeMenus.length] = childMenu;
 }
}

function hideActiveMenus() {
 if (!window.activeMenus) return;
 for (var i=0; i < window.activeMenus.length; i++) {
  if (!activeMenus[i]) continue;
  if (activeMenus[i].visibility && activeMenus[i].Menu && !window.mmIsOpera) {
   activeMenus[i].visibility = “hidden”;
   activeMenus[i].Menu.container.visibility = “hidden”;
   activeMenus[i].Menu.container.clip.left = 0;
  } else if (activeMenus[i].style) {
   var s = activeMenus[i].style;
   s.visibility = “hidden”;
   s.left = ‘-200px’;
   s.top = ‘-200px’;
  }
 }
 if (window.ActiveMenuItem) hideMenu(false, false);
 window.activeMenus.length = 0;
}

function moveXbySlicePos (x, img) {
 if (!document.layers) {
  var onWindows = navigator.platform ? navigator.platform == “Win32″ : false;
  var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
  var par = img;
  var lastOffset = 0;
  while(par){
   if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
   if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
   if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
   par = macIE45 ? par.parentElement : par.offsetParent;
  }
 } else if (img.x) x += img.x;
 return x;
}

function moveYbySlicePos (y, img) {
 if(!document.layers) {
  var onWindows = navigator.platform ? navigator.platform == “Win32″ : false;
  var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
  var par = img;
  var lastOffset = 0;
  while(par){
   if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
   if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
   if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
   par = macIE45 ? par.parentElement : par.offsetParent;
  }  
 } else if (img.y >= 0) y += img.y;
 return y;
}
</script>
<script language=”JavaScript1.2″>mmLoadMenus();</script>
<table width=”60%” border=”0″ align=”center” cellspacing=”0″>
<tr class=”top”>
  <td> <div align=”center”><font color=”#000000″>
<a href=”#” name=”link2″ id=”link1″ onMouseOver=”MM_showMenu(window.mm_menu_1008171701_0,10,18,null,’link2′)” onMouseOut=”MM_startTimeout();”>
真空镀铝机</a>
      </font></div></td>
</tr>
</table>
</BODY>
</html>

Powered by WordPress