var photo=new Array ("<li><img src='results/photo 2009/student image_20.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_34.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_1.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_2.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_3.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_4.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_5.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_6.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_7.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_8.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_9.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_10.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_11.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_12.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_13.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_14.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_15.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_16.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_17.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_18.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_21.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_22.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_23.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_24.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_25.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_26.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_27.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_28.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_29.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_30.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_31.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_32.jpg' alt='Stratford Student Image' /></li>", "<li><img src='results/photo 2009/student image_33.jpg' alt='Stratford Student Image' /></li>");


var autoSlide = true;
var autoSlideSecs = 10;
var raaz=0;
var flag=0;
function nextSlide() {
	if(raaz<33)
	{
		

		if(raaz>=10 && raaz<=20)
		{
			if(flag==0)
			{$("#featured .photo").hide(500);
			$("#featured .photo1").show(800);
			$("#featured .photo1").animate({height:161},"slow");
			$("#featured .photo1").animate({width:240},"medium");
			$("#featured .photo1").animate({height:100},"fast");
			$("#featured .photo1").animate({width:10},"fast");
			$("ul.photo ").html(photo[raaz]);
			 flag=1;
			 }
			 else{ raa=raaz;
			 $("#featured .photo1").hide(500);
			 $("#featured .photo").show(500);
			 $("ul.photo1 ").html(photo[raa]);
			 flag=0;
			 }
		}
		else
		{
			if(flag==0)
			{$("#featured .photo").hide(500);
			$("#featured .photo1").show(500);
			$("ul.photo ").html(photo[raaz]);
			 flag=1;
			 }
			 else{ raa=raaz;
			 $("#featured .photo1").hide(500);
			 $("#featured .photo").show(500);
			 $("ul.photo1 ").html(photo[raa]);
			 flag=0;
			 }
		}
		

	raaz++;
	}
	else{raaz=0;}
	
}

$(function() {
	if (autoSlide) interval = setInterval('nextSlide()', autoSlideSecs*200);
	jQuery('.next').click(function() {
		clearInterval(interval);
		nextSlide();
		if (autoSlide) interval = setInterval('nextSlide()', autoSlideSecs*200);
		return false;
	});
});




var sliderwidth="985px"
var sliderheight="100px"
var slidespeed=1
// slidebgcolor="#E1E9EF"
slidebgcolor=""
var tmp=new Array()
var leftrightslide=new Array()
var finalslide=''
//var loadinggif='background-image: url("/images/loading.gif"); background-repeat: no-repeat; background-attachment: fixed; background-position: top center;';

tmp[0]='<a href="images/photo gallery/gal_ph1a.jpg" target="_blank"><img src="images/photo gallery/gal_ph1.jpg" alt="Stratford Academy - Result: 324705" title="View Photo: 324705" border="1"></a>&nbsp;'
tmp[1]='<a href="images/photo gallery/gal_ph2a.jpg" target="_blank"><img src="images/photo gallery/gal_ph2.jpg" alt="Stratford Academy - Classroom: 217986" title="View Photo: 217986" border="0"></a>&nbsp;'
tmp[2]='<a href="images/photo gallery/gal_ph3a.jpg" target="_blank"><img src="images/photo gallery/gal_ph3.jpg" alt="Stratford Academy - Result: 320324" title="View Photo: 320324" border="0"></a>&nbsp;'
tmp[3]='<a href="images/photo gallery/gal_ph4a.jpg" target="_blank"><img src="images/photo gallery/gal_ph4.jpg" alt="Stratford Academy - Result: 323508" title="View Photo: 323508" border="0"></a>&nbsp;'
tmp[4]='<a href="images/photo gallery/gal_ph5a.jpg" target="_blank"><img src="images/photo gallery/gal_ph5.jpg" alt="Stratford Academy - Result: 297254" title="View Photo: 297254" border="0"></a>&nbsp;'
tmp[5]='<a href="images/photo gallery/gal_ph6a.jpg" target="_blank"><img src="images/photo gallery/gal_ph6.jpg" alt="Stratford Academy - Faculty: 244208" title="View Photo: 244208" border="0"></a>&nbsp;'
tmp[6]='<a href="images/photo gallery/gal_ph7a.jpg" target="_blank"><img src="images/photo gallery/gal_ph7.jpg" alt="Stratford Academy - Result: 371896" title="View Photo: 371896" border="0"></a>&nbsp;'
tmp[7]='<a href="images/photo gallery/gal_ph8a.jpg" target="_blank"><img src="images/photo gallery/gal_ph8.jpg" alt="Stratford Academy - Result: 323489" title="View Photo: 323489" border="0"></a>&nbsp;'
tmp[8]='<a href="images/photo gallery/gal_ph9a.jpg" target="_blank"><img src="images/photo gallery/gal_ph9.jpg" alt="Stratford Academy - Library: 331775" title="View Photo: 331775" border="0"></a>&nbsp;'
tmp[9]='<a href="images/photo gallery/gal_ph10a.jpg" target="_blank"><img src="images/photo gallery/gal_ph10.jpg" alt="Classroom Library: 230179" title="View Photo: 230179" border="0"></a>&nbsp;'
tmp[10]='<a href="images/photo gallery/gal_ph11a.jpg" target="_blank"><img src="images/photo gallery/gal_ph11.jpg" alt="Classroom: 279755" title="View Photo: 279755" border="0"></a>&nbsp;'
tmp[11]='<a href="images/photo gallery/gal_ph12a.jpg" target="_blank"><img src="images/photo gallery/gal_ph12.jpg" alt="Stratford Academy - Faculty: 324423" title="View Photo: 324423" border="0"></a>&nbsp;'
tmp[12]='<a href="images/photo gallery/gal_ph7a.jpg" target="_blank"><img src="images/photo gallery/gal_ph7.jpg" alt="Stratford Academy - Result: 334055" title="View Photo: 334055" border="0"></a>&nbsp;'



fisherYates_rand(tmp);

leftrightslide[0]=tmp[0]
leftrightslide[1]=tmp[1]
leftrightslide[2]=tmp[2]
leftrightslide[3]=tmp[3]
leftrightslide[4]=tmp[4]
leftrightslide[5]=tmp[5]
leftrightslide[6]=tmp[6]
leftrightslide[7]=tmp[7]
leftrightslide[8]=tmp[8]
leftrightslide[9]=tmp[9]
leftrightslide[10]=tmp[10]
leftrightslide[11]=tmp[11]
leftrightslide[12]=tmp[12]

var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join("")+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-200px;left:-9000px">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+1+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+1
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",10)
}
window.onload=fillup


function fisherYates_rand ( myArray ) {
  var i = myArray.length;
  if ( i == 0 ) return false;
  while ( --i ) {
     var j = Math.floor( Math.random() * ( i + 1 ) );
     var tempi = myArray[i];
     var tempj = myArray[j];
     myArray[i] = tempj;
     myArray[j] = tempi;
   }
}

function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+1+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+1+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+1

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+1
}
}

if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')

//write('<div style="display: inline; top: 35px; height: '+sliderheight+'; width: '+sliderwidth+'; position: absolute; text-align: center; vertical-align: middle;"><img border="0" src="images/loading.gif" alt="Loading photo slideshow..." title="Loading photo slideshow..."></div>')

// write('<div style="display:inline; position:absolute;width:'+sliderwidth+';height:'+sliderheight+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')

write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')

// write('</div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}




