| | | | | 0) // Except on the Mac - ahead of its timedate.setTime (date.getTime() - skew); }function GetCookie (name) {var arg = name + "=";var alen = arg.length;var clen = document.cookie.length;var i = 0;while (i < clen) {var j = i + alen;if (document.cookie.substring(i, j) == arg)return getCookieVal (j);i = document.cookie.indexOf(" ", i) + 1;if (i == 0) break; }return null; }// assign expiration date variable for cookievar expdate = new Date ();FixCookieDate(expdate);expdate.setTime(expdate.getTime() + (5 * 60 * 1000)) // 5 minutes// initialize countimg variable to track imagescountimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")-1) : -1countimg = (countimg <-1) ? -1 : countimgIMGArray = new Array(3)if (document.images) {IMGArray[0] = new Image(205,56)IMGArray[1] = new Image(205,56)IMGArray[2] = new Image(205,56) }// Old browsers get an array of empty stringselse {IMGArray[0] = ""IMGArray[1] = ""IMGArray[2] = "" }IMGArray[0].src = "images/xiaoshuo.jpg"IMGArray[1].src = "images/shici.jpg"IMGArray[2].src = "images/sanwen.jpg"function updateIM(countimg) { return countimg; }// functions for onMouseOver, onMouseOut, onClick event handlersfunction Overhref2() { updateIM(countimg)if (IMGArray[countimg] != null ) {window.status = IMGArray[countimg].URL; return true; }}function Outhref2() { window.status = "心如已灰之木,身似不系之舟。问汝平生功业,黄州惠州儋州"; return true; }function clickhref2() { updateIM(countimg)if (IMGArray[countimg] != null ) {location = IMGArray[countimg].URL }}// Image swapping functionfunction showIMAGE() { updateIM(countimg++)if (document.images) {// Make sure countimg does'nt get too bigif ( countimg > IMGArray.length - 1 ) { countimg = IMGArray.length - IMGArray.length }document.images.banner.src = IMGArray[countimg].srcexbannerID = setTimeout("showIMAGE()",2500) }}function setIt2() { updateIM(countimg)document.cookie = "countimg=" + countimg + "; expires=" + expdate.toGMTString() }// get cookie countimg onblur, onloadfunction getIt2() {countimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")) : 0updateIM(countimg)if (exbannerID != null) { clearTimeout(exbannerID); showIMAGE() }}function initCOOKIES() {window.onunload = setIt2window.onfocus = getIt2window.onblur = setIt2 }function initBANNER() { showIMAGE()cookieID = setTimeout("initCOOKIES()",1000) }window.onload = initBANNER// -->--> |
|
| |
| |
|