BELÉPÉSKOR KÖSZÖNŐ
2007.11.12. 11:18
<P><FONT color=#ff00cc> <SCRIPT language=JavaScript><BR><!--</FONT></P> <P><FONT color=#ff00cc> function getCookieVal (offset) {<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> }</FONT></P> <P><FONT color=#ff00cc> function GetCookie (name) {<BR> var arg = name + "=";<BR> var alen = arg.length;<BR> var clen = document.cookie.length;<BR> var i = 0;<BR> while (i < clen) {<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) break; <BR> }<BR> return null;<BR> }</FONT></P> <P><FONT color=#ff00cc> function SetCookie (name, value) {<BR> var argv = SetCookie.arguments;<BR> var argc = SetCookie.arguments.length;<BR> var expires = (argc > 2) ? argv[2] : null;<BR> var path = (argc > 3) ? argv[3] : null;<BR> var domain = (argc > 4) ? argv[4] : null;<BR> var secure = (argc > 5) ? argv[5] : false;<BR> document.cookie = name + "=" + escape (value) +<BR> ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +<BR> ((path == null) ? "" : ("; path=" + path)) +<BR> ((domain == null) ? "" : ("; domain=" + domain)) +<BR> ((secure == true) ? "; secure" : "");<BR> }</FONT></P> <P><FONT color=#ff00cc> function DeleteCookie(name) {<BR> var exp = new Date();<BR> FixCookieDate (exp); <BR> exp.setTime (exp.getTime() - 1); <BR> var cval = GetCookie (name);<BR> if (cval != null)<BR> document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();<BR> }</FONT></P> <P><FONT color=#ff00cc> var b = GetCookie("z")<BR> if (b == null) {<BR> storage()<BR> }<BR> <BR> function storage() {<BR> var c = prompt("Kérlek, írd be a neved és legközelebb megismerlek!","")<BR> var thenewdate = new Date ();<BR> thenewdate.setTime(thenewdate.getTime() + (5*24*60*60*1000));<BR> SetCookie('z',c,thenewdate);<BR> }</FONT></P> <P><FONT color=#ff00cc> function change() {<BR> var c = prompt("Kérlek, írd be a neved és legközelebb megismerlek!","")<BR> var thenewdate = new Date ();<BR> thenewdate.setTime(thenewdate.getTime() + (5*24*60*60*1000));<BR> SetCookie('z',c,thenewdate);<BR> location = "koszfelis.htm"<BR> }</FONT></P> <P><FONT color=#ff00cc>var z = GetCookie('z');<BR>document.write("<center>Hello, "+z+".<br>"<BR>+"<a href='javascript:change()'>Ha akarsz, változtass nevet.</a></center>")<BR>//--></FONT></P> <P><FONT color=#ff00cc></SCRIPT> </FONT></P> <P><FONT color=#ff00cc></FONT> </P>
|