scroll.js


var step=0
var clckme
var seconds
var minutes
var hours
var day
var date
var month
var y2k_day
var y2k_sec
var spsl
var name=""

var dots="..."
var msg=""
var bri=15
var br=""
var mns=-1

function scrollMSG() {
 spesial()
 time()
 clickMe()
 msg="Welcome to Jan Henning's Homepage"+dots+spsl+"The time is: "+hours+"."+minutes+"."+seconds+" and this day is the "+date+" of "+month+dots
 br=""
 for(var i=0;i<bri;i++) {
  br=br+" "
 }
 bri--
 if(bri<=0) {
  msg_v=msg.substring(mns,msg.length)
  mns++
 }
 else
  msg_v=msg
 if(mns>=msg.length) {
  for(i=0;i<2;i++)
   mns=-1
 }
 message=br+msg_v+msg
 document.f.t1.value=message
 document.f.t2.value=message
 setTimeout("scrollMSG()",100)
}

//function count() {
// l1=
// left=l1+l2
// c_time=total-left
//}

function spesial() {
 spsl=""
 tt=new Date()
 if(tt.getMonth()==1 && tt.getDate()==24)
  spsl="Today Is my birthday"+dots
 if(tt.getMonth()==2 && tt.getDate()==5)
  spsl="Today I celebrate my brother's birthday"+dots
 if(tt.getMonth()==2 && tt.getDate==24)
  spsl="Today I celebrate my mother's birthday"+dots
 if(tt.getMonth()==6 && tt.getDate==5)
  spsl="Today I celebrate my sister's birthday"+dots
 if(tt.getMonth()==11 && tt.getDate==31)
  spsl="Today I celebrate my father's birthday"+dots
 if(tt.getMonth()==4 && tt.getDate==17)
  spsl="Today we norwegians celebrate our constitution day"+dots
 if(tt.getMonth()==4 && tt.getDate==17)
  spsl="Today we norwegians celebrate our constitution day"+dots
}

function time() {
 tt=new Date()

 date=tt.getDate()

 year=tt.getYear()
 if(year==99)
 year=19+""+year
 else
 year=year
 
 month=tt.getMonth()
 if(month==0)
 month="January"
 if(month==1)
 month="February"
 if(month==2)
 month="March"
 if(month==3)
 month="April"
 if(month==4)
 month="May"
 if(month==5)
 month="June"
 if(month==6)
 month="July"
 if(month==7)
 month="August"
 if(month==8)
 month="September"
 if(month==9)
 month="October"
 if(month==10)
 month="November"
 if(month==11)
 month="December"

 date=tt.getDate()
 if(date==1)
 date="1st"
 if(date==2)
 date="2nd"
 if(date==3)
 date="3rd"
 if(date>=4)
 date=date+"th"

 day=tt.getDay()
 if(day==0)
 day="Sunday"
 if(day==1)
 day="Monday"
 if(day==2)
 day="Tuesday"
 if(day==3)
 day="Wednesday"
 if(day==4)
 day="Thursday"
 if(day==5)
 day="Friday"
 if(day==6)
 day="Saturday"

 hours=tt.getHours()
 if(hours<=9)
 hours="0"+hours

 minutes=tt.getMinutes()
 if(minutes<=9)
 minutes="0"+minutes

 seconds=tt.getSeconds()
 if(seconds<=9)
 seconds="0"+seconds 
}

function clickMe(o) {
 if(name==null || name=="" || name=="your_name (nation)+more")
  clckme="Please click me"
 else
  clckme="Welcome "+name+" !"

 if(o=='click') {
  if(step>=1) {
   alert("Your work have been done")
  }
  if(step==0) {
   name=prompt("Please enter your name")
   if(name!=null && name!="" && name!="your_name (nation)+more") {
    alert(dots+dots+"Thanks "+name+"! \n(Now your name is a part of the scrolling text...)")
    clkcme=name
    step++
   }
  }
 }
}