// JavaScript Document
/*
 * // $RCSfile: specialoffers-ajax.js,v $
// $Source: /cvs/cyplonweb-live/specialoffers-ajax.js,v $, $Revision: 1.1 $, $Date: 2010/07/12 10:30:12 $, $State: Exp $
 */

Event.observe(window, 'load', function() {
    var country = $('selLuxCountry');
    if(country)  { // we have already chosen a country
        /*country.observe('change', function() {
                this.form.submit();
            });*/

        bpResortBind();
    }
});

function bpResortSubmit() {
    var form = $('frmLuxResort');
    var params = form.serialize();
    var ajax = new Ajax.Updater(
        'content',
        'luxury-offers',
        { method: 'get', parameters: params, onComplete: bpResortBind, encoding: 'ISO-8859-1'}
    );
}

function bpResortBind() {
    $('selLuxCountry').observe('change', function() {
            this.form.submit();
        });
            
    $$('input.resort').each(function(elt){
            elt.observe('click', bpResortSubmit)
        });
}