function form_checkall(theform, value) {
	var z = 0;
	for(z=0; z<theform.length; z++){
		if(theform[z].type == 'checkbox') {
			theform[z].checked = value;
		}
	}
}
function form_inverse(theform) {
	var z = 0;
	for(z=0; z<theform.length; z++){
		if(theform[z].type == 'checkbox') {
			if (theform[z].checked==1) theform[z].checked=0;
			else theform[z].checked=1;
				
		}
	}
}

function toggleDiv(divid) {
	if(document.getElementById(divid).style.display == 'none'){
		document.getElementById(divid).style.display = 'block';
	} else {
		document.getElementById(divid).style.display = 'none';
	}
}

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}