var preload = new Image();
preload.src = "/images/processingbg.png";
	
	var window_width = get_document_window_width();
   width = convert_width(250,window_width);
   var window_height = get_document_window_height();
   height = convert_height(80,window_height);
   var left = calculate_left(width,window_width);
   var top = calculate_top(height,window_height);
   
	var processName="Loading";
	var popUpWindow;
	popUpWindow  = "<div id='process' style='text-align:center;position:absolute;";
	popUpWindow+="left:"+left+"px;top:"+top+"px;width:250px;border:1px solid #28903a;height:35px;padding:40px 5px 5px 5px;background:url(/images/processingbg.jpg) repeat-x top center #aed5b5;display:none;z-index:1000;'><span id='innerProcessText'>";
	popUpWindow+=processName+"</span>&hellip;<br />";
	popUpWindow+="Please Wait&hellip;";		
	popUpWindow+="</div>";
	document.writeln (popUpWindow);

function get_document_window_width()
{
   if (document.body && document.body.clientWidth)
      return document.body.clientWidth;
   else if (window && window.innerWidth) return window.innerWidth;
   else if (document.documentElement && document.documentElement.offsetWidth)
      return document.documentElement.offsetWidth;
   else if (document.body && document.body.offsetWidth)
      return document.body.offsetWidth;
   return 0;
}

function get_document_window_height()
{
   if (document.body && document.body.clientHeight &&
       (document.body.clientHeight > 1)) return document.body.clientHeight;
   else if (window && window.innerHeight) return window.innerHeight;
   else if (document.documentElement && document.documentElement.offsetHeight)
      return document.documentElement.offsetHeight;
   else if (document.body && document.body.offsetHeight)
      return document.body.offsetHeight;
   return 0;
}

function convert_width(width,window_width)
{
   if (width == null) width = page_width + 52;
   else if (typeof(width) == 'string') {
      var percent_pos = width.indexOf('%');
      if (percent_pos != -1)
         width = window_width * (width.substr(0,percent_pos) / 100);
   }
   if (! document.all) {
      if (width > (window_width - 25)) width = window_width - 25;
   }
   else if (width > (window_width - 10)) width = window_width - 10;
   return width;
}

function convert_height(height,window_height)
{
   if (height == null) height = window_height;
   else if (typeof(height) == 'string') {
      var percent_pos = height.indexOf('%');
      if (percent_pos != -1)
         height = window_height * (height.substr(0,percent_pos) / 100);
   }
//   else height += header_offset;
   if (height > (window_height - 40)) height = window_height - 40;
   return height;
}

function calculate_left(width,window_width)
{
   var left = (window_width - width) / 2;
   if (! document.all) left += 10;
   if (left < 0) left = 0;
   return left;
}

function calculate_top(height,window_height)
{
   var top = ((window_height - height) / 2) - 3;
   if (top < 0) top = 0;
   return top;
}

function printProcessWindow(processName) {
	if ( document.getElementById("process") )
	{
		document.getElementById("innerProcessText").innerHTML=processName;
		elementAppear("process");
	}
}

function closeProcessWindow() {
	if ( document.getElementById("process") )
	{
		//document.getElementById("innerProcessText").innerHTML=processName;
		elementFade("process");
	}
}