//<![CDATA[
	var lxprintSource = '';
	var lxprintCounter = 0;
	var lxprintTimer;

	function lxprintContent(reportFile, reportPane, reportControl)
	{
		lxwinPrint = window.open(reportFile,'mywin','left=20,top=20,width=700,height=700,toolbar=1,resizable=1,scrollbars=yes');
		lxprintSource = document.getElementById(reportPane).innerHTML;
		lxprintCounter = 10;
		lxwaitForTarget(reportControl);
	}
	
	function lxwaitForTarget(reportControl) { 
		lxprintCounter--; 
		if (!lxwinPrint.document.getElementById(reportControl))
		{
			//DO NOTHING
			if (lxprintCounter > 0)
			{
				eval('lxprintTimer=setTimeout("lxwaitForTarget(\'' + reportControl + '\')", 1000); ');
			}
			else
			{
				alert('Unable to load report. Please try again later.');
			}
		}
		else
		{
			lxdoneTarget(reportControl);
		}
	} 
	function lxdoneTarget(reportControl)
	{
		lxwinPrint.document.getElementById(reportControl).innerHTML = lxprintSource;
		lxwinPrint.print();
	}	
	
	//UTILITY FUNCTIONS
	function lxExpander(srcText, parentId, tagType, attributeName, autoHide, showAll)
	{
		var parentObj = document.getElementById(parentId);
		if (parentObj)
		{
			var childTags = parentObj.getElementsByTagName(tagType);
			for (var i = 0; i < childTags.length; i++)
			{
				if (childTags[i].getAttribute(attributeName))
				{
					if (childTags[i].getAttribute(attributeName) == srcText || showAll == true)
							if (childTags[i].style.display == 'block')
								childTags[i].style.display='none';
							else
								childTags[i].style.display = 'block';
					else if (autoHide == true)
							childTags[i].style.display = 'none';
				}
			}
		}
	}
	
	function lxSetValue(objectName,Value,checkValue)
	{
		var obj = document.getElementById(objectName);
		if (Value != checkValue && obj)
		{
			obj.value = Value;
		}
	}
	
	function lxComboSelect(objectName,currentValue)
	{
		var objDrop = document.getElementById(objectName);
		for (i=0;i<objDrop.options.length;i++)
		{
			if (objDrop.options[i].value == currentValue)
			objDrop.options[i].selected = true;
			else
			objDrop.options[i].selected = false;
		}
	}		
	
	function lx_ie_getElementsByTagName(parentObj, str) {
		if (str == "*")
			return parentObj.all
		else
			return parentObj.all.tags(str)
	}

	function lxSmartJoiner(parentObjID, childTagName, valueFunction) {
		childTagName = childTagName.toUpperCase();
		if (valueFunction == null)
			valueFunction = lxGetElementValue;
		var eltParent = document.getElementById(parentObjID);
		var eltsChildren;
		var sJoin = '';
		var sHead = '';
		var sValue;
		var eltChild;

		if (document.all)
			eltsChildren = lx_ie_getElementsByTagName(eltParent, childTagName);
		else
			eltsChildren = eltParent.getElementsByTagName(childTagName);

		if ((eltsChildren != "undefined") && (eltsChildren != null)) {
			for (var iChild=0; iChild < eltsChildren.length; iChild++) {
				eltChild = eltsChildren[iChild];
				sValue = valueFunction(eltChild);
				sHead += sValue.length + ';';
				sJoin += sValue;
			}
		}
		else {
			sHead = '1';
		}
		sHead = sHead.length + ':' + sHead;

		return (sHead + sJoin);
	}

	function lxSmartSplitter(sJoinedText) {
		var iPos;
		var sItems = new Array();

		if ((sJoinedText != null) && (sJoinedText.length > 0)) {
			iPos = sJoinedText.indexOf(':');
			if (iPos > 0) {
				var sHeadLen = sJoinedText.substring(0, iPos);
				var iHeadLen = parseInt(sHeadLen);
				if (iHeadLen == sHeadLen) {
					if (sJoinedText.length > (iHeadLen + iPos)) {
						var sHeader = sJoinedText.substring((iPos + 1), (iPos + 1 + iHeadLen)).split(';');
						if ((sHeader != null) && (sHeader.length > 0)) {
							iPos = (iPos + iHeadLen + 1);
							for (var iChunk=0; iChunk < sHeader.length; iChunk ++) {
								var str = sHeader[iChunk];
								var iLen = parseInt(str);
								if (sJoinedText.length >= (iPos + iLen)) {
									if (iLen > 0) {
										sItems[sItems.length] = sJoinedText.substring(iPos, (iPos + iLen));
										iPos += iLen;
									}
									else {
										sItems[sItems.length] = '';
									}
								}
							}
						}
					}
				}
			}
		}
		return (sItems);
	}

	function lxGetElementValue(elementObj) {
		if ((elementObj.getAttribute('type') != "undefined") && (elementObj.getAttribute('type') != null)) {
			if (elementObj.getAttribute('type') == "checkbox") 
				return (elementObj.checked.toString());
			else
				return (elementObj.value);
			}
		else if ((elementObj.getAttribute('value') != "undefined") && (elementObj.getAttribute('value') != null))
			return (elementObj.getAttribute('value'));
		else
			return (elementObj.innerHTML);
	}
//]]>