var NumButtons=0;
var ButtonCode="";

function ButtonSrc(buttonName,imgSrc)
{
var tButton = document.getElementById(buttonName);
tButton.setAttribute("src",imgSrc);
}

function AddButton(someHTML,buttonName)
{
var buttonBank = document.getElementById("corner");
var imgOutput,txtOutput;

if (document.all) //Workaround for I.E 'onclick' bug.
{
  var buttonTag;
  buttonTag="<img onclick=\""+someHTML+"\"></img>";
  imgOutput = document.createElement(buttonTag);
  imgOutput.setAttribute("className","float_button");
}
else  //Do it normal for Mozilla, Opera et al.
{
  imgOutput = document.createElement("img");
  imgOutput.setAttribute("onclick",someHTML);
  imgOutput.setAttribute("class","float_button");
  imgOutput.setAttribute("onmouseover","ButtonSrc('btn"+NumButtons+"','oval_button2.gif')");
  imgOutput.setAttribute("onmouseout","ButtonSrc('btn"+NumButtons+"','oval_button.gif')");
}


imgOutput.setAttribute("id","btn"+NumButtons);
imgOutput.setAttribute("src","oval_button.gif");
imgOutput.style.left=((NumButtons%2)==1)?"0px":"60px";
imgOutput.style.top=""+((NumButtons*60)+125)+"px";

buttonBank.appendChild(imgOutput);

var txtXpos = ((NumButtons%2)==1)?0:60;
txtXpos += 75-(5*buttonName.length);

txtOutput = document.createElement("p");
txtOutput.setAttribute("className","float_button");
txtOutput.setAttribute("class","float_button");
txtOutput.style.left=""+txtXpos+"px";
txtOutput.style.top=""+((NumButtons*60)+145)+"px";
txtOutput.style.zIndex=4;

buttonBank.appendChild(txtOutput);
txtOutput.appendChild(document.createTextNode(buttonName));



NumButtons++;
}