//函数名:chkdate
//功能介绍:检查是否为日期
//参数说明:要检查的字符串
//返回值:0:不是日期 1:是日期
function chkdate(datestr)
{
var lthdatestr
if (datestr != "")
lthdatestr= datestr.length ;
else
lthdatestr=0;
var tmpy="";
var tmpm="";
var tmpd="";
//var datestr;
var status;
status=0;
if ( lthdatestr== 0)
return 0
for (i=0;i<lthdatestr;i++)
{ if (datestr.charAt(i)== '-')
{
status++;
}
if (status>2)
{
//alert("Invalid format of date!");
return 0;
}
if ((status==0) && (datestr.charAt(i)!='-'))
{
tmpy=tmpy+datestr.charAt(i)
}
if ((status==1) && (datestr.charAt(i)!='-'))
{
tmpm=tmpm+datestr.charAt(i)
}
if ((status==2) && (datestr.charAt(i)!='-'))
{
tmpd=tmpd+datestr.charAt(i)
}
}
year=new String (tmpy);
month=new String (tmpm);
day=new String (tmpd)
//tempdate= new String (year+month+day);
//alert(tempdate);
if ((tmpy.length!=4) || (tmpm.length>2) || (tmpd.length>2))
{
//alert("Invalid format of date!");
return 0;
}
if (!((1<=month) && (12>=month) && (31>=day) && (1<=day)) )
{
//alert ("Invalid month or day!");
return 0;
}
if (!((year % 4)==0) && (month==2) && (day==29))
{
//alert ("This is not a leap year!");
return 0;
}
if ((month<=7) && ((month % 2)==0) && (day>=31))
{
//alert ("This month is a small month!");
return 0;
}
if ((month>=8) && ((month % 2)==1) && (day>=31))
{
//alert ("This month is a small month!");
return 0;
}
if ((month==2) && (day==30))
{
//alert("The Febryary never has this day!");
return 0;
}
if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){
if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}
else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}
function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}
</SCRIPT>
</HEAD>
<BODY bgColor=#ffffff leftMargin=8 topMargin=0>
<SCRIPT language=JavaScript1.2>
function showtip(nulling){
if (document.all){
if (nulling==0&&slidemenubar2.style.pixelLeft==-300)
slidemenubar2.title='Press "x" to expand the menu, "z" to contract it'
else
slidemenubar2.title=''
}
else if (document.layers){
if (nulling==0&&!window.pullit)
window.status='Press "x" to expand the menu, "z" to contract it'
else
window.status=''
}
}
if (document.all)
document.write('<div id="slidemenubar2" style="left:-300" onMouseover="showtip(0)" onMouseout="showtip(1)">')
</SCRIPT>
<LAYER id=slidemenubar onmouseout=showtip(1) onmouseover=showtip(0)>
<IFRAME frameBorder=0 height=215 scrolling=no src="bp.htm" width=290></IFRAME>
</LAYER>
<SCRIPT language=JavaScript1.2>
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}
window.onload=regenerate2
if (document.all){
document.write('</div>')
themenu=document.all.slidemenubar2.style
rightboundary=0
leftboundary=-300
}
else{
themenu=document.layers.slidemenubar
rightboundary=300
leftboundary=10
}
function pull(){
if (window.drawit)
clearInterval(drawit)
pullit=setInterval("pullengine()",50)
}
function draw(){
clearInterval(pullit)
drawit=setInterval("drawengine()",50)
}
function pullengine(){
if (document.all&&themenu.pixelLeft<rightboundary)
themenu.pixelLeft+=5
else if(document.layers&&themenu.left<rightboundary)
themenu.left+=5
else if (window.pullit)
clearInterval(pullit)
}
function drawengine(){
if (document.all&&themenu.pixelLeft>leftboundary)
themenu.pixelLeft-=5
else if(document.layers&&themenu.left>leftboundary)
themenu.left-=5
else if (window.drawit)
clearInterval(drawit)
}
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function menuengine(e){
if (document.layers){
if (e.which==120)
pull()
if (e.which==122)
draw()
}
else if (document.all){
if (event.keyCode==120)
pull()
if (event.keyCode==122)
draw()
}
}
document.onkeypress=menuengine
</SCRIPT>
<p align="center"> </p>
<p> </p>
<p align="center"> “x”键使在线传呼界面出现,“z”键使在线传呼界面消失!</p>
<p> </p>
<p> </p>
<p> </p>
</BODY></HTML>
<!---------------------------------------快捷键控制界面--------------------->
<script language="vbscript">
function keypress1()
if window.event.keycode==功能键CODE then
document.button1.click()
end if
if window.event.keycode==功能键CODE then
document.text1.value=".."
end if
.....
end function
</script>
<body onkeypress=keypress1()>