	var imrot_atNow = 0;
	var imrot_transitionTime = 1000;
	var imrot_durationTime = 7000;
	var imrot_images = [];
	var imageHolderId = null;
	
	function rotateImages(id, transitionTime, durationTime, images) {
		imrot_transitionTime = transitionTime;
		imrot_durationTime = durationTime;
		imrot_images = images;
		imageHolderId = id;
		
		var html = "";
		for(var i=0; i<images.length; i++) {
		  var imgi = images.length - i - 1;
		  html += '<div id="fadeSlide'+i+'" style="position:absolute"><a title="'+images[imgi].title+'" href="'+images[imgi].url+'"><img alt="'+images[imgi].title+'" border="0" src="'+images[imgi].img+'" /></a></div>\n';
		}
		$("#"+id).html(html);
		
		imrot_atNow = images.length-1;
		//imrot_hideAllOthers();
		setTimeout("imrot_nextSlide();", imrot_durationTime);
	}


	function imrot_hideAllOthers() {
		for(var i=1; i<imrot_images.length; i++) {
			$("#fadeSlide"+i).hide();
		}
	}

	function imrot_nextSlide() {
		imrot_showImage(imrot_atNow, (imrot_atNow - 1 + imrot_images.length) % imrot_images.length);
		imrot_atNow = (imrot_atNow - 1 + imrot_images.length) % imrot_images.length;
		setTimeout("imrot_nextSlide();", imrot_durationTime);
	}


	function imrot_showImage(fromId, toId){
		toDiv = $("#fadeSlide"+toId);
		fromDiv = $("#fadeSlide"+fromId);
		
	//	toDiv.show();
	//	$("#"+imageHolderId).append(toDiv);
		fromDiv.fadeOut(imrot_transitionTime);
		toDiv.fadeIn(imrot_transitionTime);
		
		return;
	
	
	//  alert("from " + fromId + " to " + toId);
	  fromDiv = "#fadeSlide"+fromId;
	  toDiv = "#fadeSlide"+toId;
	  
	  $(imageHolderId).append(toDiv);

	//  if($(toDiv).fx){$(toDiv).fx.stop();}
	//  if($(toDiv).fx){$(toDiv).fx.stop();}
	  $(toDiv).stop();
	  $(toDiv).stop();
	//  $(toDiv).fx = $(toDiv).effect('opacity', {duration: imrot_transitionTime}).start(0);
	//  $(toDiv).fx = $(toDiv).effect('opacity', {duration: imrot_transitionTime}).start(1);
	//  $(toDiv).hide();
	  $(toDiv).fadeIn(imrot_transitionTime);
	}
