
/***********************************************
* Switch Content script II- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated April 2nd, 2005.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/



// Original script has been modified (no cookie, only show element (no hide)
var ccollect=new Array()


function getElementbyClass(rootobj, classname){
  var temparray=new Array()
  var inc=0
  var rootlength=rootobj.length
  for (i=0; i<rootlength; i++){
    if (rootobj[i].className==classname)
      temparray[inc++]=rootobj[i]
  }
  return temparray
}

function show(cid){
  if (ccollect.length>0){
    document.getElementById(cid).style.display="block"
  }
}


function getselectedItem(){
  if (get_cookie(window.location.pathname) != ""){
    selectedItem=get_cookie(window.location.pathname)
    return selectedItem
  }
  else
    return ""
}

function do_onload(){
  uniqueidn=window.location.pathname+"firsttimeload"
  var alltags=document.all? document.all : document.getElementsByTagName("*")
  ccollect=getElementbyClass(alltags, "switchcontent")
}

if (window.addEventListener)
  window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
  window.attachEvent("onload", do_onload)
else if (document.getElementById)
  window.onload=do_onload
