function selectAll(formName, that)
{
	el = document.forms[formName];
  	for (var i = 0; i < el.length; i++)
  	{
    	if (el[i].type == 'checkbox' && el[i] != that)
    	{
      		el[i].checked = !el[i].checked;
		}
	}
}

function hasSelected(formName, selAllName)
{
    el = document.forms[formName];
    for (var i = 0; i < el.length; i++)
    {
        if (el[i].type == 'checkbox' && el[i].name != selAllName && el[i].checked)
        {
            return true;
        }
    }
    return false;
    
}

function submit(form, url, selAllName, selectAlert, question)
{
    if (alert)
    {
        if (!hasSelected(form, selAllName)) 
        {
            alert(selectAlert);
            return;
        }
    }
    if (question)
    {
        if (!confirm(question)) return;
    }
       
    var submitForm = document.forms[form];
   	submitForm.action = url;
   	submitForm.submit();
}

function setColor(obj, color)
{
    obj.style.backgroundColor = color;
}
