// changeTab function - used to set the state of the navigation tabs

// state = which type of tab the tab is switching to - choose from 'select' or 'open'
// navID = the ID of the tab - choose from 'nav1', 'nav2' etc
// onOff = the state the tab is switching to - choose from 'on' or 'off'
// openTabID = the ID of the current open tab - set once in the head of the page - this controls which tab is open for this page

// this function switches the styles of the tabs, therefore only the css / images need to be edited to change the look of the navigation


changeTab = function(state,navID,onOff,openTabID) {
    var centreID = String(navID)+"href";
    var leftID = String(navID)+"left";
    var rightID = String(navID)+"right";

    if(onOff == "on"){
      if((state == "select") && (navID != openTabID)){
        document.getElementById(centreID).className = "centre_selected";
        document.getElementById(leftID).className = "leftedge_selected";
        document.getElementById(rightID).className = "rightedge_selected";
      }
      else if(state == "open"){
        document.getElementById(centreID).className = "centre_open";
        document.getElementById(leftID).className = "leftedge_open";
        document.getElementById(rightID).className = "rightedge_open";
      }
    }
    else if((onOff == "off") && (navID != openTabID)){
      document.getElementById(centreID).className = "centre_default";
      document.getElementById(leftID).className = "leftedge_default";
      document.getElementById(rightID).className = "rightedge_default";
    }
  }

