function performAction(action) {
	// ASSIGN THE ACTION
	var action = action;
	
	// UPDATE THE HIDDEN FIELD
	document.getElementById("action").value = action;
	
	switch(action) {
		case "back":
			// SUBMIT THE FORM
			document.adminform.submit();
			break;
		case "edit":
			//we get an array with every input contained into the form, and the form have an id
			var aryCheck=document.getElementById('adminform').getElementsByTagName('input');

			//now we parse them
			var elm=null;
			var total=0;
			
			for(cptCnt=0;cptCnt<aryCheck.length;cptCnt++) {
				elm=aryCheck[cptCnt];
				if(elm.type=='checkbox') {
					//we have a checkbox here
					if(elm.checked==true){
						total++;
					}
				}
			}
			if(total > 1) {
				alert("You can only edit one record at a time");
			}
			else if(total == 0) {
				alert("You didn't select a record");
			}
			else {
				document.adminform.submit();
			}
			break;
		case "delete":
			//we get an array with every input contained into the form, and the form have an id
			var aryCheck=document.getElementById('adminform').getElementsByTagName('input');

			//now we parse them
			var elm=null;
			var total=0;
			
			for(cptCnt=0;cptCnt<aryCheck.length;cptCnt++) {
				elm=aryCheck[cptCnt];
				if(elm.type=='checkbox') {
					//we have a checkbox here
					if(elm.checked==true){
						total++;
					}
				}
			}
			if(total > 0) {
				if(confirm("Are you sure you want to delete the selected records?")) {
					// SUBMIT THE FORM
					document.adminform.submit();
				}
			}
			else {
				alert("You didn't select any records");
			}
			break;
		case "add":
		case "send":
		case "save":
		case "reply":
			// SUBMIT THE FORM
			document.adminform.submit();
			break;
		case "deletemsg":
			if(confirm("Are you sure you want to delete the selected records?")) {
				// SUBMIT THE FORM
				document.adminform.submit();
			}
			break;
		default:
	}
}
