function showhide(action, id) {
	if (action == "show") {
		document.getElementById(id).style.display = "block";
	} else {
		document.getElementById(id).style.display = "none";
	}
}

function showhide_two(action1, id1, action2, id2) {
	showhide(action1, id1);
	showhide(action2, id2);
}


function setfield(theField, theValue) {
	theField.value = theValue;
}

function setfieldIfEmpty(theField, theValue) {
	if (theField.value == "") {
		theField.value = theValue;
	}
}

function confirmation(fraga, url) {
	var answer = confirm(fraga)
	if (answer){
		window.location = url;
	}
}

function textCounter(field,cntfield,maxlimit) {
	if (field.value.length > maxlimit)
	field.value = field.value.substring(0, maxlimit);
	else
	cntfield.value = maxlimit - field.value.length;
}

