«
光临次数和时间的特效

时间:2010-6-11    作者:Deri    分类: 分享


   <p><code><html><br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><br /><title>光临次数和时间</title><br /></head><br /><body bgcolor="#fef4d9" onLoad="startclock()"><br /><SCRIPT language="JavaScript"><!--<br />function getCookieVal (offset)<br />  {<br />  var endstr = document.cookie.indexOf (";", offset);<br />  if (endstr == -1)<br />   endstr = document.cookie.length;<br />  return unescape(document.cookie.substring(offset, endstr));<br />  }<br />function GetCookie (name)<br />  {<br />  var arg = name + "=";<br />  var alen = arg.length;<br />  var clen = document.cookie.length;<br />  var i = 0;<br />  while (i < clen)<br />   {<br />   var j = i + alen;<br />   if (document.cookie.substring(i, j) == arg)<br />     return getCookieVal (j);<br />   i = document.cookie.indexOf(" ", i) + 1;<br />   if (i == 0)<br />     break;<br />  <br />   }<br />  <br />  return null;<br />  <br />  }<br />  <br />function SetCookie (name, value)<br />  <br />  {<br />  <br />  var argv = SetCookie.arguments;<br />  <br />  var argc = SetCookie.arguments.length;<br />  <br />  var expires = (2 < argc) ? argv[2] : null;<br />  <br />  var path = (3 < argc) ? argv[3] : null;<br />  <br />  var domain = (4 < argc) ? argv[4] : null;<br />  <br />  var secure = (5 < argc) ? argv[5] : false;<br />  <br />  document.cookie = name + "=" + escape (value) +<br />  <br />   ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +<br />  <br />   ((path == null) ? "" : ("; path=" + path)) +<br />  <br />   ((domain == null) ? "" : ("; domain=" + domain)) +<br />  <br />((secure == true) ? "; secure" : "");<br />  <br />  }<br />  <br />function ResetCounts(name)<br />  <br />  {<br />  <br />  visits = 0;<br />  <br />  SetCookie("visits", visits, expdate , "java2000.wol.com.html", null, false);<br />  <br />  location.reload();<br />  <br />  }<br />  <br />//--><br />  <br /></SCRIPT><br><SCRIPT language="JavaScript"><!--<br />  <br />var expdate = new Date();<br />  <br />var visits;<br />  <br />// Set expiration date to a year from now.<br />  <br />expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));<br />  <br />if(!(visits = GetCookie("visits")))<br />  <br />  visits = 0;<br />  <br />visits++;<br />  <br />SetCookie("visits", visits, expdate, "java2000.wol.com.html", null, false);<br />  <br />  if(visits == 1)<br />  <br />   document.write('<P><CENTER>Welcome Cadet '+username+'</CENTER>');<br />  <br />  if(visits == 2)<br />  <br />   document.write('<P><CENTER>Welcome Ensign '+username+'</CENTER>');<br />  <br />  if(visits == 3)<br />  <br />   document.write('<P><CENTER>Welcome Lieutenant '+username+'</CENTER>');<br />  <br />  if(visits == 4)<br />  <br />   document.write('<P><CENTER>Welcome Lieutenant-Commander '+username+'</CENTER>');<br />  <br />  if(visits == 5)<br />  <br />   document.write('<P><CENTER>Welcome Commander '+username+'</CENTER>');<br />  <br />  if(visits == 6)<br />  <br />   document.write('<P><CENTER>Welcome Vice-Admiral '+username+'</CENTER>');<br />  <br />  if(visits == 7)<br />  <br />   document.write('<P><CENTER>Welcome Admiral '+username+'</CENTER>');<br />  <br />  if(visits== 8)<br />  <br />   document.write('<P><CENTER>Welcome Demi-God '+username+'</CENTER>');<br />  <br />  if(visits== 9)<br />  <br />   document.write('<P><CENTER>Welcome Demi-God '+username+'</CENTER>');<br />  <br />  if(visits>=10)<br />  <br />   document.write('<P><CENTER>Welcome Master '+username+'</CENTER>');<br />  <br />//--><br />  <br /></SCRIPT><br><br />  <br /><FONT FACE=ARIAL size="2"><br />  <br /><b>Your access was granted from<br />  <br /><SCRIPT language="javascript">document.write(document.referrer)</SCRIPT><br><br />  <br />Using <SCRIPT language="javascript">document.write(navigator.userAgent)</SCRIPT><br />  <br /></b></font><br><SCRIPT language="JavaScript"><!--<br />  <br />var expdate = new Date();<br />  <br />var visits;<br />  <br />expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));<br />  <br />if(!(visits = GetCookie("visits")))<br />  <br />  visits = 0;<br />  <br />visits++;<br />  <br />SetCookie("visits", visits, expdate, "<a href=\"http://www.cnwshow.com/htm/yl/72.htm\">www.cnwshow.com/htm/yl/72.htm</a>", null, false);<br />  <br />document.write(""+"你已经光临本页"+visits+" 次了.谢谢!");<br />  <br />//--><br />  <br /></SCRIPT><br><br />  <br />You arrived at <br><SCRIPT language="JavaScript"><!--<br />  <br />Stamp = new Date();<br />  <br />var Hours;<br />  <br />var Mins;<br />  <br />var Time;<br />  <br />Hours = Stamp.getHours();<br />  <br />if (Hours >= 12) {<br />  <br />     Time = " P.M.";<br />  <br />}<br />  <br />    else {<br />  <br />        Time = " A.M.";<br />  <br />    }<br />  <br />if (Hours > 12) {<br />  <br />     Hours -= 12;<br />  <br />    }<br />  <br />if (Hours == 0) {<br />  <br />     Hours = 12;<br />  <br />    }<br />  <br />Mins = Stamp.getMinutes();<br />  <br />if (Mins < 10) {<br />  <br />     Mins = "0" + Mins;<br />  <br />    }<br />  <br />document.write('<font size="2" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>');<br />  <br />//--><br />  <br /></SCRIPT><br><br />  <br />The current time is:<br><SCRIPT language="JavaScript"><!--<br />  <br />function goback(){<br />  <br />alert("Good Bye!");<br />  <br />history.go(-1);<br />  <br />}<br />  <br />function gettheDate() {<br />  <br />Todays = new Date();<br />  <br />TheDate = "" + (Todays.getMonth()+ 1) +" / "+ Todays.getDate() + " / " +<br />  <br />Todays.getYear()<br />  <br />document.clock.date.value = TheDate;<br />  <br />}<br />  <br />// Navigation - Stop<br />  <br />// Netscapes Clock - Start<br />  <br />// this code was taken from Netscapes JavaScript documentation at<br />  <br />var timerID = null;<br />  <br />var timerRunning = false;<br />  <br />function stopclock (){<br />  <br />    if(timerRunning)<br />  <br />        clearTimeout(timerID);<br />  <br />    timerRunning = false;<br />  <br />}<br />  <br />function startclock () {<br />  <br />    // Make sure the clock is stopped<br />  <br />    stopclock();<br />  <br />    gettheDate()<br />  <br />    showtime();<br />  <br />}<br />  <br />function showtime () {<br />  <br />    var now = new Date();<br />  <br />    var hours = now.getHours();<br />  <br />    var minutes = now.getMinutes();<br />  <br />    var seconds = now.getSeconds()<br />  <br />    var timeValue = "" + ((hours >12) ? hours -12 :hours)<br />  <br />    timeValue += ((minutes < 10) ? ":0" : ":") + minutes<br />  <br />    timeValue += ((seconds < 10) ? ":0" : ":") + seconds<br />  <br />    timeValue += (hours >= 12) ? " P.M." : " A.M."<br />  <br />    document.clock.face.value = timeValue;<br />  <br />    // you could replace the above with this<br />  <br />    // and have a clock on the status bar:<br />  <br />    // window.status = timeValue;<br />  <br />    timerID = xywTimeout("showtime()",1000);<br />  <br />    timerRunning = true;<br />  <br />}<br />  <br />//--><br />  <br /></SCRIPT><br><form name="clock" onSubmit="0"><br />  <br /><div align=center><br />  <br /><b><font size="-1"></font></b><br />  <br /><input type="text" name="date" size=12 value=""><br />  <br /><input type="text" name="face" size=12 value=""><br />  <br /></div><br />  <br /></form><br />  <br /><p></p><br /><p></p>                          <br /></body><br /></html></code></p>