/*
 * This class where use in the js-Files from Weka to display Links
 */
function mabLink(displayImage,displayText,linkDoc,linkActive)
{
    this.sImage = displayImage;
    this.sText  = displayText;
    this.linkDoc   = linkDoc;
    this.active = linkActive;
    
    this.currentEntryStyle = "";
    this.filePathIcon = "./weka/images/IconsWeka/";
    this.isFirst = 0;
    this.isLast = 0;
    
    /**
    * Return the begin Element of a List of Entrys
    * @author rm
    * @return String returnValue
    */
    this.displayBegin = function()
    {
        this.isFirst = 1;
        return "<table class=\"marginalLinkTablePopup bg-color7\" border=\"0\" cellspacing=\"0px\" cellpadding=\"0px\" >";
    }
    
    /**
    * Return the current Entry in a Table Row
    * @author rm
    * @return String returnValue
    */
    this.display = function()
    {
        var textClass = "marginalLinkText";
        var textOverClass = "marginalActiveLinkText";
        var returnValue = "";
        var tdClass = "marginalLinkTd";
	var trClass = "marginalLinkTr";
        if(this.active==1){
            textClass = "marginalActiveLinkText";
            tdClass = "marginalActiveLinkTd";
	    trClass = "marginalActiveLinkTr";
        }
        if(this.isFirst==1){
            if(this.active==1){
                tdClass = "marginalActiveLinkTdFirst";
            }
            else{
                tdClass = "marginalLinkTdFirst";
            }
        }
        returnValue += "<tr class=\"" + trClass + "\" onmouseover=\"this.className='marginalLinkTrHover';\" onmouseout=\"this.className='" + trClass + "'\">";
        returnValue += "<td width=\"16px\"  class=\"" + tdClass + "\" " + this.currentEntryStyle +" style=\"padding-left:5px;\">";
        if(this.sImage!=''){
            returnValue += "<img src=\""+ this.filePathIcon + this.sImage + "\" border=\"0\"/>";
        }else{
            returnValue += ".";
        }
        returnValue += " </td>";
        returnValue += "<td class=\"" + tdClass + " text\" " + this.currentEntryStyle +"><a href=\"javascript:doWekaWebLink('" + this.linkDoc +"');\" class=\"" + textClass +"\">"+ this.sText +"</a></td>";
        returnValue += "</tr>";
        return returnValue;
    }
    
    /**
    * Return the End Element of a List of Entrys
    * @author rm
    * @return String returnValue
    */
    this.displayEnd = function()
    {
        this.isLast = 1;
        return "</table>";
    }
    
    this.setCurrentEntryStyle = function(newStyle)
    {
        this.currentEntryStyle = newStyle;
    }
    
}


/*
 * This Class 
 */
function mabTwoColList(leftText,rightText)
{
    this.sLeftText = leftText;
    this.sRightText = rightText;
    
    this.displayBegin = function()
    {
        return "<table class=\"marginalLinkTable bg-color7\">";
    }
    
    this.display = function()
    {
        var returnValue = "";
        returnValue += "<tr>";
        returnValue += "<td width=\"100px\" class=\"marginalText writing\" >" + leftText + "</td>";
        returnValue += "<td class=\"marginalText2 writing\" >" + rightText + "</td>";
        returnValue += "</tr>";
        return returnValue;
    }
    
    this.displayEnd = function()
    {
        return "</table>";
    }
        
}

