/* Functions */
function confirm_deletion(which,id,page,label,vars){
	var input_box=confirm("Are you sure you want to delete this "+label+"?");
	if (input_box==true){
		if(vars)
		 	window.location = page+"&d"+which+"="+id;
		else
			window.location = page+"?d"+which+"="+id;
	} else {
		//do nothing
	}
}

function maskEmail(user,site,message){
	document.write('<a href=\"mailto:'+ user + '@' + site + '\">'); 
	document.write(message+'</a>');
}
function forceMaxLength(obj, maxlength){
	if (obj.value.length > maxlength)
		obj.value = obj.value.substring(0,maxlength)
}

function clearInput(obj){
	obj.value = "";
}
function checkInput(obj,value){
	if(obj.value == "")
		obj.value = value;
	else if(obj.value == value)
		obj.value = "";
}

function get_radio_value(element){
for (var i=0; i < element.length; i++)
   {
   if (element[i].checked)
      {
      return element[i].value;
      }
   }
}

function skipField(len, cur, next){
	if(cur.value.length==len) next.focus();
}
