﻿var intQTLAlertHighlightCount = 0;
var intQTLAlertHighlightRate = 0;
var intQTLAlertLoopCount = 0;
var strQTLAlertCurrent = "";
var doQTLCornersOnly = false;

var constQTLAJAXInfoPopCenterNo = 0;
var constQTLAJAXInfoPopCenterWindow = 1;
var constQTLAJAXInfoPopCenterViewport = 2;

var constQTLAJAXInfoPopTitleNone = 0;
var constQTLAJAXInfoPopTitleOnly = 1;
var constQTLAJAXInfoPopTitleClose16 = 2;
var constQTLAJAXInfoPopTitleClose32 = 3;
var constQTLAJAXInfoPopTitleNoCloseOnly16 = 4;
var constQTLAJAXInfoPopTitleNoCloseOnly32 = 5;

function  QTL_HighlightAlert(strAlert, intRate, doCornersOnly, intLoopCount) {
	if (strQTLAlertCurrent == "") {
		strQTLAlertCurrent = strAlert;
		doQTLCornersOnly = doCornersOnly;
		intQTLAlertHighlightRate = intRate;
		intQTLAlertLoopCount = intLoopCount;
		setTimeout("QTL_HighlightAlertWT();", 10);
	}
}

function QTL_HighlightAlertWT() {
	if (!document.getElementById(strQTLAlertCurrent + "-TL")) {
		return;
	}
	if (document.getElementById(strQTLAlertCurrent + "-TL").style.backgroundImage == '') {
		document.getElementById(strQTLAlertCurrent + "-TL").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-TL"), 'backgroundImage');
		document.getElementById(strQTLAlertCurrent + "-T").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-T"), 'backgroundImage');
		document.getElementById(strQTLAlertCurrent + "-TR").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-TR"), 'backgroundImage');
		document.getElementById(strQTLAlertCurrent + "-R").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-R"), 'backgroundImage');
		document.getElementById(strQTLAlertCurrent + "-BR").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-BR"), 'backgroundImage');
		document.getElementById(strQTLAlertCurrent + "-B").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-B"), 'backgroundImage');
		document.getElementById(strQTLAlertCurrent + "-BL").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-BL"), 'backgroundImage');
		document.getElementById(strQTLAlertCurrent + "-L").style.backgroundImage = GetComputedStyleValue (document.getElementById(strQTLAlertCurrent + "-L"), 'backgroundImage');
	}

	document.getElementById(strQTLAlertCurrent + "-TL").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-TL").style.backgroundImage.replace('NA-', 'N-');
	document.getElementById(strQTLAlertCurrent + "-T").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-T").style.backgroundImage.replace('NA-', 'N-');
	document.getElementById(strQTLAlertCurrent + "-TR").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-TR").style.backgroundImage.replace('NA-', 'N-');
	document.getElementById(strQTLAlertCurrent + "-R").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-R").style.backgroundImage.replace('NA-', 'N-');
	document.getElementById(strQTLAlertCurrent + "-BR").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-BR").style.backgroundImage.replace('NA-', 'N-');
	document.getElementById(strQTLAlertCurrent + "-B").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-B").style.backgroundImage.replace('NA-', 'N-');
	document.getElementById(strQTLAlertCurrent + "-BL").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-BL").style.backgroundImage.replace('NA-', 'N-');
	document.getElementById(strQTLAlertCurrent + "-L").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-L").style.backgroundImage.replace('NA-', 'N-');      
	     
	if (intQTLAlertHighlightCount == 0) {
		if (intQTLAlertLoopCount == 0) {
			 strQTLAlertCurrent = "";
			 return;
		}
		else {
			 intQTLAlertHighlightCount = 8;
			 intQTLAlertLoopCount -= 1;
		}
	}

	switch (intQTLAlertHighlightCount) {
		case 8:
			 document.getElementById(strQTLAlertCurrent + "-TL").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-TL").style.backgroundImage.replace('N-', 'NA-');   
			 break;
		case 7:             
			 document.getElementById(strQTLAlertCurrent + "-T").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-T").style.backgroundImage.replace('N-', 'NA-');
			 break;
		case 6:
			 document.getElementById(strQTLAlertCurrent + "-TR").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-TR").style.backgroundImage.replace('N-', 'NA-');                  
			 break;
		case 5:
			 document.getElementById(strQTLAlertCurrent + "-R").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-R").style.backgroundImage.replace('N-', 'NA-');                  
			 break;
		case 4:
			 document.getElementById(strQTLAlertCurrent + "-BR").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-BR").style.backgroundImage.replace('N-', 'NA-');                  
			 break;
		case 3:
			 document.getElementById(strQTLAlertCurrent + "-B").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-B").style.backgroundImage.replace('N-', 'NA-');                  
			 break;
		case 2:
			 document.getElementById(strQTLAlertCurrent + "-BL").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-BL").style.backgroundImage.replace('N-', 'NA-');                  
			 break;
		case 1:
			 document.getElementById(strQTLAlertCurrent + "-L").style.backgroundImage = document.getElementById(strQTLAlertCurrent + "-L").style.backgroundImage.replace('N-', 'NA-');                  
			 break;
	}
	if (doQTLCornersOnly == true) {
		intQTLAlertHighlightCount -= 2;
	}
	else {
		intQTLAlertHighlightCount -= 1;         
	}
	setTimeout("QTL_HighlightAlertWT();", intQTLAlertHighlightRate);
}

