home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2005-08-06 | 56.8 KB | 2,066 lines
JavaScript Snippets T=Go back button <br><center><form> <SCRIPT LANGUAGE="JavaScript"> <!-- function retrace() { history.back() } // --> </SCRIPT> <INPUT TYPE="BUTTON" NAME="GOBACK" VALUE="Go to previous page" OnCLick="retrace()"></form> </center><br> T=Go back - forward <CENTER> <SCRIPT LANGUAGE="JavaScript"> <!-- function goHist(a) { history.go(a); // Go back one. } //--> </script> <FORM METHOD="post"> <INPUT TYPE="button" VALUE="Previous page" onClick="goHist(-1)"> <INPUT TYPE="button" VALUE=" Next page " onClick="goHist(1)"> </form> </CENTER><BR> T=Go back - forward <SCRIPT LANGUAGE="LiveScript"> <!-- hide function goHist(a) { history.go(a); } //<!-- done --> </script> <body> <HR> <FORM METHOD="post"> <INPUT TYPE="button" VALUE="Backward" onClick="goHist(-1)"> <INPUT TYPE="button" VALUE="Forward" onClick="goHist(1)"> </form> T=Go back - main - foward <SCRIPT LANGUAGE="JavaScript"> <!-- document.write("<CENTER>"); document.write("<FORM NAME=\"History\">");document.write("<INPUT TYPE=\"BUTTON\" VALUE=\"<<\" onClick=\"history.back()\">"); document.write("<INPUT TYPE=\"BUTTON\" VALUE=\"Main page\" onClick=\"location='http://www.creamsoft.com'\">"); document.write("<INPUT TYPE=\"BUTTON\" VALUE=\">>\" onClick=\"history.forward()\">");document.write("</FORM>"); document.write("</CENTER>"); // --> </SCRIPT> T=Welcome IP <script> window.onerror=null; myAddress=java.net.InetAddress.getLocalHost(); myAddress2=java.net.InetAddress.getLocalHost(); host=myAddress.getHostName(); ip=myAddress2.getHostAddress(); document.write("Welcome "+host); document.write("<BR>at IP "+ip); </script> T=Enter name <CENTER> Hello <B> <SCRIPT LANGUAGE"JavaScript"> <!--Hide document.write(prompt("Please enter your name:","Name")); //--> </SCRIPT></B> and welcome to this page. </CENTER><BR> T=Goodbye window <SCRIPT LANGUAGE="JavaScript"> locnm=location.href; pos=locnm.indexOf("indexb.htm"); locnm1=locnm.substring(0,pos); function ByeWin() { windowIMA=window.open("",'Anim2','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,status=no,resizable=1,width=260,height=290') windowIMA.document.write("<HTML><TITLE>Good bye Window</TITLE>" +"<BODY BGCOLOR='black' text= 'white'><CENTER>" +"<FORM METHOD=GET ACTION='"+locnm1+"h5s3.html'>" +"<H3><P><B>Thank's for the visit!<P>And welcome back.<BR>..." +"<BR>By for now." +"<BR><P><H1>Mr.B & Liz!</B></FORM><BR>"); } </SCRIPT> <BODY onUnload="ByeWin()"> T=Small clock <SCRIPT LANGUAGE="JavaScript"> function startclock(){ showtime() } function showtime(){ var now = new Date() var hours = now.getHours() var minutes = now.getMinutes() var seconds = now.getSeconds() var timeValue = "" + ((hours > 12) ? hours - 12 : hours) timeValue += ((minutes < 10) ? ":0" : ":") + minutes timeValue += ((seconds < 10) ? ":0" : ":") + seconds timeValue += (hours >= 12) ? "PM" : "AM" document.option.face2.value = timeValue setTimeout("showtime()",1000) } </SCRIPT> <BODY onLoad="startclock()"> <form name="clock" onSubmit="0"> <input type="text" name="face" size=13 value=""> T=Small clock <script language="JavaScript"> <!-- Hide the script from old browsers -- var timerID = null; var timerRunning = false; var id,pause=0,position=0; function stopclock (){ if(timerRunning) clearTimeout(timerID); timerRunning = false; } function showtime () { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds() var timeValue = "" + ((hours >12) ? hours -12 :hours) timeValue += ((minutes < 10) ? ":0" : ":") + minutes timeValue += ((seconds < 10) ? ":0" : ":") + seconds timeValue += (hours >= 12) ? " P.M." : " A.M." document.clock.face.value = timeValue; timerID = setTimeout("showtime()",1000); timerRunning = true; } function startclock () { stopclock(); showtime(); } // --End Hiding Here --> </script> <body onLoad="startclock()"> <form name="clock" onSubmit="0"> <input type="text" name="face" size=13 value=""> T=Time connected <script Language="JavaScript"> <!-- var timerID = null; var timerRunning = false; var starttime=new Date(); var startseconds=starttime.getSeconds(); var startminutes=starttime.getMinutes(); var starthours=starttime.getHours(); startmark=starthours*60*60+startminutes*60+startseconds function stopclock (){ if(timerRunning) clearTimeout(timerID); timerRunning = false; } function startclock () { stopclock(); showtime(); } function showtime () { var now = new Date(); var nowseconds = now.getSeconds(); var nowminutes=now.getMinutes(); var nowhours=now.getHours(); nowmark=nowhours*60*60+nowminutes*60+nowseconds period=nowmark-startmark period=(period>=0) ? period : period+86400 seconds=period%60; minutes=((period-seconds)/60)%60; hours=(period-seconds-(60*minutes))/3600; var timeValue = "" + ((hours < 10) ? "0" : "")+hours timeValue += ((minutes < 10) ? ":0" : ":") + minutes timeValue += ((seconds < 10) ? ":0" : ":") + seconds document.clock.face.value = timeValue; timerID = setTimeout("showtime()",1000); timerRunning = true; } // --> </script> <BODY onLoad="startclock ()"> T=Touch me <script language="LiveScript"> <!-- function m() { alert("Ok, you have done what the link told you to."); } // --> </SCRIPT> <BODY> <a href="" onMouseOver="m()">touch me</a> T=Link window open/close <SCRIPT Language='JavaScript'> function winopen1() { msg1=open("WINDOW FILE","WINDOW TITLE","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=250"); } function winopen2() { msg2=open("WINDOW FILE","WINDOW TITLE","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=250"); } </SCRIPT> <a href="LINK URL" onMouseOver="winopen1(); return true;" onMouseOut="msg1.close();">LINK NAME</a><BR> <a href="LINK URL" onMouseOver="winopen2(); return true;" onMouseOut="msg2.close();">LINK NAME</a><BR><BR> T=Visitor counrer (cookie) <SCRIPT LANGUAGE="JavaScript"> <!-- var caution = false function setCookie(name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "") if (!caution || (name + "=" + escape(value)).length <= 4000) document.cookie = curCookie else if (confirm("Cookie exceeds 4KB and will be cut!")) document.cookie = curCookie } function getCookie(name) { var prefix = name + "=" var cookieStartIndex = document.cookie.indexOf(prefix) if (cookieStartIndex == -1) return null var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length) if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)) } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT" } } function fixDate(date) { var base = new Date(0) var skew = base.getTime() if (skew > 0) date.setTime(date.getTime() - skew) } var now = new Date() fixDate(now) now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000) var visits = getCookie("counter") if (!visits) visits = 1 else visits = parseInt(visits) + 1 setCookie("counter", visits, now) document.write("You have been here " + visits + " time(s).") // --> </SCRIPT> T=Broweserversion <SCRIPT LANGUAGE='JavaScript'> <!-- shields up! document.writeln ("You are currently using: " + navigator.appName + " (" + navigator.appCodeName + ") " + navigator.appVersion); // down shields! --> </SCRIPT> T=Time limited visit <script language="JavaScript"> var i=20 function timer(){ if (i>0) i-- document.countdown_timer.timer.value=i // use this to add your action //if (i==0) //------your_action------ id=setTimeout("timer()",1000) } </script> <BODY onload="timer()"> <form name="countdown_timer"> <blink>You only have </blink> <INPUT TYPE="text" NAME="timer" SIZE="2" MAXLENGTH="2"> </INPUT> <blink>seconds left !!</blink> T=Change background color <script language="JavaScript"> function changeBackground(hexNumber) { document.bgColor=hexNumber } </script> <BODY> <CENTER> <form method=post name=background> <input type=button value="Blue" onclick="changeBackground('0000FF')"> <input type=button value="Red" onclick="changeBackground('FF0000')"> <input type=button value="Yellow" onclick="changeBackground('FFFF00')"> <input type=button value="Green" onclick="changeBackground('00FF00')"> <input type=button value="Black" onclick="changeBackground('00000000')"> <input type=button value="White" onclick="changeBackground('FFFFFF')"> <input type=button value="Purple" onclick="changeBackground('ff00ff')"> </CENTER><BR> T=Change bgcolor depending on time <SCRIPT LANGUAGE="JavaScript"> <!-- var now = new Date(); var hours = now.getHours(); //18-19 night if (hours > 17 && hours < 20){ document.write('<body bgcolor="orange" text="#FFFFFF">') } //20-21 night if (hours > 19 && hours < 22){ document.write('<body bgcolor="orangered" text="#FFFFFF">') } //22-4 night if (hours > 21 || hours < 5){ document.write('<body bgcolor="black" text="#FFFFFF">') } //9-17 day if (hours > 8 && hours < 18){ document.write('<body bgcolor="deepskyblue" text="#FFFFFF">') } //7-8 day if (hours > 6 && hours < 9){ document.write('<body bgcolor="skyblue" text="#FFFFFF">') } //5-6 day if (hours > 4 && hours < 7){ document.write('<body bgcolor="steelblue" text="#FFFFFF">') } //--> </SCRIPT> T=Password 1 (filename) <script Language="JavaScript"> <!-- function loadpage(){ document.location.href=document.frm.pswd.value + ".htm" } //--> </script> <BODY> <form name=frm> Enter Password <input type=text name=pswd><input type=button value="Enter" onClick="loadpage()"> </form> T=play sound on picture <SCRIPT LANGUAGE=JavaScript> function playSound(){ document.sound1.play(false, 'YOUR SOUND FILE'); } </SCRIPT> <body> <EMBED SRC="SOUNDFILE.WAV" autostart=false HIDDEN=TRUE NAME="sound1" MASTERSOUND> <A HREF="YOUR FILE" onMouseOver="playSound()" onClick="return false;"> <IMG SRC="IMAGE FILE"></A> T=play sound on link <SCRIPT LANGUAGE=JavaScript> function playSound(){ document.sound1.play(false, 'YOUR SOUND FILE'); } </SCRIPT> <body> <EMBED SRC="SOUNDFILE.WAV" autostart=false HIDDEN=TRUE NAME="sound1" MASTERSOUND> <A HREF="YOUR FILE" onMouseOver="playSound()" onClick="return false;"> LINK DESCRIPTION</A> T=Pull down GO image <script language="JavaScript"> <!-- Hide the script from old browsers -- function surfto(form) { var myindex=document.myform.dest.selectedIndex location=document.myform.dest.options[myindex].value; } //--> </SCRIPT> <FORM NAME="myform"> <SELECT NAME="dest" SIZE=1> <OPTION SELECTED VALUE="http://URL#1">URL #1 DESCRIPTION <OPTION VALUE="http://URL#2">URL #2 DESCRIPTION <OPTION VALUE="http://URL#3">URL #3 DESCRIPTION <OPTION VALUE="http://URL#4">URL#4 DESCRIPTION </SELECT> <A HREF="javascript: surfto()" onMouseOver="self.status='YOUR STATUS DESC HERE';return true" onMouseOut="self.status='';return true"><IMG SRC="YOUR IMAGE" border=0 align=absmiddle> </A></FORM> T=Open new link window <script language="JavaScript"> <!-- Hide the script from old browsers -- function surfto(form) { var myindex=form.dest.selectedIndex window.open(form.dest.options[myindex].value, "", ""); } //--> </SCRIPT> <FORM NAME="myform"> <SELECT NAME="dest" SIZE=1> <OPTION SELECTED VALUE="http://URL#1">URL #1 DESCRIPTION <OPTION VALUE="http://URL#2">URL #2 DESCRIPTION <OPTION VALUE="http://URL#3">URL #3 DESCRIPTION <OPTION VALUE="http://URL#4">URL#4 DESCRIPTION </SELECT> <INPUT TYPE="BUTTON" VALUE="GO NOW!" onClick="surfto(this.form)"> </FORM> T=Jump to link confirm <script> function rusure(){ question = confirm("YOUR CONFIRM MESSAGE") if (question !="0"){ top.location = "YOUR LINK GOES HERE" } } </script> <body> <a href="" onClick="rusure(); return false;">YOUR LINK DESCRIPTION</a> T=Reload frame /Just copy this line and change the FRAME TARGET NAME <form><INPUT TYPE="button" VALUE="Reload" onClick='parent.counter.location="javascript:location.reload()"'></form> T=Reload page /Just copy this line and change the FRAME TARGET NAME <form><INPUT TYPE="button" VALUE="Reload" onClick='parent.location="javascript:location.reload()"'></form> T=View source button All you need to do is to change the FRAME TARGET NAME. <form><INPUT TYPE="BUTTON" VALUE="View Source" onClick= 'parent.FRAME TARGET NAME.location = "view-source:" + parent.FRAME TARGET NAME.location'> </form> T=Linkbutton <form><INPUT TYPE="button" VALUE="BUTTON DESCRIPTION" onClick="parent.FRAME TARGET NAME.location='LINK LOCATION'"></form> T=Statusbar tyewriter <SCRIPT LANGUAGE="JavaScript"> <!-- var speed = 50 // decrease value to increase speed (must be positive) var pause = 2000 // increase value to increase pause var timerID = null var bannerRunning = false var ar = new Array() ar[0] = "MESSAGE #1" ar[1] = "MESSAGE #2" ar[2] = "MESSAGE #3" ar[3] = "MESSAGE #4" var currentMessage = 0 var offset = 0 function stopBanner() { if (bannerRunning) clearTimeout(timerID) bannerRunning = false } function startBanner() { stopBanner() showBanner() } function showBanner() { var text = ar[currentMessage] if (offset < text.length) { if (text.charAt(offset) == " ") offset++ var partialMessage = text.substring(0, offset + 1) window.status = partialMessage offset++ timerID = setTimeout("showBanner()", speed) bannerRunning = true } else { offset = 0 currentMessage++ if (currentMessage == ar.length) currentMessage = 0 timerID = setTimeout("showBanner()", pause) bannerRunning = true } } // --> </SCRIPT> <body onLoad="startBanner()"> T=Random quote <script language="JavaScript"> <!-- Hide var a = Math.random() + "" var rand1 = a.charAt(5) quotes = new Array quotes[1] = "MESSAGE #1" quotes[2] = "MESSAGE #2" quotes[3] = "MESSAGE #3" quotes[4] = "MESSAGE #4" quotes[5] = "MESSAGE #5" quotes[6] = "MESSAGE #6" quotes[7] = "MESSAGE #7" quotes[8] = "MESSAGE #8" quotes[9] = "MESSAGE #9" quotes[0] = "MESSAGE #10" var quote = quotes[rand1] // -- End </script> This goes in the body of your document. <script language="JavaScript"> <!-- Hide document.write("<i>" + quote + "</i>") // -- End </script> T=Random quote <SCRIPT LANGUAGE="JavaScript"> <!-- //store the quotations in arrays quotes = new Array(6); authors = new Array(6); quotes[0] = "I have a new philosophy. I'm only going to dread one day at a time."; authors[0] = "Charles Schulz"; quotes[1] = "Reality is the leading cause of stress for those in touch with it."; authors[1] = "Jack Wagner"; quotes[2] = "Few things are harder to put up with than the annoyance of a good example."; authors[2] = "Mark Twain"; quotes[3] = "The pure and simple truth is rarely pure and never simple."; authors[3] = "Oscar Wilde"; quotes[4] = "There's no business like show business, but there are several businesses like accounting."; authors[4] = "David Letterman"; quotes[5] = "Man invented language to satisfy his deep need to complain."; authors[5] = "Lily Tomlin"; //calculate a random index index = Math.floor(Math.random() * quotes.length); //display the quotation document.write("<DL>\n"); document.write("<DT><I>" + "\"" + quotes[index] + "\"</I>\n"); document.write("<DD>" + "-- " + authors[index] + "\n"); document.write("</DL>\n"); //done //--> </SCRIPT> T=Random image <script language="JavaScript"> <!-- Hide var imagenumber = 5 ; var randomnumber = Math.random() ; var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ; images = new Array images[1] = "IMAGE #1" images[2] = "IMAGE #2" images[3] = "IMAGE #3" images[4] = "IMAGE #4" images[5] = "IMAGE #5" var image = images[rand1] // -- End </script> This goes in the body of your document. <script language="JavaScript"> <!-- Hide document.write('<IMG SRC="' + image + '">') // -- End </script> T=Random image with link <script language="JavaScript"> <!-- Hide var imagenumber = 5 ; var randomnumber = Math.random() ; var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ; images = new Array images[1] = "IMAGE #1" images[2] = "IMAGE #2" images[3] = "IMAGE #3" images[4] = "IMAGE #4" images[5] = "IMAGE #5" var image = images[rand1] links = new Array links[1] = "YOUR LINK HERE" links[2] = "YOUR LINK HERE" links[3] = "YOUR LINK HERE" links[4] = "YOUR LINK HERE" links[5] = "YOUR LINK HERE" var link = links[rand1] // -- End </script> This goes in the body of your document. <script language="JavaScript"> <!-- Hide document.write('<A HREF="' + link + '"><IMG SRC="' + image + '" border="0"></a>') // -- End </script> T=Random background <SCRIPT LANGUAGE="JavaScript"> <!-- Begin Hiding var timeout1; var Imager = new Array; var RandomBackground; Imager[0] = "BACKGROUND #1" Imager[1] = "BACKGROUND #2" Imager[2] = "BACKGROUND #3" Imager[3] = "BACKGROUND #4" RandomBackground = Imager[Math.floor(Math.random() * Imager.length)]; // End Hiding --> </SCRIPT> <body BACKGROUND="&{RandomBackground};"> T=Random sound <script> var now=new Date(); var status=(now.getSeconds())%4; document.write('<embed src="SOUND LOCATION/BEGGINING NAME'+status+'.SOUND EXTENTION" height=2 width=2 autostart=true hidden=true>'); </script> T=Search your page <script language="javascript"> var key = ""; function makeEntry (){ this.Name=""; this.URL = ""; this.Desc = ""; this.Category = ""; return this; } function makeArray(n) { this.length = n; for (var k = 1; k <= n; k++) { this[k] = ""; } return this; } function makeLinks(size) { this.length = size; for (var r=1; r<= size; r++) { this[r] = new makeEntry(); this[r].Name = namesArray[r]; this[r].URL = urlsArray[r]; this[r].Desc = descArray[r]; } return this; } var linksize=0 datesArray = new makeArray(linksize); namesArray = new makeArray(linksize); urlsArray = new makeArray(linksize); descArray = new makeArray(linksize); var arraycount=0 arraycount += 1 urlsArray[arraycount] = "YOUR LINK" namesArray[arraycount] = "YOUR PAGE NAME" descArray[arraycount] = "YOU KEYWORDS OR DESCRIPTION" arraycount += 1 urlsArray[arraycount] = "YOUR LINK" namesArray[arraycount] = "YOUR PAGE NAME" descArray[arraycount] = "YOU KEYWORDS OR DESCRIPTION" linksize = arraycount; // ----end data ------- function searchLinks(links, keyword){ document.write("<BODY BGCOLOR='YOUR COLOR' TEXT='YOUR COLOR' LINK='YOUR COLOR' VLINK='YOUR COLOR' ALINK='YOUR COLOR'>") document.write("Search results for keyword: <strong>" +keyword +"</strong><br><br>"); for (var q=1; q<=links.length; q++) { if (links[q].URL.toLowerCase().indexOf(keyword) != -1){ document.write("<a href=" + links[q].URL +">" + links[q].Name + "</a> - "); document.write( links[q].Desc + "<br>"); continue; } if (links[q].Desc.toLowerCase().indexOf(keyword) != -1) { document.write("<a href=" + links[q].URL +">" + links[q].Name + "</a> - "); document.write( links[q].Desc + "<br>"); continue; } if (links[q].Name.toLowerCase().indexOf(keyword) != -1) { document.write("<a href=" + links[q].URL +">" + links[q].Name + "</a> - "); document.write( links[q].Desc + "<br>"); continue; } } } </script> <form name="form"> Search:<br><input type="text" size=50 name="search"><br> <input type="button" name="submit" value="Submit" onClick="validate_form()"><input type="reset" name="reset" value="Clear"></form> <script> function validate_form() { txt = document.form.search.value; if (txt.indexOf(".") != -1){ alert("Search is invalid! Contains a '.'"); return;} if (txt.indexOf(",") != -1){ alert("Search is invalid! Contains a ','"); return;} if (txt.indexOf("@") != -1){ alert("Search is invalid! Contains a '@''"); return;} if (txt.indexOf("!") != -1){ alert("Search is invalid! Contains a '!''"); return;} if (txt.indexOf("#") != -1){ alert("Search is invalid! Contains a '#''"); return;} if (txt.indexOf("$") != -1){ alert("Search is invalid! Contains a '$''"); return;} if (txt.indexOf("%") != -1){ alert("Search is invalid! Contains a '%''"); return;} if (txt.indexOf("^") != -1){ alert("Search is invalid! Contains a '^''"); return;} if (txt.indexOf("&") != -1){ alert("Search is invalid! Contains a '&''"); return;} if (txt.indexOf("*") != -1){ alert("Search is invalid! Contains a '*''"); return;} if (txt.indexOf("(") != -1){ alert("Search is invalid! Contains a '(''"); return;} if (txt.indexOf(")") != -1){ alert("Search is invalid! Contains a ')''"); return;} if (txt.indexOf("[") != -1){ alert("Search is invalid! Contains a '[''"); return;} if (txt.indexOf("]") != -1){ alert("Search is invalid! Contains a ']''"); return;} if (txt.indexOf(";") != -1){ alert("Search is invalid! Contains a ';''"); return;} if (txt.indexOf(":") != -1){ alert("Search is invalid! Contains a ':''"); return;} if (txt.indexOf("<") != -1){ alert("Search is invalid! Contains a '<''"); return;} if (txt.indexOf(">") != -1){ alert("Search is invalid! Contains a '>''"); return;} if (txt.indexOf("?") != -1){ alert("Search is invalid! Contains a '?''"); return;} if (txt.indexOf("-") != -1){ alert("Search is invalid! Contains a '-''"); return;} if (txt.indexOf("=") != -1){ alert("Search is invalid! Contains a '=''"); return;} if (txt.indexOf("+") != -1){ alert("Search is invalid! Contains a '+''"); return;} else { jsi = new makeLinks(linksize); searchLinks(jsi, txt); document.write("<br><hr><br>"); document.write("<a href='YOUR PAGE LOCATION'>Back</a><br>"); } } </script> To add more links or searchs possibliites, just add the following lines of code. They go in about the top-middle of the script with the ones that are exactly like them. arraycount += 1 urlsArray[arraycount] = "YOUR LINK" namesArray[arraycount] = "YOUR NAME" descArray[arraycount] = "YOU KEYWORDS OR DESCRIPTION" T=Background flash <SCRIPT>function initArray() { this.length = initArray.arguments.length for (var i = 0; i < this.length; i++) this[i+1] = initArray.arguments[i] } var hexChars = "0123456789ABCDEF"; function Dec2Hex (Dec) { var a = Dec % 16; var b = (Dec - a)/16; hex = "" + hexChars.charAt(b) + hexChars.charAt(a); return hex; } function bgChanger (begin, end, steps) { steps = steps -1 ; redA = begin.charAt(0) + begin.charAt(1); red_valA = parseInt(redA,'16'); redB = end.charAt(0) + end.charAt(1); red_valB = parseInt(redB,'16'); red_int = ((red_valB - red_valA) / steps) * -1; grnA = begin.charAt(2) + begin.charAt(3); grn_valA = parseInt(grnA,'16'); grnB = end.charAt(2) + end.charAt(3); grn_valB = parseInt(grnB,'16'); grn_int = ((grn_valB - grn_valA) / steps) * -1; bluA = begin.charAt(4) + begin.charAt(5); blu_valA = parseInt(bluA,'16'); bluB = end.charAt(4) + end.charAt(5); blu_valB = parseInt(bluB,'16'); blu_int = ((blu_valB - blu_valA) / steps) * -1; step = 2; red = red_valA; grn = grn_valA; blu = blu_valA; document.bgColor = begin; while ( steps >= step ) { red -= red_int; red_round = Math.round(red); red_hex = Dec2Hex(red); grn -= grn_int; grn_round = Math.round(grn); grn_hex = Dec2Hex(grn); blu -= blu_int; blu_round = Math.round(blu); blu_hex = Dec2Hex(blu); document.bgColor = red_hex + grn_hex + blu_hex; // document.write("<br>bgcolor = " + red_hex + grn_hex + blu_hex); step++; } document.bgColor = end; } <!-- // black to black (pause) bgChanger("000000","000000",25); // black to red bgChanger("000000","FF0000",25); // red to black bgChanger("FF0000","000000",25); // black to purple bgChanger("000000","AA00EE",25); // purple to black bgChanger("AA00EE","000000",25); // black to blue bgChanger("000000","0000FF",25); // blue to black bgChanger("0000FF","000000",25); // black to white (pause) bgChanger("000000","FFFFFF",25); // --> </SCRIPT> T=Statusbar flash <script> var yourwords = "YOUR MESSAGE GOES HERE"; var speed = 300; var control = 1; function flash() { if (control == 1) { window.status=yourwords; control=0; } else { window.status=""; control=1; } setTimeout("flash()",speed); } </script> <body onLoad="flash()"> T=Link in new window <a href="PARENT WINDOW LOCATION" ONCLICK="window.open('DESTINATION LINK IN NEW WINDOW', 'NewWindow', 'toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes, resizable=no,copyhistory=yes,width=635,height=260')"> Link description</a> T=Switching images <SCRIPT LANGUAGE="JavaScript"> function makeArray() { this.length = makeArray.arguments.length for (var i = 0; i < this.length; i++) this[i+1] = makeArray.arguments[i] } var teams = new makeArray ("IMAGE1.gif", "IMAGE2.gif", "IMAGE3.gif"); var eatMe = 1; function flipper() { document.form.image.src = teams[eatMe]; eatMe += 1; if (eatMe == 4) eatMe = 1; setTimeout("flipper()", 2000); } </SCRIPT> <body onLoad="flipper()"> <form name="form"> <IMG name=image border=0 SRC = "IMAGE.gif"> T=play sound on load <SCRIPT LANGUAGE = "JavaScript"> function PlaySound(){ window.location = "YOUR SOUND FILE" } </SCRIPT> <body onLoad="PlaySound()"> T=Greeting depending on time <script language="JavaScript"> <!-- Hide the script from old browsers -- today = new Date() if(today.getMinutes() < 10){ pad = "0"} else pad = ""; document.write ;if((today.getHours() <=6) && (today.getHours() >=9)){ document.write("Good Morning") } if((today.getHours() >=10) && (today.getHours() <=11)){ document.write("Good Morning! ") } if((today.getHours() >=12) && (today.getHours() <=16)){ document.write("Good Afternoon") } if((today.getHours() >=17) && (today.getHours() <=23)){ document.write("Good Evening!") } if((today.getHours() >=0) && (today.getHours() <=4)){ document.write("You're up late night crawler!") } if((today.getHours() >=4) && (today.getHours() <=6)){ document.write("Wow! You're up early!!") } // -- End Hiding Here --> </script> T=Enter password (main) <script language="JavaScript"> <!-- Hide the script from old browsers -- var new_window = null; function password() { new_window = window.open('pass.html', 'pass', 'width=350,height=200,resizable=1'); } // End hiding ---> </SCRIPT> Now this is how you call the link. <A HREF="javascript:password()">Enter password</A> T=Enter password (save as pass.html) <HTML> <HEAD> <TITLE>STOP!! Enter Your Password!!</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!--- Hide from old browsers function goForit() { var location; var password; password=this.document.testform.inputbox.value location=password + ".htm" fetch(location) theKeeper=window.close() } function fetch(location) { var root; if (opener.closed) {root=window.open('','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no'); root.location.href = location; } else { opener.location.href = location; } } // End hiding ---> </SCRIPT> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080"> <CENTER> <FONT SIZE=+2>Enter the password to go to <EM><font color="purple">your</font></EM> page!! <FORM NAME="testform"> <INPUT TYPE="text" NAME="inputbox" VALUE="" size=20> <INPUT TYPE="button" NAME="button" Value="Submit Password" onClick="goForit(this.form)"></FORM> </FONT> (<EM>You must click the button, don't press Enter.</EM>) </CENTER> </BODY> </HTML> T=Vertical scroll <SCRIPT Language="JavaScript"> <!-- function scrollit() { for (I=1; I<=500; I++){ parent.scroll(1,I) ** OR IF FRAMES ** parent.NAME_OF_DESIRED_FRAME.scroll(1,I) } } //--> </SCRIPT> <form> <input type=button value="Scroll Now!!" onClick="scrollit()"> </font> ** OR START SCROLL ON LOAD ** <body onLoad="scrollit()"> T=Visitor count with message <script language="JavaScript"> <!-- Hide this script from old browsers -- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } 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; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (2 < argc) ? argv[2] : null; var path = (3 < argc) ? argv[3] : null; var domain = (4 < argc) ? argv[4] : null; var secure = (5 < argc) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function ResetCounts(name) { visits = 0; SetCookie("visits", visits, expdate , "/", null, false); location.reload(); } // -- End Hiding Here --> </script> Now put these lines where you want the message to go. <script language="JavaScript"> <!-- Hide this script from old browsers -- var expdate = new Date(); var visits; expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); if(!(visits = GetCookie("visits"))) visits = 0; visits++; SetCookie("visits", visits, expdate, "/", null, false); document.write("You have visited this page "+visits+" time(s)."+"<br>"); if(visits == 1) document.write("YOUR MESSAGE"); if(visits == 2) document.write("YOUR MESSAGE"); if(visits == 3) document.write("YOUR MESSAGE"); if(visits == 4) document.write("YOUR MESSAGE"); if(visits == 5) document.write("YOUR MESSAGE"); if(visits == 6) document.write("YOUR MESSAGE"); if(visits == 7) document.write("YOUR MESSAGE"); if(visits== 8) document.write("YOUR MESSAGE"); if(visits== 9) document.write("YOUR MESSAGE"); if(visits>=10) document.write("YOUR MESSAGE"); // -- End Hiding Here --> </script> T=Browser type with message <SCRIPT Language="JavaScript"> if(navigator.appName.indexOf("BROWSER TYPE") != -1){ document.writeln("START TAG GOES HERE");} </script> DESCRIPTION GOES HERE <SCRIPT Language="JavaScript"> if(navigator.appName.indexOf("BROWSER TYPE") != -1){ document.writeln("END TAG GOES HERE");} </script> /Browser Types: /Netscape = Netscape /Internet Explorer = Microsoft Internet Explorer T=Browser detect <Script Language="JavaScript"> <!--document.write(navigator.appName) document.write(navigator.appVersion)//--> </script> T=Page reffer <Script Language="JavaScript"> document.write(document.referrer)</SCRIPT> T=System OP detect <SCRIPT Language="JavaScript"> if(navigator.appVersion.indexOf("BROWSER TYPE") != -1){ document.writeln("START TAG GOES HERE");} </script> DESCRIPTION GOES HERE <SCRIPT Language="JavaScript"> if(navigator.appVersion.indexOf("BROWSER TYPE") != -1){ document.writeln("END TAG GOES HERE");} </script> /System Types: /Windows 3.11 = Win16 /Windows 95 = Win95 /Windows NT = WinNT /Mac = Macintosh T=Horisontal scroll <SCRIPT Language="JavaScript"> <!-- function scrollit(){ for (H=0; H<=2500; H++){ parent.scroll(H,0) ** OR IF FRAMES ** parent.NAME_OF_DESIRED_FRAME.scroll(H,0) } } //--> </SCRIPT> <form> <input type=button value="Push and follow me!" onClick="scrollit()"> </form> ** OR START SCROLL ON LOAD ** <body onLoad="scrollit()"> T=Popup link window <SCRIPT LANGUAGE="JavaScript"> <!-- function PopIt(label, msg, URLE){ // Set up Page Colors & Table var DQUOTE = '\"' var s1 = "<TITLE>" + label + "</TITLE>" + "<BODY BGCOLOR='ffffff'><TABLE BORDER=0><TR>" + "<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+ "<FONT SIZE=4>" var s2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><P>" var s3 = "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+ "<TD VALIGN=TOP ALIGN=RIGHT>"+ "<FORM><INPUT TYPE='BUTTON' VALUE='Close'" + "onClick='self.close()'>" + "<INPUT TYPE='BUTTON' VALUE='Jump to!'" + "onClick='window.open("+DQUOTE+URLE+DQUOTE+")'" + "</FORM></TD></TR></TABLE></BODY>" popup = window.open("","popDialog","height=200,width=300,scrollbars=no") popup.document.write(s1+s2+msg+s3) popup.document.close() } // --> </SCRIPT> <A HREF="JavaScript:PopIt('Link1','A resource with 1 million ways to improve your site!','http://www.link1.com')">Link1</A> <BR> <A HREF="JavaScript:PopIt('Link2','A resource with 2 million mistakes you shouldn┤t make!','http://www.link2.com')">Link2</A> T=Professional calculator <SCRIPT LANGUAGE="JavaScript"> <!-- var wynik=0, op=0, nowe=0, nowe2=0, done=1, oset=0, kropka, temp; function reset(value) { document.form1.ekran.value = value; wynik = 0, op = 0, nowe = 0, nowe2 = 0; done = 1; oset = 0; } function wspolna(new_temp) { kropka = 1; if(nowe || done) { nowe = 0; done = 0; temp = new_temp; } for(var i=0; i<temp.length; i++) if (temp[i]=='.') kropka=0; } function button(ktory,ktory2) { temp = document.form1.ekran.value; if(ktory2=='.') { wspolna('0'); if(kropka) { temp += ktory2; document.form1.ekran.value = temp; oset = 0; } } if(ktory>=0 && ktory<=9) { wspolna(''); if(temp==0 && kropka==1) temp=''; temp += ktory; document.form1.ekran.value = temp; oset = 1; } if(ktory2=='-' || ktory2=='+' || ktory2=='/' || ktory2=='*') { if(nowe) op = ktory2 else { if(!nowe2) { op = ktory2; wynik = temp; nowe2=1; } else { wynik = eval(wynik + op + temp); op = ktory2; document.form1.ekran.value = wynik; } oset=0; nowe = 1; } } if(ktory2=='1/x' ) { wynik = eval(1 / temp) ; reset(wynik); } if(ktory2=='sqrt') { wynik = Math.sqrt(temp); reset(wynik); } if(ktory2=='exp' ) { wynik = Math.exp(temp) ; reset(wynik); } if(ktory2=='+/-') document.form1.ekran.value = eval(-temp); if(ktory2=='=' && oset && op!='0') reset(eval(wynik + op + temp)); if (ktory2=='C') reset(0); if(document.form1.ekran.value[0] == '.') document.form1.ekran.value = '0' + document.form1.ekran.value; } //--> </SCRIPT> ** This goes in your body ** <form name="form1"> <TABLE bgcolor="#430086"><TR><TD> <TABLE BORDER=1 cellspacing=5 cellpadding=0 bgcolor="#430086"> <TR align=center> <TD colspan=5><input type="text" name="ekran" value="0"></TD> </TR> <TR align=center> <TD colspan=4><B>Calculator</B></TD> <TD ><input type="button" name="C" value=" C " onclick="button(11,'C')"></TD> </TR> <TR align=center> <TD><input type="button" name="7" value=" 7 " onclick="button(7 ,'')"></TD> <TD><input type="button" name="8" value=" 8 " onclick="button(8 ,'')"></TD> <TD><input type="button" name="9" value=" 9 " onclick="button(9 ,'')"></TD> <TD><input type="button" name="/" value=" / " onclick="button(11,'/')"></TD> <TD><input type="button" name="sqrt" value="sqrt" onclick="button(11,'sqrt')"></TD> </TR> <TR align=center> <TD><input type="button" name="4" value=" 4 " onclick="button(4,'')"></TD> <TD><input type="button" name="5" value=" 5 " onclick="button(5,'')"></TD> <TD><input type="button" name="6" value=" 6 " onclick="button(6,'')"></TD> <TD><input type="button" name="*" value=" * " onclick="button(11,'*')"></TD> <TD><input type="button" name="exp" value="exp" onclick="button(11,'exp')"></TD> </TR> <TR align=center> <TD><input type="button" name="1" value=" 1 " onclick="button(1,'')"></TD> <TD><input type="button" name="2" value=" 2 " onclick="button(2,'')"></TD> <TD><input type="button" name="3" value=" 3 " onclick="button(3,'')"></TD> <TD><input type="button" name="-" value=" - " onclick="button(11,'-')"></TD> <TD><input type="button" name="1/x" value="1/x " onclick="button(11,'1/x')"></TD> </TR> <TR align=center> <TD><input type="button" name="0" value=" 0 " onclick="button(0,'')"></TD> <TD><input type="button" name="+/-" value=" +/- " onclick="button(11,'+/-')"></TD> <TD><input type="button" name="." value=" , " onclick="button(11,'.')"></TD> <TD><input type="button" name="+" value=" + " onclick="button(11,'+')"></TD> <TD><input type="button" name="=" value=" = " onclick="button(11,'=')"></TD> </TR> </TABLE> </TD></TR></TABLE> </form> T=Textdate <script language="javascript"> <!-- Hide var DDMMYY =0 var MMDDYY =1 function getdate(mode) { var now = new Date(); var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate(); if (mode==DDMMYY) var MonthDayYear =(dayNr+"/"+(now.getMonth()+1)+"/"+now.getYear()); else var MonthDayYear =((now.getMonth()+1)+"/"+dayNr+"/"+now.getYear()); return MonthDayYear; } function gettime() { var now = new Date(); var ampm = (now.getHours() >= 12) ? " P.M." : " A.M." var hours = now.getHours(); hours = ((hours > 12) ? hours - 12 : hours); var minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes(); var seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds(); var TimeValue =(" " + hours + minutes + seconds + " " + ampm); return TimeValue; }//--> </script> This goes in your body <script language="javascript">document.write(getdate(DDMMYY));</script> T=Very cool linkbutton <SCRIPT LANGUAGE="JavaScript"> <!-- var timerID = null var timerRunning = false var charNo = 0 var charMax = 0 var lineNo = 0 var lineMax = 3 var lineArr = new Array(lineMax) var urlArr = new Array(lineMax) lineArr[1] = "LINK NAME" urlArr[1] = "YOUR LINK HERE" lineArr[2] = "LINK NAME" urlArr[2] = "YOUR LINK HERE" lineArr[3] = "LINK NAME" urlArr[3] = "YOUR LINK HERE" var lineText = lineArr[1] function StartShow() { StopShow() ShowLine() timerRunning = true } function FillSpaces() { for (var i = 1; i <= lineWidth; i++) { spaces += " " } } function StopShow() { if (timerRunning) { clearTimeout(timerID) timerRunning = false } } function ShowLine() { if (charNo == 0) { // Next line if (lineNo < lineMax) { lineNo++ } else { lineNo = 1 } lineText = lineArr[lineNo] charMax = lineText.length } if (charNo <= charMax) { // Next char document.formDisplay.buttonFace.value = lineText.substring(0, charNo) charNo++ timerID = setTimeout("ShowLine()", 100) } else { charNo = 0 timerID = setTimeout("ShowLine()", 3000) } } function GotoUrl(url) { top.location.href = url } // end hide --> </SCRIPT> This goes in your body <SCRIPT LANGUAGE="JavaScript"> <!-- document.write("<FORM NAME=\"formDisplay\">"); document.write("<INPUT TYPE=\"BUTTON\" NAME=\"buttonFace\" VALUE=\"&{lineText}\" SIZE=\"18\" onClick=\"GotoUrl(urlArr[lineNo])\">"); document.write("</FORM>"); StartShow(); //--> </SCRIPT> T=Resizing button <SCRIPT LANGUAGE="JavaScript"> <!-- var blinking = true; var mypos = 0; var dpos = 25; var a = 1; var b = 1; stringm = new Array(4); stringm[1] = " This "; stringm[2] = " is "; stringm[3] = " a small demonstration "; stringm[4] = " of an rezining button! "; function ablink() { if (b==1) { document.forms[0].abutton.value = stringm[a] b-- ; a++; if (a>4) {a = 1};} else { document.forms[0].abutton.value = ""; b++ } } function myblink() { if (dpos > 13) { mypos++} if (dpos > 48) { mypos = 0; dpos = 25; } else {dpos++} ianID = setTimeout ("myblink(); ablink()", 200); } function stopit() { if (blinking==true) { clearTimeout(ianID); document.forms[0].abutton.value = "Click me!"; blinking = false; } else { myblink(); document.forms[0].cbutton.value = "Stop" ; blinking = true; } } //--> </SCRIPT> This goes in your body <SCRIPT LANGUAGE="JavaScript"> <!-- document.write("<FORM NAME=\"pajjs\">"); document.write("<INPUT TYPE=\"BUTTON\" NAME=\"abutton\" VALUE=\" WAITING \" SIZE=\"18\" onclick=\"alert('button is disabled')\">"); document.write("</FORM>"); myblink(); //--> </SCRIPT> T=Typewriter in window <script language="JavaScript"> <!-- Hide var max=0; function textlist() { max=textlist.arguments.length; for (i=0; i<max; i++) this[i]=textlist.arguments[i]; } tl=new textlist ( "YOUR MESSAGE GOES HERE" ); var x=0; pos=0; var l=tl[0].length; function textticker() { document.tickform.tickfield.value=tl[x].substring(0,pos)+"_"; if(pos++==l) { pos=0; setTimeout("textticker()",1000); x++; if(x==max) x=0; l=tl[x].length; } else setTimeout("textticker()",50); } // end --> </script> This goes in your body <SCRIPT LANGUAGE="JavaScript"> <!-- document.write("<FORM NAME=\"tickform\">"); document.write("<INPUT TYPE=\"TEXT\" NAME=\"tickfield\" SIZE=\"34\">"); document.write("</FORM>"); textticker(); //--> </SCRIPT> T=Scrolling text message <SCRIPT LANGUAGE="JavaScript"> <!-- var timerID = null; var timerRunning = false; var id,pause=0,position=0; function marquee() { var i,k,msg=" YOUR MESSAGE GOES HERE "; k=(75/msg.length)+1; for(i=0;i<=k;i++) msg+=" "+msg; document.marqueeform.marquee.value=msg.substring(position,position+120); if(position++==135) position=0; id=setTimeout("marquee()",1000/10); } function action() { if(!pause) { clearTimeout(id); pause=1; } else { marquee(); pause=0; } } // --> </script> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- document.write("<FORM NAME=\"marqueeform\">"); document.write("<INPUT TYPE=\"TEXT\" NAME=\"marquee\" SIZE=\"25\">"); document.write("</FORM>"); marquee(); //--> </SCRIPT> T=Days left to year 2000 OR ???? <SCRIPT LANGUAGE="JavaScript"> <!-- // (c) Henryk Gajewski var urodz = new Date("January 1, 2000"); var now = new Date(); var ile = urodz.getTime() - now.getTime(); var dni = Math.floor(ile / (1000 * 60 * 60 * 24)); if (dni > 1) document.write(dni + " days left to year 2000!") else if (dni == 1) document.write("Only two days left to year 2000!") else if (dni == 0) document.write("Tommorow is year 2000!") else document.write("January 1, 2000 - year 2000"); // --></SCRIPT> T=Exit browser (close) <SCRIPT LANGUAGE="JavaScript"> <!-- Hide function clickclose () { alert("I thought I warned you not to click here!"); close(); } // --End </script> <BOBY> Don't click <A HREF ="" onclick="clickclose()">here</a><BR> T=Pull down menues <SCRIPT LANGUAGE="JavaScript"> <!-- function menu1on() { if (document.layers['menu1'].clip.bottom < 80) { document.layers['menu1'].clip.bottom += 10; setTimeout("menu1on();",50); } } function menu1off() { if (document.layers['menu1'].clip.bottom > 20) { document.layers['menu1'].clip.bottom -= 20; setTimeout("menu1off();",20); } } function menu2on() { (document.layers['menu2'].clip.bottom < 80) { document.layers['menu2'].clip.bottom += 10; setTimeout("menu2on();",50); } } function menu2off() { if (document.layers['menu2'].clip.bottom > 20) { document.layers['menu2'].clip.bottom -= 20; setTimeout("menu2off();",20); } } //--> </SCRIPT> <BOBY> <LAYER NAME="menu1" LEFT=150 TOP=130 BGCOLOR=#ffffff WIDTH=200 CLIP="-10,0,190,20" onMouseOver="menu1on()" onMouseOut="menu1off()"> Pages 1-3 <LI>Page 1 - <A HREF="a1.html">A</A> <LI>Page 2 - <A HREF="a2.html">B</A> <LI>Page 3 - <A HREF="a3.html">C</A> </LAYER> <LAYER NAME="menu2" LEFT=370 TOP=130 BGCOLOR=#ffffff WIDTH=200 CLIP="-10,0,165,20" onMouseOver="menu2on()" onMouseOut="menu2off()"> Pages 4 -6 <LI>Page 4 - <A HREF="b1.html">D</A> <LI>Page 5 - <A HREF="b2.html">E</A> <LI>Page 6 - <A HREF="b3.html">F</A> </LAYER> T=Nice date banner <SCRIPT TYPE="text/javascript"> var isn1=null; var isn2=false; today=new Date(); function stopit(){ if(isn2){ clearTimeout(isn1); } isn2 = false; } function startit(){ stopit(); isnclock(); } function isnclock(){ var now=new Date(); isn1=setTimeout("isnclock()",1000); isn2=true; } function isnArray() { argnr=isnArray.arguments.length for (var i=0;i<argnr;i++) { this[i+1] = isnArray.arguments[i]; } } var isnMonths=new isnArray("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"); var isnDays= new isnArray("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); </SCRIPT> <BOBY> <CENTER> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH=130><TR> <TD BGCOLOR="#0064AC"> <CENTER> <Font Face="Trebuchet MS,Arial, Hevetica" Size=1 Color="#FFFFFF"><B> <SCRIPT LANGUAGE="Javascript"> document.write(isnDays[today.getDay()+1] +" "+today.getDate() +" "+isnMonths[today.getMonth()+1] +" 19"+today.getYear()); </SCRIPT> </B></Font> </CENTER> </TD></TR> </TABLE> </CENTER> T=Cookie counter <SCRIPT LANGUAGE="JavaScript"> <!-- var caution = false function setCookie(name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "") if (!caution || (name + "=" + escape(value)).length <= 4000) document.cookie = curCookie else if (confirm("Cookie exceeds 4KB and will be cut!")) document.cookie = curCookie } function getCookie(name) { var prefix = name + "=" var cookieStartIndex = document.cookie.indexOf(prefix) if (cookieStartIndex == -1) return null var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length) if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)) } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-99 00:00:01 GMT" } } function fixDate(date) { var base = new Date(0) var skew = base.getTime() if (skew > 0) date.setTime(date.getTime() - skew) } var now = new Date() fixDate(now) now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000) var visits = getCookie("counter") if (!visits) visits = 1 else visits = parseInt(visits) + 1 setCookie("counter", visits, now) document.write("You have been here " + visits + " time(s).") // --> </SCRIPT> T=Black shrinking layer <SCRIPT> <!-- function addList(url,desc) { var w = window.open("","_IDHTML_LIST_","top=0,left=0,width=475,height=150,history=no,menubar=no,status=no,resizable=no") var d = w.document if (!w._init) { d.open d.write("<TITLE>Loading...</TITLE><EM>Loading...</EM>") d.close() d.location.replace("/assist/listing.asp?url="+escape(url)+"&desc="+escape(desc)) w.opener = self window.status = "Personal Assistant (Adding): " + desc } else { window.status = w.addOption(url,desc) w.focus() } return false } // --> </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> <!-- NS4 = (("Netscape"==navigator.appName) && ("4"<=parseInt(navigator.appVersion))) window.name = "main" // --> </SCRIPT> <STYLE> <!-- #box {position: absolute; top:0; left: 0;z-index: 100; background: black; layer-background-color:black; border: .1px solid black; clip: rect(0 100% 100% 0)} --> </STYLE> <DIV ID=box></DIV> <SCRIPT LANGUAGE="JavaScript1.2"> // Determine Version var NS =navigator.appName == "Netscape" var MS = navigator.appName == "Microsoft Internet Explorer" var ver = parseInt(navigator.appVersion) var NS4 = NS && ver>=4 var IE4 = MS && ver>=4 var steps = 100 // This determines how fast of a transition if (NS4 || IE4) { if (IE4) { var box = document.all.box var nWidth = box.style.pixelWidth = document.body.clientWidth var nHeight = box.style.pixelHeight = document.body.clientHeight } else { var box = document.layers.box var nWidth = box.clip.width = window.innerWidth var nHeight = box.clip.height = window.innerHeight } var nTop = nLeft = 0 destWidth = nWidth/2 destHeight = nHeight/2 var stepWidth = destWidth/steps var stepHeight = destHeight/steps boxIn() } function boxIn() { nWidth -= stepWidth*2 nHeight -= stepHeight*2 nLeft += stepWidth nTop += stepHeight if (IE4) { nLeft += stepWidth nTop += stepHeight box.style.pixelTop = document.body.scrollTop box.style.pixelLeft = document.body.scrollLeft box.style.clip = "rect(" + nTop + " " + nWidth + " " + nHeight + " " + nLeft + ")" } else { box.top = window.pageYOffset box.left = window.pageXOffset box.clip.left = nLeft box.clip.width = nWidth box.clip.top = nTop box.clip.height = nHeight } steps-- if (steps>0) setTimeout("boxIn()",10) } </SCRIPT> T=Links with explain window 1 <script language="JavaScript"> var CurrentMsg = 'Welcome to 24 hour JavaScripts!'; function update(msg) { var pad_str=""; n = msg.length; if(n<81) { pad = (81-n)/2; for(var i=0; i<pad; i++) { pad_str+=" "; } } CurrentMsg = pad_str + msg; document.messages.field.value = CurrentMsg; clearTimeout(timer); timer = setTimeout("idleMsg()",5000); } function MakeArray(n) { this.length=n; for(var i = 1; i<= n; i++) { this[i] = ""; } return(this); } var index = 1; var notice_num = 8; var notices = new MakeArray(notice_num); notices[1] = "Automatic rotating text 1"; notices[2] = "Automatic rotating text 2"; notices[3] = "Automatic rotating text 3"; notices[4] = "Automatic rotating text 4"; notices[5] = "Automatic rotating text 5"; notices[6] = "Automatic rotating text 6"; notices[7] = "Automatic rotating text 7"; var timer = setTimeout('idleMsg()',5000); function nochange() { document.messages.field.value = CurrentMsg; } function idleMsg() { update(notices[index++]); if(index>notice_num) { index=1; } } </script> <BODY> <CENTER> <center><form name="messages" onSubmit="return false"> <input type="text" name="field" size=60 height=5 value="Check out this neat little status window text replacer!" onFocus="self.status='Roll over one of the below links.'; return true" onChange="nochange()"> <br><br> <A HREF="http://" onMouseOver="update('Message')">Site name</a> T=Calendar <SCRIPT LANGUAGE="JavaScript"> <!-- function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11) { this[0] = m0; this[1] = m1; this[2] = m2; this[3] = m3; this[4] = m4; this[5] = m5; this[6] = m6; this[7] = m7; this[8] = m8; this[9] = m9; this[10] = m10; this[11] = m11; } function calendar() { var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec"; var today = new Date(); var thisDay; var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); year = today.getYear() + 1900; thisDay = today.getDate(); // leap year calculation if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29; // figure out how many days this month will have... nDays = monthDays[today.getMonth()]; // and go back to the first day of the month... firstDay = today; firstDay.setDate(1); // check which day of the week it is startDay = firstDay.getDay(); document.writeln("<CENTER>"); document.write("<TABLE BORDER>"); document.write("<TR><TH COLSPAN=7>"); document.write(monthNames.substring(today.getMonth() * 3, (today.getMonth() + 1) * 3)); document.write(". "); document.write(year); document.write("<TR><TH>Sun<TH>Mon<TH>Tue<TH>Wed<TH>Thu<TH>Fri<TH>Sat"); // write the blank days document.write("<TR>"); column = 0; for (i=0; i<startDay; i++) { document.write("<TD>"); column++; } for (i=1; i<=nDays; i++) { document.write("<TD>"); if (i == thisDay) document.write("<FONT COLOR=\"#FF0000\">") document.write(i); if (i == thisDay) document.write("</FONT>") column++; if (column == 7) { document.write("<TR>"); // start a new row column = 0; } } document.write("</TABLE>"); document.writeln("</CENTER>"); } document.write(calendar()); <!-- --> </SCRIPT> T=Scrolling message <style type="text/javascript"> <!-- ids.clr.fontfamily="Arial"; ids.clr.whiteSpace="pre"; ids.clr.fontSize="20"; ids.clr.color="#000000"; ids.clr.fontweight="bold"; ids.clr.fontStyle="italic"; //--> </style> <Script Language="Javascript1.2"> <!-- Hiding var y=0; var message= new Array() message[0]=" Message #1 " message[1]=" Message #2 " message[2]=" Message #3 " message[3]=" Message #4 " message[4]=" Message #5 " function dspl(){ if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4){ var text=""; if(y<message.length){ for (x=0; x<message[y].length; x++){ text+=message[y].charAt(x) for(z=0; z<800; z++){}; document.stext.document.write('<P ID="clr" Align="center">'+text); document.stext.document.close(); } y+=1; window.setTimeout('dspl()',3000); } else{ y=0; dspl(); } } } //done Hiding--> </Script> <BODY bgcolor="#FFFFFF" onLoad="dspl()" > <HR> <P> </P> <Layer ID="stext" Width=800 Height=30 Top=120 Left=10 visibility="show" bgcolor="#FFFFFF"> </Layer> T=Day of the week <SCRIPT LANGUAGE="JavaScript"> <!-- document.write("<center><font size=+1><b>") now = new Date() if (now.getDay() == 5) document.write("Magnificent, it's Friday!") if (now.getDay() == 6) document.write("We've got a weekend! Feel free and rest well!") if (now.getDay() == 0) document.write("We've got a weekend! Feel free and rest well!") if (now.getDay() == 1) document.write("We've got Monday today! This will be good week, I hope so!") if (now.getDay() == 2) document.write("It's Tuesday. Monday is fortunately the past.") if (now.getDay() == 3) document.write("Wednesday, are your week also good?") if (now.getDay() == 4) document.write("It's Thursday, weekend is near.") document.write("</b></center></font>") //--> </SCRIPT> T=Headline banner <style type="text/css"> .stHeadliner {font-family: courier new, monospace; font-size: large; font-weight: bold; font-style: italic; color: navy; text-transform: capitalize; text-align: center; width: 92%; height: auto; border-style: none; cursor: hand;} </style> <BOBY> <script language="JavaScript"> <!-- start hide setTimeout('StartHeadliner()',5); typeWriterWait=120 blinkTextWait=1000 blinkSpacesWait=300 blinkMax=6 expandWait=100 scrollWait=90 scrollWidth=34 randomLines=false lineMax=3 lines=new Array(lineMax) lines[1]=new Line("MESSAGE #1", "LINK #1", "", TypeWriter, 1000) lines[2]=new Line("MESSAGE #2", "LINK #2", "", Scroll, 1500) lines[3]=new Line("MESSAGE #3", "LINK #3", "", Expand, 3000) lineText="" timerID=null timerRunning=false spaces="" charNo=0 charMax=0 charMiddle=0 lineNo=0 lineWait=0 function Line(text, url, frame, type, wait) { this.text=text this.url=url this.frame=frame this.Display=type this.wait=wait } function StringFill(c, n) { var s="" while (--n >= 0) { s+=c } return s } function getNewRandomInteger(oldnumber, max) { var n=Math.floor(Math.random() * (max - 1) + 1) if (n >= oldnumber) { n++ } return n } function getRandomInteger(max) { var n=Math.floor(Math.random() * max + 1) return n } function GotoUrl(url, frame) { if (frame != '') { if (frame == 'self') self.location.href=url else if (frame == 'parent') parent.location.href=url else if (frame == 'top') top.location.href=url else { s=eval(top.frames[frame]) if (s != null) top.eval(frame).location.href=url else window.open(url, frame, "toolbar=yes,status=yes,scrollbars=yes") } } else window.location.href=url } function Static() { document.formDisplay.buttonFace.value=this.text timerID=setTimeout("ShowNextLine()", this.wait) } function TypeWriter() { lineText=this.text lineWait=this.wait charMax=lineText.length spaces=StringFill(" ", charMax) TextTypeWriter() } function TextTypeWriter() { if (charNo <= charMax) { document.formDisplay.buttonFace.value=lineText.substring(0, charNo)+spaces.substring(0, charMax-charNo) charNo++ timerID=setTimeout("TextTypeWriter()", typeWriterWait) } else { charNo=0 timerID=setTimeout("ShowNextLine()", lineWait) } } function Blink() { lineText=this.text charMax=lineText.length spaces=StringFill(" ", charMax) lineWait=this.wait TextBlink() } function TextBlink() { if (charNo <= blinkMax * 2) { if ((charNo % 2) == 1) { document.formDisplay.buttonFace.value=lineText blinkWait=blinkTextWait } else { document.formDisplay.buttonFace.value=spaces blinkWait=blinkSpacesWait } charNo++ timerID=setTimeout("TextBlink()", blinkWait) } else { charNo=0 timerID=setTimeout("ShowNextLine()", lineWait) } } function Expand() { lineText=this.text charMax=lineText.length charMiddle=Math.round(charMax / 2) lineWait=this.wait TextExpand() } function TextExpand() { if (charNo <= charMiddle) { document.formDisplay.buttonFace.value=lineText.substring(charMiddle - charNo, charMiddle + charNo) charNo++ timerID=setTimeout("TextExpand()", expandWait) } else { charNo=0 timerID=setTimeout("ShowNextLine()", lineWait) } } function Scroll() { spaces=StringFill(" ", scrollWidth) lineText=spaces+this.text charMax=lineText.length lineText+=spaces lineWait=this.wait TextScroll() } function TextScroll() { if (charNo <= charMax) { document.formDisplay.buttonFace.value=lineText.substring(charNo, scrollWidth+charNo) charNo++ timerID=setTimeout("TextScroll()", scrollWait) } else { charNo=0 timerID=setTimeout("ShowNextLine()", lineWait) } } function StartHeadliner() { StopHeadliner() timerID=setTimeout("ShowNextLine()", 2000) timerRunning=true } function StopHeadliner() { if (timerRunning) { clearTimeout(timerID) timerRunning=false } } function ShowNextLine() { if (randomLines) lineNo=getNewRandomInteger(lineNo, lineMax) else (lineNo < lineMax) ? lineNo++ : lineNo=1 lines[lineNo].Display() } function LineClick(lineNo) { document.formDisplay.buttonFace.blur() if (lineNo > 0) GotoUrl(lines[lineNo].url, lines[lineNo].frame) } with (document) { write('<center><form name="formDisplay"><input class="stHeadliner" type="button"') write('name="buttonFace" value="Please wait. Loading ..."') write('onClick="LineClick(lineNo)"></input></form></center>') } // end hide --> </script>