<!-- Begin
function inF(obj,little_help){
	obj.style.borderColor="#6C95C1";
	obj.style.backgroundColor="#E8EDF0";
	printHelp(little_help);
}

function inB(obj){
	obj.style.borderColor="#666666";
	obj.style.backgroundColor="#f6f6f6";
	printHelp('');
}
function inG(obj){
        obj.style.borderColor="#6CD162";
        obj.style.backgroundColor="#f6f6f6";
        printHelp('Format is Correct');
}

function inE(obj,little_help){
	obj.style.borderColor="red";
	obj.style.backgroundColor="#f6f6f6";
	printHelp("<font color=red>"+little_help+"</font>");
}
var state = 'hidden';

function showhide(layer_ref) {

	if (state == 'visible') {
		state = 'hidden';
	}
	else {
		state = 'visible';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
	}
	if (document.getElementById && !document.all) {
		maxwell_smart = document.getElementById(layer_ref);
		maxwell_smart.style.visibility = state;
	}
}


function checkField(obj,type){
// takes obl - html object and checks it in various ways
// type is the type of data it should be formated like
// Type:(ssn,phone,email);
    error = "0";
    switch(type){
	case "ssn":
	    if (!(/^[0-9]{3}-[0-9]{2}-[0-9]{4}$/.test(obj.value))){
 		inE(obj,"Format for SSN is XXX-XX-XXX");
		error = "1";	
	    }	
	    break;
	case "phone":
            if (!(/\d{3}-\d{3}-\d{4}$/.test(obj.value))){
        	inE(obj,"Format for Phone Number is XXX-XXX-XXX");
        	error = "1";
            }
            break;
	case "email":
            if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(obj.value))){
        	inE(obj,"Format for Email is incorrect");
        	error = "1";
            }
            break;
        case "money":
            if (!(/\$\d{1,3}(,\d{3})*\.\d{2}/.test(obj.value))){
                inE(obj,"Format for Email is incorrect");
                error = "1";
            }
            break;
        case "time":
            if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(obj.value))){
                inE(obj,"Format for Email is incorrect");
                error = "1";
            }
            break;
        case "notnull":
            if (obj.value == ""){
                inE(obj,"You cannot leave this field blank");
                error = "1";
            }
            break;

	default:
	break;
    }//end swtich
    if(error != "1"){inG(obj);}
}// End checkField

function printHelp(message){
	document.getElementById('HELP').innerHTML= ""+message+"&nbsp;";
	document.getElementById('HELP').className= "helpt";
	window.status=message;
} 
function DelRow(loc){
	if(confirm('Are you sure you want to delete this')){location.replace(""+loc+"");}
}

//  End -->
