function showFL(details){
guindou = open(details, "FLDetails", "toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=no,width=540,height=440")
if(navigator.appName == "Netscape")
guindou.focus()
}

var num_field
function NumFields(name){
var index
var formLength = document.forms[0].elements.length
for(n = 0;n < formLength;n ++){
if(document.forms[0].elements[n].name == name)
index = n
}
return(index)
}

// PTRs1038075
function GoToAirAuxWin(n, page) {
indexAirlines = NumFields('AIRLINE_1')
GoToAuxWin(n, page)
}
// PTRe1038075

function GoToAuxWin(n, page){
numero = n
i = page.indexOf("/")
if(i >= 0){
if(page.substring(0,i) == "LangDir"){
whole_url = document.URL
page = whole_url.substring(0,whole_url.lastIndexOf("/")) + page.substring(i,page.length)
}
}
else
page = "/pl/" + page
listin = open(page, "", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=320,height=300")
if(navigator.appName == "Netscape")
listin.focus()
}

function ErrorWindow(cadena){
var parameter = cadena
newWindow = window.open("error.htm","newWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=320,height=325")
if(navigator.appName == "Netscape")
newWindow.focus()
}

function CheckDates(month, day, year, returning){
var year = parseInt(year)
var leap_year = (year % 4 == 0 & year % 100 != 0) || (year % 400 == 0)
if(month == "02" && (day == "30" || day == "29") && !leap_year){
if(returning == 0)
return "<li> Invalid departure date."
else
return "<li> Invalid return date."
}
var comp1 = (month == "02" || month == "04" || month == "06" || month == "09" || month == "11")
var comp2 = (day == "31")
if(comp1 && comp2){
if(returning == 0)
return "<li> Invalid departure date."
else
return "<li> Invalid return date."
}
else
return ""
}

function CheckFields(myfieldsarray, myvarsarray){
for(n = 0;n < document.forms[0].elements.length;n ++){
var elementName = document.forms[0].elements[n].name
for(j = 0;j < myfieldsarray.length;j ++){
if(elementName == myfieldsarray[j])
eval(myvarsarray[j] + " = n")
}
}
}

function ShowFlightInfo(details){
guindou = window.open(details, "", "toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=600,height=450")
if(navigator.appName == "Netscape")
guindou.focus()
}

function ShowPopupTripElementDetail(urlParam){
guindou = window.open(urlParam, "","toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=no,width=545,height=400")
if(navigator.appName == "Netscape")
guindou.focus()
}

function CheckFieldsNew(name){
for(n = 0;n < document.forms[0].elements.length;n ++){
var elementName = document.forms[0].elements[n].name
if(elementName == name)
indexHotel = n
}
}

function GoToAuxWinNew(n, page,name){
CheckFieldsNew(name)
numero = n
i = page.indexOf("/")
if(i >= 0){
if(page.substring(0,i) == "LangDir"){
whole_url = document.URL
page = whole_url.substring(0,whole_url.lastIndexOf("/")) + page.substring(i,page.length)
}
}else
page = "/pl/" + page
listin = open(page, "", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=320,height=300")
if(navigator.appName == "Netscape")
listin.focus()
}

function existsincombo(mystring, mycombo, textorvalue){
for(i = 0;i < mycombo.length;i ++){
if(textorvalue == "text" && mycombo.options[i].text == mystring)
return true
if(textorvalue == "value" && mycombo.options[i].value == mystring)
return true
}
return false
}

function addoptionatthebegin(mytext, myvalue, mycombo){
var keepselectedindex = mycombo.selectedIndex
mycombo.options[mycombo.options.length] = new Option(mycombo.options[mycombo.options.length - 1].text,mycombo.options[mycombo.options.length - 1].value,false,false)
for(i = mycombo.length - 2;i >= 0;i --){
mycombo.options[i+1].text = mycombo.options[i].text
mycombo.options[i+1].value = mycombo.options[i].value
}
var myoption = new Option(mytext, myvalue, false, false)
myoption.selected = false
mycombo.options[0] = myoption
mycombo.options[keepselectedindex].defaultSelected = true
mycombo.selectedIndex = keepselectedindex
}

