var btnCount = 13;
var staCount = 3;
var pressed = -1;
var btnImages = new Array();
function btnMouseOut(img)
{
	if (pressed == img)
		return;
	document.images[img].src = btnImages[img.substring(img.indexOf('mbtn')+4,img.length)][0].src;
};
function btnMouseOver(img)
{
	if (pressed == img)
		return;
	document.images[img].src = btnImages[img.substring(img.indexOf('mbtn')+4,img.length)][1].src;
};
function btnMouseDown(img)
{
	if (pressed == img)
		return;
	if (pressed != -1)
		document.images[pressed].src = btnImages[pressed.substring(pressed.indexOf('mbtn')+4,pressed.length)][0].src;
	document.images[img].src = btnImages[img.substring(img.indexOf('mbtn')+4,img.length)][2].src;
	pressed = img;
};
function gen_td(iIndex,sLink,sTarget,iWidth,iHeight,sHint,imgFolder,iPressed) {
str="<td style=\"padding-bottom:2px\" id=\"mbtn_td"+iIndex+"\">";
str+="<a onMouseOver=\"btnMouseOver('mbtn"+iIndex+"')\" onMouseOut=\"btnMouseOut('mbtn"+iIndex+"')\" onMouseDown=\"btnMouseDown('mbtn"+iIndex+"')\" href=\""+sLink+"\"";
if (sTarget.length >0)
	str+=" target=\""+sTarget+"\"";
str+=">";
str+="<img src=\""+imgFolder+"/mbtn"+iIndex;
if (iIndex==iPressed) str+="_2.gif\""; else str+="_0.gif\"";
str+=" name=mbtn"+iIndex+" border=0 width=\""+iWidth+"\" height=\""+iHeight+"\" alt=\""+sHint+"\">";
str+="</a></td>";
return str;
};
function get_table(bHor,imgFolder,iPressed) {
str="<table id=\"mbtn_tb\" cellpadding=0 cellspacing=0 border=0>";
str+="<tr>";
str+=gen_td(0,"index.php?gomb1=1","","92","40","Button1",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(1,"index.php?gomb1=13","","92","40","Button13",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(2,"index.php?gomb1=2","","92","40","Button2",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(3,"index.php?gomb1=3","","92","40","Button3",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(4,"index.php?gomb1=4","","92","40","Button4",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(5,"index.php?gomb1=5","","92","40","Button5",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(6,"index.php?gomb1=6","","92","40","Button6",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(7,"index.php?gomb1=7","","92","40","Button7",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(8,"index.php?gomb1=8","","92","40","Button8",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(9,"index.php?gomb1=9","","92","40","Button9",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(10,"index.php?gomb1=10","","92","40","Button12",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(11,"index.php?gomb1=14","","92","40","Button14",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(12,"index.php?gomb1=11","","92","40","Button13",imgFolder,iPressed);
if (bHor==false) str+="</tr><tr>";
str+=gen_td(13,"index.php?gomb1=12","","92","40","Button12",imgFolder,iPressed);
str+="</tr>";
str+="</table>";
return str;
};
function draw_buttons(imgFolder,divID,iPressed)
{
for (i= 0; i< btnCount; i++)
{
	btnImages[i] = new Array();
	for (j= 0; j< staCount; j++)
	{
		btnImages[i][j] = new Image();
		btnImages[i][j].src = imgFolder + '/mbtn' + i + '_' + j + '.gif';
	}
}
if (iPressed >=0) pressed = 'mbtn' + iPressed;
result=get_table(false,imgFolder,iPressed);
document.write(result);
}