var HtmlReplace		= /\<.[^>]*>/g;
var ValueReplace	= /%value%/g;
function ToggleAll(sSrc, checked)
{
	var TmpObj		= sSrc;
	while (TmpObj.tagName!="TABLE")
		{ TmpObj = TmpObj.parentNode; }
	var Elements	= TmpObj.getElementsByTagName("input");
	for (var i=0; i<Elements.length; i++)
	{
		if (Elements[i].type=="checkbox")
		{
			Elements[i].checked = checked; 
		}
	}
}
var HtmlReplace	= /\<.[^>]*>/g;
function DoDomainAction(targ,selObj,restore)
{ 
	var TmpObj		= selObj;
	var SelItem		= selObj.options[selObj.selectedIndex];
	var SelAttr		= SelItem.getAttribute("onchange");
	var Exit		= false;
	while (TmpObj.tagName!="TR")
		{ TmpObj = TmpObj.parentNode; }
	var		TmpValue	= TmpObj.cells[0].innerHTML.replace(HtmlReplace, "");
	if ((SelAttr!=null) && (SelAttr.length>0))	// evaluates the function in the onchange attribute return value 
		{ eval("if (" + SelAttr + "==false) { Exit = true; }"); }
	if (Exit==true) // a return value of false means exit is true so we exit 
	{ selObj.selectedIndex = 0; return; }
	eval(targ+".location='" + SelItem.value.replace(/%value%/, TmpValue) +"'");
	if (restore) selObj.selectedIndex=0;
}
function confirmSubmit(sMsg)
{
	return confirm(sMsg);
}
	//Disk Manager Actions drop down
	// This function accepts a reference to a <select object or a string. if it's a select object then 
	// it will grab the selected item and use it's value as the action. 
	// If a string is passed the string will be used as the action instead.
	function PerformAction(mObj,action)
	{
		var Sel ;
		if (typeof mObj!="string")
			{ Sel = mObj.options[mObj.selectedIndex].value; }
		else 
			{ Sel = mObj; }
		var tmpfrm	= document.getElementById("action");
		if (tmpfrm!=null)
		{ 
			tmpfrm.value = Sel; 
            if (action != "") { document.forms[0].action = action; }
			document.forms[0].submit();
		}
	}
