﻿if (typeof (HotelsInfoControl) == 'undefined') {


	Type.registerNamespace("HotelsInfoControl");

	HotelsInfoControl.Feed = function(element) {
		HotelsInfoControl.Feed.initializeBase(this, [element]);

		this._service = new RoutenetFeedService();
		this._service.set_defaultUserContext(this);
		this._service.set_defaultSucceededCallback(this.ServiceCallbackSucceeded);
		this._service.set_defaultFailedCallback(this.ServiceCallbackFailed);
		this._service.set_timeout(10000);
		this._language = 'nl';

		this._pagesize = 10;
		this._currentindex = 0;
		this._rect = null;


	};



	HotelsInfoControl.Feed.prototype = {
		initialize: function() {
			HotelsInfoControl.Feed.callBaseMethod(this, "initialize");
		},
		dispose: function() {
			HotelsInfoControl.Feed.callBaseMethod(this, "dispose");
		},

		get_pagesize: function() {
			return this._pagesize;
		},
		set_pagesize: function(value) {
			this._pagesize = value;
		},

		get_currentindex: function() {
			return this._currentindex;
		},
		set_currentindex: function(value) {
			this._currentindex = value;
		},

		get_language: function() {
			return this._language;
		},
		set_language: function(value) {
			this._language = value;
		},

		get_rect: function() {
			return this._rect;
		},
		set_rect: function(value) {
			this._rect = value;
		},

		NextPage: function() {
			this._currentindex += this._pagesize;
			this.Update();
		},
		PrevPage: function() {
			this._currentindex -= this._pagesize;
			this.Update();
		},

		Update: function() {
			this._service.Hotels(TripzoomLib.Constants.USERID, this._rect.toString(), this._currentindex, this._pagesize, this._language);
		},

		ServiceCallbackSucceeded: function(result, userContext, methodName) {
			userContext.get_element().innerHTML = result.HTML;
		},
		ServiceCallbackFailed: function(error, userContext, methodName) {
		}


	};
	
	HotelsInfoControl.Feed.registerClass("HotelsInfoControl.Feed", Sys.UI.Behavior)
}


	

