function movedown(){
if (window.moveupvar) clearTimeout(moveupvar)
if (iens6&&parseInt(crossobj.style.top)>=(contentnewsheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
else if (ns4&&crossobj.top>=(contentnewsheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",20)
}
function moveup(){
if (window.movedownvar) clearTimeout(movedownvar)
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",20)
}
function stopscroll(){
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}
function movetop(){
stopscroll()
if (iens6)
crossobj.style.top=0+"px"
else if (ns4)
crossobj.top=0
}
function getcontentnews_height(){
if (iens6)
contentnewsheight=crossobj.offsetHeight
else if (ns4)
document.nscontainernews.document.nscontentnews.visibility="show"
}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
addLoadEvent(getcontentnews_height);
addLoadEvent(function() {
});
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: William Bontrager :: http://willmaster.com/possibilities/ */
var thispagedomain = ExtractDomainName(document.URL);
for(var i = 0; i <= document.links.length - 1; i++) {
  var url = document.links[i].href.toLowerCase();
  if(url.indexOf('http://') != 0) { continue; }
  var hrefdomain = ExtractDomainName(url);
  if(thispagedomain != hrefdomain) {
    document.links[i].target = '_blank';
  }
}
function ExtractDomainName(s) {
  var i = s.indexOf('//');
  if(i > -1) { s = s.substr(i+2); }
  i = s.indexOf('/');
  if(i > -1) { s = s.substr(0,i); }
  i = s.indexOf(':');
  if(i > -1) { s = s.substr(0,i); }
  var re = /[a-z]/i;
  if(! re.test(s)) { return s; }
  var a = s.split('.');
  if(a.length < 2) { return s; }
  var domain = a[a.length-2] + '.' + a[a.length-1];
  if(a.length > 2) {
    if(a[a.length-2].length==2 && a[a.length-1].length==2) {
      domain = a[a.length-3] + '.' + domain;
      }
    }
  return domain.toLowerCase();
}

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

    //Convert 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.
    //Taking into account the time differential between the client computer and the server.
    Time_Left = Math.round((Target_Date - Todays_Date + time_difference) / 1000);
    if(Time_Left < 0)
	Time_Left = 0;
    else {
	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 = JS_dps;
	dds = JS_dds;
	sec0 = '';
	min0 = '';
	if(days == 1) dps = '';
	if(days == 0) { dds = ''; dps = ''; days = ''; }
	if(seconds < 10) sec0 = '0';
	if(minutes < 10) min0 = '0';
	

	document.all.countdown.innerHTML = days + dds + dps + ' ';
	document.all.countdown.innerHTML += hours + ':';
	document.all.countdown.innerHTML += min0 + minutes + ':';
	document.all.countdown.innerHTML += sec0 + seconds + JS_countsec;
	//Recursive call, keeps the clock ticking.
	setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + time_difference + ');', 1000);
    }
}

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);
    Today = new Date();
    Todays_Year = Today.getFullYear();
    Todays_Month = Today.getMonth();

    //Computes the time difference between the client computer and the server.
    Server_Date = (new Date(JS_Server_year , JS_Server_month - 1, JS_Server_day, JS_Server_hour, JS_Server_minute, JS_Server_second)).getTime();
    Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();
    countdown(year, month, day, hour, minute, (Todays_Date - Server_Date), format);
//    countdown(year, month, day, hour, minute, 0, format);
}
