<%
'*********************************
'Function: bbimg(l1,maximgheight,maximgwidth)
'Parameters: l1, image path; maximgheight, maximum allowable image height; maximgwidth, maximum allowable image width
'Author: Alixi
'Date: 2007/7/12
'Description: Limit the maximum height and width of the page image
'Example: <%=bbimg("alixixi.gif",300,100)%>
'*********************************
functionbbimg(l1,maximgheight,maximgwidth)
diml2,I2:l2=l1
setI2=newregexp
I2.global=true
I2.ignorecase=true
I2.pattern="<img.[^>]*(src="".[^>]+?").[^>]*>"
l2=I2.replace(l2,"<img$1onload=""javascript:if(this.width>"&maximgwidth&")this.style.width="&maximgwidth&";if(this.height>"&maximgheight&")this.style.width=(this.width*"&maximgheight&")/this.height;""//this.height;""///
bbimg=l2
setI2=nothing
endfunction
%>