//Snap javascript code.

//Toggle the checkbox when image/checkbox is clicked
//and change the class to a 'selected' class.
function snap_item_toggle(item) 
{
	//select the checkbox and item
	this_checkbox = document.getElementById('snap_checkbox_' + item);
	this_item = document.getElementById('snap_item_' + item);
	
	if (this_checkbox.checked) 
	{
		this_checkbox.checked = false;
		this_item.className = 'snap_item';
	} 
	else 
	{
		this_checkbox.checked = true;
		this_item.className = 'snap_item_checked';
	}
}

function hide_checkboxes()
{
	//Select the form
	var theForm = document.forms[0]

	//cycle through the form elements
	for(i=0; i<theForm.elements.length; i++)
	{
			//if the element is a checkbox...
			if(theForm.elements[i].type == "checkbox")
      {
      	theForm.elements[i].checked=false;				//uncheck the box
      	theForm.elements[i].style.display="none"	//hide the element
			}   
   }	
}