var CountryPage = new Class({

  _jsonRequest : Class.empty,
  _country_iframe : '',
  _country_url : '',


    /*
     * initialize
     */
    initialize: function( country_iframe, country_code ) {
        this._country_iframe =  $(country_iframe);
        //init json...
        var postObject = JSON.encode({'action':'DestinationCountry', 'country_code': country_code});
        this._jsonRequest = new Request.JSON({url:'/sbeos/ajax/JsonCall.php', data: {json: postObject}, onComplete: this.retrievedData.bind(this)});
        this._jsonRequest.send();
    },

    /**
     * onComplete handler for json request
     *
     * @param {Object} jsonObj
     */
    retrievedData: function(jsonObj) {
        if (jsonObj.success == true) {
            //replace previous country
            this._country_iframe.src = jsonObj.country_url;
        }
    }
});