timer = new Array();

function showMenu(id,level,off,id2)
{
	if (timer[id]) clearTimeout(timer[id])
	if (off==1)
		timer[id] = setTimeout('showMenu(\''+id+'\','+level+',2,\''+id2+'\')',200);
	else if (off==2) $('#m'+level+id).hide();
	else
	{	
		if (level==1)
			$('#m1'+id).css('margin-top',9);
		else if (level==2)
		{
			$('#m2'+id).css('margin-left',$('#m1'+id2).width()-12);
			$('#m2'+id).css('margin-top',-15 - $('#a1'+id).height());
		}
		else if (level==4)
		{
			$('#m4'+id).css('margin-top', -15 - $('#a3'+id).height());
			$('#m4'+id).css('left',255);
		}
		else if (level==5)
		{
			$('#m5'+id).css('margin-top',-15 - $('#a4'+id).height());
			$('#m5'+id).css('margin-left',$('#m4'+id2).width() - 12);			
		}
		
		if ($('#m'+level+id).width()>200)
		{
			$('#m'+level+id).css('white-space','normal');
			$('#m'+level+id).width(200);
		}
		
		$('.menusub'+level).hide();
		$('#m'+level+id).show();
	}
}

/*
function showMenu(id,level,off,id2)
{
	if (timer[id]) clearTimeout(timer[id])
	if (off==1)
		timer[id] = setTimeout('showMenu(\''+id+'\','+level+',2,\''+id2+'\')',200);
	else if (off==2) $('#m'+level+id).hide();
	else
	{	
		if (level==2)
		{
			$('#m2'+id).css('margin-left',$('#m1'+id2).width()-17);
			$('#m2'+id).css('margin-top',-20 - $('#a1'+id).height());
		}
		else if (level==4)
		{
			$('#m4'+id).css('margin-top',-20 - $('#a3'+id).height());
			$('#m4'+id).css('left',253);
		}
		else if (level==5)
		{
			$('#m5'+id).css('margin-left',$('#m4'+id2).width() - 17);
			$('#m5'+id).css('margin-top',-20 - $('#a4'+id).height());
		}
		
		if ($('#m'+level+id).width()>200)
		{
			$('#m'+level+id).css('white-space','normal');
			$('#m'+level+id).width(200);
		}
		
		$('#m'+level+id).show();
	}
}
*/
function fPage(id)
{
	for(i=1;i<5;i++)
	{
		if (i==id)
		{
			$("#page"+i).show();		
			$("#a"+i).addClass('psel');			
		}
		else
		{
			$("#page"+i).hide();		
			$("#a"+i).removeClass('psel');	
		}
	}
}

