function checkSubmit()
{
	var msg="";
	if (document.getElementById("destination").value==""){
	msg="- Indica una destinazione."
	}
	if (document.getElementById("dateFrom").value==""){
	msg+="- Indica una data dalla quale effettuare una ricerca viaggi."
	}
	if (document.getElementById("dateTo").value==""){
	msg+="\n- Indica una data fino alla quale effettuare una ricerca viaggi."
	}
				if (msg.length > 0){
				alert(msg)
				return false;
				}
				else
				{return true;}
}

function setSearchDestination( destVal ) {
            document.getElementById( "destination" ).value = destVal;
    hideDestinations();
}

function callback(depSelected)
{
	var html = [];	
	var d = document.tuiForm.destination;
	var i,m=0; 
	var str='';
	var strSelected='';
	
	html[html.length]="<table class=\"vbmenu_option_best\" align=\"left\" cellspacing=\"2\" cellpadding=\"0\" width=\"100%\" border=\"0\">"
	html[html.length]="<tr valign=\"top\" ><td nowrap><ul>";
	for(var i=0; i<topDest.length; i++)
	{
		if (i % 32 == 0 && i>0)	html[html.length]="</td><td nowrap>";
		str = topDest[i].value;
		if (str.toLowerCase() == depSelected.toLowerCase()) html[html.length] = "<li><a href=\"javascript:setSearchDestination('" + topDest[i].value + "')\" style='background-color:#000066'>&nbsp; " + topDest[i].name + " &nbsp;</a></li>";   
		else html[html.length] = "<li><a href=\"javascript:setSearchDestination('" + topDest[i].value + "')\">&nbsp; " + topDest[i].name + " &nbsp;</a></li>";   
   }
	html[html.length]="</ul></td></tr></table>";
	document.getElementById("displayTOP").innerHTML = html.join("");
   
	html = [];
   
	html[html.length]="<table class=\"vbmenu_option\" align=\"left\" cellspacing=\"2\" cellpadding=\"0\" width=\"100%\" border=\"0\">"
	html[html.length]="<tr><td nowrap valign=\"top\"><ul>";
	for(var i=0; i<rlmDest.length; i++)
	{
		if (i % 32 == 0 && i>0) html[html.length]="</td><td nowrap>";
		str = rlmDest[i].value;
		if (str.toLowerCase() == depSelected.toLowerCase()) html[html.length] = "<li><a href=\"javascript:setSearchDestination('" + rlmDest[i].value + "')\" style='background-color:#F88941'>&nbsp; " + rlmDest[i].name + " &nbsp;</a></li>";   
		else html[html.length] = "<li><a href=\"javascript:setSearchDestination('" + rlmDest[i].value + "')\">&nbsp; " + rlmDest[i].name + " &nbsp;</a></li>";   
	}
	html[html.length]="</ul></td></tr></table>";
	document.getElementById("displayRLM").innerHTML = html.join("");    
}



function setDepartureSelected(depSelected)
{
    var d = document.tuiForm.destination;
	var i,m=0; 
	var str='';
	var strSelected='';
	
	for(i=0; i<rlmDest.length; i++) 
	{
		str = rlmDest[i].value;
		if (str.toLowerCase() == depSelected.toLowerCase()) strSelected = rlmDest[i].name		
	}
	
	d.value = (strSelected ? strSelected : '');	
}



