doCarousel = function() { if ((navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) || navigator.appName.indexOf("Microsoft") > -1){ jQuery("#carousel_1").hide(); jQuery("#carousel_2").hide(); jQuery("#carousel_3").hide(); jQuery("#carousel_4").hide(); jQuery("#carousel_5").hide(); } else { jQuery("#homeFlash").hide(); jQuery('#carousel_1').css('opacity',0.6); jQuery('#carousel_2').css('opacity',0.9); jQuery('#carousel_4').css('opacity',0.9); jQuery('#carousel_5').css('opacity',0.6); var carouselArray = new Array(); var tArray = new Array(); tArray.push('carousel_globalsantafe.png'); tArray.push('/Case_Studies/By_Client_Name/GlobalSantaFe/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_milkingstool.png'); tArray.push('/Knowledge/SpeechesPresentations/Websites_that_Work/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_sbdarticle3.png'); tArray.push('/News_Events/News/Brand_Building/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_ppcloan.png'); tArray.push('/Case_Studies/By_Client_Name/PPC_Loan/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_sbdarticle1.png'); tArray.push('/News_Events/News/Positioned_for_Success/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_stripes.png'); tArray.push('/Case_Studies/By_Client_Name/Stripes/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_totalsafety.png'); tArray.push('/Case_Studies/By_Client_Name/Total_Safety/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_varel.png'); tArray.push('/Case_Studies/By_Client_Name/Varel_International/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_uson.png'); tArray.push('/Case_Studies/By_Client_Name/Uson/'); carouselArray.push(tArray); var tArray = new Array(); tArray.push('carousel_sbdarticle2.png'); tArray.push('/News_Events/News/Positioned_for_Success/'); carouselArray.push(tArray); for(var x=1; x<6; x++) { if(x!=3) { jQuery("#carousel_"+x+" img").bind("click", function(e){ var filename = this.src.substring(this.src.lastIndexOf("/")+1, this.src.indexOf("&")); var pos = getArrayPos(filename); reOrderArray(pos); var pos = getArrayPos(filename); if(x<3) { pos = pos + 2; setCarousel(pos); } else if(x>3) { pos = pos - 2; setCarousel(pos); } }) } else { jQuery("#carousel_"+x+" img").bind("click", function(e){ var filename = this.src.substring(this.src.lastIndexOf("/")+1, this.src.lastIndexOf("&")); var pos = getArrayPos(filename); window.open(carouselArray[pos][1]); }) } } var getArrayPos = function(file) { for(var y=0; ycenterPos) { var a = carouselArray.splice(0,2); carouselArray.push(a[0]) carouselArray.push(a[1]) } } var setCarousel = function(start) { var carouselCount = 1; var startStep = start; var endStep = startStep + 5; for(var x=startStep; x