var DHTML = (document.getElementById || document.all || document.layers);

/*function expandit(flag)
{
	if (!DHTML) return;
	var x = new getObj(hideThis);
	x.style.visibility = 'hidden';
}*/


function expandit(hideThis,dspIcon,troggleCheck)
{
	
	//folder = (document.all) ? document.all[hideThis].style : document.layers[hideThis];
	//folder.display = (folder.display=='inline') ? 'none' : 'inline'
	//alert(DHTML);
	var dspText_on = "+";
	var dspText_off = "_";

	if (!DHTML) return;
	var x = new getObj(hideThis);
	x.style.display = (x.style.display=='inline'||x.style.display=='') ? 'none' : ''
	if(troggleCheck != '0')
	{
		new_str = troggleCheck.split("|");
		if(new_str.length == 2) { dspText_off = new_str[1]; }
		dspText_on = new_str[0];
		//alert(new_str.length);
		
		//dspText_on = troggleCheck;
	}
	
	if(dspIcon)
		dspIcon.value = (x.style.display=='inline'||x.style.display=='') ? dspText_off : dspText_on;
		
}

function writeWinControl(hideThis,dspIcon,troggleCheck)
{
	//alert(arguments.length);
	var dspIcon_val = dspIcon;
	
	if(!dspIcon)
		dspIcon = "_"; //dspIcon = "O";


	new_str = dspIcon.split("|");
	dspIcon_val = new_str[0];
	//if(new_str.length == 2) { dspIcon_val = new_str[0]; }

	//alert(new_str.length);
	
	
	//troggleCheck = 1;
		
	if((troggleCheck==1)&&(dspIcon))
		troggleCheck=dspIcon;
	else
		troggleCheck = 0;
		
	document.write("<input type=\"button\" value=\""+dspIcon_val+"\" onClick=\"expandit('"+hideThis+"',this,'"+troggleCheck+"');\" onfocus=\"this.blur();\" class=resize-button>");
	//document.write("<a href=\"javascript:expandit('"+hideThis+"')\">"+dspIcon+"</a>");
}

function writeWinControlTrans(hideThis,dspIcon,troggleCheck)
{
	//alert(arguments.length);
	var dspIcon_val = dspIcon;
	
	if(!dspIcon)
		dspIcon = "+"; //dspIcon = "O";

	
	new_str = dspIcon.split("|");
	dspIcon_val = new_str[0];
	//if(new_str.length == 2) { dspIcon_val = new_str[0]; }

	//alert(new_str.length);
	
	
	//troggleCheck = 1;
		
	if((troggleCheck==1)&&(dspIcon))
		troggleCheck=dspIcon;
	else
		troggleCheck = 0;
		
	document.write("<input type=\"button\" value=\""+dspIcon_val+"\" onClick=\"expandit('"+hideThis+"',this,'"+troggleCheck+"');\" onfocus=\"this.blur();\" class=inline style=\"text-decoration:underline;\">");
	//document.write("<a href=\"javascript:expandit('"+hideThis+"')\">"+dspIcon+"</a>");
}

function divDsp(hideThis,dspState) {
	if (!objExist(hideThis)) return;
	var x = new getObj(hideThis);
	x.style.display = (dspState)? (dspState=='inline'?'':dspState) : (x.style.display=='inline'||x.style.display=='') ? 'none' : '';
}



function grabAxis(axis,event)
{
	var showX;
	var showY;
	var padMyMouse = 20;
	if (navigator.appName=="Netscape")
	{
		showX = event.pageX-padMyMouse;
		showY = event.pageY;
	}
	else{
		showX = (document.body.scrollLeft + event.clientX)-padMyMouse;
		showY = (document.body.scrollTop + event.clientY);
	}

	num = (axis == 'x') ? 1 : 0;
	var xy = new Array(showX,showY);
	return xy[num];
}
