function passfrm1(the_field) {
        return(the_field[the_field.selectedIndex].value);
}
function getDpt() {
        var the_date = "";
        if ( (document.frm1.dt_dpt_dd.selectedIndex > 0) && (document.frm1.dt_dpt_mm.selectedIndex > 0) && (document.frm1.dt_dpt_yy.selectedIndex > 0) ) {
                the_date = passfrm1(document.frm1.dt_dpt_yy) + "-" + passfrm1(document.frm1.dt_dpt_mm) + "-" + passfrm1(document.frm1.dt_dpt_dd);
        }
        return(the_date);
}
function getRet() {
        var the_date = "";
        if ( (document.frm1.dt_ret_dd.selectedIndex > 0) && (document.frm1.dt_ret_mm.selectedIndex > 0) && (document.frm1.dt_ret_yy.selectedIndex > 0) ) {
                the_date = passfrm1(document.frm1.dt_ret_yy) + "-" + passfrm1(document.frm1.dt_ret_mm) + "-" + passfrm1(document.frm1.dt_ret_dd);
        }
        return(the_date);
}
function appbox() {
        var Dpt_dt = getDpt();
        var Ret_dt = getRet();
        var dest = document.frm1.dest_city_par.value;
        var gw = document.frm1.dept_city_par.value;
        var adults = passfrm1(document.frm1.adults);
        var kids = passfrm1(document.frm1.kids);

        var link = "http://partners.kcdataservices.com/web30/custom/buildMyOwn.jsp?agn_id=00593482&ui_path=femtrip2";
        link = link + "&Adults=" + adults;
        link = link + "&kids=" + kids;
        if (dest!="") link = link + "&Destination=" + dest;
        if (gw!="") link = link + "&Gateway=" + gw;
        if (Dpt_dt!="") link = link + "&Depart=" + Dpt_dt;
        if (Ret_dt!="") link = link + "&Return=" + Ret_dt;
        mywin = window.open(link ,'apple_link');
}