function addTappa(pane, address, bComeBack, bCheckFromApt) {
	var myContent = dijit.byId(pane + 'Content');
	var myDivContent = dijit.byId(pane);
	var waDate = new Date;
	
	// DATI TAPPA
	nAd	= document.getElementById('ADULTS_iti').value;
	nCh	= document.getElementById('CHILDS_iti').value;
	nIf	= document.getElementById('INFANTS_iti').value;
	arrayRoomTypes = getElementsByAttribute('id', 'RoomType_iti', 'select');
	if (arrayRoomTypes.length > 0) {
		lstRoomTypes = "";
		for (var n=0; n < arrayRoomTypes.length; n++) {
			lstRoomTypes += arrayRoomTypes[n].options[arrayRoomTypes[n].selectedIndex].value;
			if (n<arrayRoomTypes.length-1)
				lstRoomTypes += ',';			
		}		
	} else  {	
		lstRoomTypes = document.getElementById('RoomType').value;
	}
	
	objTravelBy = document.getElementById('travelBy');
	objFirstApt = document.getElementById('firstApt');
	objLastApt = document.getElementById('LastApt');
	objLastAptFrom = document.getElementById('LastAptFrom');
	lstPkDest = document.getElementById('SRC_PRP_1iti').value;
	descDest = document.getElementById('SRC_PRP_1iti_desc').value;
	destNoApt = document.getElementById('SRC_PRP_1iti_noapt').value;

	if(bCheckFromApt && objLastAptFrom.selectedIndex == 0 && opt.form.getCheckboxValues('travelBy')=='fly') {
		if(bComeBack){
			document.getElementById('btnToCall').value = 'btnComeBack';	
			document.getElementById('lblDescAptTo').innerHTML = objLastApt.options[objLastApt.selectedIndex].text;
		}else{
			document.getElementById('lblDescAptTo').innerHTML = descDest;
		}	
	
		dijit.byId('AptFromdlg').show();
	} else  {	
		
		strAddress = address +"&lstPkDest="+ lstPkDest + "&ADULTS="+nAd+"&CHILDS="+nCh+"&INFANTS="+nIf+"&RoomType="+lstRoomTypes;
		if(destNoApt != '')
			strAddress = strAddress + "&NOAPT=1";
		
		//DATE
		objStartDate = dijit.byId("startDateIti");
		
		ggIti = document.getElementById('gg_iti').value;
		startDate = dateFormat(objStartDate.getValue(), 'dd/MM/yyyy');
		dataOrder = dateFormat(objStartDate.getValue(), 'yyyyMMdd');
		endDate = dateFormat(dojo.date.add(objStartDate.getValue(), 'day', parseInt(ggIti)), 'dd/MM/yyyy');
		if(objLastAptFrom != undefined)	 {
			objDateLastAptFrom = dijit.byId("DateLastAptFrom");		
			if(objDateLastAptFrom != undefined)
			startDate = dateFormat(objDateLastAptFrom.getValue(), 'dd/MM/yyyy');
		}	
		strAddress = strAddress + "&duration="+ggIti+"&startDate="+startDate+"&endDate="+endDate+"&dataorder="+dataOrder;	
		
		//TRASPORTO
		if(objLastAptFrom != undefined && opt.form.getCheckboxValues('travelBy')=='fly')	//Inserisco i dati per la citta' di partenza di un volo dove non c'e' apt nella tappa precedente	
			strAddress = strAddress + '&LastAptFrom='+ objLastAptFrom.options[objLastAptFrom.selectedIndex].value + '&LastAptFromDesc='+ objLastAptFrom.options[objLastAptFrom.selectedIndex].text;		
		if(objFirstApt != undefined)				
			strAddress = strAddress+'&AptDept='+ objFirstApt.options[objFirstApt.selectedIndex].value + '&AptDeptCod='+ objFirstApt.options[objFirstApt.selectedIndex].getAttribute('opt:codApt') +'&AptDeptDesc='+ objFirstApt.options[objFirstApt.selectedIndex].text;	
		if(objLastApt != undefined && bComeBack) {

			strAddress = strAddress+'&Tipo=fly&DESCPROD=fly&AptArr='+ objLastApt.options[objLastApt.selectedIndex].value + '&AptArrCod='+ objLastApt.options[objLastApt.selectedIndex].getAttribute('opt:codApt') +'&AptArrDesc='+ objLastApt.options[objLastApt.selectedIndex].text;		
		}
		else  {	
			if(objTravelBy != undefined)				
				strAddress = strAddress+'&TravelBy='+ opt.form.getCheckboxValues('travelBy');	
				
			//INSERIMENTO TAPPA
				strAddress = strAddress + "&DESCPROD="+ descDest+"&Tipo=Tappa";	
		}		
		myContent.setHref(strAddress+'&time='+waDate);	
	}		
}

