window.onerror = null;
startMenu = function () {
if (document.all&&document.getElementById) {
cssmenu = document.getElementById("csstopmenu");
for (i=0; i<cssmenu.childNodes.length; i++) {
node = cssmenu.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function(){
this.className=this.className.replace(" over", "")
}
}
}
}
}

if (window.attachEvent)
window.attachEvent("onload", startMenu)
else
window.onload=startMenu;

color1='#ffffff';
color2='#cdb189';
function dec2hex(dec, metric)
{
  var digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  metric=!metric ? 16 : metric;
  var hex="";
  var tmp="";
  while(dec!=0)
  {
    tmp=hex;
    hex=digits.charAt(dec % metric)+tmp;
    dec=Math.floor(dec / metric);
  }
  return hex;
}


function rollBlock(first,second) {
	first.count++;
	c11 = parseInt (color1.replace('#',''), 16) %256;
	c12 = (parseInt (color1.replace('#',''), 16)>>8) %256;
	c13 = (parseInt (color1.replace('#',''), 16)>>16) %256;

	c21 = parseInt (color2.replace('#',''), 16) %256;
	c22 = (parseInt (color2.replace('#',''), 16)>>8) %256;
	c23 = (parseInt (color2.replace('#',''), 16)>>16) %256;
	r11=c11 - parseInt ((c11-c21)*first.count/20);
	r12=c12 - parseInt ((c12-c22)*first.count/20);
	r13=c13 - parseInt ((c13-c23)*first.count/20);

	r21=c21 + parseInt ((c11-c21)*first.count/20);
	r22=c22 + parseInt ((c12-c22)*first.count/20);
	r23=c23 + parseInt ((c13-c23)*first.count/20);
	first.bgColor=dec2hex( r11+(r12<<8)+(r13<<16));
	second.bgColor=dec2hex(r21+(r22<<8)+(r23<<16));
	if (first.count==20) {
		clearInterval (first.timer);
		first.count=-1;
		second.count=-1;
		setTimeout ('setBlock ()', 2000);
	}
}

