// JavaScript Document
var imgOpened    = new Image(13,13);
imgOpened.src    = 'images/b2.gif';
var imgClosed    = new Image(13,13);
imgClosed.src    = 'images/b1.gif';

function toggleLayer(whichLayer) {
  var elem, vis, image;
  	

  if(document.getElementById) { 
  	elem = document.getElementById('div'+whichLayer); // this is the way the standards work
	image = document.getElementById('img'+whichLayer);
  }	
  else if(document.all) elem = document.all['div'+whichLayer]; // this is the way old msie versions work
  else if(document.layers) elem = document.layers['div'+whichLayer]; // this is the way nn4 works
    
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here ?'block':'none';
  
  if (vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) {
  	if (elem.offsetWidth!=0&&elem.offsetHeight!=0) {
		vis.display ='block';
		image.src=imgOpened.src;
	}
	else {
	  	vis.display ='none';
		image.src=imgClosed.src;
	}
  }
  
  
  //vis.display = (vis.display==''||vis.display=='block')?'none':'block';
  
  if (vis.display==''||vis.display=='block') {
  	vis.display ='none';
	image.src=imgClosed.src;
  } 
  else {
  	vis.display ='block';
	image.src=imgOpened.src;	
  }
}


function ExpandAll() {
var tempDiv    = document.getElementsByTagName('DIV');
var tempDivCnt = tempDiv.length;
var image, imageid, id;

   for (var i = 0; i < tempDivCnt; i++) {
      if (tempDiv[i].className == 'p2') {
	  	  tempDiv[i].style.display = 'block' ;
	  	  id=tempDiv[i].id;
		  imageid='img'+id.substring(3);
		  
		  image = document.getElementById(imageid);
		  image.src=imgOpened.src;
	   }	
	  
   }
   


}

function CollapseAll() {
var tempDiv    = document.getElementsByTagName('DIV');
var tempDivCnt = tempDiv.length;
var image, imageid, id;

   for (var i = 0; i < tempDivCnt; i++) {
      if (tempDiv[i].className == 'p2') { 
		  tempDiv[i].style.display = 'none' ;
		  
		  id=tempDiv[i].id;
		  imageid='img'+id.substring(3);
		  image = document.getElementById(imageid);
		  image.src=imgClosed.src;
	  }
	  
   }
   


}



//**************************

function addBookmark(title,url) {    
   if(window.external)
   {
       window.external.AddFavorite(url, title);
       return false;
   }
   return true;
}

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}