function swapF(from){
	
	var to;
	var setF=false;
	
	if(from.type=='password'){
		to=from.form.pass_hoster;
	}
	else {
		to=from.form.password;
		setF=true;
	}
	if(setF || from.value==''){
		// swappa solo se:
		// e' da settare il focus (quindi to e' pass_hoster)
		// oppure non viene inserito valore nel campo passwod
		to.style.display='block';
		from.style.display='none';
	}
	if(setF) to.focus();
	
}

function refreshLoginDatas(){
	sndReq(http_img_circuito_home, 'libs/rpc/index.php', 'img_circuito_home', '' ,'img_circuito_home');
	sndReq(http_event_countdown_home, 'libs/rpc/index.php', 'event_countdown_home', '' ,'event_countdown_home');
	sndReq(http_event_title_home, 'libs/rpc/index.php', 'event_title_home', '' ,'event_title_home');
	//sndReq(http_partecipants_home, 'libs/rpc/index.php', 'partecipants_home', '' ,'partecipants_home');
	setTimeout('refreshLoginDatas()',5000);
}

function refreshIndexDatas(){
		
	sndReq(http_event_countdown_index, 'libs/rpc/index.php', 'event_countdown_index', '' ,'event_countdown_index');
	sndReq(http_datetime_f_index, 'libs/rpc/index.php', 'datetime_f_index', '' ,'datetime_f_index');
	
	if (document.getElementById('event_countdown_livegpsc')) {
		sndReq(http_event_countdown_livegpsc, 'libs/rpc/index.php', 'event_countdown_livegpsc', '' ,'event_countdown_livegpsc');
	}
	
	//sndReq(http_online_sx, 'libs/rpc/index.php', 'online_sx', '' ,'online_sx');
	
	setTimeout('refreshIndexDatas()',5000);
}

function textarea_ismaxlength(obj){
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength)
	obj.value=obj.value.substring(0,mlength)
}

// #TMP_DEVTIME
function tmp_refreshLoginDatas(){
	sndReq(http_tmp_event_countdown_home, 'libs/rpc/index.php', 'tmp_event_countdown_home', '' ,'tmp_event_countdown_home');
	setTimeout('tmp_refreshLoginDatas()',5000);
}
