function validateField(thisObject, regex){
	thisObject.addEvent('change', function(){
		checkRegex(thisObject, regex)
	});
	thisObject.addEvent('blur', function(){
		checkRegex(thisObject, regex)
	});
}

function checkRegex(thisObject, regex){
	if(thisObject.get('value').match(regex))
		thisObject.setStyle('background-color', '#D2FFCF');
	else 
		thisObject.tween('background-color', '#FFCFD1');
}

function validateSelect(thisObject){
	if (thisObject.value != '')
		thisObject.setStyle('background-color', '#D2FFCF');
	else 
		thisObject.tween('background-color', '#FFCFD1');
}

