function mtoggle(index) {
	layername = "menu" + index;
	imagename = "tree" + index;
	if (ie4) {
		if (document.all[layername].style.display == 'none') {
			document.all[layername].style.display = '';
			if (document.images[imagename])
				document.images[imagename].src = '../sweetrush.net/cms/images/minus.gif';
		}
		else {
			document.all[layername].style.display = 'none';
			if (document.images[imagename])
				document.images[imagename].src = '../sweetrush.net/cms/images/plus.gif';
		}
	}
	else if (ns6) {
		if (document.getElementById(layername).style.display == 'none') {
			document.getElementById(layername).style.display = '';
			if (document.images[imagename])
				document.images[imagename].src = '../sweetrush.net/cms/images/minus.gif';
		}
		else {
			document.getElementById(layername).style.display = 'none';
			if (document.images[imagename])
				document.images[imagename].src = '../sweetrush.net/cms/images/plus.gif';
		}	
	}
	else if (ns4) {
	}
}

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers
var x;
var y;

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

// *** THE FOLLOWING ARE FUNCTIONS USED FOR SUBMENU CELL HIGHLIGHTING ****************************************
// *** NOT USED BY NETSCAPE 4 (HIGHLIGHTING IS ACHIEVED BY A DIFFERENT MECHANISM *****************************
/*
var cellHilite = "#AAAAAA";
var cellColor = "#FFFFFF";
var sHILITE = "#FFFFFF";
var sCOLOR = "#000000";

function highlight(what,color,fontcolor){
	what.style.background=color;
	what.style.color=fontcolor;
}

function highlight_on(e){
	highlight(e,cellHilite,sHILITE);
}

function highlight_off(e){
	highlight(e,cellColor,sCOLOR);
}


// *** used for Netscape 4 and IE 4 (font highlighting)

function display(id, str) {
	if (ns4) {
		with (id.document) {
			open(); // open document
			write(str); // write to document
			close(); // close document
		}
	} 
	else {
		id.innerHTML = str; // "assign" to element
	}
}


function swapClass(text, url, spName, cssFont) {
	var tempurl = myReplace(url,"~~~","'");
	var str = '<table cellborder=0 cellpadding=0 border=0  height="' + mHEIGHT + '" width="' + mWIDTH + '"><tr><td><a href="' + tempurl + '"  class="' + cssFont + '">' + text + '</a></td></tr></table>';

	display(spName, str); // update the code
}


function myReplace(str, tofind, toreplace) {
	var tempstr;
	tempstr = str;
	while (tempstr.indexOf(tofind) != -1) {
		tempstr = tempstr.replace(tofind, toreplace);
	}
	return tempstr;
}

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


document.write("<STYLE>")
if (ns6) {
	document.write(".row {font-family: Arial; font-size:10pt; font-weight: bold; cursor:pointer; color: #000000; background: #FFFFFF}");
}
else if (ns4) {
	document.write(".row {font-family: Arial; font-size:10pt; font-weight: bold; cursor:hand; color: #000000; background: #FFFFFF}");
}
else {
	document.write(".row {font-family: Arial; font-size:10pt; font-weight: bold; cursor:hand; color: #000000; background: #FFFFFF}");
}
document.write(".row2 {font-family: Arial; font-size:10pt; font-weight: bold; cursor:hand; color: #000000;}");
document.write("</STYLE>");



function toggleMenu(objID, isVisible) {
	if (ie4) {
		document.all[objID].style.visibility = isVisible;
		//document.all['line'].style.visibility = isVisible;
	}
	else if (ns6)
		document.getElementById(objID).style.visibility = isVisible;
	else if (ns4) {
		document.layers[objID].visibility = isVisible;
	}
	else {

	}
}

function showTip(e, objID, isVisible) {
var isMin = (document.location.search.indexOf('min=y') > -1)? true:false;

	if (ie4){
		/*if (obd.mac) {
			document.all[objID].style.top =  document.body.scrollTop+e.clientY - 100;
			document.all['line'].style.top =  document.body.scrollTop+e.clientY - 100;
		}
		else  {	
			document.all[objID].style.top = document.body.scrollTop+ e.clientY;
			document.all['line'].style.top = document.body.scrollTop+ e.clientY;
		}

		document.all['line'].style.left =  e.clientX;
		document.images['helpline'].width = 670-e.clientX;
		
		if (isMin == true) {
			document.all[objID].style.left =  450;
			document.images['helpline'].width = 450-e.clientX;
		}*/
		
		if (obd.mac) {
			document.all[objID].style.left =  document.body.scrollLeft+e.clientX;
			document.all[objID].style.top = document.body.scrollTop+ e.clientY;
		} else {
			document.all[objID].style.left =  document.body.scrollLeft+e.clientX;
			document.all[objID].style.top = document.body.scrollTop+ e.clientY;		
		}
		toggleMenu(objID, isVisible);
	}
	else if (ns6){
		document.getElementById(objID).style.top = scrollY+e.clientY;
		document.getElementById(objID).style.left = scrollX+e.clientX;
		toggleMenu(objID, isVisible);
	}
	else if (ns4){ 
		document.layers[objID].top = e.pageY;
		document.layers[objID].left = e.pageX;
		/*if (isMin == true)
			document.layers[objID].left = 450;*/
		
		if (isVisible == "")
			isVisible = "show";
		else
			isVisible = "hide";
		
		toggleMenu(objID, isVisible);
	}
	else {

	}

}


/*function initAll() {
     if (ns6) {
	document.all = (document.all) ? document.all : ((document.getElementsByTagName("*").length > 0) ? document.getElementsByTagName("*") : null);
     }

     document.onclick = closeAllLayers;
}*/


function submitForm(myInput, myValue, myPos) {
		
	eval("document.form1." + myInput + ".value = '" + myValue + "'")
	
	for (var i = parseInt(myPos)+1; i <= 7; i++)
		eval("document.form1.html" + i + ".value = ''")
		
	for (var i=1; i<= myPos; i++) {
		curval = eval("document.form1.html"+i+".value")
		if (curval == '')
			eval("document.form1.html"+i+".value='XX'")
	}
	
	document.form1.submit()
}

/*function closeAllLayers() {
	var myLayer;

	for (var i=1; i<=7; i++) {
		if (ie4 || ns6)
			eval("myLayer = document.all.menu" + i);
		else if (ns4) 
			eval("myLayer = document.menu" + i);	
		else { }

		if (layerExists(myLayer)) 
			toggleMenu("menu" + i, "hidden");
	}
}

function layerExists(layerName) {
	myResult = false;

	if (layerName)
		myResult = true;

	return myResult;
}*/


