
var i = 0;
var timeout;
var el;
var maxX;
var footerscrollwidth;

function changeFooter () {
	
	var footer = getRefToDiv('footer');
	var p = document.getElementById('scroll');

	footer.style.overflow = 'hidden';
	footer.position = 'relative';
	footer.style.height = '20px';
	p.style.whiteSpace = 'nowrap';
	p.style.position = 'absolute';
	p.style.left = '800px';
	p.style.width = '100px';
}









function changeFooter_old () {
	var footer = getRefToDiv('footer');
	var p = document.getElementById('scroll');

	p.style.whiteSpace = 'nowrap';
 	footer.style.position = 'relative';
	footer.style.overflow = 'hidden';/*
	footer.style.backgroundColor = '#c0a080';*/
	
	if (footer.offsetHeight != p.offsetHeight) footer.style.height = p.offsetHeight + 'px';
	footerscrollwidth = footer.scrollWidth;
	var xwidth = footer.scrollWidth;

	footer.style.clip = p.style.clip = 'rect(0px '+xwidth+'px '+p.offsetHeight + 'px '+'0px)';

	i = -footer.scrollWidth-100;
	// start animation
	var diff = xwidth - footer.offsetWidth;
	el = p;
	maxX = diff;
	animate ();
}

function animate() {
//FF working IE not
	el.style.marginLeft = Math.round(-i) + 'px' ;
	//el.style.left = Math.round(-i) + 'px' ;
	if (i < 120 ) {i += 1} else { i+=2 };
	if (i > footerscrollwidth*2 + 100) i = -1*footerscrollwidth-100;
	timeout = setTimeout('animate();',10);
}






function animatesin() {
	el.style.marginLeft = Math.round(Math.sin(i)*maxX - maxX/2) + 'px' ;
	i += 0.01;
	if (i > 314) i = 0;
	timeout = setTimeout('animate(maxX);',10);
}

function getCurrentValue (el, value) {
	var val;
	if( window.getComputedStyle ) {
  	val = window.getComputedStyle(el,null)['value'];
	} else if( el.currentStyle ) {
			val = el.currentStyle['value'];
	}
}

function getRefToDiv(divID) {
	if( document.layers ) { //Netscape layers
		return document.layers[divID]; }
	if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
		return document.getElementById(divID); }
	if( document.all ) { //Proprietary DOM; IE4
		return document.all[divID]; }
	if( document[divID] ) { //Netscape alternative
		return document[divID]; }
	return false;
}
function halloween_DoFSCommand(command, args) {
	if (command == "window_close") {
		myReference = getRefToDiv('commercial');

		if( myReference.style ) { //DOM & proprietary DOM
			myReference.style.visibility = 'hidden';
		} else {
			if( myReference.visibility ) { //Netscape
				myReference.visibility = 'hide';
			} else {
				window.alert('Reload the browser to turn commercial off');
			}
		}
		return true;
	}
}


function openWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}


