function refresh(link)
{
	if(link == null || link == '') location = location;
	else location = link;
}

function dateTime(id) 
{
	/*var now = new Date();*/
	now.setSeconds(now.getSeconds()+1);

	var time = '';
	time += (now.getHours() < 10 ? '0' : '') + now.getHours() + ':';
	time += (now.getMinutes()<10 ? '0' : '') + now.getMinutes()+':';
	time += (now.getSeconds()<10 ? '0' : '') + now.getSeconds();
   
	var date = ' ' + now.getYear(); 
	date  = '200' + date.substr(date.length-1) + '-'; 
	date += ((now.getMonth()+1)<10 ? '0' : '') + (now.getMonth()+1) + '-';
	date += (now.getDate() <10 ? '0' : '') + now.getDate();
	
	var day = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	
	document.getElementById(id).innerHTML = date + ' | ' + time + ' | ' + day[now.getDay()];
	setTimeout("dateTime('"+id+"')", 1000);
}

function selectAll(name,state)
{
	for(var n=0;n<document.forms.length;n++)
	{
		for(var i=0;i<document.forms[n].elements.length;i++)
		{
			if(document.forms[n].elements[i].name == name) document.forms[n].elements[i].checked = state;
		}
	}
}



function initSlide(name, id, shiftBy, interval)
{
    this.name = name;
    this.id = id;
    this.shiftBy = shiftBy ? shiftBy : 1;
    this.interval = interval ? interval : 0;
    this.runId	= null;
    this.div = document.getElementById(id);
    var node = this.div.firstChild;
    var next;
    while(node) 
    {
        next = node.nextSibling;
        if(node.nodeType == 3) this.div.removeChild(node);
        node = next;
    }
    this.left = 0;
    this.shiftLeftAt = this.div.firstChild.offsetWidth;
    this.div.style.height = this.div.firstChild.offsetHeight;
    this.div.style.width = 2 * screen.availWidth;
}

function startSlide()
{
    this.stop();
    this.left -= this.shiftBy;
    if(this.left <= -this.shiftLeftAt)
    {
        this.left = 250;
        this.div.appendChild(this.div.firstChild);
        this.shiftLeftAt = this.div.firstChild.offsetWidth;
    }
    this.div.style.left = (this.left + 'px');
    this.runId = setTimeout(this.name + '.start()', this.interval);
}

function stopSlide()
{
    if (this.runId) clearTimeout(this.runId);
    this.runId = null;
}

initSlide.prototype.start = startSlide;
initSlide.prototype.stop = stopSlide;