// JavaScript Document

//menu hightlighting
function HightLightMenu()
{
  var siteMenuDiv = document.getElementById("site_menu");  
  
  var mainAnchors = siteMenuDiv.getElementsByTagName("a");    
  
  var current_url = window.location.href;
  
 
  if (current_url == "http://www.konoker.com/"){
      mainAnchors.style.color = "#444444";
      mainAnchors.style.backgroundImage = "url(../images/menu_icon_selected.gif)";
  }
 
  for (var x=0; x < mainAnchors.length; x++)
  { 
    var indexPageId = mainAnchors[x].getAttribute("href").toString();    
    var index = window.location.href.toString().indexOf(indexPageId);    
    if (index > -1)
    {            
      mainAnchors[x].style.color = "#444444";
      mainAnchors[x].style.backgroundImage = "url(../images/menu_icon_selected.gif)";
    }
       
    var subAnchors = mainAnchors[x].parentNode.getElementsByTagName("a");  
    for (var y=0; y < subAnchors.length; y++)
    {
      var indexSubPageId = subAnchors[y].getAttribute("href").toString();      
      var indexSub = window.location.href.toString().indexOf(indexSubPageId);      
      if (indexSub > -1)
      {          
        subAnchors[y].style.color = "#444444";
        mainAnchors[x].style.color = "#444444";
        mainAnchors[x].style.backgroundImage = "url(../images/menu_icon_selected.gif)";
      }
    } 
  }
  
  FixHeight();
  
}

//make all height equal


function FixHeight()
{
    var divLeft = document.getElementById("LeftColDiv");
    var divContent = document.getElementById("BodyContentDiv");
    var divLeftContent = document.getElementById("colleft");
    
    if (divLeftContent != null && (divLeftContent.clientHeight > divContent.clientHeight))
      divContent.style.height = (divLeftContent.clientHeight + 70) + "px";
    

    if (navigator.appVersion.indexOf("MSIE 6") > -1 || navigator.appVersion.indexOf("MSIE 5") > -1)
    {      
     if (divLeft != null && divContent != null && divLeft.clientHeight < divContent.clientHeight)
    // if (divLeft.clientHeight < divContent.clientHeight)
        divLeft.style.height = divContent.clientHeight + "px";
    
    }
}


window.onload = HightLightMenu;

