var heightPDiv
var outerPath = "";
	function ExpandMenu(I,Sgn,SubNum,path)
	{	
		if(path)
		{
			outerPath = path;
			var img = new Image();
			img.src = outerPath + "Images/menu2.jpg";
		}
		//div is open
		if (document.getElementById('div'+I).style.display=='block')
		{	
			document.getElementById('img'+I).src = outerPath + 'images/long.jpg' 
			var x = new String 
			x = document.getElementById('div'+I).style.height
			
			x=x.substring(0,x.length-2);
			if(eval(x)%2==0)
			{
				document.getElementById('div'+I).style.height = eval(x) - 1;
			}
			shrinkMenu(I,2,1)
		}
		else 
		{
			document.getElementById('img'+I).src = outerPath + 'images/short.jpg' 
			if (heightPDiv != null)
			{
				if (parseInt(heightPDiv)%2==0)
				{
					expandMenu(I,2,parseInt(heightPDiv)+1)
				}
				else
				{
					expandMenu(I,2,parseInt(heightPDiv))
				}
			}	
			else
			{
				expandMenu(I,2,(eval(SubNum) * 20));					
			}
		}		
 	}

 /**************   Expand Menu ****************************/
 
	function expandMenu(victim, factor, reach)
	{  
		document.getElementById('div'+victim).style.display='block';
		if (parseInt(document.getElementById('div'+victim).style.height)>=reach)
		{
			var h = parseInt(document.getElementById('div'+victim).style.height);
			document.getElementById('div'+victim).style.height = parseInt(document.getElementById('div'+victim).style.height)- (h - parseInt(reach));
			clearTimeout(expandMove);
			flag=false;
		}
		else
		{
			flag=true;
			document.getElementById('div'+victim).style.height =parseInt(document.getElementById('div'+victim).style.height) + parseInt(factor);
			expandMove = window.setTimeout("expandMenu('" + victim + "'," + factor + " ," + reach + ");",0.0000000000000000000000000000000000000000001);
		}
	}
	
/**************   Shrink Menu ****************************/
	function shrinkMenu(victim,factor, reach)
	{
		if (parseInt(document.getElementById('div'+victim).style.height)<=reach)
		{
			var h = parseInt(document.getElementById('div'+victim).style.height);
			document.getElementById('div'+victim).style.height = parseInt(document.getElementById('div'+victim).style.height) + (parseInt(reach) - h);
			clearTimeout(shrinkMove);
			document.getElementById('div'+victim).style.overflow='hidden';
			document.getElementById('div'+victim).style.display='none';
		}
		else
		{
			document.getElementById('div'+victim).style.height = parseInt(document.getElementById('div'+victim).style.height) - parseInt(factor);
			var shrinkMove = window.setTimeout("shrinkMenu('" + victim + "'," + factor + " ," + reach + ");",0.00000000000000000000000000000000000000000001);
		}
	}
