function cookieVal(cookieName)
{
   thisCookie = document.cookie.split("; ")
   for(i=0 ; i < thisCookie.length ; i++)
   {
      if(cookieName == thisCookie[i].split("=")[0])
      {
         return thisCookie[i].split("=")[1]
      }
   }

   return 0
}
    
function openWindow(content, name)
{
   //screen.height-65 (for no toolbar) screen.height-125 (for toolbar)
   info= "width=" + eval(screen.width-10) + ",height=" + eval(screen.height-65) + ",left=0,top=0"
   aWindow= window.open(content,name,info)
   aWindow.focus()
}

function loadImages(imageArray, size, names)
{
   if(document.images)
   {
      for(i= 0 ; i < size ; i++)
      {
         imageArray[i]= new Image
         imageArray[i].src= names[i]
      }
   }
   else
   {
      for(i= 0 ; i < size ; i++)
      {
         imageArray[i]=""
      }
   }
}

function changeImage(imageArrray, image, index)
{
   document[image].src= imageArray[index].src  
}

function addSuffix(num)
{
   if((num/10-(num%10)/10) != 1)
   {
      if(num%10 == 1){
         document.write("st")
      }else if(num%10 == 2){
         document.write("nd")
      }else if(num%10 == 3){
         document.write("rd")
      }else{
         document.write("th")
      }
   }else{
      document.write("th")
   }
}

function updateInfo()
{
   now = new Date
   date= now.getDate()
   document.write("<!doctype html public \"-\/\/W3C\/\/DTD HTML 4.0\/\/EN\"><html><head><title>Date and Time!<\/title><link rel=stylesheet type=\"text/css\" href=\"xyris.css\"><\/head><body>")
   document.write("<center><table border=1 bordercolor=black cellpadding=5 cellspacing=0><tr><td class=small>Days Visited:<\/td><td align=left class=small>"+dayCt+"<\/td><\/tr><tr><td class=small>Your Hits:<\/td><td align=right class=small>"+hitCt+"<\/td><\/tr><\/table><\/center>")
   document.write("<center><table border=0 bordercolor=white cellpadding=5 cellspacing=0><tr align=center><td align=left><p class=\"small\">Today is "+days[now.getDay()]+", the "+date)
   addSuffix(date)
   document.write(" of "+months[now.getMonth()]+". ")

   hours= new Number(now.getHours())
   minutes = new Number(now.getMinutes())
   seconds = new Number(now.getSeconds())

   document.write("You loaded this page at "+hours.toString()+":")

   if(minutes < 10){
      document.write("0")
   }

   document.write(minutes.toString()+":")

   if(seconds < 10){
      document.write("0")
   }

   document.write(seconds.toString()+".")

   document.write("<\/p><\/td><\/tr><\/table><\/center><\/body><\/html>")
}

function changeItem(block, color, message)
{
   block.style.backgroundColor=color
   window.status= message
}

function changeLayer(layer, color, message)
{
   layer.style.bgColor= color
   window.status= message
}