function OpenWindow(page, name, w, h, scroll, resz)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	prop = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resz+'';
	win = window.open(page, name, prop);
}

var myWidth = 0;
var myHeight = 0;
function getSize() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}

function showAnim(layer,left,top) {
	getSize();
	
	if(myWidth > 955) {
		var winLeft = myWidth / 2;
			
		document.getElementById(layer).style.display="block";
		document.getElementById(layer).style.left=(winLeft+left)+"px";
		document.getElementById(layer).style.top=top+"px";
	}
}

var timeoutID = null;
var SantaLeft = -1;
var goForward = false;
function showSanta() {
	return;
	
	clearInterval(timeoutID);
	document.getElementById('Santa1').style.display="none";
	document.getElementById('Santa2').style.display="none";
	
	getSize();
		
	if(SantaLeft <= 0) {
		var d = document.getElementById('Santa1');
		d.style.display="block";
		d.style.top = 80;
		SantaLeft = myWidth;
		d.style.left = SantaLeft;
		goForward = false;
	}
	else {
		var d = document.getElementById('Santa2');
		d.style.display="block";
		d.style.top = 80;
		SantaLeft = -250;
		d.style.left = SantaLeft;
		goForward = true;
	}
	
	timeoutID = setInterval("updSanta()", 75);
}

function updSanta() {
	var step = 10;
	if(goForward) {
		var d = document.getElementById('Santa2');
		SantaLeft += step;
		d.style.left = SantaLeft;
	} else {		
		var d = document.getElementById('Santa1');
		SantaLeft -= step;
		d.style.left = SantaLeft;		
	}
	
	if(SantaLeft < -450) {
		goForward = true;
		SantaLeft = 1;
		showSanta();	
	}
	
	if(SantaLeft > myWidth + 250) {
		goForward = false;
		SantaLeft = -1;
		showSanta();	
	}
}
