// * Funzioni per eseguire codice sulla pressione di invio
function input_keyUpReturn(eventKeyUp, closure)
{
	if(eventKeyUp.keyCode == 13)
		closure();
}

function input_submit_onreturn(eventKeyUp, el) {
	input_keyUpReturn(eventKeyUp, function(){ el.form.submit(); });
}


// * Funzioni per il blurring

function input_blur_onfocus(el)
{
	if( !el.modificato ) 
	{
		el.modificato = true;
		el.value = '';
//		el.defColor = el.style.color;
		el.style.color = '#000';
	}
}

function input_blur_onblur(el)
{
	if(el.value == '' ) {
		el.value = el.defaultValue;
		el.modificato = false;
		el.style.color = '#777';
	}
}

function input_blur_onkeyup(el)
{
	return;
/*	el.modificato = true;*/
}


// * Funzioni di highlight per le label

function input_label_highlight_onfocus(label_id, new_style)
{
	var el = $('#'+label_id)[0];
	if( !el.defStyle )
		el.defStyle = el.style.color;
	el.style.color = new_style;
}

function input_label_highlight_onblur(label_id)
{
	var el = $('#'+label_id)[0];
	el.style.color = el.defStyle;
}

