// $Id: func.js,v 1.3 2005/09/15 07:17:13 max Exp $
isDOM=document.getElementById?true:false
isOpera=isOpera5=window.opera && isDOM
isOpera6=isOpera && window.print
isOpera7=isOpera && document.readyState
isMSIE=isIE=document.all && document.all.item && !isOpera
isStrict=document.compatMode=='CSS1Compat'
isNN=isNC=navigator.appName=="Netscape"
isNN4=isNC4=isNN && !isDOM
isMozilla=isNN6=isNN && isDOM
isSafari=(navigator.userAgent.indexOf("Safari") >= 0)

isMac = (navigator.appVersion.indexOf("Mac") != -1);
isMacPPC = (isMac && (navigator.appVersion.indexOf("PPC") != -1 || navigator.appVersion.indexOf("PowerPC") != -1));

catPrefix = 'cat';
skinWebPath = 'skin1/images/custom/';

var imgOut = new Image;
var imgOver = new Image;
imgOut.src = skinWebPath+"rootmarker2.gif";
imgOver.src = skinWebPath+"rootmarker.gif";

function SwitchTreeItem(cat, is_last) {
	var obj = document.getElementById(catPrefix+cat);
	if (!obj) return false;

	var minus_flag = (obj.style.display == "none");
	obj.style.display = (minus_flag ? (isMSIE ? "block" : "") : "none");
        
	obj = document.getElementById(catPrefix+cat+'img');
	if (obj) obj.src = (minus_flag?imgOver.src:imgOut.src);


	obj2 = document.getElementById(catPrefix+cat+'lnk');
	if (obj2) obj2.className = (minus_flag?obj2.className="rootcat-over":obj2.className="rootcat");
//	if (obj2) obj2.className = (minus_flag?obj2.className+=" over":obj2.className.replace(/ over/, ""));


	obj3 = document.getElementById(catPrefix+cat+'td');
	if (obj3) obj3.className = (minus_flag?obj3.className="roottd-over":obj3.className="roottd-out");
}

/*
  this.className += ;
  this.className = this.className.replace(/ over/, "");
*/
