This site created with Front Page. I am a wysiwyg and cut and paste web designer. Any constructive criticism is welcome.
Site is http:\\nwms.ohsd.net
Thanks.
Site is http:\\nwms.ohsd.net
Thanks.
//Get cookie routine by Shelley Powers function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) // if cookie exists if (offset != -1) { offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end) ) } } return returnvalue; }
/****************************************************** This is the code that actually sets your cookie. I have used the variable "visited" to determine whether or not the cookie has been set... I'm looking for the "visitedValue" variable in this instance (however you can change it if you want- just remember to change it later on in the code too!). ******************************************************/ function get_visit(){ get_cookie(); var visited=get_cookie("visitedValue"); if (visited){ // do nothing } else{ /****************************************************** For the addtime variable below, one month (31 days) of milliseconds would be calculated like so: (31 * 24 * 60 * 60 * 1000) OR 2678400000. So you can use either: addtime=(31 * 24 * 60 * 60 * 1000) // 1 month OR: addtime=2678400000 // 1 month ******************************************************/ addtime=(31 * 24 * 60 * 60 * 1000) // 1 month /****************************************************** The calculation below gets the current time and adds on what you calculated for the expiration date... ******************************************************/ expdate = new Date() expdate.setTime(expdate.getTime() + addtime) expdate = expdate.toGMTString() /****************************************************** The part below adds an expiration date to the cookie, making it "persistent". If you wish for the cookie to expire as soon as the browser is closed, simply take out this part: expires=" + expdate; and don't forget to replace it with a closing " (double quote). Something else useful- if you want to cookie to work in subdirectories, change the line below to this: document.cookie="visitedValue=true; expires=" + expdate + "; path=/;"; Also note that here is where the cookie's "visitedValue" variable is set. ******************************************************/ document.cookie="visitedValue=true; expires=" + expdate; /****************************************************** The part below determines what you want to do after you set the cookie (assuming it wasn't already set). ******************************************************/ // do something here- call a function or whatever } }
function delete_cookie(){ if (document.cookie != "") { thisCookie = document.cookie.split("; ") expireDate = new Date expireDate.setDate(expireDate.getDate()-1) for (i=0; i<thisCookie.length; i++) { cookieName = thisCookie[i].split("=")[1] document.cookie = "visitedValue=" + cookieName + ";expires=" + expireDate.toGMTString() } } alert('You are now logged out!') }
<html> <head> <title>Your Page</title> <script language="JavaScript" type="text/javascript"> image1 = new Image(); image1.src = "[b]imageToBeSeenonMouseover.gif[/b]"; </script> </head> <body> Content here... </body> </html>
<html> <head> <title>Your Page</title> [b]A:link { font-family: "Arial"; color: #ffff00; font-weight: 600; font-size: 12pt; text-decoration: none; } A:active { font-size: 12pt; font-family: "Arial"; color: #ff0000; font-weight: 700; text-decoration: underline; } A:visited { font-size: 12pt; font-family: "Arial"; color: #ffff00; font-weight: 700; text-decoration: none; } A:hover { font-size: 12pt; font-family: "Arial"; color: #ff0000; font-weight: 700; text-decoration: underline; }[/b] </head>
Comment