		
			var Timer,TimeCount=10;
			var SubTimer,SubTimeCount=10;
			var ChatTimer,ChatTimeCount=1000;
			var PrivateChatTimer,PrivateChatTimeCount=10;
			var ULTimer,ULTimeCount=1000;
			var StrName,SubMenuStrName;
			var OptionRightVal=0,OptionBottomVal=0;
			var OptionSubRightVal=0,OptionSubBottomVal=0;
			
			var pubChatXmlObj = new ActiveXObject("Microsoft.XMLHTTP")
			var pubChatXmlObj1 = new ActiveXObject("Microsoft.XMLDOM")
			var pubChatXslObj = new ActiveXObject("Microsoft.XMLDOM")
			var priChatXmlObj = new ActiveXObject("Microsoft.XMLDOM")
			var priChatXslObj = new ActiveXObject("Microsoft.XMLDOM")
			var ULXmlObj = new ActiveXObject("Microsoft.XMLHTTP")
			var ULXslObj = new ActiveXObject("Microsoft.XMLDOM")
			
			//pubChatXmlObj.async = false
			pubChatXslObj.async = false
			priChatXmlObj.async = false
			priChatXslObj.async = false
			//ULXmlObj.async = false
			ULXslObj.async = false		
			
			// Load the XSL for public chat
			pubChatXslObj.load("../xsl/PublicChatMessages.xsl")
			
			// Load the XSL for private chat
			priChatXslObj.load("../xsl/PublicChatMessages.xsl")	
			
			// Load the XSL to display chat members
			ULXslObj.load("../xsl/ChatMembers.xsl")		
	
			
			function ShowMenu(ctlName)
			{				
				StopTimer();
				OptionRightVal=0;
				OptionBottomVal=0;
				HideAll();
				StrName = ctlName;	
				Timer = window.setTimeout("StartTimer()",TimeCount);				  
			}
			
			function ShowSubMenu(ctlName)
			{				
				StopSubTimer();
				OptionSubRightVal=0;
				OptionSubBottomVal=0;
				HideAllSubMenus();
				SubMenuStrName = ctlName;	
				SubTimer = window.setTimeout("StartSubTimer()",SubTimeCount);				  
			}
			
			function HideMenu(ctlName)
			{				
				
				document.getElementById(ctlName).style.display = "none";				
				//StopTimer();
			}			
			
			function HideAll()
			{			
				document.getElementById("divExchangerLayer").style.display = "none";	
				document.getElementById("divNewsLayer").style.display = "none";		
				document.getElementById("divClassifiedLayer").style.display = "none";		
				document.getElementById("divHPLayer").style.display = "none";		
				document.getElementById("divHP_PollingLayer").style.display = "none";		
				document.getElementById("divHP_ArticleLayer").style.display = "none";
				document.getElementById("divHP_PageSettingsLayer").style.display = "none";
				document.getElementById("divJobsLayer").style.display = "none";				
				document.getElementById("divPinoyLinksLayer").style.display = "none";	
				document.getElementById("divHP_ETicketLayer").style.display = "none";								
			}
			
			function HideAllSubMenus()
			{					
				document.getElementById("divHP_PollingLayer").style.display = "none";		
				document.getElementById("divHP_ArticleLayer").style.display = "none";	
				document.getElementById("divHP_PageSettingsLayer").style.display = "none";		
				document.getElementById("divHP_ETicketLayer").style.display = "none";				
			}
			
			function StartTimer() 
			{
					document.getElementById(StrName).style.display ="block";				
					OptionRightVal = OptionRightVal + 100;
					OptionBottomVal = OptionBottomVal + 100;
					document.getElementById(StrName).style.clip ="rect(auto,"+ OptionRightVal + "," + OptionBottomVal + ",auto)";					
					Timer = window.setTimeout("StartTimer()",TimeCount);					
			}
			
			function StartSubTimer() 
			{
					document.getElementById(SubMenuStrName).style.display ="block";				
					OptionSubRightVal = OptionSubRightVal + 100;
					OptionSubBottomVal = OptionSubBottomVal + 100;
					document.getElementById(SubMenuStrName).style.clip ="rect(auto,"+ OptionSubRightVal + "," + OptionSubBottomVal + ",auto)";					
					SubTimer = window.setTimeout("StartSubTimer()",TimeCount);					
			}
			
			function StopTimer() 
			{				
    				clearTimeout(Timer);
    				if (OptionRightVal = 250)
						OptionRightVal = 0;				
					if (OptionBottomVal = 50)
						OptionRightVal = 0;						
					
			}
			function StopSubTimer() 
			{				
    				clearTimeout(SubTimer);
    				if (OptionSubRightVal = 250)
						OptionSubRightVal = 0;				
					if (OptionSubBottomVal = 50)
						OptionSubRightVal = 0;						
					
			}
			
			function ChangeArrow(ctlname1,option)
			{
				if (option == 0)
					document.getElementById(ctlname1).src ="../images/tri-arrow-white.gif";	
				else	
					document.getElementById(ctlname1).src ="../images/tri-arrow.gif";	
			}
			
			function ChangeColor(ctlname1,ancControl,option)
			{
				if (option == 0)
				{
					document.getElementById(ctlname1).style.background ="darkgray";					
					document.getElementById(ancControl).style.color ="black";	
				}
				else	
				{
					document.getElementById(ctlname1).style.background ="#6699ff";					
					document.getElementById(ancControl).style.color ="white";	
				}
			}
			
			function ChangeSubMenuColor(ctlname,option)
			{
				if (option == 0)
					document.getElementById(ctlname).style.background ="#ffcc00";					
				else	
					document.getElementById(ctlname).style.background ="whitesmoke";									
			}
			
			function showMenu(strName)
			{				
				if ( document.getElementById(strName).style.visibility == "hidden" )
					document.getElementById(strName).style.visibility = "visible";
			}
			
			function hideMenu(strName)
			{
				if ( document.getElementById(strName).style.visibility == "visible" )
					document.getElementById(strName).style.visibility="hidden";
			}
			
			function GetPublicChatMessages(ctlName,divCtl)
			{					
				ChatTimer = window.setTimeout("StartChatTimer('" + ctlName + "','" + divCtl + "')",ChatTimeCount);					
			}			
			
			function StartChatTimer(ctlName,divCtl)
			{	
				// Load XML 
				/*pubChatXmlObj.load("../xml/" + document.getElementById(ctlName).value + ".xml")
			
				document.getElementById(divCtl).innerHTML = pubChatXmlObj.transformNode(pubChatXslObj);					*/
				
				pubChatXmlObj.Open("POST","GetChatMessage.aspx",false);
				//pubChatXmlObj.OnReadyStateChange = EventReady;

				pubChatXmlObj.Send("");
				
				while (pubChatXmlObj.ReadyState != 4);
			/*pubChatXmlObj1.load(pubChatXmlObj.ResponseText);
				alert(pubChatXmlObj1.transformNode(pubChatXslObj));*/
				document.getElementById(divCtl).innerHTML = pubChatXmlObj.ResponseText			
				document.getElementById(divCtl).doScroll("scrollbarDown");
				ChatTimer = window.setTimeout("StartChatTimer('" + ctlName + "','" + divCtl + "')",ChatTimeCount);							
			}
			
			function StartChatTimer1(ctlName,divCtl)
			{	
				// Load XML 
				pubChatXmlObj.load("../xml/" + document.getElementById(ctlName).value + ".xml")
			
				document.getElementById(divCtl).innerHTML = pubChatXmlObj.transformNode(pubChatXslObj);					
				
				document.getElementById(divCtl).doScroll("scrollbarDown");
				ChatTimer = window.setTimeout("StartChatTimer('" + ctlName + "','" + divCtl + "')",ChatTimeCount);							
			}
			
			function EventReady()
			{
				if ( pubChatXmlObj.ReadyState == 4 )
				{
				
				
				}
			}

			function ResetPubChatTimer()
			{			
				clearTimeout(ChatTimer);
			}
			
			function GetPrivateChatMessages(ctlName,divCtl)
			{	
				PrivateChatTimer = window.setTimeout("StartPrivateChatTimer('" + ctlName + "','" + divCtl + "')",PrivateChatTimeCount);					
			}			
			
			function StartPrivateChatTimer(ctlName,divCtl)
			{		
				// Load XML 
				priChatXmlObj.load("../xml/" + document.getElementById(ctlName).value + ".xml")

				document.getElementById(divCtl).innerHTML = priChatXmlObj.transformNode(priChatXslObj);	
				document.getElementById(divCtl).doScroll("scrollbarDown");
								
				PrivateChatTimer = window.setTimeout("StartPrivateChatTimer('" + ctlName + "','" + divCtl + "')",PrivateChatTimeCount);				
			}
			function ResetPriChatTimer()
			{				
				clearTimeout(PrivateChatTimer);
			}
			
			function GetChatUsersList(ctlName,divCtl)
			{	
				ULTimer = window.setTimeout("StartULTimer('" + ctlName + "','" + divCtl + "')",ULTimeCount);					
			}			
			
			function StartULTimer(ctlName,divCtl)
			{		
				// Load XML 
				ULXmlObj.Open("POST","GetChatUsers.aspx",false);
				ULXmlObj.Send("");
				
				while (ULXmlObj.ReadyState != 4);
				document.getElementById(divCtl).innerHTML = ULXmlObj.ResponseText			
				ULTimer = window.setTimeout("StartULTimer('" + ctlName + "','" + divCtl + "')",ULTimeCount);										
							
				//// Load XML 
				//ULXmlObj.load("../xml/" + document.getElementById(ctlName).value + "ChatMembers.xml")

				//document.getElementById(divCtl).innerHTML = ULXmlObj.transformNode(ULXslObj);					
				//ULTimer = window.setTimeout("StartULTimer('" + ctlName + "','" + divCtl + "')",ULTimeCount);				
			}
			function ResetULTimer()
			{
				clearTimeout(ULTimer);
			}
