function Toggle(name,parent)
{
  a=document.getElementById(name+"_"+parent);
  for(i=0;i<a.childNodes.length;i++)
  {
    if(a.childNodes[i].type=="checkbox")
      if(a.childNodes[i].checked==true && document.getElementById(name+parent).checked==false)
       a.childNodes[i].checked=false;
      else
      {
       if(a.childNodes[i].checked==false && document.getElementById(name+parent).checked==true)
       a.childNodes[i].checked=true;
      }
  }
}
function lib_open_img_window(src,width,height){ 
if(width==0)
	width=500;
	width+=20;
	if(height==0)
	height=400;
	height+=20;
	if(height>600)
	height=600;
	var left = (screen.availWidth/2) - (width/2);
	var top = (screen.availHeight/2) - (height/2);
	info=window.open('/img_preview.php?src='+src,'info','resizable=1, scrollbars=1, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
	info.focus();
}

function open_window(win,params,width,height){ 
	if(width==0)
	width=500;
	width+=20;
	if(height==0)
	height=400;
	height+=20;
	if(height>600)
	height=600;
	var left = (screen.availWidth/2) - (width/2);
	var top = (screen.availHeight/2) - (height/2);
	if(params!='')
	win+=params
	info=window.open(win,'info','resizable=1, scrollbars=1, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
	info.focus();
}

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef(id,path) {
	if(!path)
	path=document;
	if (isDOM) return path.getElementById(id);
	if (isIE4) return path.all[id];
	if (isNS4) return path.layers[id];
}

function DoMenu(id) {
	var item = null;
	if (document.getElementById) {
	item = document.getElementById(id);
	}
	else if (document.all) {
	item = document.all[id];
	}
	else if (document.layers) {
	item = document.layers[id];
	}
	if (!item) {
	}
	else if (item.style) {
	if (item.style.display == "none") {
	item.style.display = "";
	}
	else {
	item.style.display = "none";
	}
	}
	else {
	item.visibility = "show";
	}
}
	


