// button class
function jsButton(element, type, imgBaseFile, width, height)
{
    this.m_element = element;
    this.m_type = type;

    // get the image base name and extension
    var imgArray = imgBaseFile.split(".");
    this.m_imgBase = imgArray[0];
    this.m_imgExtension = imgArray[1];
    this.m_imgDirectory = 'images/';
    this.m_imgOutSrc = this.m_imgDirectory+this.m_imgBaseFile;
    this.m_imgOverSrc = this.m_imgDirectory + this.m_imgBase+'_over.'+this.m_imgExtension;

    // button width and height
    this.m_width = width;
    this.m_height = height;
    
    // link the member functions
    this.over = jsb_Over;
    this.out = jsb_Out;
    this.preload = jsb_Preload;
}

// execute the mouse over action
function jsb_Over()
{
    //var popWin = window.open("", "debug Window");
    //popWin.document.write(this.m_imgDirectory + this.m_imgBase+'_over.'+this.m_imgExtension);
    //popWin.document.close();
    switch(this.m_type)
    {
        case 'TD':
            document.getElementById(this.m_element).src = this.m_imgOverSrc;
            document.getElementById(this.m_element).style.cursor='hand';
            break;
        case 'TABLE':
            break;
    }

}

// execute the mouse out action
function jsb_Out()
{

}

// preload the over images
function jsb_Preload()
{
    this.m_imgOver = new Image(142, 20);
    this.m_imgOver.src = this.imgOverSrc;
}
