function getRotationBanners(xmlURL, divID, width, height, animationType){
	var rotationBannerList;
	var resume = false;
	var startTime = new Date();
	var endTime = new Date();
	var timeDifference = 0;
	// Open the xml file
	$.ajax({
		type: "GET",
		url: xmlURL,
		dataType: "xml",
		async: false,
		success: function(xml) {
			$(divID).append("<ul></ul>");
			// Run the function for each tag in the XML file
			$('image',xml).each(function(i) {
				itemImage = $(this).attr("path");
				itemLink = $(this).attr("myURL");
				itemAlt = $(this).attr("alt");
				itemPubDate = $(this).attr("pubDate");
				itemExpDate = $(this).attr("expDate");
				itemFlashPath = $(this).attr("flashPath");
				itemTimer = $(this).attr("timer")
				
				//set publish date if none specified
				if(isNaN(Date.parse(itemPubDate))){
					itemPubDate = "January 1, 1970";
				}
				//set expiration date if none specified. Remember to updated this in the year 9999. We don't want to have another Y2K senario.
				if(isNaN(Date.parse(itemExpDate))){
					itemExpDate = "December 31, 9999";	
				}
				//set timer if none specified
				if(isNaN(+itemTimer)){
					itemTimer = (+5000);	
				}
				
				//places the xml items into a html list if serverTime is between itemPubDate and itemExpDate
				if(Date.parse(itemPubDate)<= Date.parse(serverTime) && Date.parse(itemExpDate) >= Date.parse(serverTime)) {
					if(itemFlashPath != "" && itemFlashPath != undefined) {
						itemWmode = $(this).attr("wmode");
						itemAllowScriptAccess = $(this).attr("allowscriptaccess");
						if(itemWmode == "" || itemWmode == undefined){
							itemWmode = "transparent";
						}
						if(itemAllowScriptAccess == "" || itemAllowScriptAccess == undefined){
							itemAllowScriptAccess = "always";
						}
						$(divID + " ul").append('<li id="'+divID+'Flash'+i+'" width="' + width + '" height="' + height + '"></li>');
						$(divID + " ul" + " li:last").flashembed({src: itemFlashPath,
							onFail: function(){$(divID + " ul" + " li:last").html('<a href="'+ itemLink + '"><img src="'+ itemImage +'" alt="'+ itemAlt +'" width="' + width + '" height="' + height + '" /></a>');},
							width: width,
							height: height,
							wmode: itemWmode,
							allowscriptaccess: itemAllowScriptAccess
						}
						);
						$(divID + " ul" + " li:last").data('htmlForFlashObject', $(divID + " ul" + " li:last").html());
					}
					else {
						if(itemLink == '#'){
							$(divID + " ul").append('<li><img src="'+ itemImage +'" alt="'+ itemAlt +'" width="' + width + '" height="' + height + '" /></li>');	
						}
						else{
							$(divID + " ul").append('<li><a href="'+ itemLink + '"><img src="'+ itemImage +'" alt="'+ itemAlt +'" width="' + width + '" height="' + height + '" /></a></li>');
						}
					}
					$(divID + " ul" + " li:last").data('timer', itemTimer);
				}				
			});
			rotationBannerList = $(divID + " ul");
			$(rotationBannerList.children(":first")).css("display","list-item"); 	
		return;
		}});

	//begin animation
	animator($(divID + " ul").children(":first"));
	
	function animator(currentItem) {
		//if there is only one list item, end animator function
		if(currentItem.siblings().length == 0) {
			return;	
		};
		
		if(animationType == "slideLeft"){
			//the closer to zero, the slower the slide
			var normalSpeed = 1;
		}
		else {
			var normalSpeed = 1000;	
		}
		startTime = new Date();
		var timer = $(currentItem).data('timer');
		var	speed = normalSpeed;
		var distance = currentItem.width();
		var duration = (distance + parseInt(currentItem.css("marginLeft"))) / speed;
		if (resume == true){
			timer = timer - timeDifference;
			if (timer <= 0) {
			timer = 50;
			}
		}
		resume = false;
		
		var timeoutID = setTimeout(function(){
			//if swf, reload so it starts over
			if($(currentItem).next().data('htmlForFlashObject') != undefined){
				$(currentItem).next().html($(currentItem).next().data('htmlForFlashObject'));	
			};
			
			if(animationType == "fade"){
				$(currentItem).css("position","absolute").parent().css("overflow", "visible", "position", "relative");
				setTimeout(function(){
					$(currentItem).fadeOut("slow").next().fadeIn("slow", function(){
						$(currentItem).appendTo(currentItem.parent()).css("marginLeft", 0);
						currentItem = rotationBannerList.children(":first");
						animator(currentItem);
					});
				}, 1000);
				}
			else {
				setTimeout(function(){
					$(currentItem).animate({ marginLeft: -distance }, duration, "linear", function() {
					$(currentItem).appendTo(currentItem.parent()).css("marginLeft", 0);
						currentItem = rotationBannerList.children(":first");
						animator(currentItem);
					});
				}, 1000);
			}
			
		}, timer);
		//mouseover function is included within the animator function to maintain scope for timeoutID
		rotationBannerList.mouseover(function() {
			clearTimeout(timeoutID);
			return
		});	
		
	};
	//mouseout function uses timeDifference to determine how long to set the timer on mouseout
	rotationBannerList.mouseout(function() {
		currentItem = rotationBannerList.children(":first");
		//timer = $(currentItem).data('timer');
		resume = true;
		endTime = new Date();
		timeDifference = endTime - startTime;
		animator(currentItem);
	});
		
	return;
};





