$.preloadImages = function() {
	for (var i = 0; i<arguments.length; i++) {
		img = new Image();
		img.src = arguments[i];
	}
}

$.preloadImages('/pictures/inbasket.gif','/pictures/tobasket.gif','/pictures/icon_loader.gif');

var icon_loader='<img src="/pictures/icon_loader.gif" border="0" width="16" height="16" alt="" />';
var inbasket='<img src="/pictures/inbasket.gif" border="0" width="60" height="55" alt="" />';

// calculate the current window width //
function pageWidth() {
  return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

// calculate the current window height //
function pageHeight() {
  return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
}

// calculate the current window vertical offset //
function topPosition() {
  return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

// calculate the position starting at the left of the window //
function leftPosition() {
  return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}   

function ShowSpinner() {
	var left = leftPosition();
	var top = topPosition();
	var width = pageWidth();
	var height = pageHeight();
	var topposition = top + parseInt(height / 2)-100;
	var leftposition = left + parseInt(width / 2) -150;
	$('#spinner').css( "top", topposition + "px");
	$('#spinner').css( "left", leftposition + "px");
	$('#spinner').css( "display", "block");
}

function HideSpinner() {
	$('#spinner').css( "display", "none");
}

