function tabchange( cur, max, name ) {
  tabName  = name + cur
  linkName = tabName + "_"

  for( i = 1; i <= max; i++) {
    link = document.getElementById(name + i + "_");
    tab  = document.getElementById(name + i );

    if( cur == i ) {
      if( link )
	link.className = "active";
      if( tab )
	tab.style.display = "block";
    } else {
      if( link )
	link.className = "notactive";
      if( tab )
	tab.style.display = "none";
    }
  }

  return false;
}

function imagechange( id, imgpath, imgorig, label ) {
  img = document.getElementById( id );
  txt = document.getElementById( id+"_label" ).firstChild;
  lod = document.getElementById( id+"_load" );
  lnk = img.parentNode;

  lod.style.display = "block";
  img2 = new Image();
  img2.onload = function() {
	lod.style.display = "none";
	if( img ) {
		img.src = imgpath;
	}
  };
  img2.src = imgpath;
  lnk.href = imgorig;
  lnk.title = label;


  if( txt ) {
	txt.nodeValue = label;
  }
}
