
//Check and Uncheck Checkboxes
//Call fucntion:
//              checkallflds(document.formname.fieldname)

function checkallflds(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true
}

function uncheckallflds(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = false
}

//=============================
//====Confirm Function=========
//====Call Function:
//====              confirmaction("pagetomoveto.asp")
function confirmaction(page,msg)
{
if (confirm(msg))
self.location.href=page
else
alert("Action was Canceled")
}
//============================

//=============================
//====Redirect Funtion=========
//==Simple Redirect in Java
//====Call Function:
//====              redirect("pagetomoveto.asp")

function redirect(page)
{
self.location.href=page
}
//============================
function digitsonly(evt){
	evt = (evt) ? evt : event;
	var charCode = (evt.which) ? evt.which : evt.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		status = "This field accepts numbers only."
		return false
	}
	status = ""
	return true
	
}
function digitsonlychange(tempfield){

	var charCode1,temp
	num = Array("1","2","3","4","5","6","7","8","9","0");
	charCode1 = ""
	for (x=0;x < tempfield.value.length;x++) {
		temp = tempfield.value.substr(x,1);
		for (y=0;y < 10;y++) {	if (temp == num[y]) {charCode1 += temp}	}
		}
tempfield.value = charCode1;
}
function phoneformat(temp){
	evt = temp.event;
	something = temp.value;
	max = temp.value.length;
	if (digitsonly(evt)) {
		if (max > 0) {
		
		 something= something.replace("(","");
		something = "(" + something ;
		max = something.length }
		if (max > 3) {
		something = something.replace(")","");
		
		something = something.substr(0,4) + ")" + something.substr(4,max); 
		max = something.length}
		
		if (max > 7) {something = something.replace("-","");something = something.substr(0,8) + "-" + something.substr(8,max);max = something.length }
		temp.value = something;
		if (max > 12) {return false}
		
	}else {return false}

}
