Good-bye, "+visitor+"!");
myWindow.document.write("");
myWindow.document.write(" We enjoyed your visit here very much.");
myWindow.document.write(" Please Come Back Soon.");
myWindow.document.write("
");
myWindow.document.write("");
// close the document - (not the window!)
myWindow.document.close();
}
function person() {
visitor=prompt("Please, Enter Your Name:","Web Surfer");
if((visitor==null) || (visitor=="")) visitor="Web Surfer";
countvalue="0";
countvalue=parseInt(countvalue)+1;
setCookie("counter",countvalue);
setCookie("visitor",visitor);
setCookie("lastvisited",today.toGMTString());
}
// this function extracts cookie by name and return value.
function getCookie(byname){
thiscookie=document.cookie
if((fromN = thiscookie.indexOf(byname+"=")) != -1)
{toN=thiscookie.indexOf(";",(fromN+=(byname+"=").length));
if(toN == -1) {toN=thiscookie.length;}
return unescape(thiscookie.substring(fromN,toN));
}
return null;
}
//this function writes to cookie
function setCookie(name,value,time){
exp = new Date();
if((name==null)||(value==null)) return;
if(time==null) time =365*86400000;
exp.setTime(exp.getTime()+time);
document.cookie=escape(name)+"="+escape(value)+";"+"expires="+exp.toGMTString();
}
//this function looks into cookie for counter, visitor and lastvisited
function checkAccess()
{today=new Date();
countvalue=getCookie("counter");
visitor=getCookie("visitor");
lastvisited=getCookie("lastvisited");
if((countvalue==null)||(countvalue=="")) {
countvalue="0";
if((visitor==null) || (visitor=="")) visitor="Web Surfer";
}
countvalue=parseInt(countvalue)+1;
setCookie("counter",countvalue);
setCookie("visitor",visitor);
setCookie("lastvisited",today.toGMTString());
}
//this function writes welcome message into browser.
function welcome(){
checkAccess();
s="
Welcome, "+visitor+"!
";
count = parseInt(countvalue);
if(count==1) s+="It's your first visit to my home page. Thanx";
else {
s+="You visited my page "+count+" times.";
s+="Last time it was "+lastvisited;
if(count>=100)s+="
Congratz!!!! YOU ARE HERE FOR 100 TIMES. COOL MAN...."+"
";
}
if (visitor !="Web Surfer") {
document.write("
")
day = new Date()
hr = day.getHours()
if (hr <12)document.write("Good Morning, "+visitor+"!")
if (hr >11) {
if (hr <19)document.write("Good Afternoon, "+visitor+"!")
if (hr ==12)document.write("It's Lunch Time!,"+visitor+"!")
}
if (hr >18)document.write("Good Evening, "+visitor+"!")
document.write("
")
}
}
function openMe2() {
myWin2 = open("", "display2",
"width=400,height=360,top=20,left=50,status=yes,scrollbars=no,menubar=no");
// open document for further output
myWin2.document.open();
// create document
myWin2.document.write("Oregon Coast Pictures");
myWin2.document.write("
");
myWin2.document.write("");
// close the document - (not the window!)
myWin2.document.close();
myWin2.focus();
}
function Playit(Song) {
myWin= open("", "display1",
"width=190,height=140,top=150,left=214,status=yes,scrollbars=no,menubar=no");
// open document for further output
myWin.document.open();
// create document
myWin.document.write("Juke Box");
myWin.document.write("");
myWin.document.write("");
myWin.document.write("
");
if (navigator.appName == "Netscape") {
myWin.document.write( '
");
myWin.document.write("");
// close the document - (not the window!)
myWin.document.close();
myWin.focus();
}
If You Like Music, Check out the Juke Box Player Below