function login()
{

  

}//End function


function entsub(event,ourform) 
{
//alert("in entsub event.which = " + event.which + " event.keyCode = " + event.keyCode);
  if (event && event.which == 13)
  {
    ourform.submit();
  }//End if
  else
  {
    
    if(event.keyCode == 13)
    {
      ourform.submit();
    }//End if
    else
    {
      return true;
    }//End else
  }//End else
}//End function



function countdown_clock(year, month, day, hour, minute, format)
{
  //I chose a div as the container for the timer, but
  //it can be an input tag inside a form, or anything
  //who's displayed content can be changed through
  //client-side scripting.
  html_code = '<div id="countdown"></div>';

  document.write(html_code);

  countdown(year, month, day, hour, minute, format);                
}

         
function countdown(year, month, day, hour, minute, format)
{
  Today = new Date();
  Todays_Year = Today.getFullYear() - 2000;
  Todays_Month = Today.getMonth() + 1;                  

  //Convert both today's date and the target date into miliseconds.                           
  Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
		 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();                                 
  Target_Date = (new Date(year, month, day, hour, minute, 00)).getTime();                  

  //Find their difference, and convert that into seconds.                  
  Time_Left = Math.round((Target_Date - Todays_Date) / 1000);

  if(Time_Left < 0)
  Time_Left = 0;

  switch(format)
  {
  case 0:
    //The simplest way to display the time left.
    document.getElementById("countdown").innerHTML = Time_Left + ' seconds';
    break;
  case 1:
    //More datailed.
    days = Math.floor(Time_Left / (60 * 60 * 24));
    Time_Left %= (60 * 60 * 24);
    hours = Math.floor(Time_Left / (60 * 60));
    Time_Left %= (60 * 60);
    minutes = Math.floor(Time_Left / 60);
    Time_Left %= 60;
    seconds = Time_Left;

    dps = 's'; hps = 's'; mps = 's'; sps = 's';
    //ps is short for plural suffix.
    if(days == 1) dps ='';
    if(hours == 1) hps ='';
    if(minutes == 1) mps ='';
    if(seconds == 1) sps ='';

    document.getElementById("countdown").innerHTML = days + ' day' + dps + ' ';
    document.getElementById("countdown").innerHTML += hours + ' hour' + hps + ' ';
    document.getElementById("countdown").innerHTML += minutes + ' minute' + mps + ' and ';
    document.getElementById("countdown").innerHTML += seconds + ' second' + sps;
    break;
  default: 
    document.getElementById("countdown").innerHTML = Time_Left + ' seconds';
  }

  //Recursive call, keeps the clock ticking.
  setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + format + ');', 1000);

}//End function


//*****START FUN FACTS TICKER****

var list; // global list variable cache
var tickerObj; // global tickerObj cache
var hex = 0;

function fadeText(divId) 
{
  if(tickerObj)
  {
    if(hex>0) 
    {
      hex+=5; // increase color darkness
      tickerObj.style.color="rgb("+hex+","+hex+","+hex+")";
      setTimeout("fadeText('" + divId + "')", fadeSpeed); 
    } 
    else
    {
      hex=0; //reset hex value
    }
  }
}//End function


function initialiseList(divId) 
{
  tickerObj = document.getElementById(divId);
  if(!tickerObj)
    reportError("Could not find a div element with id \"" + divId + "\"");
  list = tickerObj.childNodes;
  if(list.length <= 0)
    reportError("The div element \"" + divId + "\" does not have any children");
  for (var i=0; i<list.length; i++) 
  {
    var node = list[i];
    if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
              tickerObj.removeChild(node);
  }
  run(divId, 0);
}//End function


function run(divId, count) 
{
  fadeText(divId);
  list[count].style.display = "block";
  if(count > 0)
    list[count-1].style.display = "none";
  else
    list[list.length-1].style.display = "none";
  count++;
  if(count == list.length)
    count = 0;
  window.setTimeout("run('" + divId + "', " + count+ ")", interval*1000);
}//End function


function reportError(error) 
{
  alert("The script could not run because you have errors:\n\n" + error);
  return false;
}//End function


var interval = 4; // interval in seconds
var fadeSpeed = 30; // fade speed, the lower the speed the faster the fade.  40 is normal.

//*****END FUN FACTS TICKER****



//*****START FUN FACTS SCROLLER*****
var toScroll=new Array()
var ie=document.all
var dom=document.getElementById
var firstNews_obj;
var secondNews_obj;

function newsScroll(name){
  var c=this; c.name=name; c.mc=0; c.i=2;
  return this;
}

newsScroll.prototype.addItem = function(text,link,font,fontSize,fontStyle){
  var c = this;
  if (link !=''){
    if (font != '')
      toScroll[c.mc]="<a href='"+link+"'><font face='"+font+"' size='"+fontSize+"' Class='"+fontStyle+"'>"+text+"</font></a>";
    else
      toScroll[c.mc]="<a href='"+link+"'><font Class='"+fontStyle+"'>"+text+"</font></a>";
  }
  else { 
    if (font != '')
      toScroll[c.mc]="<font face='"+font+"' size='"+fontSize+"' Class='"+fontStyle+"'>"+text+"</font>";
    else
      toScroll[c.mc]="<font Class='"+fontStyle+"'>"+text+"</font>";
  }
  c.mc++;
}

