var iw = "img/btn/";

function drawButtonSmall (contentNode) { return drawButtonRaw( 9,16,'small', 8,contentNode); }
function drawButtonMedium(contentNode) { return drawButtonRaw(11,18,'med'  , 9,contentNode); }
function drawButtonLarge (contentNode) { return drawButtonRaw(13,20,'big'  ,10,contentNode); }

var jsButtonAmount=0;
function drawButtonRaw(fsize,uheight,tsize,psize,contentNode) {
    uheight+='';
    psize+='';
    node = document.createElement('table');
    with (node) {
        setAttribute('height',uheight);
        setAttribute('style','height:'+uheight+'px');

        // Muh ha ha haaa !
        setAttribute('onmouseover',"document.getElementById('jsButton_"+jsButtonAmount+"').style.color='#fff'");
        setAttribute('onmouseout' ,"document.getElementById('jsButton_"+jsButtonAmount+"').style.color='#800000'");

        style.cursor='pointer';
        with (appendChild(document.createElement('tr'))) {
            setAttribute('height',uheight);
            setAttribute('style','height:'+uheight+'px');
            with (appendChild(document.createElement('td'))) {
                setAttribute('height',uheight);
                setAttribute('style','height:'+uheight+'px');
                style.backgroundImage='url('+iw+tsize+'_lt.gif)';
                style.backgroundRepeat='no-repeat';
                style.width=psize+'px';
            }
            with (appendChild(document.createElement('td'))) {
                setAttribute('id','jsButton_'+jsButtonAmount);
                setAttribute('height',uheight);
                setAttribute('class','btnfont');
                setAttribute('style','height:'+uheight+'px');
                style.backgroundImage='url('+iw+tsize+'_tile.gif)';
                style.backgroundRepeat='repeat-x';
                style.fontWeight='bold';
                style.color='#800000';
                appendChild(contentNode);
                style.fontSize=fsize+'px';
            }
            with (appendChild(document.createElement('td'))) {
                setAttribute('height',uheight);
                setAttribute('style','height:'+uheight+'px');
                style.backgroundImage='url('+iw+tsize+'_rt.gif)';
                style.backgroundRepeat='no-repeat';
                style.width=psize+'px';
            }
        }
    }
    jsButtonAmount++;
    return node;
}


