﻿function slideSwitch(){var a=$("#slideshow li.active");a.length==0&&(a=$("#slideshow li:last"));var c=a.next().length?a.next():$("#slideshow li:first");a.addClass("last-active");c.css({opacity:0}).addClass("active").animate({opacity:1},1E3,function(){a.removeClass("active last-active");detectZindex()})}
function detectZindex(){function a(a){$("#rotatorIMG-"+a).css("z-index")=="10"&&($("#rotateButtons input").css({border:"1px solid #fff",color:"#369","background-color":"#E6E6E6"}),$("#rotateButton"+a).css({border:"1px solid #fff",color:"#fff","background-color":"#369"}))}var c=$("#slideshow ul li").length;for(i=1;i<=c;i++)a(i)}
$(document).ready(function(){var a,c=$("#slideshow ul li").length;if(c>1){$("#rotateButtons").css("display","block");a=setInterval("slideSwitch()",5E3);var b=[];for(i=1;i<=c;i++)b[i]='<input type="button" value="'+i+'" id="rotateButton'+i+'" onfocus="this.blur();" />';b=b.join(" ");$("#rotateButtons").html(b.toString());b=function(b){$("#rotateButton"+b).click(function(){for(j=1;j<=c;j++)$("#rotatorIMG-"+j).css("opacity","0.0"),$("#rotatorIMG-"+j).css("z-index","-1");$("#rotatorIMG-"+b).css("opacity",
"1.0");$("#rotatorIMG-"+b).css("z-index","10");$("#rotateButtons input").css({border:"1px solid #fff",color:"#369","background-color":"#E6E6E6"});$("#rotateButton"+b).css({border:"1px solid #fff",color:"#fff","background-color":"#369"});a=clearInterval(a)})};for(i=1;i<=c;i++)b(i);$("#rotateButton1").css({border:"1px solid #fff",color:"#fff","background-color":"#369"})}});
