//	FadeRotate a set of images (see fadeRotate.orig.js)
(function(a){a.fn.fadeRotate=function(b){b.interval=+b.interval>0?b.interval:3e3;b.duration=+b.duration>0?b.duration:1e3;b.botZ=+b.botZ>0?b.botZ:10;b.midZ=+b.midZ>0?b.midZ:11;b.topZ=+b.topZ>0?b.topZ:12;a(this.children()[0]).css({"z-index":b.topZ});this.current=0;var c=this;this.fade=function(c){var d=c.children();var e=c.current;var f=e+1>=d.length?0:e+1;a(d[e]).css({"z-index":b.midZ});a(d[f]).css({"z-index":b.topZ,opacity:0});a(d[f]).animate({opacity:1},b.duration,"linear",function(){if(a(this).prev().length>0){a(this).prev().css({"z-index":b.botZ})}else{a(this).siblings().last().css({"z-index":b.botZ})}});c.current++;if(c.current>=d.length){c.current=0}window.setTimeout(function(){c.fade(c)},b.interval)};window.setTimeout(function(){c.fade(c)},b.interval)}})(jQuery)

jQuery(function($) {
//	Swapping between image on mouseover
	$("img[rel^='alt']")
		.mouseover(function() {
			if (this.src.indexOf('404.gif')>-1) return;	// Don't do swap if 404 image
			this.orig=this.src;
			var rel=$(this).attr('rel');
			var newImg=rel.substring(rel.indexOf('[')+1);
			var newImg=newImg.substring(0,newImg.indexOf(']'));
			if (newImg=='') return;
			this.src=newImg;
		})
		.mouseout(function() {
			if (typeof(this.orig)=='undefined') return;
			this.src=this.orig;
		});
	$('#topRotateImgs').fadeRotate({interval:2000,duration:750});
});

