// JScript source code
// 2009-08-20, M. Lob, TRINEA Consulting GmbH, Anpassung vür OrderProcess (OP) neuer cursor
// 2003-06-10, E. Manser, TRINEA Consulting GmbH

function waitCursorLocation() {
	if(typeof(sCheckData) == 'string')
		return 'OP';
		
	return 'unknown';
}

function createWaitCursor(){
	document.write("<div id='WaitDiv' style='FONT-WEIGHT: bold; FONT-SIZE: 30px; Z-INDEX: 200; LEFT: 0px; VISIBILITY: hidden; VERTICAL-ALIGN: baseline; WIDTH: 100%; COLOR: aqua; POSITION: absolute; TOP: 0px; HEIGHT: 100%; TEXT-ALIGN: center'>");
	document.write("<table width='100%' height='100%' border='0' border=0>");
	document.write("<tr height='40%'>");
	document.write("<td width='30%'></td>");
	document.write("<td width='20%'></td>");
	document.write("<td width='50%'></td>");
	document.write("</tr>");
	document.write("<tr height='20%'>");
	document.write("<td width='30%'></td>");
	
	switch(waitCursorLocation()) {
		case 'OP':	document.write("<td width='20%' align='right' valign='middle'><img id='zsWaitCursor' src='/eServices/wait0.gif'></td>");
					document.write("<td width='50%' align='left'>"+ sCheckData +"</td>");
					break;
		default:	document.write("<td width='20%' align='right' valign='middle'><img id='zsWaitCursor' src='/eServices/wait.gif'></td>");
					document.write("<td width='50%'></td>");
					break;
	}
	document.write("</tr>");
	document.write("<tr height='40%'>");
	document.write("<td width='30%'></td>");
	document.write("<td width='20%'></td>");
	document.write("<td width='50%'></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</div>");
}

function xCenter(sId) {
  var l = xScrollLeft() + (xClientWidth() - xWidth(sId))/2;
  var t = xScrollTop() + (xClientHeight() - xHeight(sId))/2;
  xMoveTo(sId,l,t);
}

function WaitCursor(){
//		if(true)return;
  var imgCursor=xGetElementById('zsWaitCursor');
  if(imgCursor && !imgCursor.complete) {
		switch(waitCursorLocation()) {
			case 'OP': imgCursor.src='/eServices/wait0.gif';
						break;
						
			default:imgCursor.src='/eServices/wait.gif';
		}
  }

  xCenter( "WaitDiv" );
  document.body.style.cursor = "wait";
  xShow("WaitDiv");
}

function StopCursor(){
	document.body.style.cursor = "auto";
	xHide("WaitDiv");
}

createWaitCursor();

