//****************************************************
// All non-page-specific javascript functions included
//****************************************************

//initialize page vars
var sAction = "";
var sMode = "";

//image swapping
function swapImage	(fm,to)	{
	fm.src = to.src;
	return;
}

//image preloading
function loadImage (sPath)	{
	img = new Image();
	img.src = sPath;
	return img;
}

function formSubmit (frm, act, mode)	{
	if (!validate(frm))	{
		return false;
	}
	frm.mode.value = mode;
	frm.action = act;
	frm.submit();
}

function selectAllInfo(oFrm, oElem)	{
	bChecked = false;
	if (oElem.checked)	{
		bChecked = true;
	}
	for (var i=0; i<oFrm.elements.length; i++)	{
		if (oFrm.elements[i].type == "checkbox")	{
			if (bChecked)	{
				oFrm.elements[i].checked = true;
			} else {
				oFrm.elements[i].checked = false;
			}
		}
	}
}

function selectAllParent(oFrm, oElem, iParent)	{
	bChecked = false;
	if (oElem.checked)	{
		bChecked = true;
	}
	for (var i=0; i<oFrm.elements.length; i++)	{
		if (oFrm.elements[i].value.indexOf("_") > -1)	{
			tmp = oFrm.elements[i].value.split("_");
			if (tmp[0] == iParent)	{
				if (bChecked)	{
					oFrm.elements[i].checked = true;
				} else {
					oFrm.elements[i].checked = false;
				}
			}
		}
	}
}

function newWindow	(url, name, scroll, w, h, menu, resize, tool)	{
	return window.open(""+url+"", ""+name+"", "scrollbars="+scroll+",width="+w+",height="+h+",menubar="+menu+",resizable="+resize+",toolbar="+tool+"");
}

//******************************************************************************************
//Verisign Certificate Popup
//******************************************************************************************

function popUp(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}

function popUpSized(url, w, h)
{
	window.open(url, "new", "toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width="+w+",height="+h);
}

//******************************************************************************************
//Wizard popup windows
//******************************************************************************************

function Wizard(sFile, sName, iHeightWidth, bBars) {

	window.open("wizards/" + sFile, sName, iHeightWidth, "scrollbars=" + bBars);
	return false;
}

//******************************************************************************************
//onClick Confirm options
//******************************************************************************************




