function Gallery(updateHtmlElement, variableGalleryName, galcId)
{
    this.updateHtmlElement			= updateHtmlElement;
    this.variableGalleryName		= variableGalleryName;
    this.galcId						= galcId;
    this.request					= BASE_URL + 'indexajax.php?action=GALGallery&variable_gallery_name=' + variableGalleryName + '&galcId=' + this.galcId ;
}

Gallery.prototype.get = function(pageOffset, order)
{
	var ajaxResponseHtml 	= null;
	var ajaxResponseErrors 	= null;
	var ajaxResponseResult 	= 0;
	var updateHtmlElement 	= this.updateHtmlElement;
	pageOffset	   		= pageOffset ? pageOffset : 0;
	this.order	   		= this.order ? this.order : 1;
	
	this.order	   		= order ? order : this.order;
	
	var request = this.request + '&start=search' + '&offset=' + pageOffset + '&order=' + this.order;

	$.ajax({
		type: "get",
		url: request,
		dataType: "xml",
		global: false,
		success: function(xml)
		{
		$("response > items > html", xml).each (
		function()
		{
			ajaxResponseHtml = ($(this).text());
		}
		);

		$("response > result", xml).each (
		function()
		{
			ajaxResponseResult = ($(this).text());
		}
		);

		$("response > error", xml).each (
		function()
		{
			ajaxResponseErrors = ($(this).text());
		}
		);

		$("response > message", xml).each (
		function()
		{
			ajaxResponseMessage = ($(this).text());
		}
		);

		if(ajaxResponseResult == 1)
		{
			$('#' + updateHtmlElement).html(ajaxResponseHtml);
		}
		}
		});
}


