function roundedButton(color,inputHTML)
{  
  var outputHTML; 
  var HTMLClass;
  
  if (color=="blue") HTMLClass="bg_caerul";
  if (color=="white")HTMLClass="bg_aterul15"; 
  
  
  outputHTML=""+
  "<table cellspacing=\"0\" cellpadding=\"0\" style=\"padding:0px\">" +
  "<tr>"+
   "<td style=\"width:1px;height:1px;padding:0px\"><img src=\"images/1x1_trans.gif\" /></td>"+
   "<td id=\"roundedinputStyled\" class=\""+HTMLClass+"\" style=\"height:1px;padding:0px\"></td>"+
   "<td style=\"width:1px;height:1px;padding:0px\"><img src=\"images/1x1_trans.gif\" /></td>"+
  "</tr>"+
  "<tr>"+
   "<td id=\"roundedinputStyled\" class=\""+HTMLClass+"\" style=\"width:1px;padding:0px\"></td>"+
   "<td style=\"padding:0px\">"+inputHTML+"</td>"+
   "<td id=\"roundedinputStyled\" class=\""+HTMLClass+"\" style=\"width:1px;padding:0px\"></td>"+
  "</tr>"+
  "<tr>"+
   "<td style=\"width:1px;height:1px;padding:0px\"><img src=\"images/1x1_trans.gif\" /></td>"+
   "<td id=\"roundedinputStyled\" class=\""+HTMLClass+"\" style=\"height:1px;padding:0px\"></td>"+
   "<td style=\"width:1px;height:1px;padding:0px\"><img src=\"images/1x1_trans.gif\" /></td>"+
  "</tr>"+
  "</table>";
  return(outputHTML);      
}

function buttonActive(ButtonId,color,active) {
  function findNodes(aNode) {
    var i = 0;
    try {
      
      for (i=0; i<aNode.childNodes.length; i++) {
        try {
          if (aNode.childNodes[i].id == 'roundedinputStyled') {
//            alert(aNode.childNodes[i].name);
            if ( active ) {
              if (color == 'blue')   {
                if (aNode.childNodes[i].type=="button") {
                  aNode.childNodes[i].disabled = false;
                  aNode.childNodes[i].className = 'rounded_button_blue';               
                } else {
                  aNode.childNodes[i].className = 'bg_caerul';
                }
              }
              if (color == 'white')  {
                if (aNode.childNodes[i].type=="button") {
                  aNode.childNodes[i].disabled = false;
                  aNode.childNodes[i].className = 'rounded_button_white';               
                } else {
                  aNode.childNodes[i].className = 'bg_aterul15';
                }
              }
            } else {
              if (color == 'blue')  {
                if (aNode.childNodes[i].type=="button") {
                  aNode.childNodes[i].disabled = true;
                  aNode.childNodes[i].className = 'rounded_button_blue_inactive';               
                } else {
                  aNode.childNodes[i].className = 'bg_inactive';
                }
              }
              if (color == 'white') {
                if (aNode.childNodes[i].type=="button") {
                  aNode.childNodes[i].disabled = true;
                  aNode.childNodes[i].className = 'rounded_button_white_inactive';               
                } else {
                  aNode.childNodes[i].className = 'bg_inactive';
                }
              }
            }
          }
//          if (aNode.childNodes[i] 
        } catch (e) { alert('catched '+e) };
        findNodes(aNode.childNodes[i]);
      }
      return;
    } catch (e) {};
  }
  var theB = document.getElementById(ButtonId);
  findNodes(theB);
  return;
}

function roundedButtonStyled(color,inputHTML,aLocation)
{  
  var outputHTML; 
  var HTMLClass;
  var Style = '';
  if (color=="blue") { 
    HTMLClass="bg_caerul";
    Style = 'background-color:#0091DC;'
  }
  if (color=="white") {
    HTMLClass="bg_aterul15"; 
    Style = 'background-color:#D9D9D9;'
  }  
  
  outputHTML=""+
  "<table class=\"festoreset\" cellspacing=\"0\" cellpadding=\"0\" style=\"padding:1px; line-height:0px\"><thead class=\"festoreset\"></thead><tbody class=\"festoreset\">" +
  "<tr class=\"festoreset\" style=\"height: 1px\">"+
   "<td class=\"festoreset\" style=\"width: 1px;height: 1px;padding: 0px 0px 0px 0px;\"><span/></td>"+
   "<td class=\"festoreset\" id=\"roundedinputStyled\" style=\"width: 1px; height:1px;padding:0px;"+Style+"\"><span/></td>"+
   "<td class=\"festoreset\"  style=\"width: 1px;height: 1px;padding: 0px 0px 0px 0px;\"><span/></td>"+
  "</tr>"+
  "<tr class=\"festoreset\">"+
   "<td class=\"festoreset\" id=\"roundedinputStyled\" style=\"width:1px;padding:0px;"+Style+"\"><span/></td>"+
   "<td class=\"festoreset\" style=\"padding:0px\">"+inputHTML+"</td>"+
   "<td class=\"festoreset\" id=\"roundedinputStyled\" style=\"width:1px;padding:0px;"+Style+"\"><span/></td>"+
  "</tr>"+
  "<tr class=\"festoreset\" style=\"height: 1px\">"+
   "<td class=\"festoreset\" style=\"width: 4px;height: 1px;padding: 0px 0px 0px 1px;\"><span/></td>"+
   "<td class=\"festoreset\" id=\"roundedinputStyled\" style=\"height:1px;padding:0px 0px 0px 0px;"+Style+"\"><span/></td>"+
   "<td class=\"festoreset\" style=\"width: 4px;height: 1px;padding: 0px 1px 0px 0px;\"><span/></td>"+
  "</tr>"+
  "</tbody></table>";     
  return outputHTML;
}