//=============================================================================//
// This file is part of AutositePHP. Copyright 2004, 2005 Alex Collins         //
//                                                                             //
// AutositePHP is proprietary software; you must not copy, distribute in part  //
// or in full, and/or modify it without the express written agreemeent of the  //
// copyright owner.                                                            //
//                                                                             //
// AutositePHP is distributed by the owner in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY implied or otherwise as to MERCHANTABILITY or      //
// FITNESS FOR ANY PARTICULAR PURPOSE.                                         //
//                                                                             //
// You should have received a copy of the AutositePHP License along with       //
// AutositePHP; if not, contact the copyright owner.                           //
//=============================================================================//

function sitemap_click(id,rootpath) {
   if (document.getElementById('sitemap_ul_'+id).style.display == 'none') {
      document.getElementById('sitemap_ul_'+id).style.display = 'block';
      document.getElementById('sitemap_img_'+id).src = rootpath+'styles/default/modules/sitemap/collapse.gif';
   } else {
      document.getElementById('sitemap_ul_'+id).style.display = 'none';
      document.getElementById('sitemap_img_'+id).src = rootpath+'styles/default/modules/sitemap/expand.gif';
   }
}

function sitemap_expand_all(rootpath) {
   var elems = getElementsByClassName(document,'ul','sitemap_wrapper');
   var id;
   for (var i = 0; i < elems.length; i++) {
      elems[i].style.display = 'block';
      id = elems[i].id.replace('sitemap_ul_','');
      document.getElementById('sitemap_img_'+id).src = rootpath+'styles/default/modules/sitemap/collapse.gif';
   }
}

function sitemap_collapse_all(rootpath) {
   var elems = getElementsByClassName(document,'ul','sitemap_wrapper');
   var id;
   for (var i = 0; i < elems.length; i++) {
      elems[i].style.display = 'none';
      id = elems[i].id.replace('sitemap_ul_','');
      document.getElementById('sitemap_img_'+id).src = rootpath+'styles/default/modules/sitemap/expand.gif';
   }
}
