function w_menu_items(container_, options_)
{
	
	this.container = container_;
	this.opt = new Array();
	
	if (options_ != null)
	{
		for (x in options_)
			this.opt[x] = options_[x];
	}

	this.items = new Array();
	this.itemIndex = 0;
	
	this.loadData = function() {
		
		// This is how it should work live:
		if (this.opt["url"] != null)
		{
			
			var self = this;
			$j.ajax({
				async: true,
				url: this.opt["url"],
				method: "GET",
				cache: false,
				data: "item_menu=" + this.opt["tab"],
				dataType: "jsonp",
				timeout: 5000,
				success: function(json) {
					
					if (json.found != 0){	
						self.items= new Array();
						for (iitem in json.news){
							if (json.news.hasOwnProperty(iitem)) {
								var a = new Array();
								a["NAME"] = json.news[iitem].NAME;
								a["NewURL"] = json.news[iitem].NewURL;
								a["id_dep"] = json.news[iitem].id_dep;
								a["vanity_url"] = json.news[iitem].vanity_url;
								
								self.items.push(a);
							}
						 }
						 self.displayItems();
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
				}
			});	
		}
	}
	var initHtml = "";
	this.displayItems = function() {
		var self = this;
		
		var last_item = "";
				
		if (this.items != null)
		{
			initHtml+='<ul>';
			for(i in this.items)			
			{
				if (this.items.hasOwnProperty(i)) {
					var theItem = this.items[i];
					
					if((theItem["NAME"] != last_item)){
						
						if(theItem["vanity_url"] != ""){
							initHtml+= '<li><a href="/park-stay-a-go/' + theItem["vanity_url"] + '">' + theItem["NAME"] + '</a></li>';
						}
						else {
							initHtml+= '<li><a href="/park-stay-a-go/hotel_dep_det.php?item_id=' + theItem["id_dep"] + '&amp;type=d">' + theItem["NAME"] + '</a></li>';					 
						}
					}
				}
				
				last_item = theItem["NAME"];
								
			}
			initHtml+='</ul>';
		}		
		$j(this.container).html(initHtml);	
	}
	this.loadData();	
}
