function pageScroll() {
	var max_x = 220;
	var h = f_clientHeight();
	var w = f_clientWidth();
	var x_pos = f_scrollLeft();
	var y_pos = f_scrollTop();
	//alert("h * w: " + h + " * " + w + " x_pos: " + x_pos + " y_pos: " + y_pos);
	var vertScrollPos = 0;
	var horizScrollPos = 0;
	//alert("height: " + h);
    	if(h < 899) {
		vertScrollPos = (899 - h)/2 - y_pos;
		//alert("vertScrollPos: " + vertScrollPos);
		//window.scrollBy(0,vertScrollPos); // horizontal and vertical scroll increments
	}
	if(w < 1441) {
		if(w < 1160) {
			//x_pos += x_pos - max_x;
			horizScrollPos = max_x - x_pos;
		} else {
			horizScrollPos = max_x - x_pos;
		}
		//horizScrollPos = (1441 - w) - x_pos;
		//alert("horizScrollPos: " + horizScrollPos);
	}
	//alert("vertScrollPos: " + vertScrollPos + " horizScrollPos: " + horizScrollPos);
    	//scrolldelay = setTimeout('pageScroll()',100); // scrolls every 100 milliseconds
	window.scrollBy(horizScrollPos,vertScrollPos); // horizontal and vertical scroll increments
}


function alertSize() {
  var myWidth = 0, myHeight = 0;
  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 );
}

// cross browser functions
function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}

function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}