	var _intervalDown = 0;
	var _intervalUp = 0;
	var maxHeight = 0;
	var maxWidth = 350;
	var curHeight = 0;
	var curWidth = 0;
	var speed = 10;
	var thediv = "";
	var uptimeout = 0;
	var downtimeout = 0;
/////////////////////////////////
	var _intervalDownSub = 0;
	var _intervalUpSub = 0;
	var maxHeightSub = 0;
	var maxWidthSub = 350;
	var curHeightSub = 0;
	var curWidthSub = 0;
	var speedSub = 10;
	var thedivSub = "";
	var uptimeoutSub = 0;
	var downtimeoutSub = 0;
	
	function swivalDown(divElem,menutype){		
		swivalUp();
		if(document.getElementById(divElem)){			
			//if(document.getElementById(divElem).id != thediv.id){					
				curHeight = 0;
				curWidth = 0;
				maxHeight = 0;
				thediv = document.getElementById(divElem);	
				thediv.style.height = 0 + "px";
				var innerTables = thediv.getElementsByTagName("TABLE");					
				var rows = innerTables[0].getElementsByTagName("TR");
				for(var $i=0; $i < rows.length;$i++){
					if(rows[$i].className == menutype){
						maxHeight = maxHeight + 22;
					}
				}	
				thediv.style.display = "block";			
				_intervalDown = window.setInterval('down()',20);				
			//}
		}
	}
	function down(){				
		var innerDiv = thediv.getElementsByTagName("DIV");
		innerDiv[0].style.display = "block";
		innerDiv[0].style.height = 0 + "px";	
		innerDivTable = innerDiv[0].getElementsByTagName("TABLE");
		innerDivTable[0].style.visibility = "hidden";
		if(curHeight < maxHeight){				
			thediv.style.height = curHeight + "px";	
			innerDiv[0].style.height = curHeight + "px";	
			//if(curWidth < maxWidth){
				//thediv.style.width = curWidth + "px";	
			//}
			//curWidth = curWidth + speed;
			curHeight = curHeight + speed;
			if(curHeight > maxHeight-45){speed = 5;}	
		}else{
			clearInterval(_intervalDown);	
			curHeight = maxHeight;
			//curWidth = 350;
			speed = 10;
			thediv.style.height = maxHeight + "px";				
			innerDiv[0].style.height = maxHeight + "px";		
			innerDivTable[0].style.visibility = "visible";
			//thediv.style.width = maxWidth + "px";		
			//innerDiv[0].style.display = "block";
		}
	}
	
	
	
	function swivalUp(){
		if(thediv){
			thediv.style.height = 0 + "px";
			//thediv.style.width = 0 + "px";
			thediv.style.display = "none";
			clearTimeout(uptimeout);
			clearInterval(_intervalDown);
		}
	}
	
	
	
//////////////////////////// SUB MENU LEVEL 2 ////////////////////////////////	

function swivalDownSub(divElem,menutype){		
		swivalUpSub();
		if(document.getElementById(divElem)){			
			curHeightSub = 0;
			curWidthSub = 0;
			maxHeightSub = 0;
			thedivSub = document.getElementById(divElem);	
			thedivSub.style.height = 0 + "px";
			var innerTables = thedivSub.getElementsByTagName("TABLE");					
			var rows = innerTables[0].getElementsByTagName("TR");
			for(var $c=0; $c < rows.length;$c++){
				if(rows[$c].className == menutype){
					maxHeightSub = maxHeightSub + 22;
				}
			}	
			thedivSub.style.display = "block";			
			_intervalDownSub = window.setInterval('downSub()',20);					
		}
	}
	function downSub(){				
		var innerDiv = thedivSub.getElementsByTagName("DIV");
		innerDiv[0].style.display = "block";
		innerDiv[0].style.height = 0 + "px";	
		innerDivTable = innerDiv[0].getElementsByTagName("TABLE");
		innerDivTable[0].style.visibility = "hidden";
		if(curHeightSub < maxHeightSub){				
			thedivSub.style.height = curHeightSub + "px";	
			innerDiv[0].style.height = curHeightSub + "px";	
			curHeightSub = curHeightSub + speedSub;
			//if(curHeightSub > maxHeightSub-45){speedSub = 5;}	
		}else{
			clearInterval(_intervalDownSub);	
			curHeightSub = maxHeightSub;
			//curWidth = 350;
			speedSub = 10;
			thedivSub.style.height = maxHeightSub + "px";				
			innerDiv[0].style.height = maxHeightSub + "px";		
			innerDivTable[0].style.visibility = "visible";
			//thediv.style.width = maxWidth + "px";		
			//innerDiv[0].style.display = "block";
		}
	}
	
	
	
	function swivalUpSub(){
		if(thedivSub){
			thedivSub.style.height = 0 + "px";
			//thediv.style.width = 0 + "px";
			thedivSub.style.display = "none";
			clearTimeout(uptimeoutSub);
			clearInterval(_intervalDownSub);
		}
	}
	
	