function thumbsWidthDetails()
{
  setObjectsThumbsWidth('scrollerThumbs','thumbnail');
}

function setObjectsThumbsWidth(div,classe)
{
  if(holder=document.getElementById(div))
  {
    var thumbsWidth = 0;
    count = 0;
    if(nav=document.getElementsByTagName('div'))
    {
      for(i=0;i<nav.length;i++)
      {
        if(nav[i].className.indexOf(classe)!=-1)
        {
          thumbsWidth += nav[i].offsetWidth;
          count++;
        }
      }
    }
    holder.style.width = (thumbsWidth + 4) + 'px';
  }
}

function toggleDisplayBlockById($id, $mode, $displayText, $location) {
   if ($id != '') {
      $element = document.getElementById($id);
      
      if ($element != null) {
        switch ($mode) {
          case "on": {
              if ($displayText != null) {
                  if ($displayText.length > 0) {
                    $element.innerHTML = $displayText;
                  }
              }
              
              if($location != null) {
                  if($location.length > 0) {
                    $element.href = $location;
                  }
              }
              
              $element.style.display = 'block';
              break;
          }
          case "off": {
              $element.style.display = 'off';
              break;
          }
          case "auto": {
              if ($element.style.display == 'block') {
                  $element.style.display == 'none';
              }
              else {
                  if ($displayText != null) {
                      if ($displayText.length > 0) {
                        $element.innerHTML = $displayText;
                      }
                  }
                  
                  if($location != null) {
                      if($location.length > 0) {
                        $element.href = $location;
                      }
                  }
                  $element.style.display == 'block';
              }
              break;
          }
          default: {
              alert('There has not been provided a valid mode, valid modes are on / off / auto.');
              break;
          }
        }
      }
   }
   
}


function activateObjectTab(selectedTab) { 
  sourceId = selectedTab.id; 
  selectedTab = 'tab_' + selectedTab.id;
  tabControl = document.getElementById('tabsholder');
  tabControlChilds = tabControl.childNodes;
  for (i = 0; i < tabControlChilds.length; i++) {
    node = tabControlChilds[i];
    if (node.nodeName == "DIV") { // Checks if it is a tab
      if (node.id  == selectedTab) {
        node.style.display = 'block';
        node.style.visibility = 'visible';
        if (selectedTab == 'tab_locatie') {
          node.style.width = '574px';
          node.style.height = '450px';
        }
        node.className = 'tabSelected';
      }
      else {
        node.style.display = 'none';
        node.style.visibility = 'hidden';
      }
    }
  }
  activateObjectTabLink(sourceId);
  return false;
}

function activateObjectTabLink(selectedTab) {
  tabs = document.getElementById('pagenavholder').childNodes;

  for (i = 0; i < tabs.length; i++) {
    if (tabs[i].nodeName == 'DIV') {
      if (tabs[i].className == 'tabholder active clearfix') {
        tabs[i].className = 'tabholder  clearfix';
      } 
      
      if (tabs[i].id == selectedTab) {
        tabs[i].className = 'tabholder active clearfix';
      }
    }   
  }
}

