
function Item(_txt,_url,_fore,_back,_link)
{
	this.txt=_txt;
	this.url=_url;
	this.fore=_fore;
	this.back=_back;
	this.link=_link;
}

function butex(a,b)
{
	doc=document.getElementsByTagName('DIV');
	but=eval('doc["m'+a+'_'+b+'"].style');
//	but.fontWeight='900';
	but.backgroundColor=eval(a+'['+b+'].fore');
}

function butim(a,b)
{
	doc=document.getElementsByTagName('DIV');
	but=eval('doc["m'+a+'_'+b+'"].style');
//	but.fontWeight='100';
	but.backgroundColor=eval(a+'['+b+'].back');
}

function gotopage(a)
{
	if(a.indexOf('http://')!=-1)
		nowy=window.open();
	else
		nowy=document;
	nowy.location=a;
}

function insertmenu(id,fS,pre)
{
	that=eval(id);
	l=that.length;
	for(i=1;i<l;i++)
	{
		document.writeln('<DIV ID="m'+id+'_'+i+'" CLASS="button" onMouseOver="butex(\''+id+'\','+i+')" onMouseOut="butim(\''+id+'\','+i+')" onClick="gotopage(\''+that[i].url+'\')">');
//		document.writeln(pre+'<A HREF="'+that[i].url+'">');
		document.writeln(that[i].txt);
//		document.writeln('</A>');
		document.writeln('</DIV>');
		doc=document.getElementsByTagName('DIV');
		but=eval('doc["m'+id+'_'+i+'"].style');
		but.visibility='hidden';
		if (pre!='')
			but.fontFamily=pre;
		but.textAlign='center';
		but.fontSize=fS+'px';
		but.height=(fS*3/2)+'px';
		but.fontWeight='200';
		but.color=that[i].link;
		but.backgroundColor=that[i].back;
		but.visibility='visible';
//		alert(i+' of '+l+' OK');
	}
}