function setBlock () {
	do {
		item1r = Math.floor(Math.random()*desc.rows.length);
		item1c = Math.floor(Math.random()*desc.rows[item1r].cells.length)}
	while ((desc.rows[item1r].cells[item1c].bgColor==color2)||(desc.rows[item1r].cells[item1c].count!=-1));
	do {
		item2r = Math.floor(Math.random()*desc.rows.length);
		item2c = Math.floor(Math.random()*desc.rows[item2r].cells.length)}
	while ((desc.rows[item2r].cells[item2c].bgColor==color1)||(desc.rows[item2r].cells[item2c].count!=-1));

	desc.rows[item1r].cells[item1c].count=0;
	desc.rows[item2r].cells[item2c].count=0;
	desc.rows[item1r].cells[item1c].timer= setInterval ('rollBlock(desc.rows['+item1r+'].cells['+item1c+'],desc.rows['+item2r+'].cells['+item2c+'])', 50);
}
function drawTable (x,y,width,height) {
color1='#ffffff';
color2='#cdb189';
	document.write ('<table id="desc" cellspacing="1" bgcolor="'+color2+'" width="'+width+'" height="'+height+'">');
	for (i=0;i<y;i++) {
		document.write ('<tr>');
		for (j=0;j<x;j++)
			document.write ('<td valign="bottom">'+((i==y-1&&j==0)?'<img src="img/cube.gif">':'&nbsp;&nbsp;')+'</td>');
		document.write ('</tr>');
	}
	document.write ('</table>');
var	desc=document.getElementById("desc");
	for (i=0;i<desc.rows.length;i++)
		for (j=0;j<desc.rows[i].cells.length;j++) {
			desc.rows[i].cells[j].count=-1;
			if (Math.random()>0.5)
				desc.rows[i].cells[j].bgColor=color2
			else
				desc.rows[i].cells[j].bgColor=color1;
		}
	setBlock ();
	setBlock ();
	setBlock ();
	setBlock ();
}
/*_d=document;menunum=0;zi=20;
function AddMenu (nMenu) {
	_m='menu'+(menunum++);
	_d.write ('<div style="position:absolute;display:none;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80) progid:DXImageTransform.Microsoft.Shadow(color=#888888,direction=135,strength=10);" id="'+_m+'"onmouseover="clearTimeout('+_m+'.clMnT); if ('+_m+'.par) clearTimeout(eval(eval(\''+_m+'.par\')).clMnT); '+_m+'.mouse=true;" onmouseout="HideMenu (\''+_m+'\'); '+_m+'.mouse=false;"><table class="mntbl" cellspacing="0">');
	for (i in nMenu) {
		if (nMenu[i][0].length==0) _d.write ('<tr id="mnt'+_m+i+'"><td class="mntr1" height="2"></td></tr>')
		else {
		if ((__m=nMenu[i][0].indexOf('$N'))>=0) {
			_j=parseInt (nMenu[i][0].substring(__m+2,nMenu[i][0].indexOf('$',__m+1)));
			nMenu[i][0]=nMenu[i][0].substring(0,__m);
			for (_i=0;_i<_j;_i++) nMenu[i][0]+='&nbsp;';
			nMenu[i][0]+='&raquo;'}
		__m=(nMenu[i][1].indexOf('$M')==0)?nMenu[i][1].substring(2,nMenu[i][1].length):'';
		_d.write('<tr id="mnt'+_m+i+'"><td class="mntr1" onmouseover="event.srcElement.className=\'mntr'+((__m!='')?'3':'2')+'\';');
		if (__m!='') _d.write(' clearTimeout(eval(\'menu'+__m+'\').clMnT); eval(\'menu'+__m+'\').clMnT=setTimeout (\'ShowMenu('+__m+','+_m+'.style.posLeft+'+_m+'.offsetWidth-15,'+_m+'.style.posTop+mnt'+_m+i+'.offsetTop+mnt'+_m+i+'.offsetHeight/4,\\\''+_m+'\\\')\',500);');
		_d.write('" onmouseout="event.srcElement.className=\'mntr1\';'+((__m!='')?'HideMenu (\'menu'+__m+'\');"':'"')+' style="cursor:'+((nMenu[i][1].indexOf('$U$')==0)?'hand" onclick="_d.location.href=\''+nMenu[i][1].substring(3,nMenu[i][1].length)+'\';"':((nMenu[i][1].indexOf('$J$')==0)?'hand" onclick="'+nMenu[i][1].substring(3,nMenu[i][1].length)+'; return false;"':'default"'))+'>'+nMenu[i][0]+'</td></tr>')}}
	_d.write ('</table></div>');
	eval (_m).clMnT=0;
	return menunum-1}
function HideM (_m) {
	with (eval (_m)) {
		style.display='none';
		if (par) if (!eval(par).mouse) HideMenu (par)}
	allmvis=true;
	for (i=0;i<menunum;i++) allmvis=(eval ('menu'+i).style.display=='')?false:allmvis;
	i=0;
	while (allmvis&&_d.all.tags('select')(i)) _d.all.tags('select')(i++).style.display='';
	return false}
function HideMenu (_m) {
	clearTimeout (eval(_m).clMnT);
	eval(_m).clMnT=setTimeout ('HideM (\''+_m+'\')',500);
	return false;}
function ShowMenu (MenuId,mnX,mnY,prnt) {
	i=0;
	while (_d.all.tags('select')(i)) _d.all.tags('select')(i++).style.display='none';
	with (eval ('menu'+MenuId)) {
		clearTimeout (clMnT);
		with (style) {
			zIndex=zi++;
			if (mnX) posLeft=mnX; else posLeft=event.clientX+_d.body.scrollLeft;
			if (mnY) posTop=mnY; else posTop=event.clientY+_d.body.scrollTop;
			display=''}}
	eval ('menu'+MenuId).par=prnt;
	return false}
function posMenuX () {
	return event.srcElement.offsetLeft+leftTd.offsetWidth+5}
function posMenuY () {
	return event.srcElement.offsetTop+event.srcElement.offsetHeight}

menuAbout	=AddMenu ([['Îêõõêó, çåïïðõæê','$U$/get.asp?id=N21'],['Ïðþðõæê','$U$/news.asp'],['Òôåõõâ ð ìðîòâïêê','$U$/get.asp?id=N20'],['Þýõæâþìê','$U$/get.asp?id=N22'],['Þâìâïõêê','$U$/get.asp?id=N23'],['Ìðïæâìæý','$U$/get.asp?id=N24'],['Öðôèî','$U$/forum.asp'],['Òâôæïåôý','$U$/get.asp?id=N88'],['Èõíðþêó òâôæïåôõæþâ','$U$/get.asp?id=N25'],['Èàå÷ïýë çåïæô','$U$/get.asp?id=N42'],['Äêíåôâî','$U$/get.asp?id=N26']]);

window.onerror = null;

function oW(c) {
	ww = screen.width;
	wh = screen.height;
	w=window.open('/get.asp?id='+c, 'View','menubar=no,fullscreen=yes,status=no,location=no,directories=no,scrolling=no,resizable=no,width='+ww+',height='+wh);
	w.moveTo(0,0);
	w.focus();
	return false;
}


menuCatalog	=AddMenu ([['Òôêéðãêå ','$U$/grp.asp?id=100000'],['Úðõæêïýå ','$U$/grp.asp?id=100001'],['Ìâ÷êïåæý ','$U$/grp.asp?id=100002'],['Äåæõìêå ','$U$/grp.asp?id=100003'],['Õòâíûïê ','$U$/grp.asp?id=100004'],['Úâôäåôð÷ïýå ','$U$/grp.asp?id=100005'],['Õòåçîå÷åíû ','$U$/grp.asp?id=100006'],['Õêõæåîý','$U$/grp.asp?id=100007'],['Âìõåõõèâôý','$U$/get.asp?id=N28'],['Îâæåôêâíý','$U$/get.asp?id=N29']]);
menuWhere	=AddMenu ([['Îðõìþâ','$U$/sale.asp'],['Ôåúêðïý','$U$/russia.asp']]);


*/