newsScroll.prototype.construct = function(){
  var c = this; theWidth = c.scrollerwidth; theHeight=c.scrollerheight; thebgColor = c.scrollerbgcolor; theBackground =c.scrollerbackground; theDelay=c.scrollerdelay;
  scroll_obj=eval(c.name);        
  if (ie||dom){
    document.writeln('<div id="main2" style="position:relative;width:'+theWidth+';height:'+theHeight+';overflow:hidden;background-color:'+thebgColor+' ;background-image:url('+theBackground+')">')
    document.writeln('<div style="position:absolute;width:'+theWidth+';height:'+theHeight+';clip:rect(0 '+theWidth+' '+theHeight+' 0);left:0;top:0">')
    document.writeln('<div id="firstNews" style="position:absolute;width:'+theWidth+';left:0;top:1">')
    document.write(toScroll[0])
    document.writeln('</div>')
    document.writeln('<div id="secondNews" style="position:absolute;width:'+theWidth+';left:0;top:0;visibility:hidden">')
    document.write(toScroll[dyndetermine=(toScroll.length==1)? 0 : 1])
    document.writeln('</div>')
    document.writeln('</div>')
    document.writeln('</div>')
  }
}

newsScroll.prototype.move = function(whichdiv){
  var c = this; theDelay = c.scrollerdelay; theHeight = c.scrollerheight; 
  scroll_obj=eval(c.name);
  tdiv=eval(whichdiv)

  if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
    tdiv.style.top=0+"px"
    setTimeout("scroll_obj.move(tdiv)",theDelay)
    setTimeout("scroll_obj.move2(secondNews_obj)",theDelay)
    //document.write('Got Milk?')
  return
  }
  if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
    tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
    setTimeout("scroll_obj.move(tdiv)",50)
  }
  else {
    tdiv.style.top=parseInt(theHeight)+"px"
    tdiv.innerHTML=toScroll[c.i]
    if (c.i==toScroll.length-1)
      c.i=0
    else
      c.i++
  }
}

newsScroll.prototype.move2 = function(whichdiv){
  var c = this; theDelay = c.scrollerdelay; theHeight= c.scrollerheight;
  scroll_obj=eval(c.name);
  tdiv2=eval(whichdiv)

  if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
    tdiv2.style.top=0+"px"
    setTimeout("scroll_obj.move2(tdiv2)",theDelay)
    setTimeout("scroll_obj.move(firstNews_obj)",theDelay)
    return
  }
  if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
    tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
    setTimeout("scroll_obj.move2(secondNews_obj)",50)
  }
  else {
    tdiv2.style.top=parseInt(theHeight)+"px"
    tdiv2.innerHTML=toScroll[c.i]
    if (c.i==toScroll.length-1)
      c.i=0
    else
      c.i++
  }
}

newsScroll.prototype.startScroll = function(){
  var c = this;
  scroll_obj=eval(c.name);        
  
  if (toScroll.length >2)
    c.i = 2;
  else
    c.i = 0;
  
  firstNews_obj=ie? firstNews : document.getElementById("firstNews")
  secondNews_obj=ie? secondNews : document.getElementById("secondNews")
  setTimeout("scroll_obj.move(firstNews_obj)",c.scrollerDelay);
  secondNews_obj.style.top=theHeight;
  secondNews_obj.style.visibility='visible'
}

//*****END FUN FACTS SCROLLER*****






//*****START MARQUEE SCROLLER*****

var msgWidth = 570, bannerWidth;
var timerID;
/* This function centers the banner window in the main browser window */
function centerBanner() 
{
  if (bannerWidth == null) setBannerWidth();
  var el = document.getElementById('canvas');
  var scrnWidth = (document.all ? document.body.clientWidth : window.innerWidth);
  el.style.left = parseInt(0.5*(scrnWidth - bannerWidth)) + "px";
  el.style.visibility = 'visible';
}

/* Gets the banner window width from the select box value */
function setBannerWidth() 
{
  var selEL = document.getElementById('banWidth');
  bannerWidth = parseInt(selEL.options[selEL.selectedIndex].text);
  document.getElementById('canvas').style.width = bannerWidth + "px";
  document.getElementById('canvasText').style.left = bannerWidth + "px";
  centerBanner();
}

/* Function to start and stop scrolling */
function scroll(type) 
{
alert("in function scroll");
   if (type == 'start') 
   {
     scrollIt(bannerWidth, 10, 250);
   } 
   else
   {
     if (timerID != null) clearTimeout(timerID);
   }
}

/* Function to reset the text layer for next scroll */
function clearText() {
  scroll('stop');
  var el = document.getElementById('canvasText');
/* Reposition the scrolling text */
  el.style.left = bannerWidth + "px";
}

/* Function which toggles the display of the script code.
 * Rather than going through the textNode creation shown here
 * the node value can be directly set to accomplish the
 * same thing */
function showCode() 
{
  var toggleEL = document.getElementById('toggleCode');
  var scrpEL = document.getElementById('scriptContainer');
  if (toggleEL.childNodes[0].nodeValue.indexOf('Show') != -1) 
  {
     var eTEXT = document.createTextNode("Hide Script Code");
     toggleEL.replaceChild(eTEXT, toggleEL.childNodes[0]);
     scrpEL.className = 'scrShow';
  } 
  else 
  {
     var eTEXT = document.createTextNode("Show Script Code");
     toggleEL.replaceChild(eTEXT, toggleEL.childNodes[0]);
     scrpEL.className = 'scrHidden';
  }
  return false; 
}

/* Function that does the actually scrolling */
function scrollIt(Left, dx, speed) 
{
  var text = document.getElementById('canvasText');
  Left -= dx;
  text.style.left = Left + "px";
  if (Left > -msgWidth)
    timerID = setTimeout("scrollIt(" + Left + ", " + dx + ", " + speed + ")", speed);
}

//*****END MARQUEE SCROLLER*****
