
dom = (document.getElementById)? true : false;
ie4 = (document.all)? true : false;
ns4 = (document.layers)? true : false;

check = []; //this is an array that stores all the true/false values for each checkbox

function checkBox(id)
    {

   if(dom){
    if(check[id] != true) //if a value is not true, use this rather than == false
        {
        document.getElementById('imgCheck' + id).src = "/media/true.png"; //change the image
        document.getElementById('inputCheck' + id).value = "true"; //change the field value
        check[id] = true; //change the value for this checkbox in the array
        }
    else
        {
        document.getElementById('imgCheck' + id).src = "/media/false.png";
        document.getElementById('inputCheck' + id).value = "false";
        check[id] = false;
        }
      } else {
        if(check[id] != true) //if a value is not true, use this rather than == false
                {
                document.layers('imgCheck' + id).src = "/media/true.png"; //change the image
                document.layers('inputCheck' + id).value = "true"; //change the field value
                check[id] = true; //change the value for this checkbox in the array
                }
            else
                {
                document.layers('imgCheck' + id).src = "/media/false.png";
                document.layers('inputCheck' + id).value = "false";
                check[id] = false;
                }
        }
    }

    
function confirmText(text, url)
{
	var confirm_button = confirm(text);
	if (confirm_button)
	{	
		location.href = url;
	}

}