function valFlightFreq(Type, Origin, Dest, theDay, theMonth, theYear)
{

//================================================================
//GENERATED IN VB6 - CREATION DATE:07/04/2005 10:36:52
//================================================================

//work out day of week number and search within string like:- dow number in string '12--567'
//use prefix of
//if dayofweek

var tempdate = theMonth + theYear + theDay
var mmddyyyy = tempdate.substr(0,2) + '/' + tempdate.substr(6,2) + '/' +  tempdate.substr(2,4)
var newuserdate= new Date(mmddyyyy)
var dy = newuserdate.getDay()
if (dy==0) {  //if dy is a Sunday set the value to a 7
    dy = 7
}
if (Type=='O') {  //outbound flight
    typeText='*OUTBOUND FLIGHT*\n\n'
}
if (Type=='R') {  //return flight
    typeText='*RETURN FLIGHT*\n\n'
}
var userdate = tempdate.substr(2, 4) + tempdate.substr(0, 2) + tempdate.substr(6, 2)
//----------------------------------------------------------------------------------

//===================================================
if (Origin=='BGY' && Dest=='LMP') {
    if (userdate<20050716) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 16/07/2005')
        return false
    }

    if (userdate>20050917) {
        alert(typeText + 'Attualmente su questa rotta non ci sono voli disponibili dopo il 17/09/2005')
        return false
    }

    str='     6 ';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli operano solo nei giorni sabato')
        return false
    }
}
//===================================================
if (Origin=='LMP' && Dest=='BGY') {
    if (userdate<20050716) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 16/07/2005')
        return false
    }

    if (userdate>20050917) {
        alert(typeText + 'Attualmente su questa rotta non ci sono voli disponibili dopo il 17/09/2005')
        return false
    }

    str='     6 ';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli operano solo nei giorni sabato')
        return false
    }
}
//===================================================
if (Origin=='BGY' && Dest=='PMO') {
    if (userdate<20050527) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 27/05/2005')
        return false
    }

    str='12345 7';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli operano solo nei giorni lunedi, martedi, mercoledi, giovedi, venerdi e domenica')
        return false
    }
}
//===================================================
if (Origin=='PMO' && Dest=='BGY') {
    if (userdate<20050527) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 27/05/2005')
        return false
    }

    str='12345 7';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli non operano il sabato')
        return false
    }
}
//===================================================
if (Origin=='VCE' && Dest=='NAP') {
    if (userdate<20050527) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 27/05/2005')
        return false
    }

    str=' 2 4 6 ';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli operano solo nei giorni martedi, giovedi e sabato')
        return false
    }
}
//===================================================
if (Origin=='NAP' && Dest=='VCE') {
    if (userdate<20050527) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 27/05/2005')
        return false
    }

    str=' 2 4 6 ';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli operano solo nei giorni martedi, giovedi e sabato')
        return false
    }
}
//===================================================
if (Origin=='VCE' && Dest=='CAG') {
    if (userdate<20050624) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 24/06/2005')
        return false
    }

    if (userdate>20050919) {
        alert(typeText + 'Attualmente su questa rotta non ci sono voli disponibili dopo il 19/09/2005')
        return false
    }

    str='1  4567';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli non operano nei giorni martedi e mercoledi')
        return false
    }
}
//===================================================
if (Origin=='CAG' && Dest=='VCE') {
    if (userdate<20050624) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 24/06/2005')
        return false
    }

    if (userdate>20050919) {
        alert(typeText + 'Attualmente su questa rotta non ci sono voli disponibili dopo il 19/09/2005')
        return false
    }

    str='1  4567';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli non operano nei giorni martedi e mercoledi')
        return false
    }
}
//===================================================
if (Origin=='VCE' && Dest=='ORY') {
    if (userdate<20050421) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 21/04/2005')
        return false
    }

}
//===================================================
if (Origin=='ORY' && Dest=='VCE') {
    if (userdate<20050421) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 21/04/2005')
        return false
    }

}
//===================================================
if (Origin=='NAP' && Dest=='BBU') {
    if (userdate<20050527) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 27/05/2005')
        return false
    }

    str=' 2 4 6 ';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli operano solo nei giorni martedi, giovedi e sabato')
        return false
    }
}
//===================================================
if (Origin=='BBU' && Dest=='NAP') {
    if (userdate<20050527) {
        alert(typeText + 'Su questa rotta non ci sono voli prima del 27/05/2005')
        return false
    }

    str=' 2 4 6 ';
    if (str.indexOf(dy)==-1) {
        alert(typeText + 'Sulla rotta selezionata i nostri voli operano solo nei giorni martedi, giovedi e sabato')
        return false
    }
}
return true;
}
