Array.prototype.shuffle = function( b )
{
 var i = this.length, j, t;
 while( i ) 
 {
  j = Math.floor( ( i-- ) * Math.random() );
  t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];
  this[i] = this[j];
  this[j] = t;
 }

 return this;
};

function picShow(arSection1,arSection2,arSection3,arSection4,arSection5){
$(document).ready(function() {

	//alert(arSection2[0]);
	//$("#section_1").text("");
 
	var j=0;
	$("#timer").everyTime(1000, function(i) {
		j++;

		//$("#timer_test").text(j);
		if(j==30){ j=0;}
 
		switch(j){
		case 25:
			arSection1.shuffle(); 
			$("#section_1").slideUp("slow",function() {
					url=$("#section_1").parents("a").attr("href");
					$("#section_1").html("<img onClick='docloc("+url+")' src='"+arSection1[0]+"'>");
				});
			$("#section_1").slideDown("slow");			
	    		break;	
		case 5:
			arSection2.shuffle(); 
			$("#section_2").slideUp("slow",function() {
					url=$("#section_2").parents("a").attr("href");
					$("#section_2 ").html("<img onClick='docloc("+url+")' src='"+arSection2[0]+"'>");


				});
			$("#section_2 ").slideDown("slow");
			//$("#section_2 div").show("slide","","slow","");

	    		break;	
		case 15:
			arSection3.shuffle(); 
			$("#section_3").slideUp("slow",function() {
					url=$("#section_3").parents("a").attr("href");
					$("#section_3").html("<img onClick='docloc("+url+")' src='"+arSection3[0]+"'>");
				});
			
			$("#section_3").slideDown("slow");
	    		break;
		case 10:
			arSection4.shuffle(); 
			$("#section_4").slideUp("slow",function() {
					url=$("#section_4").parents("a").attr("href");
					$("#section_4").html("<img onClick='docloc("+url+")' src='"+arSection4[0]+"'>");
				});
			
			$("#section_4").slideDown("slow");
	    		break;
		case 20:
			arSection5.shuffle(); 
			$("#section_5").slideUp("slow",function() {
					url=$("#section_5").parents("a").attr("href");
					$("#section_5").html("<img onClick='docloc("+url+")' src='"+arSection5[0]+"'>");
				});
			$("#section_5").slideDown("slow");
	    		break;				

		}
	});


});	
}

