/*Created by Peter Scott*/

(function($)
{jQuery.fn.slide=function(options)
{var defaults={"Rotate speed":5000,"Fade speed":300};var o=jQuery.extend(defaults,options);return this.each(function()
{var el=$(this);var imgCount=$("#imageRotate img").length;var currentPosition=imgCount-1;function setupDom()
{$("body").append("<div class='rightArrow'></div>");$("body").append("<dvi class='leftArrow'></div>");};function setup()
{el.children("div").each(function(index)
{$(this).addClass("slide_"+index).css("z-index",index);});};setup();function beginFade()
{};var t=setInterval(function()
{if(currentPosition<0)
{currentPosition=imgCount-1;};var image=$(".slide_"+currentPosition+" img");var currentSlide=$(".slide_"+currentPosition);var otherSlides=$(".background").not(".slide_"+currentPosition);image.fadeTo(o["Fade speed"],0,function()
{otherSlides.each(function()
{var orZindex=$(this).css("z-index");$(this).css("z-index",parseInt(orZindex)+1)});currentSlide.css({"z-index":0});image.css("opacity",1);});currentPosition--;},o["Rotate speed"]);});};})(jQuery);
