// JavaScript Document

menu_status = new Array();
function showHide(theid){
  if (document.getElementById) {
  var switch_id = document.getElementById(theid);

    if(menu_status[theid] != 'show') {
      switch_id.className = 'show';
      menu_status[theid] = 'show';
    }else{
      switch_id.className = 'hide';
      menu_status[theid] = 'hide';
    }
  }
}

var hotspots = document.getElementsByName('hotspot');
var toggles = document.getElementsByName('toggle');

function visibilitytoggle()
{
 for (var i = 0; i < hotspots.length; i++)
 {
 hotspots[i].someProperty = i;
 hotspots[i].onclick = function() {toggle(this.someProperty)};
 }

 for (var i = 0; i < toggles.length; i++)
 {
 toggles[i].style.display = 'none';
 }
}

function toggle(i)
{
 if (toggles[i].style.display == 'none')
 {toggles[i].style.display = ''
 }
 else
 toggles[i].style.display = 'none'
} 

function showall()
{
 for (var i = 0; i < toggles.length; i++)
 {
 toggles[i].style.display = '';
 }
}

function hideall()
{
 for (var i = 0; i < toggles.length; i++)
 {
 toggles[i].style.display = 'none';
 }
}

// Scale SCS homepage logo
   function getElement(elementID) {
      if(document.getElementById){
         return document.getElementById(elementID);
      }else if(document.all){
         return document.all[elementID];
      }else if(document.layers){
         return document.layers[elementID];
      }
   }

   function setImage() {
      imgS = getElement("thisimage");
      if ( imgS != null ) {
         if ( screen.width <= 640 ) {
            imgS.src = "../images/logo_mini.jpg";
         } else if ( screen.width <= 800 ) {
            imgS.src = "../images/logo_small.gif";
         } else if ( screen.width <= 1024 ) {
            imgS.src = "../images/logo_large.jpg";
         } else {
            imgS.src = "../images/logo_large.jpg";
         }
      }
   }