/************************************************************************************
Funzione per visualizzare
************************************************************************************/
function vis_it(id) {
	document.getElementById(id).style.visibility = "visible";
}
/************************************************************************************
Funzione per nascondere
************************************************************************************/
function hid_it(id) {
	document.getElementById(id).style.visibility = "hidden";
}
/************************************************************************************
Funzione per muovere
************************************************************************************/
function mov_it(id, x, y) {
	document.getElementById(id).style.top = y;
	document.getElementById(id).style.left = x;
}
/************************************************************************************
Funzione per il bordo del giorno selezionato
************************************************************************************/
function bord_it(id, x, y){
mov_it(id, x, y)
vis_it(id);
}

var gp=new Array(); 
function out_arr(el,arr){
	nar=new Array();
	for (i=0; i<arr.length; i++){
		if(arr[i]!=el){p=nar.push(arr[i]);}
	} 
	gp=nar;
}
function prenota(id) {
	os=document.getElementById(id).style;
	if(os.backgroundColor==''){os.backgroundColor='rgb(255,182,109)';gp.push(id);}
	else{os.backgroundColor='';out_arr(id,gp);}
}

function set_cal(i)
{
	check=true;
	obj=document.forms.setCal;
	if(gp.length<1){alert("Devi selezionare almeno un giorno!\n(Clicca sul calendario)");check=false;}
	gp.sort();
	obj.giorni.value=gp.join("-");
	obj.tipo.value=i;
	if(check==true){
		obj.submit();
	}	
}

