jQuery.noConflict();
function rotate() {	
	//Get the first image
	var current = (jQuery('div.rotator ul li.show')?  jQuery('div.rotator ul li.show') : jQuery('div.rotator ul li:first'));
    if ( current.length == 0 ) current = jQuery('div.rotator ul li:first');
	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? jQuery('div.rotator ul li:first') :current.next()) : jQuery('div.rotator ul li:first'));
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	next.css('z-index','999')
	next.addClass('show')
	next.animate({opacity: 1.0}, 1000);
	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	current.removeClass('show');
	current.css('z-index','99')
};

function rotatenext() {	

	//Get the first image
	var current = (jQuery('div.rotator ul li.show')?  jQuery('div.rotator ul li.show') : jQuery('div.rotator ul li:first'));
    if ( current.length == 0 ) current = jQuery('div.rotator ul li:first');
	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? jQuery('div.rotator ul li:first') :current.next()) : jQuery('div.rotator ul li:first'));
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	next.css('z-index','999')
	next.addClass('show')
	next.animate({opacity: 1.0}, 1000);
	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	current.removeClass('show');
	current.css('z-index','99')
};
function rotateprev() {	
	//Get the first image
	var current = (jQuery('div.rotator ul li.show')?  jQuery('div.rotator ul li.show') : jQuery('div.rotator ul li:last'));
    if ( current.length == 0 ) current = jQuery('div.rotator ul li:last');
	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.prev().length) ? ((current.prev().hasClass('show')) ? jQuery('div.rotator ul li:last') :current.prev()) : jQuery('div.rotator ul li:last'));
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	next.css('z-index','999')
	next.addClass('show')
	next.animate({opacity: 1.0}, 1000);
	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	current.removeClass('show');
	current.css('z-index','99')
};
jQuery(document).ready(function() {	
jQuery('div.rotator ul li:first').css('z-index','999')
jQuery('div.rotator ul li').css({opacity: 0.0});
jQuery('div.rotator ul li:first').css({opacity: 1.0});
setInterval(' rotate()',6000);
//theRotator();
	//jQuery('div.rotator ul li:first a').attr('href',frs)
	jQuery('div.arrow-left a').attr('href','javascript:void(0)')
	jQuery('div.arrow-right a').attr('href','javascript:void(0)')		
	jQuery('div.arrow-left ').css('visibility','hidden')
	jQuery('div.arrow-right').css('visibility','hidden')
	//Load the slideshow
	
	jQuery('div.rotator').fadeIn(1000);
    jQuery('div.rotator ul li').fadeIn(1000); // tweek for IE

	jQuery('div.arrow-left a').click(function()
	{
		rotateprev();
		return false;
	})
	jQuery('div.arrow-right a').click(function()
	{
		rotatenext();
		return false;
	})
	jQuery('#center-1 .starter-amazon-com-HTMLWidget-2').mouseenter(function()
	{
		jQuery('div.arrow-left ').css({'visibility':'visible','z-index':'1000'})
		jQuery('div.arrow-right ').css({'visibility':'visible','z-index':'1000'})
		
	});
	jQuery('#center-1 .starter-amazon-com-HTMLWidget-2').mouseleave(function()
	{
	
		jQuery('div.arrow-left ').css('visibility','hidden')
		jQuery('div.arrow-right ').css('visibility','hidden')
	});
});