function GetComputedStyleValue (objEl, strPropertyName) { 
	var objDocument, objView; 
	if ((objDocument = objEl.ownerDocument) && (objView = objDocument.defaultView) && objView.getComputedStyle) 
	{ 
	 return objView.getComputedStyle(objEl, '')[strPropertyName]; 
	} 
	else if (objEl.currentStyle) { 
	 return objEl.currentStyle[strPropertyName]; 
	} 
}
      
var QTL_intTypeRate = 0;
var QTL_strResponse = new String();
var QTL_doType = false;
var QTL_intTypeCount = 0;

function QTL_UpdateSystemResponse(strResponse, doType, intTypeRate, doSound, strSoundPath, DoNotify, intRate, doCornersOnly, intLoopCount) {
	if (document.getElementById("QTLSystemResponseCell") != null && QTL_strResponse == "") {
		document.getElementById("QTLSystemResponseCell").innerHTML = "";
		if (strResponse == "") {
			document.getElementById("QTLSystemResponseCell").innerHTML = "&nbsp;";
			return;
		}
		if (doType == true) {
			QTL_strResponse = strResponse;
			QTL_doType = true;
			QTL_intTypeRate = intTypeRate;
			document.getElementById("QTLSystemResponseCell").innerHTML = "&nbsp;";               
			QTL_UpdateSystemResponseWT();
		}
		else {
			document.getElementById("QTLSystemResponseCell").innerHTML = strResponse;
		}
		if (doSound == true) {
			PlaySound(strSoundPath);
		}
		else {
			//document.getElementById("QTLSystemResponseCell").innerHTML = "<span style='color: white'><u>System Response:</u></span> " + strResponse; 
		}
		if (DoNotify == true) {
			QTL_HighlightAlert("QTLSystemResponse", intRate, doCornersOnly, intLoopCount);
		}
		return true;
	}
	else {
		return false;
	}
}

function QTL_UpdateSystemResponseWT() {
	document.getElementById("QTLSystemResponseCell").innerHTML += QTL_strResponse.substr(QTL_intTypeCount, 1);
	QTL_intTypeCount++;
	if (QTL_intTypeCount == QTL_strResponse.length) {
		QTL_intTypeRate = 0;
		QTL_strResponse = new String();
		QTL_doType = false;
		QTL_intTypeCount = 0;
		return;
	}
	setTimeout("QTL_UpdateSystemResponseWT();", QTL_intTypeRate);
}

