function moveArrow(where, who, motore) {
	var getID = document.getElementById('arrow');
	getID.style.left = where+"px";

	if (document.getElementById(who)){
		var getIDSezione = document.getElementById(who);
		getIDSezione.id = who+"Sel";
	}
	unSel(who);
	showMotore(motore);
}

/* funzione aggiunta */
function showMotoreMini(who, motore) {
	if (document.getElementById(who)){
		var getIDSezione = document.getElementById(who);
		getIDSezione.id = who+"Sel";
	}
	
	unSel(who);
	showMotore(motore);
}
/* ----------------- */
function unSel(who) {
	for (i = 1; i <= 6; i++) {
		if (document.getElementById('sez'+i+'Sel')){
			var getIDSez = document.getElementById('sez'+i+'Sel');
			
			if(getIDSez.id != who+'Sel')
				getIDSez.id = 'sez'+i;
		}
	}
}

function showMotore(motore) {
	var getMotore = document.getElementById(motore);
	getMotore.style.display = "";
	
	for (i = 1; i <= 6; i++) {
		var getIDMotore = document.getElementById('motore'+i);
		
		if(getIDMotore.id != motore)
			getIDMotore.style.display = 'none';
	}
}

function selTab(counter, whichTab) {
	if (document.getElementById(whichTab)) {
		var toSel = document.getElementById(whichTab);
		//alert(toSel.style.backgroundPosition);
		toSel.className = 'sel';
		toSel.style.backgroundPosition = '0 0';
		
		var toShow = document.getElementById(whichTab+'Content');
		toShow.style.display =  '';
	}
	if(whichTab.indexOf('Top') > -1) {
		toSel.className = 'HdrTop sel';
		unSelTabTop(counter, whichTab);	
	}
	else {	
		unSelTab(counter, whichTab);
	}
}

function unSelTab(counter, whichTab) {
	for (i = 1; i <= counter; i++) {
		if (document.getElementById('tab'+i)) {
			var getIDTab = document.getElementById('tab'+i);
			var getIDTabToShow = document.getElementById('tab'+i+'Content');
			
			if(getIDTab.id != whichTab) {
				getIDTab.className = 'unsel';
				getIDTab.style.backgroundPosition = '0 -29px';
			}
			if(getIDTabToShow.id != (whichTab+'Content')) {
				getIDTabToShow.style.display = 'none';
			}
		}
	}
}

function unSelTabTop(counter, whichTab) {	
	for (i = 1; i <= counter; i++) {		
		if (document.getElementById('tab'+i+'Top')) {
			var getIDTab = document.getElementById('tab'+i+'Top');
			var getIDTabToShow = document.getElementById('tab'+i+'TopContent');
			
			if(getIDTab.id != whichTab) {
				getIDTab.className = 'HdrTop unsel';
				getIDTab.style.backgroundPosition = '0 -29px';
			}
			if(getIDTabToShow.id != (whichTab+'Content')) {
				getIDTabToShow.style.display = 'none';
			}
		}
	}
}

function SetupRoundTrip(inputDate) {
	var getDateReturn = document.getElementById(inputDate);
	getDateReturn.style.display = '';
}
	
function SetupOneWay(inputDate) {
	var getDateReturn = document.getElementById(inputDate);
	getDateReturn.style.display = 'none';		
}

$('.include-search').live('click',function(){
	if($(this).prev().hasClass('jqTransformChecked')) {
		$(this).val('no');
	}
	else {
		$(this).val('yes');
	}		
});

$(function(){
	$('#VacanzeLat-Destination').click(function(){ $(this).val(''); });	
	$('#VoliLat-DepartCity').click(function(){ $(this).val(''); });	
	$('#VoliLat-ArrivalCity').click(function(){ $(this).val(''); });		
	$('#HotelLat-destination').click(function(){ $(this).val(''); });	
	$('#VoliHotelLat-DepartCity').click(function(){ $(this).val(''); });
	$('#VoliHotelLat-ArrivalCity').click(function(){ $(this).val(''); });
	$('#OstelliLat-destination').click(function(){ $(this).val(''); });	
	$('#Lat-PickUpLocation').click(function(){ $(this).val(''); });
});

$(function(){
	$('#Leonardo_Navigation-Logo').html('<a title="Visita Leonardo.it" href="http://www.leonardo.it" target="_blank"><span>Leonardo.it</span></a>').css('background-image', 'url("http://www.europelowcost.com/images/LeonardoLogoGrey.png")');
});