jQuery.noConflict();		
jQuery(document).ready(function(){
	var links=jQuery("#promo-carousel li a");	
	//jQuery("#promo-carousel li a:first").addClass("selected");
	links.each(function(i){
		this.myIndex=(i==0?"":i);
		
	})
	
	links.click(function(){
	

		try{


			//Remove selected classes from all
			jQuery("#promo-carousel li a").removeClass("selected");

			//Hide all promos - and remove selected style from all
			for(var iCount=0; iCount<4; iCount++){
				jQuery("#mainpromo"+(iCount==0?"":iCount)).hide();
			}
			
			//Show requested promo
			var idets=eval("imagedetails" + this.myIndex);						
			//Fetch and build the image
			if(jQuery("#mainpromo" + this.myIndex + " img").length==0){														
				var hrefStart=idets.href?"<a href='" + idets.href + "'>":"";
				var hrefEnd=idets.href?"</a>":"";	
				jQuery("#mainpromo"  + this.myIndex + " div.imgcont").html(hrefStart + "<img height='" + idets.height + "' width='" + idets.width + "' src='" + idets.src + "' alt='" + idets.alt + "'/>" + hrefEnd);
			}						
		}
		
		catch(err){}

		//Add selected class to clicked on item
		jQuery("#promo-carousel li a:eq("+this.myIndex+")").addClass("selected");

		//Show the requested promo
		jQuery("#mainpromo" + this.myIndex).show();
		
		return false;
	})
})
