
function buildImage(id,src,border,alt,width,height){
  //returns:<img id="" src="" alt="" border="" width="" height="">
  //anbindung newtd.appendChild(buildImage('meineID','www.adn.de/toolebild.gif','','','',''));

  var imgButton = document.createElement("img");
  
    //src
    var imgScr = document.createAttribute("src");
    imgScr.nodeValue = src;
    imgButton.setAttributeNode(imgScr);
    
    //id
    var imgID = document.createAttribute("id");
    imgID.nodeValue = id;
    imgButton.setAttributeNode(imgID);
    
    //border //0 wenn kein parameter
    var imgBorder = document.createAttribute("border");
    if(border.lenght > 0){
      imgBorder.nodeValue = border;
    }
    else{
      imgBorder.nodeValue = "0";
    }
    imgButton.setAttributeNode(imgBorder);
    
    //alt, wenn parameter
    if(alt.length > 0){
      var imgAlt = document.createAttribute("alt");
      imgAlt.nodeValue = alt;
      imgButton.setAttributeNode(imgAlt);
    }
    
    //width, wenn parameter
    if(width.length > 0){
      var imgWidth = document.createAttribute("width");
      imgWidth.nodeValue = width;
      imgButton.setAttributeNode(imgWidth);
    }
    
    //heigth, wenn parameter
    /*if(height.length > 0){
      var imgHeight = document.createAttribute("height");
      imgHeight.nodeValue = height;
      imgButton.setAttributeNode(imgHeight);
    }*/
        
    return imgButton;    
 }//buildImage
 
 
function buildSpan(id,sTitle){
  //returns:<span id="" title="hierTitle">
  //anbindung: newtr.appendChild(buildSpan('meineID','hierTitle'));
  return buildSpan1(id,sTitle,'');
}//buildSpan

function buildSpan1(id,sTitle,sClass){
  //returns:<span id="" title="hierTitle" class="myClass">
  //anbindung: newtr.appendChild(buildSpan('meineID','hierTitle'));

  var newSpan = document.createElement("span");
      
  //id
  var spanID = document.createAttribute("id");
  spanID.nodeValue = id;
  newSpan.setAttributeNode(spanID);
  
  //title, wenn parameter
  if(sTitle != null){
    if(sTitle.length > 0){
      var spanTitle = document.createAttribute("title");
      spanTitle.nodeValue = sTitle;
      newSpan.setAttributeNode(spanTitle);
    }
  }
  
  //class, wenn parameter
  if(sClass != null){
    if(sClass.length > 0){
      var spanClass = document.createAttribute("class");
      spanClass.nodeValue = sClass;
      newSpan.setAttributeNode(spanClass);
    }
  }
  
  return newSpan;  
}//buildSpan1


function buildDiv(id,sTitle){
  //returns:<div id="" title="hierTitle">
  //anbindung: newtr.appendChild(buildDiv('meineID'));

  var newDiv = document.createElement("div");
      
  //id
  var divID = document.createAttribute("id");
  divID.nodeValue = id;
  newDiv.setAttributeNode(divID);
  
  return newDiv;  
}//buildDiv
 
 function buildTd(id,colspan,width,height,nowrapping,title){
  //returns:<td id="" src="" alt="" border="" width="" height="" title="yipiyeah">
  //anbindung: newtr.appendChild(buildTd('meineID','2','','','',''));

    var newtd = document.createElement("td");
    
   
      
    //id
    var tdID = document.createAttribute("id");
    tdID.nodeValue = id;
    newtd.setAttributeNode(tdID);
    
    //colspan, wenn parameter
    var tdColspan = document.createAttribute("colspan");
    if(width.length > 0){
      tdColspan.nodeValue = colspan;
     }
     else{
       tdColspan.nodeValue = "1";
     }
    newtd.setAttributeNode(tdColspan);
    
    //width, wenn parameter
    if(width.length > 0){
      var tdWidth = document.createAttribute("width");
      tdWidth.nodeValue = width;
      newtd.setAttributeNode(tdWidth);
    }
    
    //heights, wenn parameter
    if(height.length > 0){
      var tdHeight = document.createAttribute("height");
      tdHeight.nodeValue = height;
      newtd.setAttributeNode(tdHeight);
    }
    
    //nowrap, wenn parameter 'nowrap'
    if(nowrapping == "nowrap"){
      var tdNowrap = document.createAttribute("nowrap");
      tdNowrap.nodeValue = "true";
      newtd.setAttributeNode(tdNowrap);
    }
    
    
      
    
    //title, wenn parameter
    if(title.length > 0){
      var tdTitle = document.createAttribute("title");
      tdTitle.nodeValue = title;
      newtd.setAttributeNode(tdTitle);
      
      newtd.onmouseover = myOnmouseover;
      newtd.onmouseout = myOnmouseout;
    }
    
    // var tdAlign = document.createAttribute("align");
    //  tdAlign.nodeValue = "right";
    //  newtd.setAttributeNode(tdAlign);
       
    return newtd;    
 }//buildTd
 
function buildSelect(id,sClass){
  //returns:<span id="meineID"  class="myClass">
  //anbindung: newtr.appendChild(buildSelect('meineID','myClass'));
  var newSelect = document.createElement("select");
      
  //id
  var selectID = document.createAttribute("id");
  selectID.nodeValue = id;
  newSelect.setAttributeNode(selectID);
  
  //class, wenn parameter
  if(sClass != null){
    if(sClass.length > 0){
      var selectClass = document.createAttribute("class");
      selectClass.nodeValue = sClass;
      newSelect.setAttributeNode(selectClass);
    }
  }
  
  return newSelect;  
}//buildSelect



function buildOption(sValue,sAnzeige){
  //returns:<option value="meinValue">meineAnzeige</option>
  //anbindung: newSelect.appendChild(buildOption('meinValue','meineAnzeige'));

  var newOption = document.createElement("option");
      
  //value
  var optionValue = document.createAttribute("value");
  optionValue.nodeValue = sValue;
  newOption.setAttributeNode(optionValue);
  
  //sAnzeige
  newOption.appendChild(document.createTextNode(sAnzeige))
  
  return newOption;  
}//buildOption


 function buildTbody(id){
  //returns:<tbody id="tBody1" >
  //anbindung: newtable.appendChild(buildTbody('meineID'));

    var newtbody = document.createElement("tbody");
      
    //id
    var tbodyID = document.createAttribute("id");
    tbodyID.nodeValue = id;
    newtbody.setAttributeNode(tbodyID);
   
    return newtbody;    
 }//buildTbody
 
 
 function buildA(id,href,sclass,title){
  //returns:<a href="" class="">
  //anbindung: newta.appendChild(buildA('meineID','toll.htm','classwhite','Dies ist der onMouseOver'));

    var newA = document.createElement("a");
    
    //id
    var aID = document.createAttribute("id");
    aID.nodeValue = id;
    newA.setAttributeNode(aID);
    
    //href
    var aHref = document.createAttribute("href");
    aHref.nodeValue = href;
    newA.setAttributeNode(aHref)
    
    //class, wenn parameter
    if(sclass.length > 0){
      var aClass = document.createAttribute("class");
      aClass.nodeValue = sclass;
      newA.setAttributeNode(aClass);
    }
    
    //title, wenn parameter
    if(title.length > 0){
      var aTitle = document.createAttribute("title");
      aTitle.nodeValue = title;
      newA.setAttributeNode(aTitle);
      
      newA.onmouseover = myOnmouseover;
      newA.onmouseout = myOnmouseout;
    }
    
    
       
    return newA;    
 }//buildA
 

 
 
