﻿function btnToggle(item)
{
  switch (item.id)
  {
    case "homeTab":
      requestContent(true,"content/home/home.html");
	  requestContent(false,"content/home/ribbonElements.html");
	  initScrollers();
      break;
    case "systemTab": 
      selectedImage = "";
      requestContent(true, "content/products/products.html");
	  requestContent(false, "content/products/ribbonElements.html");
      break;
    case "partnersTab": 
      requestContent(true, "content/partners/partners.html");
	  requestContent(false, "none.html");
      break;
    case "contactTab": 
      requestContent(true, "content/contactUs/contactUs.html");
	  requestContent(false, "content/contactUs/ribbonElements.html");
      break;
  }

  changeButton(item, "none", "current");
}

function changeButton(item, classUp, classDn)
{
  var allGroup = document.getElementsByTagName("LI");
  var howMany = allGroup.length;
  var iGroup;
  
  for (iGroup = 0; iGroup < howMany; iGroup++){
    if (allGroup[iGroup].className == classDn){
      allGroup[iGroup].className = classUp;
      break;
    }
  }
  item.className = classDn;
}

var selectedImage = "";
        
function ShowDialog(dialogId, action)
{                    
    var oWnd = window.radopen(null, dialogId);
    oWnd.SetUrl(dialogId + ".aspx?Action=" + action);
}

function setColorImage(modName)
{
    selectedImage = modName;
    
    if (modName != "goals")
        document.getElementById("goals").src="images/modulesIcons/goalsDown.gif";
    
    if (modName != "workforce")
        document.getElementById("workforce").src="images/modulesIcons/workforceDown.gif";
    
    if (modName != "descriptions")
        document.getElementById("descriptions").src="images/modulesIcons/descriptionsDown.gif";
    
    if (modName != "compensation")
        document.getElementById("compensation").src="images/modulesIcons/compensationDown.gif";
    
    if (modName != "right")
        document.getElementById("right").src="images/modulesIcons/rightDown.gif";
    
    if (modName != "performance")
        document.getElementById("performance").src="images/modulesIcons/performanceDown.gif";
    
    if (modName != "training")
        document.getElementById("training").src="images/modulesIcons/trainingDown.gif";
}

function setOverImg(element, imgId)
{
    element.className = "cdchumidcover"; 
    document.getElementById(imgId).src = "images/modulesIcons/" + imgId + "Up.gif";
}

function setOutImg(element, imgId)
{
    element.className = "cdchumidc"; 
    
    if (selectedImage != imgId)
        document.getElementById(imgId).src = "images/modulesIcons/" + imgId + "Down.gif";
}