	var DynamicResizeArray = new Array();
	var DynamicResizeArrayXRun = new Array();
	var DynamicResizeArrayYRun = new Array();
	var ResizeSpeed=10;
	var ColapseSpeed=30;
	var InitialHeight=10;
	var InitialWidth=10;
		
	function Expand(JSFilter,X_Value,Y_Value)
		{
		var doc = document.getElementsByTagName('DIV');
		var i,x;
		x=0;
		for (var i = 0; i < doc.length; i++)
			{
			if (doc[i].JSFilter==JSFilter)
				{
				DynamicResizeArray[x]=doc[i];
				DynamicResizeArrayXRun[x]=true;
				DynamicResizeArrayYRun[x]=true;
				x++;
				}
			}
		if (Y_Value && !X_Value)
			SmoothYResize();
		else if (!Y_Value && X_Value)
			SmoothXResize();
		else
			SmoothResize();

		  
		}
		

	function Colapse(JSFilter,X_Value,Y_Value,Ini_Width,Ini_Height)
		{
		var doc = document.getElementsByTagName('DIV');
		var i,x;
		x=0;
		for (var i = 0; i < doc.length; i++)
			{
			if (doc[i].JSFilter==JSFilter)
				{
				DynamicResizeArray[x]=doc[i];
				DynamicResizeArrayXRun[x]=true;
				DynamicResizeArrayYRun[x]=true;
				x++;
				}
			}
		InitialHeight=Ini_Height;
		InitialWidth=Ini_Width
		if (Y_Value && !X_Value)
			SmoothYColapse();
		else if (!Y_Value && X_Value)
			SmoothXColapse();
		else
			SmoothColapse();
			
		

		  
		}		
		
		
	function SmoothYResize()
		{
			var RunAgain;
			for (x in DynamicResizeArray) 
				{
				if (DynamicResizeArrayYRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.scrollHeight)>parseFloat(myObj.style.height))
						{
						myObj.style.height=parseFloat(myObj.style.height)+ResizeSpeed;
						RunAgain=true;
						}
					else
						{
						myObj.style.height=myObj.scrollHeight+2;						
						DynamicResizeArrayYRun[x]=false;
						RunAgain=false;
						for (y in DynamicResizeArrayYRun) 
							{
							if (DynamicResizeArrayYRun[y]==true)
								RunAgain=true;
							}
						}
					}
				}
			if (RunAgain)
				timer1=setTimeout('SmoothYResize()',10);
		}
	function SmoothXResize()
		{
			var RunAgain;
			for (x in DynamicResizeArray) 
				{
				if (DynamicResizeArrayXRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.scrollWidth)>parseFloat(myObj.style.width))
						{
						myObj.style.width=parseFloat(myObj.style.width)+ResizeSpeed;
						RunAgain=true;
						}
					else
						{
						myObj.style.width=myObj.scrollWidth;						
						DynamicResizeArrayXRun[x]=false;
						RunAgain=false;
						for (y in DynamicResizeArrayXRun) 
							{
							if (DynamicResizeArrayXRun[y]==true)
								RunAgain=true;
							}
						}
					}
				}
			if (RunAgain)
				timer1=setTimeout('SmoothXResize()',10);
		}	
	function SmoothResize()
		{
			var RunXAgain;
			var RunYAgain;
			for (x in DynamicResizeArray) 
				{
				if (DynamicResizeArrayXRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.scrollWidth)>parseFloat(myObj.style.width))
						{
						myObj.style.width=parseFloat(myObj.style.width)+ResizeSpeed;
						RunXAgain=true;
						}
					else
						{
						myObj.style.width=myObj.scrollWidth;						
						DynamicResizeArrayXRun[x]=false;
						RunXAgain=false;
						for (y in DynamicResizeArrayXRun) 
							{
							if (DynamicResizeArrayXRun[y]==true)
								RunXAgain=true;
							}
						}
					}
				if (DynamicResizeArrayYRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.scrollHeight)>parseFloat(myObj.style.height))
						{
						myObj.style.height=parseFloat(myObj.style.height)+ResizeSpeed;
						RunYAgain=true;
						}
					else
						{
						myObj.style.height=myObj.scrollHeight;						
						DynamicResizeArrayYRun[x]=false;
						RunYAgain=false;
						for (y in DynamicResizeArrayYRun) 
							{
							if (DynamicResizeArrayYRun[y]==true)
								RunYAgain=true;
							}
						}
					}
				}
			if (RunXAgain || RunYAgain)
				timer1=setTimeout('SmoothResize()',10);
		}		
			
	function SmoothYColapse()
		{
			var RunAgain;
			for (x in DynamicResizeArray) 
				{
				if (DynamicResizeArrayYRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.style.height)-parseFloat(ColapseSpeed)>InitialHeight)
						{
						myObj.style.height=Math.abs(parseFloat(myObj.style.height)-parseFloat(ColapseSpeed));
						RunAgain=true;
						}
					else
						{
						myObj.style.height=InitialHeight;						
						DynamicResizeArrayYRun[x]=false;
						RunAgain=false;
						for (y in DynamicResizeArrayYRun) 
							{
							if (DynamicResizeArrayYRun[y]==true)
								RunAgain=true;
							}
						}
					}
				}
			if (RunAgain)
				timer1=setTimeout('SmoothYColapse()',10);
		}
	function SmoothXColapse()
		{
			var RunAgain;
			for (x in DynamicResizeArray) 
				{
				if (DynamicResizeArrayXRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.style.width)-parseFloat(ColapseSpeed)>InitialWidth)
						{
						myObj.style.width=Math.abs(parseFloat(myObj.style.width)-parseFloat(ColapseSpeed));
						RunAgain=true;
						}
					else
						{
						myObj.style.width=InitialWidth;						
						DynamicResizeArrayXRun[x]=false;
						RunAgain=false;
						for (y in DynamicResizeArrayXRun) 
							{
							if (DynamicResizeArrayXRun[y]==true)
								RunAgain=true;
							}
						}
					}
				}
			if (RunAgain)
				timer1=setTimeout('SmoothXColapse()',10);
		}
	function SmoothColapse()
		{
			var RunXAgain;
			var RunYAgain;
			for (x in DynamicResizeArray) 
				{
				if (DynamicResizeArrayXRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.style.width)-parseFloat(ColapseSpeed)>InitialWidth)
						{
						myObj.style.width=Math.abs(parseFloat(myObj.style.width)-parseFloat(ColapseSpeed));
						RunXAgain=true;
						}
					else
						{
						myObj.style.width=InitialWidth;						
						DynamicResizeArrayXRun[x]=false;
						RunXAgain=false;
						for (y in DynamicResizeArrayXRun) 
							{
							if (DynamicResizeArrayXRun[y]==true)
								RunXAgain=true;
							}
						}
					}
				if (DynamicResizeArrayYRun[x])
					{
					myObj=DynamicResizeArray[x];
					if(parseFloat(myObj.style.height)-parseFloat(ColapseSpeed)>InitialHeight)
						{
						myObj.style.height=Math.abs(parseFloat(myObj.style.height)-parseFloat(ColapseSpeed));
						RunYAgain=true;
						}
					else
						{
						myObj.style.height=InitialHeight;						
						DynamicResizeArrayYRun[x]=false;
						RunYAgain=false;
						for (y in DynamicResizeArrayYRun) 
							{
							if (DynamicResizeArrayYRun[y]==true)
								RunYAgain=true;
							}
						}
					}
				}
			if (RunXAgain || RunYAgain)
				timer1=setTimeout('SmoothColapse()',10);
		}