function PlaySound(strSoundPath, strSpanName) {
	var objSpan;
	var strSpanID;
	if (strSpanName) {
		strSpanID = strSpanName;
	}
	else {
		strSpanID = "spanSound";
	}
	if (document.getElementById(strSpanID) == null) {
		objSpan = window.document.createElement('span');
		objSpan.id = strSpanID;
		window.document.body.appendChild(objSpan); 
	}
	document.getElementById(strSpanID).innerHTML= "<embed src='" + strSoundPath + "' hidden=true autostart=true loop=false>";
	//document.body.removeChild(objSpan);
}

//Content Div For Displaying Direct Content Using the QTLAJAX or other library.

function QTL_ContentDiv(strID, intX, intY, flgCenterHow, intWidth, intHeight, strMessage, strClass, strDivClass, objDocHolder, objParent) {
	this.ID = strID;
	this.X = intX;
	this.Y = intY;
	this.CenterHow = flgCenterHow;
	this.Width = intWidth;
	this.Height = intHeight;
	this.MyDiv = null;
	this.ForceDims = false;
	this.LastX = "";
	this.LastY = "";
	if (objParent) {
		this.Parent = objParent;
	}
	else {
		this.Parent = null;
	}
	if (strMessage) {
		this.Message = strMessage;
	}
	else {
		this.Message = "Loading<br>Please Wait"
	}
	if (strClass) {
		this.Class = strClass;
	}
	else {
		this.Class = "";
	}
	if (strDivClass) {
		this.DivClass = strDivClass;
	}
	else {
		this.DivClass = "";
	}	
	if (objDocHolder) {
		this.DocHolder = objDocHolder;
	}
	else {
		this.DocHolder = window;
	}
	this.QTLContentWaiterTempo = 400;
	this.QTLContentWaiterDivTimeoutID = null;
	this.QTLContentWaiterDotCount = 0;
}

//Drag & Drop Support

var QTL_ContentDivDragObject = null;

QTL_ContentDiv.prototype.makeClickable = function(object) {
	object.onmousedown = function(){
		dragObject = this;
	}
}

QTL_ContentDiv.prototype.makeDraggable = function(item) {
	if (!item) {
		if (this.Parent) {
			item = document.getElementById(this.Parent.ClickObject);
			item.DragParent = this;
			item.onmousedown = function(ev) {
				dragObject  = this.DragParent.MyDiv;
				QTL_ContentDivDragObject = this.DragParent;
				mouseOffset = getMouseOffset(dragObject, ev);
				return false;
			}
		}
	}
	else {
		item.onmousedown = function(ev) {
			QTL_ContentDivDragObject = this;
			dragObject  = this;
			mouseOffset = getMouseOffset(this, ev);
			return false;
		}
	}
}


