<!--
var url_search='http://www.luxuryadventures.co.nz/';
//var url_search='http://localhost/luxury/nouveau/';

function affichage(div,texte) { document.getElementById(div).innerHTML=texte; }

function file(fichier) {
        if(window.XMLHttpRequest) { xhr_object=new XMLHttpRequest(); } // FIREFOX
        else if(window.ActiveXObject) { xhr_object=new ActiveXObject("Microsoft.XMLHTTP"); } // IE
        else { return(false); }
        xhr_object.open("GET", fichier, false);
        xhr_object.send(null);
        if(xhr_object.readyState==4) { return(xhr_object.responseText); }
        else { return(false); }
}

function search_form(get) {
        if(texte=file(url_search+'ajax.php?'+get)) { affichage("search_form",texte); }
}

function search_form2(get) {
        if(texte=file(url_search+'ajax.php?type2=1&div=2&'+get)) { affichage('search_form2',texte); }
}

function search_form3(get) {
        if(texte=file(url_search+'ajax.php?type2=1&div=3&'+get)) { affichage('search_form3',texte); }
}

function verif(type,div) {
        if(type=="acc") {
                search_form('type='+type+'&page=1&ok=1&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value+'&region='+document.forms.search.region[document.forms.search.region.selectedIndex].value+'&acc_type='+document.forms.search.acc_type[document.forms.search.acc_type.selectedIndex].value);
        }
        else if(type=="boa") {
                if(document.forms.search.region) {
                   search_form('type='+type+'&page=1&ok=1&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value+'&region='+document.forms.search.region[document.forms.search.region.selectedIndex].value+'&length_boat='+document.forms.search.length_boat[document.forms.search.length_boat.selectedIndex].value+'&type_boat='+document.forms.search.type_boat[document.forms.search.type_boat.selectedIndex].value);
                }
                else { alert('This country has no cruising ground.'); }
        }
        else if(type=="act") {
                search_form('type='+type+'&page=1&ok=1&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value+'&region='+document.forms.search.region[document.forms.search.region.selectedIndex].value);
        }
        else if(type=="eve") {
                search_form('type='+type+'&page=1&ok=1&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value+'&region='+document.forms.search.region[document.forms.search.region.selectedIndex].value+'&category='+document.forms.search.category[document.forms.search.category.selectedIndex].value+'&date_s='+document.forms.search.day_s[document.forms.search.day_s.selectedIndex].value+'/'+document.forms.search.month_s[document.forms.search.month_s.selectedIndex].value+'/'+document.forms.search.year_s[document.forms.search.year_s.selectedIndex].value+'&date_e='+document.forms.search.day_e[document.forms.search.day_e.selectedIndex].value+'/'+document.forms.search.month_e[document.forms.search.month_e.selectedIndex].value+'/'+document.forms.search.year_e[document.forms.search.year_e.selectedIndex].value);
        }
        else if(type=="off") {
                if(document.forms.search.offer_type[document.forms.search.offer_type.selectedIndex].value=='acc') { search_form('type='+type+'&page=1&ok=1&offer_type='+document.forms.search.offer_type[document.forms.search.offer_type.selectedIndex].value+'&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value+'&region='+document.forms.search.region[document.forms.search.region.selectedIndex].value); }
                else { search_form('type='+type+'&page=1&ok=1&offer_type='+document.forms.search.offer_type[document.forms.search.offer_type.selectedIndex].value+'&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value); }
        }
        else if(type=="exc") {
                if(document.forms.search.exc_type[document.forms.search.exc_type.selectedIndex].value=='acc') { search_form('type='+type+'&page=1&ok=1&exc_type='+document.forms.search.exc_type[document.forms.search.exc_type.selectedIndex].value+'&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value+'&region='+document.forms.search.region[document.forms.search.region.selectedIndex].value); }
                else { search_form('type='+type+'&page=1&ok=1&exc_type='+document.forms.search.exc_type[document.forms.search.exc_type.selectedIndex].value+'&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value); }
        }
        else {
                var la_chaine="";
                for(i=0;i<document.forms.search.destination.length;i++) {
                    if(document.forms.search.destination[i].selected==true) {
                       if(la_chaine!="") { la_chaine=la_chaine+","; }
                       la_chaine=la_chaine+document.forms.search.destination[i].value;
                    }
                }
                search_form('destis='+la_chaine+'&type='+type+'&page=1&ok=1&destination='+document.forms.search.destination[document.forms.search.destination.selectedIndex].value+'&nights='+document.forms.search.nights[document.forms.search.nights.selectedIndex].value+'&pac_type='+document.forms.search.pac_type[document.forms.search.pac_type.selectedIndex].value);
        }
}

function verif2(type,div) {
        document.forms["search"+div].type.value=type;
        var page=document.createElement('input');
        page.setAttribute("type","hidden" );
        page.setAttribute("name","page");
        page.setAttribute("value","1");
        if(type=="pac") {
           var la_chaine="";
           //document.forms["search"+div].destination.name="destination[]";
           for(i=0;i<document.forms["search"+div].destination.length;i++) {
               if(document.forms["search"+div].destination[i].selected==true) {
                  if(la_chaine!="") { la_chaine=la_chaine+','; }
                  la_chaine=la_chaine+document.forms["search"+div].destination[i].value;
               }
           }
           document.forms["search"+div].destis.value=la_chaine;
        }
        document.forms["search"+div].action=url_search+"search.php";
        document.forms["search"+div].submit();
}

function goto(url) {
        if(url!='') { window.location.href=url_search+url; }
}

function ajax_enquire(type,get,div) {
        if(texte=file(url_search+'form.php?type='+type+'&'+get)) { affichage(div,texte); }
}

function ajax_enquire2(select, type) {
    var tablo='';
    for(i=0;i<select.options.length;i++) {
        if(select[i].selected==true) {
            if(tablo=='') { tablo=select[i].value; }
            else { tablo+=','+select[i].value; }
        }
    }
    if(type==1) {
        if(tablo!='All' && tablo!='') {
            if(texte=file(url_search+'form.php?type=properties&tablo='+tablo)) { affichage('properties', texte); }
        }
        else { affichage('properties', 'Please choose a country then a region first to display properties.<br /><br />') }
    }
    if(type==2) {
        if(texte=file(url_search+'form.php?type=properties2&tablo='+tablo)) { affichage('properties', texte); }
    }
}

function ajax_act(select) {
    var tablo='';
    for(i=0;i<select.options.length;i++) {
        if(select[i].selected==true) {
        if(tablo=='') { tablo=select[i].value; }
        else { tablo+=','+select[i].value; }
        }
    }
    if(texte=file(url_search+'form.php?type=activities&tablo='+tablo)) { affichage('activities', texte); }
}

function echeck(echeck,div) {
        if(echeck) {
                if(texte=file(url_search+'form.php?type='+div)) { affichage(div,texte); }
        }
        else { affichage(div,''); }
}

function echeck2(echeck,div) {
        if(texte=file(url_search+'form.php?type='+div+'&ok='+echeck)) { affichage(div,texte); }
}

function ajax_index(country) {
        if(texte=file('./ajax2.php?type=ajax_index&country='+country)) { affichage("trailer_index",texte); }
}
-->
