window.onload = function() {
	new Spry.Widget.ValidationTextField("checkText1", "none", {validateOn:["change"]});
	new Spry.Widget.ValidationTextField("checkText2", "email",{validateOn:["change"]});
	new Spry.Widget.ValidationTextarea("checkText3",{maxChars:150,validateOn:["change"]});
	new Spry.Widget.ValidationTextarea("checkText4",{maxChars:30,validateOn:["change"]});
	}

function countChars(idElement){
max_chars = 30;
counter = document.getElementById(idElement);
field = document.getElementById('text').value;
field_length = field.length;

// Calculate remaining chars
remaining_chars = max_chars-field_length;
// Update the counter on the page
counter.innerHTML = remaining_chars;
}
