/**
 * Function preFillInput(...) is used to add text to Input Box witch will be removed on focus and added on blur if input is empty
 * Usage: preFillInput(inputId, emptyText) => inputId : id of the Input Box; emptyText : text that will be used for swaping
 * Example: preFillInput('newsletter', 'e-mail ...');
 */

function preFillInput(inputId, emptyText){
	var inputElm = $(inputId);
	if(inputElm.value == ''){ inputElm.value = emptyText; };
	Event.observe(inputElm, 'focus', function(){ if(inputElm.value == emptyText){ inputElm.value = ''; } });
	Event.observe(inputElm, 'blur', function(){ if(inputElm.value == ''){ inputElm.value = emptyText; } });
}

function preventDef(e) {
	if (!e)
		event.returnValue = false;
	else
		e.preventDefault();
	return false;
}
