
		function renderProgBar()
		{
			var sHTML = "";
			if (this.m_bShowPlate == true)
			{
				this.m_nTop = (parseInt(this.m_Obj.clientHeight) - this.m_nHeight) / 2 ;
				this.m_nLeft = parseInt(this.m_Obj.clientWidth - this.m_nWidth) / 2;
				
				var shadowDiv = "<div style='position:absolute;left:" + (this.m_nLeft+5) + ";top:" + (this.m_nTop+5) + ";filter:alpha(opacity=30);z-index:40000'><table bgcolor='black' width='300' height='150'><tr><td>&nbsp;</td></tr></table></div>"; 
				sHTML +=shadowDiv;
				sHTML += "<div style=\"position:absolute;z-index:40000;left:" + this.m_nLeft + "px;top:" + this.m_nTop + "px;width:" + this.m_nWidth + "px;height:" + this.m_nHeight + "px\">";
				sHTML += "<img src=\"/youtools/ytclient/ndstudent_6_0/images/loadingPlate.jpg\" width=100% height=100%></div>";
				this.m_nWidth -= 40;
				this.m_nLeft += 17;
				this.m_nTop += 50;
			}
			else 
			{
				sHTML += "<div id='txtStatBarMessage' name='txtStatBarMessage' style=\"color:#2d2d2d;font-family:arial;font-size:14px;position:absolute;left:" + this.m_nLeft + "px;top:" + (this.m_nTop - 30) + "px; width:" + this.m_nWidth + "px; text-align:center\">" + this.m_sMessage + "</div>"
				sHTML += "<div id='txtStatBarPrecentage' name='txtStatBarPrecentage' style=\"color:#2d2d2d;font-family:arial;font-size:14px;position:absolute;left:" + this.m_nLeft + "px;top:" + (this.m_nTop + 10) + "px; width:" + this.m_nWidth + "px; text-align:center\">0% Done</div>"
			}
			
			sHTML += "<div style=\"position:absolute;z-index:40000;left:" + this.m_nLeft + "px;top:" + this.m_nTop + "px;width:" + this.m_nWidth + "px;height:100px\">";
			sHTML += "<table width=" + this.m_nWidth + " height=100% cellspacing=0 cellpadding=0>";
			sHTML += "<tr>";
			sHTML += "<td><img src=\"/youtools/YTClient/CommonGraphics/loadingBGleft.gif\" height=" + this.HOUSE_HEIGHT + "></td>";
			sHTML += "<td width=100%><img src=\"/youtools/YTClient/CommonGraphics/loadingBGcenter.gif\" width=" + (this.m_nWidth - (2 * this.HOUSE_SIDE_WIDTH)) + " height=" + this.HOUSE_HEIGHT + "</td>";
			sHTML += "<td><img src=\"/youtools/YTClient/CommonGraphics/loadingBGright.gif\" height=" + this.HOUSE_HEIGHT + "></td>";
			sHTML += "</tr>";
			sHTML += "</table>";
			sHTML += "</div>";
			sHTML += "<div id=\"InnerProgDiv\" style=\"position:absolute;z-index:40000;left:" + (this.m_nLeft + this.PROG_DISTANCE+2) + "px;top:" + this.m_nTop + "px;width:" + (this.m_nWidth - (this.PROG_DISTANCE * 2)) + "px;height:100px\">"
			sHTML += "<table height=100%  cellspacing=0 cellpadding=0>"
			sHTML += "<tr>";
			sHTML += "<td style=\"width:" + this.PROG_SIDE_WIDTH + "px\"><img src=\"/youtools/YTClient/CommonGraphics/loadingBallLeft.gif\" height=" + this.PROG_HEIGHT + " width=" + this.PROG_SIDE_WIDTH + "></td>";
			sHTML += "<td id=ProgTD width=0><img id=\"ProgImg\" src=\"/youtools/YTClient/CommonGraphics/loadingBallCenter.gif\" width=0 height=" + this.PROG_HEIGHT + "></td>";
			sHTML += "<td width=" + this.PROG_SIDE_WIDTH + "><img src=\"/youtools/YTClient/CommonGraphics/loadingBallRight.gif\" height=" + this.PROG_HEIGHT + "></td>";
			sHTML += "</tr>"
			sHTML += "</table>"
			sHTML += "</div>"
		    try
		    {
			  this.m_Obj.innerHTML = sHTML + this.m_Obj.innerHTML;
			}
			catch(e)
			{
			  alert(e + " Error 2")
			}
		}


        function renderProgBar_firefox()
		{
			var sHTML = "";
			if (this.m_bShowPlate == true)
			{
				this.m_nTop = (parseInt(this.m_Obj.clientHeight) - this.m_nHeight) / 2 ;
				this.m_nLeft = parseInt(this.m_Obj.clientWidth - this.m_nWidth) / 2;
				
				var shadowDiv = "<div style='position:absolute;left:" + (this.m_nLeft+5) + ";top:" + (this.m_nTop+5) + ";filter:alpha(opacity=30);z-index:40000'><table bgcolor='black' width='300' height='150'><tr><td>&nbsp;</td></tr></table></div>"; 
				sHTML +=shadowDiv;
				sHTML += "<div style=\"position:absolute;z-index:40000;left:" + this.m_nLeft + "px;top:" + this.m_nTop + "px;width:" + this.m_nWidth + "px;height:" + this.m_nHeight + "px\">";
				sHTML += "<img src=\"/youtools/ytclient/ndstudent_6_0/images/loadingPlate.jpg\" width=100% height=100%></div>";
				this.m_nWidth -= 40;
				this.m_nLeft += 17;
				this.m_nTop += 50;
			}
			else 
			{
				sHTML += "<div id='txtStatBarMessage' name='txtStatBarMessage' style=\"color:#2d2d2d;font-family:arial;font-size:14px;position:absolute;left:" + this.m_nLeft + "px;top:" + (this.m_nTop - 30) + "px; width:" + this.m_nWidth + "px; text-align:center\">" + this.m_sMessage + "</div>"
				sHTML += "<div id='txtStatBarPrecentage' name='txtStatBarPrecentage' style=\"color:#2d2d2d;font-family:arial;font-size:14px;position:absolute;left:" + this.m_nLeft + "px;top:" + (this.m_nTop + 10) + "px; width:" + this.m_nWidth + "px; text-align:center\">0% Done</div>"
			}
			
			sHTML += "<div style=\"position:absolute;z-index:40000;left:" + this.m_nLeft + "px;top:" + this.m_nTop + "px;width:" + this.m_nWidth + "px;height:100px\">";
			sHTML += "<table width=" + this.m_nWidth + " height=100% cellspacing=0 cellpadding=0>";
			sHTML += "<tr>";
			sHTML += "<td><img src=\"/youtools/YTClient/CommonGraphics/loadingBGleft.gif\" height=" + this.HOUSE_HEIGHT + "></td>";
			sHTML += "<td width=100%><img src=\"/youtools/YTClient/CommonGraphics/loadingBGcenter.gif\" width=" + (this.m_nWidth - (2 * this.HOUSE_SIDE_WIDTH)) + " height=" + this.HOUSE_HEIGHT + "</td>";
			sHTML += "<td><img src=\"/youtools/YTClient/CommonGraphics/loadingBGright.gif\" height=" + this.HOUSE_HEIGHT + "></td>";
			sHTML += "</tr>";
			sHTML += "</table>";
			sHTML += "</div>";
			sHTML += "<div id='InnerProgDiv' style='position:absolute;z-index:40000;left:" + (this.m_nLeft + this.PROG_DISTANCE+2) + "px;top:" + this.m_nTop + "px;width:" + (this.m_nWidth - (this.PROG_DISTANCE * 2)) + "px;height:100px'>"
			sHTML += "<table height=100% cellspacing=0 cellpadding=0>"
			sHTML += "<tr>";
			sHTML += "<td style=\"width:" + this.PROG_SIDE_WIDTH + "px\"><img src=\"/youtools/YTClient/CommonGraphics/loadingBallLeft.gif\" height=" + this.PROG_HEIGHT + " width=" + this.PROG_SIDE_WIDTH + "></td>";
			sHTML += "<td id=ProgTD width=0><img id=\"ProgImg\" src=\"/youtools/YTClient/CommonGraphics/loadingBallCenter.gif\" width=0 height=" + this.PROG_HEIGHT + "></td>";
			sHTML += "<td width=" + this.PROG_SIDE_WIDTH + "><img src=\"/youtools/YTClient/CommonGraphics/loadingBallRight.gif\" height=" + this.PROG_HEIGHT + "></td>";
			sHTML += "</tr>"
			sHTML += "</table>"
			sHTML += "</div>"
		    try
		    {
			  this.m_Obj.innerHTML = sHTML + this.m_Obj.innerHTML;
			}
			catch(e)
			{
			  alert(e + " Error 1");
			}
		}

		function isProgBarComplete()
		{
			return (this.m_nCurrentValue == this.m_nMax);
		}

		function getPBCurrentValue()
		{
			return this.m_nCurrentValue;
		}

		function isProgBarAlive()
		{
			try
			{	
			    
				if (this.m_Obj.all["ProgImg"])
					return true;
			}	
			catch (AnyError)
			{
				return false;
			}
		}

        function isProgBarAlive_firefox()
		{
			try
			{	
			    var ProgImg = document.getElementById("ProgImg");
				if (ProgImg)
					return true;
			}	
			catch (AnyError)
			{
				return false;
			}
		}


		
		
		function resetPBParameters(nMax, nValue, sMessage, Obj)
		{
		    
			this.m_nMax = nMax;
			this.setValue(nValue);
			if (nValue == 0)
			{
				this.m_nCurrentValue = 0;
				try {
					Obj.all["txtStatBarPrecentage"].innerText = "0%"
				}
				catch(ErrorToIgnore){}
			}
			m_Obj = Obj;
			if (m_Obj.all["txtStatBarMessage"])
			{
				m_Obj.all["txtStatBarMessage"].innerHTML = sMessage;
			}
		}
		
		function setProgBarValue_old(nValue, Obj)
		{ 
			try {
				
				if (!this.m_Obj.all["ProgImg"])
				{
					this.toHTML();
				}
				
					
			}
			catch (Any)
			{
			    alert("first exception block in setProgBarValue: " + Any)
				this.toHTML();
			}
			try {
				this.m_nCurrentValue = nValue;
				var nWidth = (parseInt(parseFloat(nValue) / parseFloat(this.m_nMax) * parseFloat(parseFloat(this.m_Obj.all["InnerProgDiv"].style.width) - 2 * this.PROG_SIDE_WIDTH)) - 2);
				if (nWidth < 0)
					nWidth = 0;
				
				var sWidth =  nWidth + "px";
				var ProgImg = document.getElementById("ProgImg");
				var ProgTD = document.getElementById("ProgTD");
				
				ProgImg.style.width = sWidth;
				ProgTD.style.width = sWidth;
				
				this.m_Obj.all["ProgImg"].style.width = sWidth;
				this.m_Obj.all["ProgTD"].style.width = sWidth;
					
				if (Obj.all["txtStatBarPrecentage"])
					Obj.all["txtStatBarPrecentage"].innerText = parseInt((parseFloat(this.m_nCurrentValue) / parseFloat(this.m_nMax)) * 100) + "% Done";

			}
			catch(Any)
			{
			 alert("second exception block in setProgBarValue: " + Any)
			}
		}


       function setProgBarValue_nisui(nValue, Obj)
		{ 
			try {
				var ProgImg = document.getElementById("ProgImg");
				
				if (!ProgImg)
				{
					this.toHTML();
				}
				
					
			}
			catch (Any)
			{
			    alert("first exception block in setProgBarValue: " + Any)
				this.toHTML();
			}
			try {
			   
				this.m_nCurrentValue = nValue;
				var nWidth = (parseInt(parseFloat(nValue) / parseFloat(this.m_nMax) * parseFloat(parseFloat(this.m_Obj.all["InnerProgDiv"].style.width) - 2 * this.PROG_SIDE_WIDTH)) - 2);
				if (nWidth < 0)
					nWidth = 0;
				
				var sWidth =  nWidth + "px";
				
				var ProgTD = document.getElementById("ProgTD");
				
				ProgImg.style.width = sWidth;
				ProgTD.style.width = sWidth;
				
				this.m_Obj.all["ProgImg"].style.width = sWidth;
				this.m_Obj.all["ProgTD"].style.width = sWidth;
					
				if (Obj.all["txtStatBarPrecentage"])
					Obj.all["txtStatBarPrecentage"].innerText = parseInt((parseFloat(this.m_nCurrentValue) / parseFloat(this.m_nMax)) * 100) + "% Done";

			}
			catch(Any)
			{
			 alert("second exception block in setProgBarValue: " + Any)
			}
		}



        function setProgBarValue(nValue, Obj)
		{ 
			try {
				var ProgImg = document.getElementById("ProgImg");
				
				if (!ProgImg)
				{
					this.toHTML(); // activate the page's html.
				}
				
					
			}
			catch (Any)
			{
			    alert("first exception block in setProgBarValue: " + Any)
				this.toHTML();// Activate the pointed function.
			}
			try {
				this.m_nCurrentValue = nValue;
				var InnerProgDiv = document.getElementById("InnerProgDiv");
				var ProgImg = document.getElementById("ProgImg");
				var ProgTD = document.getElementById("ProgTD");
				var txtStatBarPrecentage = document.getElementById("txtStatBarPrecentage");
				var nWidth = (parseInt(parseFloat(nValue) / parseFloat(this.m_nMax) * parseFloat(parseFloat(InnerProgDiv.style.width) - 2 * this.PROG_SIDE_WIDTH)) - 2);
			    var sWidth =  nWidth + "px";
				if (nWidth < 0 || sWidth == "NaNpx")
				{
					nWidth = 0;
					sWidth =  nWidth + "px";
			    }
				
				ProgImg.style.width = nWidth;
				ProgTD.style.width = nWidth;
				
				if (txtStatBarPrecentage)
				{
					txtStatBarPrecentage.innerText = parseInt((parseFloat(this.m_nCurrentValue) / parseFloat(this.m_nMax)) * 100) + "% Done";
				}
                
			}
			catch(Any)
			{
			 alert("second exception block in setProgBarValue: " + Any)
			}
		}


		function incPBValue(nAmount, Obj)
		{

			if (this.m_nCurrentValue + nAmount <= this.m_nMax)
				this.setValue(this.m_nCurrentValue + nAmount, Obj);

		}
		function ProgBar(nWidthInPixels, nHeight, nMaxVal, nTop, nLeft, Obj, bShowPlate, sMessage)
		{
			this.HOUSE_SIDE_WIDTH = 23;
			this.PROG_SIDE_WIDTH = 15;
			this.HOUSE_HEIGHT = 32;
			this.PROG_HEIGHT = 32;
			this.PROG_DISTANCE = 1;
			this.m_bShowPlate = bShowPlate;
			this.m_Obj = Obj;
			this.m_nMin = 0;
			this.m_nMax = nMaxVal;
			this.m_nWidth = nWidthInPixels;
			this.m_nHeight = nHeight;
			this.m_nTop = nTop;
			this.m_nLeft = nLeft;
			this.m_nCurrentValue = 0;
			this.m_sMessage = sMessage;
			this.toHTML = renderProgBar;
			this.setValue = setProgBarValue;
			this.isComplete = isProgBarComplete;
			this.isAlive = isProgBarAlive;
			this.getCurrentValue = getPBCurrentValue;
			this.reset = resetPBParameters;
			this.incValue = incPBValue;
			this.toHTML();
		}
