
 /***********************************************
* Menu Script by Nicholas Murray
* Free to use but please acknowledge   
* This is my simple take on the Accordion Content script: By Dynamic Drive, at http://www.dynamicdrive.com
* and expands on http://javascript.about.com/library/blclmenu.htm this menu.
* This notice must stay intact for legal use
***********************************************/


var url = window.location.pathname;
var filename = url.substring(url.lastIndexOf('/')+1);
var makeLink = false;
filename = filename.replace(".shtml", "");
if(filename == 'SocialPics1' || filename == 'SocialPics2' || filename == 'SocialPics3' || filename ==  'SocialPics4')
{
  filename = 'social';
  makeLink = true; 
}
var obj=document.getElementById(filename);
    
if(obj != null)
{

  
  
    
  if(filename == "index")
  {
  obj.style.display = 'none';
  toggleMenu('menu0');
  var bkLogoObj = document.getElementById('bkLogoImg');
  bkLogoObj.setAttribute("height", "27");
  bkLogoObj.setAttribute("width", "170");
  var bkDiv = document.getElementById('blokartLogo');
  bkDiv.style.marginBottom = '12px';
  bkDiv.style.marginTop = '12px';
  }
  else
  {
  if (makeLink == false)
  {
  var content =  obj.innerHTML;
  content = content.replace(/<\/?[^>]+(>|$)/g, "");

  if(!isIE())
  {
    
    obj.innerHTML = content;
  } 
  else
  {
    content = content.replace("amp;","");
    obj.innerText = content;    
  }

  obj.className='menuOn';
  }
//find menu name and collapse other menues.
var menu_id=obj.parentNode;     //list id
    menu_id = menu_id.parentNode.id;   //menu id name
toggleMenu(menu_id);
  }
}
else
{
toggleMenu('menu0');
}

 
function isIE()
{
 return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}


function toggleMenu(objID) 
{
  if (!document.getElementById) return;

  var i =0;
  var MAX_MENUS = 4;
  for (i=0;i< MAX_MENUS;i++)
  { 
   var ob = document.getElementById("menu"+i).style;
   if("menu"+i == objID)
   {
     ob.display = 'block';
   }
   else
   {
      ob.display = 'none';
    }

  }
}


