function highlightNav(options)
{
	var that = this;
	
	this.ajaxSetup  = options.ajaxSetup || {};
	this.url	    = options.url || '';

	this.promoLimit	 = options.promoLimit  || 1;
	this.promoActive = options.promoActive || 1;
	
	this.anchorPrev	= options.anchorPrev || null;
	this.anchorNext	= options.anchorNext || null;

	this.imgLoading	= options.imgLoading || null;

	this.jSONparse  = options.jSONparse || { };

	$.ajaxSetup( this.ajaxSetup );
	
	this.anchorPrev.click(function()
	{
		if (that.promoActive > 1 )
		{
			that.promoActive--;
			that.getPrev(that.promoActive);
		}
		return false;
	});

	this.anchorNext.click(function()
	{
		
		if ( that.promoActive < that.promoLimit )
		{
			that.promoActive++;			
			that.getNext(that.promoActive);
		}
		return false;
	});
}

highlightNav.prototype =
{	
	
	getPrev	: function() 
	{
		this.getPromo( this.promoActive );	
	},
	getNext	: function()
	{
		this.getPromo( this.promoActive );
	},
	getPromo : function(promo)
	{
		var that = this;
		try
		{
			$.ajax({			
				url: this.url,
				data: { promo : promo },
				success:function(xml)
				{
					that.parseContent(xml)
				},
				error: function(e) {
					alert(e);
				}
			});	
		}
		catch (e) {}
	},
	parseContent : function(xml)
	{
		
		var d = this.jSONparse;
		for(i in d)
		{			
			switch(d[i].type) {
				case 'attr':
					if (i == 'image')
					{
						$(d[i].selector).attr( d[i].attr, this.imgLoading);
						var im = document.createElement('img');
						im.src = $(d[i].parent + i,xml).text();
						(function(){
							if (!im.complete) setTimeout(arguments.callee,1);
							else $(d[i].selector).attr( d[i].attr, $(d[i].parent + i,xml).text() );
						})();
					}
					else
					{
						$(d[i].selector).attr( d[i].attr, $(d[i].parent + i,xml).text() );
					}
					break;
			}
		}
	}

}