function confirmDeletion(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 replaceURLWithHTMLLinks(text){
	var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
	return text.replace(exp,"<a href='$1' target='_blank'>$1</a>"); 
}
