	var time
		function menuBar(name,tableProperties)
	{
		this.type='menuBar'
		this.name=name
		this.menuBar=name
		this.tableProperties=tableProperties
		this.style=""
		
		this.openItem
		this.children=new Array()
		
		this.create=drawMainMenu
	}

	function drawMainMenu()
	{
		var table
		table="<table border='0' "+this.tableProperties+"><tr><td>"
		for(i=0;i<this.children.length;i++)
		{
	
			table+="<br style='font-size:8'><table border='0' cellspacing='0' cellpadding='0' width='100%' id="+this.children[i].name+"Td onmouseover='closeMenus("+this.menuBar+".openItem,"+this.name+");onItem("+this.children[i].name+")' onmouseout='offItem("+this.children[i].name+")' style='cursor:hand;"+this.style+"'><tr>"
				table+="<td  valign='baseline' width='11'><img src='images/bull1.jpg' width='16' height='17' border='0'></td>"
				table+="<td align='right' ><font size='-1' font face='Arial' color='#3C3421'><b>"+this.children[i].caption+"</b></font></a></td>"
			table+="</tr></table>"
			
					if (i<this.children.length-1)
		table+=""
		else
				table+=""
			
			
		//	if (i<this.children.length-1)
		//		table+="<img src='images/pas_mafrid.jpg' width='154' height='16' border='0'>"
		//	else
		//		table+="<img src='images/pas_mafrid_sof.jpg' width='154' height='23' border='0'>"
			
		}
		table+="</tr></table>"
		
		document.write(table)
	
		for(i=0;i<this.children.length;i++)
			this.children[i].td=eval(this.children[i].name+"Td")
	
	}
	
	function tatMenu(name,parent,x,y,width)
	{
		this.type='tatMenu'
		this.status=0
		this.name=name
		
		this.x=x
		this.y=y
		
		if(width)
			this.width=width
		
		this.parent=parent
		this.menuBar=parent.menuBar
		this.parent.child=this
		this.children=new Array()
		
		this.style=parent.parent.style
		
		this.create=drawTatMenu
	}
	
	function drawTatMenu()
	{
		var table
		
		table="<div id="+this.name+"Div onmouseover='onItem("+this.name+")' onmouseout='offItem("+this.name+")' style='position:absolute;left:"+this.x+"px;top:"+this.y+"px;visibility:hidden'>"
			
			if (this.parent.parent.type=='menuBar')
			{
			table+="<table border='0' cellspacing='0' cellpadding='0' bgcolor='#DEE7C6'>"
			table+="<tr><td colspan='2'></td></tr>"
			 table+="<tr><td valign=top background=images/pix_shir.gif width=2><img src= width=2 height=2 border=0></td><td>&nbsp;</td><td align=right valign=top>"
			 }
			else
			{
			table+="<table border='0' cellspacing='0' cellpadding='0' bgcolor='#DEE7C6'>"
			table+="<tr><td colspan='2'></td></tr>"
			 table+="<tr><td align=right valign=top>"
			 }
			//	table+="<tr><td><img src='images/pas_mafrid_top.gif' width='154' height='23' border='0'></td></tr>"
				//table+="<tr><td background='images/pix_varod_sagur.jpg' align=right>"
					table+="<table border='0' cellspacing='0' cellpadding='0' dir='rtl'>"
					if (this.parent.parent.type!='menuBar')
						for(i=0;i<this.children.length;i++)
						{
							table+="<tr id="+this.children[i].name+"Td onmouseover='closeMenus("+this.menuBar+".openItem,"+this.name+");onItem("+this.children[i].name+")' onmouseout='offItem("+this.children[i].name+")' style='cursor:hand;"+this.style+"'"
							if (this.children[i].action)
								table+=" onclick=location.href='"+this.children[i].action+"'"
							table+=">"
							childWidth=(this.width)?this.width:250
							table+="<td valign='baseline'><img src='images/bull2.jpg' width='9' height='9' border='0'></td><td>&nbsp;</td><td width="+childWidth+"  height=20 nowrap><font  font face='Arial' color='#264466' size='-1'>"+this.children[i].caption+"</font></td></tr>"
						}
					else
						for(i=0;i<this.children.length;i++)
						{
							table+="<tr id="+this.children[i].name+"Td  onmouseover='closeMenus("+this.menuBar+".openItem,"+this.name+");onItem("+this.children[i].name+")' onmouseout='offItem("+this.children[i].name+")' style='cursor:hand;"+this.style+"'"
							if (this.children[i].action)
								table+=" onclick=location.href='"+this.children[i].action+"'"
							table+=">"
							childWidth=(this.width)?this.width:150
							
							table+="<td valign='baseline' width="+childWidth+" nowrap>&nbsp;<font  font face='Arial' color='#A23E2F' size='-1'>"+this.children[i].caption+"</font></td></tr>"
						}
					table+="</table>"
				table+="</td></tr>"
				table+="<tr><td></td></tr>"
		//		table+="<tr><td><img src='images/pas_mafrid_sof1.gif' width='154' height='23' border='0'></td></tr>"
			table+="</table>"
		table+="</div>"

		document.write(table)
		
		for(i=0;i<this.children.length;i++)
			this.children[i].td=eval(this.children[i].name+"Td")
		
		this.div=eval(this.name+"Div")
		
		if(this.parent.parent.type!='menuBar')
			this.parent.caption+='<font size=-1>-</font><font size=-1><b>></b></font>'
			
			 
	}

	function menuItem(name,caption,parent,action)
	{
		this.type='menuItem'
		this.status=0
		this.name=name
		this.caption=caption
		this.action=action
		
		this.parent=parent
		this.menuBar=parent.menuBar
		
		parent.children[parent.children.length]=this
	}

	function onItem(item)
	{
	
		if (item.child)
			item.child.div.style.visibility='visible'
						
		do {
			item.status=1
			if (item.type=='menuItem')
			{
				item.td.style.fontWeight=700
			if(item.parent.type=='menuBar')
			   item.td.style.background='#DEE7C6'
			}
		
			item=item.parent
			
		}while(item.type!='menuBar')
			
	}
	
	function offItem(item)
	{
		if (item.type=='menuItem')
			eval(item.menuBar+".openItem=item")
			
		time=setTimeout('closeMenus('+item.name+')',1)

		do {
			item.status=0
			if (item.type=='menuItem')
			
				item.td.style.fontWeight=400
		if(item.parent.type=='menuBar')
			   item.td.style.background=''
			item=item.parent
		}while(item.type!='menuBar')
	}
	
	function closeMenus(item,newItem)
	{
		if(!item)return
		if (newItem)
			if (newItem.parent==item)
				return
		if (item.status!=1)
		{
			eval(item.menuBar+".offItem=null")
			if (item.type=='menuItem' && item.child)
				item.child.div.style.visibility='hidden'
			else if (item.type=='tatMenu')
			{
				do {
					if (item.type=='tatMenu' && item.parent.status!=1)
						item.div.style.visibility='hidden'
						
					item=item.parent
				}while(item.type!='menuBar' && item.parent.status!=1)
			}
		}
	}

