function passfrm1(the_field) {
        return(the_field[the_field.selectedIndex].value);
}
function getDptdd() {
        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_dd);
        }
        return(the_date);
}
function getDptmm() {
        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_mm);
        }
        return(the_date);
}
function getDptyy() {
        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);
        }
        return(the_date);
}
function getRetdd() {
        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_dd);
        }
        return(the_date);
}
function getRetmm() {
        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_mm);
        }
        return(the_date);
}
function getRetyy() {
        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);
        }
        return(the_date);
}
function appbox() {
        var Dpt_dd = getDptdd();
        var Dpt_mm = getDptmm();
        var Dpt_yy = getDptyy();
        var Ret_dd = getRetdd();
        var Ret_mm = getRetmm();
        var Ret_yy = getRetyy();
        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://www.applevacations.com/search.do?command=handleAppleVacationPackageSearch"
;
        if (Dpt_dd!="") link = link + "&departureDay=" + Dpt_dd;
        if (Dpt_mm!="") link = link + "&departureMonth=" + Dpt_mm;
        if (Dpt_yy!="") link = link + "&departureYear=" + Dpt_yy;
        link = link + "&numberOfAdults=" + adults;
        if (Ret_dd!="") link = link + "&returnDay=" + Ret_dd;
        if (Ret_mm!="") link = link + "&returnMonth=" + Ret_mm;
        if (Ret_yy!="") link = link + "&returnYear=" + Ret_yy;
        link = link + "&searchType=applePackage";
        if (dest!="") link = link + "&selectedDestination=" + dest;
        if (gw!="") link = link + "&selectedGateway=" + gw;
        link = link + "&agentId=00593482";
        mywin = window.open(link ,'apple_link');
}