QTL_ContentDiv.prototype.QTL_ShowContentDiv = function() {
	this.MyDiv.style.display = "block";
	this.MyDiv.style.visibility = "visible";	
	var objDivCC = new QTL_ControlCoords(this.DocHolder.document.getElementById(this.ID));
	if (this.CenterHow == constQTLAJAXInfoPopCenterNo) {
		objDivCC.MoveTo(this.X, this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterWindow) {
		objDivCC.MoveToCenter(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterViewport) {
		objDivCC.MoveToCenterView(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}
	objDivCC.ShowDiv(this.DocHolder);
}

QTL_ContentDiv.prototype.QTL_ShowContentDivPleaseWait = function() {
	this.MyDiv.style.overflowX = "hidden";
	this.MyDiv.style.overflowY = "hidden";
	this.MyDiv.style.display = "block";
	this.MyDiv.style.visibility = "visible";
	var strTable = '<table rules="none" width="' + this.Width + '" cellpadding="0" cellspacing="0" border="5" bordercolor="#000000" class="' + this.Class + '"><tr><td width="' + this.Width + '" align="center" valign="middle" height="' + (this.Height - 10) + '">' + this.Message + '</td></table>'
	this.MyDiv.innerHTML = strTable;	
	var objDivCC = new QTL_ControlCoords(this.DocHolder.document.getElementById(this.ID));
	if (this.CenterHow == constQTLAJAXInfoPopCenterNo) {
		objDivCC.MoveTo(this.X, this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterWindow) {
		objDivCC.MoveToCenter(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterViewport) {
		objDivCC.MoveToCenterView(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}
	if (this.QTLContentWaiterTempo != -1) {
		var objMe = this;
		this.QTLContentWaiterDivTimeoutID = setTimeout(function() {objMe.QTL_UpdateContentDivWindow();}, this.QTLContentWaiterTempo);			
	}
	objDivCC.ShowDiv(this.DocHolder);
}

QTL_ContentDiv.prototype.QTL_CenterContentDiv = function() {
	var objDivCC = new QTL_ControlCoords(this.DocHolder.document.getElementById(this.ID));
	if (this.CenterHow == constQTLAJAXInfoPopCenterNo) {
		objDivCC.MoveTo(this.X, this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterWindow) {
		objDivCC.MoveToCenter(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterViewport) {
		objDivCC.MoveToCenterView(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}	
}

QTL_ContentDiv.prototype.QTL_CreateContentDiv = function() {
	if (this.MyDiv != null) {
		this.QTL_HideContentDiv();
	}
	this.MyDiv = this.DocHolder.document.createElement('div');
	this.MyDiv.id = this.ID;
	this.MyDiv.style.position = "absolute";
	this.MyDiv.style.width = this.Width;
	this.MyDiv.style.height = this.Height;
	this.MyDiv.style.left = 0;
	this.MyDiv.style.top = 0;
	this.MyDiv.style.visibility = "hidden";
	this.MyDiv.style.display = "none";	
	this.MyDiv.innerHTML = "";
	if (this.DivClass != "") {
		this.MyDiv.className = this.DivClass;
	}	

	this.DocHolder.document.body.appendChild(this.MyDiv);
}


QTL_ContentDiv.prototype.QTL_HideContentDiv = function () {
	clearTimeout(this.QTLContentWaiterDivTimeoutID);
	
	if (this.DocHolder == undefined) {
		this.DocHolder = window;
	}
	if (this.MyDiv != null) {
		//this.MyDiv = null;
		var objDivCC = new QTL_ControlCoords(this.MyDiv);
		objDivCC.HideDiv(this.DocHolder);
		this.DocHolder.document.body.removeChild(this.MyDiv);	
	}
	//this.Message = "";
	this.MyDiv = null;
}

QTL_ContentDiv.prototype.QTL_UpdateContentDivWindowMessage = function (strMessage) {
	this.Message = strMessage;
}


QTL_ContentDiv.prototype.QTL_UpdateContentDivWindow = function () {
	clearTimeout(this.QTLContentWaiterDivTimeoutID);
	
	if (this.MyDiv != null) {
		//var strPleaseWait = "Please Wait";
		var strPleaseWait = "Working";		
		for (var intCounter = 1; intCounter <= this.QTLContentWaiterDotCount; intCounter++) {
			strPleaseWait += ".";
		}
	  this.MyDiv.innerHTML = '<table rules="none" width="' + this.Width + '" cellpadding="0" cellspacing="0" border="5" bordercolor="#000000" class="' + this.Class + '"><tr><td width="' + this.Width + '" align="center" valign="middle" height="' + (this.Height - 10) + '">' + this.Message + strPleaseWait + '</td></table>'
		if (this.QTLContentWaiterDotCount == 7) {
			this.QTLContentWaiterDotCount = 0;
		}
		else {
			this.QTLContentWaiterDotCount++;
		}
		if (this.QTLContentWaiterTempo != -1) {
			var objMe = this;
			this.QTLContentWaiterDivTimeoutID = setTimeout(function() {objMe.QTL_UpdateContentDivWindow();}, this.QTLContentWaiterTempo);					
		}
	}
}

QTL_ContentDiv.prototype.QTL_SetContentDivTempo = function (intTempo) {
	if (intTempo) {
		this.QTLWaiterTempo = intTempo;
	}
	else {
		this.QTLWaiterTempo = 400;
	}
}

QTL_ContentDiv.prototype.LoadDirectQTLPage = function (objEngine, strPage, strObjectName) {
	//window.location.href = strPage;   //Browser Refresh Functionality.
	objEngine.CallService(-1, strPage, strObjectName + ".LoadDirectQTLPageCB");   //No Browser Refresh Functionality.
}

QTL_ContentDiv.prototype.LoadDirectQTLPageCB = function (objRet) {
	if (objRet.IsEmpty == true) {
	}
	else if (objRet.IsError == true) {
		alert(objRet.ErrorTitle + "\n\n" + objRet.ErrorMessage);
	}
	else {
		clearTimeout(this.QTLContentWaiterDivTimeoutID);
		var arrRet = new Array();
		arrRet = objRet.Value.split(gloconstAJAXReturnSplit);
		this.MyDiv.innerHTML = arrRet[0];
		var intCounter = 0;
		for (intCounter = 1; intCounter < arrRet.length; intCounter++) {
			if (arrRet[intCounter].indexOf("QTLFunctionBasePageMarker") == -1) {
				eval(arrRet[intCounter]);
			}
		}
		for (intCounter = 1; intCounter < arrRet.length; intCounter++) {
			if (arrRet[intCounter].indexOf("QTLFunctionBasePageMarker") != -1) {
				eval(arrRet[intCounter]);
			}
		}		
	}		
}


//WaiterWindow Class For Showing Statuses From the QTLAJAX Lib or Other Custom Needs.

function QTL_WaiterWindow(strID, intX, intY, flgCenterHow, intWidth, intHeight, strMessage, strClass, objDocHolder) {
	this.ID = strID;
	this.X = intX;
	this.Y = intY;
	this.CenterHow = flgCenterHow;
	this.Width = intWidth;
	this.Height = intHeight;
	this.Message = strMessage;
	this.Class = strClass;
	this.MyDiv = null;
	if (objDocHolder) {
		this.DocHolder = objDocHolder;	
	}
	else {
		this.DocHolder = window;
	}
	this.QTLWaiterTempo = 400;
	this.QTLWaiterDivTimeoutID = null;
	this.QTLWaiterDotCount = 0;
}

QTL_WaiterWindow.prototype.QTL_ShowWaiterWindow = function () {
	if (this.MyDiv != null) {
		this.QTL_HideWaiterWindow();
	}
	this.MyDiv = this.DocHolder.document.createElement('div');
	this.MyDiv.id = this.ID;
	this.MyDiv.style.position = 'absolute';
	this.MyDiv.style.width = this.Width;
	this.MyDiv.style.height = this.Height;
	this.MyDiv.style.display = 'block';
	this.MyDiv.style.left = 0;
	this.MyDiv.style.top = 0;
	this.MyDiv.style.visibility = "visible";
	var strQTLWaiterCustomMessage = this.Message;
	var strQTLWaiterDivClass = this.Class;
	var strTable = '<table rules="none" width="' + this.Width + '" cellpadding="0" cellspacing="0" border="5" bordercolor="#000000" class="' + strQTLWaiterDivClass + '"><tr><td width="' + this.Width + '" align="center" valign="middle" height="' + this.Height + '">' + strQTLWaiterCustomMessage + '</td></tr><tr><td align="center" valign="middle"><br></td></tr><tr><td align="left" valign="middle">Please Wait</td></tr></table>'
	this.MyDiv.innerHTML = strTable;
	this.DocHolder.document.body.appendChild(this.MyDiv);
	var objDivCC = new QTL_ControlCoords(this.DocHolder.document.getElementById(this.ID));
	if (this.CenterHow == constQTLAJAXInfoPopCenterNo) {
		objDivCC.MoveTo(this.X, this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterWindow) {
		objDivCC.MoveToCenter(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterViewport) {
		objDivCC.MoveToCenterView(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}

	objDivCC.ShowDiv(this.DocHolder);
	if (this.QTLWaiterTempo != -1) {
		var objMe = this;
		//this.QTLWaiterDivTimeoutID = setTimeout("QTL_UpdateWaiterWindow();", this.QTLWaiterTempo);
		this.QTLWaiterDivTimeoutID = setTimeout(function() {objMe.QTL_UpdateWaiterWindow();}, this.QTLWaiterTempo);		
	}
}

QTL_WaiterWindow.prototype.QTL_UpdateWaiterWindowMessage = function (strMessage) {
	this.Message = strMessage;
}


QTL_WaiterWindow.prototype.QTL_UpdateWaiterWindow = function () {
	clearTimeout(this.QTLWaiterDivTimeoutID);
	if (this.MyDiv != null) {
		var strPleaseWait = "Please Wait";
		for (var intCounter = 1; intCounter <= this.QTLWaiterDotCount; intCounter++) {
			strPleaseWait += ".";
		}
		this.MyDiv.innerHTML = '<table rules="none" width="' + this.MyDiv.style.width + '" cellpadding="0" cellspacing="0" border="5" bordercolor="#000000" class="' + this.Class + '"><tr><td width="' + this.MyDiv.style.width + '" align="center" valign="middle" height="' + this.MyDiv.style.height + '">' + this.Message + '</td></tr><tr><td align="center" valign="middle"><br></td></tr><tr><td align="left" valign="middle">' + strPleaseWait + '</td></tr></table>';
		if (this.QTLWaiterDotCount == 7) {
			this.QTLWaiterDotCount = 0;
		}
		else {
			this.QTLWaiterDotCount++;
		}
		if (this.QTLWaiterTempo != -1) {
			var objMe = this;		
			//this.QTLWaiterDivTimeoutID = setTimeout("QTL_UpdateWaiterWindow();", this.QTLWaiterTempo);
			this.QTLWaiterDivTimeoutID = setTimeout(function() {objMe.QTL_UpdateWaiterWindow();}, this.QTLWaiterTempo);
		}
	}
}

QTL_WaiterWindow.prototype.QTL_HideWaiterWindow = function () {
	if (this.DocHolder == undefined) {
		this.DocHolder = window;
	}
	clearTimeout(this.QTLWaiterDivTimeoutID);
	if (this.MyDiv != null) {
		//this.MyDiv = null;
		var objDivCC = new QTL_ControlCoords(this.MyDiv);
		objDivCC.HideDiv(this.DocHolder);
		this.DocHolder.document.body.removeChild(this.MyDiv);	
	}
	//this.Message = "";
	this.QTLWaiterDotCount = 0;
	this.MyDiv = null;	
}

QTL_WaiterWindow.prototype.QTL_SetWaiterTempo = function (intTempo) {
	if (intTempo) {
		this.QTLWaiterTempo = intTempo;
	}
	else {
		this.QTLWaiterTempo = 400;
	}
}

//Info Pop Class For Showing Popups With & Without Interactive Content.

function QTL_InfoPop(strID, intX, intY, flgCenterHow, intWidth, intHeight, strContent, flgTitleBar, strTitle, strTitleClass, objDocHolder) {
	this.ID = strID;
	this.X = intX;
	this.Y = intY;
	this.CenterHow = flgCenterHow;
	this.Content = strContent;
	this.TitleBarType = flgTitleBar;
	this.Title = strTitle;
	this.Class = strClass;
	this.MyDiv = null;
	if (objDocHolder) {
		this.DocHolder = objDocHolder;	
	}
	else {
		this.DocHolder = window;
	}
	
	var strTitleBar = "";	
	
	switch (this.TitleBarType) {
		case constQTLAJAXInfoPopTitleNone :
		break;
		case constQTLAJAXInfoPopTitleOnly :
			strTitleBar = "<table border='0' cellspacing='0' cellpadding='0'><tr><td class='" + this.Class + "'>" + this.Title + "</td><tr></table>";
		break;
		case constQTLAJAXInfoPopTitleClose16 :
		break;
		case constQTLAJAXInfoPopTitleClose32 :
		break;
		case constQTLAJAXInfoPopTitleNoCloseOnly16 :
		break;
		case constQTLAJAXInfoPopTitleNoCloseOnly32 :
		break;
}

QTL_InfoPop.prototype.QTL_ShowInfoPop = function () {
	if (this.MyDiv != null) {
		this.QTL_CloseInfoPop();
	}
	this.MyDiv = this.DocHolder.document.createElement('div');
	this.MyDiv.id = this.ID;
	this.MyDiv.style.position = 'absolute';
	this.MyDiv.style.width = this.Width;
	this.MyDiv.style.height = this.Height;
	this.MyDiv.style.display = 'block';
	this.MyDiv.style.left = 0;
	this.MyDiv.style.top = 0;
	this.MyDiv.style.visibility = "visible";
	eval(this.ID + " = document.getElementById('" + this.ID + "');");
	
			
	}				
	

	this.MyDiv.innerHTML = this.Content;
	this.DocHolder.document.body.appendChild(this.MyDiv);
	var objDivCC = new QTL_ControlCoords(this.DocHolder.document.getElementById(this.ID));
	if (this.CenterHow == constQTLAJAXInfoPopCenterNo) {
		objDivCC.MoveTo(this.X, this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterWindow) {
		objDivCC.MoveToCenter(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}
	else if (this.CenterHow == constQTLAJAXInfoPopCenterViewport) {
		objDivCC.MoveToCenterView(this.DocHolder);
		objDivCC.MoveTo(objDivCC.PageTopLeft.X() + this.X, objDivCC.PageTopLeft.Y() + this.Y);
	}

	objDivCC.ShowDiv(this.DocHolder);
	if (this.QTLWaiterTempo != -1) {
		var objMe = this;
		//this.QTLWaiterDivTimeoutID = setTimeout("QTL_UpdateWaiterWindow();", this.QTLWaiterTempo);
		this.QTLWaiterDivTimeoutID = setTimeout(function() {objMe.QTL_UpdateWaiterWindow();}, this.QTLWaiterTempo);		
	}
}

QTL_InfoPop.prototype.QTL_HideInfoPop = function () {
	if (this.DocHolder == undefined) {
		this.DocHolder = window;
	}
	clearTimeout(this.QTLWaiterDivTimeoutID);
	if (this.MyDiv != null) {
		//this.MyDiv = null;
		var objDivCC = new QTL_ControlCoords(this.MyDiv);
		objDivCC.HideDiv(this.DocHolder);
		this.DocHolder.document.body.removeChild(this.MyDiv);	
	}
	this.Message = "";
	this.QTLWaiterDotCount = 0;
	this.MyDiv = null;	
}

QTL_InfoPop.prototype.QTL_CloseInfoPop = function () {
	if (this.DocHolder == undefined) {
		this.DocHolder = window;
	}
	clearTimeout(this.QTLWaiterDivTimeoutID);
	if (this.MyDiv != null) {
		//this.MyDiv = null;
		var objDivCC = new QTL_ControlCoords(this.MyDiv);
		objDivCC.HideDiv(this.DocHolder);
		this.DocHolder.document.body.removeChild(this.MyDiv);	
	}
	this.Message = "";
	this.QTLWaiterDotCount = 0;
	this.MyDiv = null;	
}

QTL_InfoPop.prototype.QTL_InfoPopCloseEvent = function () {
}

