<!--

function toggle(box,theId) {
   if(document.getElementById) {
      var cell = document.getElementById(theId);
      if(box.checked) {
         cell.className = "on";
      }
      else {
         cell.className = "off";
      }
   }
}


function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function popup(theURL,winName,features) {
  window.open(theURL,winName,features);
}

// countdown for text field
function textCounter(field,cntfield,maxlimit) {
  if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
  // otherwise, update 'characters left' counter
  else
    cntfield.value = maxlimit - field.value.length;
}

function textCountdown(field, cntfield, maxlimit) 
{
 	if (field.value.length > maxlimit) // if too long...trim it!
	{  
		field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	} else {
    	cntfield.value = maxlimit - field.value.length;
	}
}

function check() 
{
	var SelectedIndex = document.getElementById("status").selectedIndex;  // The number of the selected option
	var Selected = document.getElementById("status").options[SelectedIndex].value;  // The value of the selected option above
// The above two lines can be combined into one as follows:
//	var Selected = document.getElementById("new_value").options[document.getElementById("new_value").selectedIndex].value;
	if (Selected=='none'){
  		alert('You must select a new status for the selected item(s)');  // Show error message
	}
	else{
  		if(confirm('do you really want to change these items?')){  // Ask for confirmation
			return true;  // True is returned if confirmation is given and form is submitted
		}
	}
    return false;  // False is returned if either: a) no option is selected; b) Confirmation is cancelled
}


function checkAll(form)
{
	var inputs =  document.getElementsByTagName('input');
	for (var i = 0; i < inputs.length; i++)
	{
		if ((inputs[i].type == 'checkbox') && (inputs[i].name == 'id[]'))
		{
			inputs[i].checked = true;
		}
	}
}


function uncheckAll(field)
{
		var inputs =  document.getElementsByTagName('input');
	for (var i = 0; i < inputs.length; i++)
	{
		if ((inputs[i].type == 'checkbox') && (inputs[i].name == 'id[]'))
		{
			inputs[i].checked = false;
		}
	}
}


// Checks for terms and conditions to validate registration form
function selectterms(form) {
	if(!document.register.terms.checked){
		alert("You must tick the Agree to Terms of Use to complete registration.");
	return false; }
return true;
}
	
// -->