function checkSubmit()
{
	var msg="";
	if (document.getElementById("DEPFROM").value==""){
	msg="- Indica una destinazione."
	}
	if (document.getElementById("depDateFrom").value==""){
	msg+="- Indica una data dalla quale effettuare una ricerca viaggi."
	}
	if (document.getElementById("depDateTo").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( "DEPFROM" ).value = destVal;
    hideDestinations();
}

function callback(depSelected)
{
	var html = [];	
	var d = document.tuiForm.DEPFROM;
	var i,m=0; 
	var str='';
	var strSelected='';
   
	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 % 18 == 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.DEPFROM;
	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 : '');	
}



function getVideo(act)
{
    if (act=='view') document.getElementById("box_video").style.visibility = 'visible'
	else document.getElementById("box_video").style.visibility = 'hidden'
}



Calendar.prototype.hide = function () 
{
	if (this.isPopup) {
		Calendar.removeEvent(document, "keydown", Calendar._keyEvent);
		Calendar.removeEvent(document, "keypress", Calendar._keyEvent);
		Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar);
	}
	this.element.style.display = "none";
	this.hidden = true;
	this.hideShowCovered();	
	getVideo('view')
};




