// ####################################################################
// Checks/unchecks checkboxes 
// ----
// boolean checkall()
function checkall(ownercheckbox,targetcheckbox,formname)
	{	
    // Always forms[0] has been taken because there are more than
    // one forms with the same name in the page. This is causing
    // conflicts. The listing which includes the form should be
    // the first (index 0) form in the page for this function to 
    // work.
    var elts      = document.forms[0].elements[targetcheckbox];
    var elts_cnt  = elts.length;
    var do_check  = true;

    owner_checkbox = document.forms[0].elements[ownercheckbox];

	if (owner_checkbox.checked == true)
        {
        do_check = true;
        }
    else
        {
        do_check = false;
        }
    
    for (var i = 0; i < elts_cnt; i++)
        {
        elts[i].checked = do_check;
        } // end for

    return true;
	}



function centeredPopUp(page,title,popWidth,popHeight) {
	//CENTER A POPUP WINDOW ON THE SCREEN
	if (! popWidth)  popWidth = 300;
	if (! popHeight) popHeight = 200;
	var xOffset = 0;
	var yOffset = 0;

	if (screen.width && screen.height) {
		xOffset = parseInt((screen.width - popWidth) / 2);
		yOffset = parseInt((screen.height - popHeight) / 3);
	}
	var ohbaby = window.open(page,title,'width=' + popWidth + ',height=' + popHeight + ',left=' + xOffset + ',top=' + yOffset + ',screenX=' + xOffset + ',screenY=' + yOffset + ',scrollbars=yes');

	return ohbaby;
}
