1 2var thisPhoto = []; 3var timer = []; 4var x = []; 5var sem = []; 6 7function rotatePics(i, currentTimer, currentPhoto) 8{ 9 var rnd = Math.random(); 10 if(sem[i] != 0) 11 return; 12 sem[i] = 1; 13 if(currentTimer == -1) 14 { 15 clearTimeout(timer[i]); 16 currentTimer = ++x[i]; 17 } 18 if(x[i] != currentTimer) 19 { 20 sem[i] = 0; 21 return; 22 } 23 24 var dc = $('.pslideshow-container').eq(i); 25 var numberOfPhotos = jQuery('.pslideshow li.img', dc).length; 26 var lastPhoto = (thisPhoto[i] + numberOfPhotos) % numberOfPhotos; 27 28 var animDelay = parseFloat(jQuery('dfn.delay', dc).text().replace(",", "."))*1000; 29 var imgActive = jQuery('dfn.img_active', dc).text(); 30 var imgInactive = jQuery('dfn.img_inactive', dc).text(); 31 32 if(typeof(currentPhoto) == 'undefined') 33 currentPhoto = thisPhoto[i] + 1; 34 currentPhoto = (currentPhoto + numberOfPhotos) % numberOfPhotos; 35 var preparePhoto = (currentPhoto + 1 + numberOfPhotos) % numberOfPhotos; 36 $('.pslideshow_nav img', dc).attr("src", imgInactive); 37 $('.listNav_'+currentPhoto, dc).attr("src", imgActive); 38 animate(i, lastPhoto, currentPhoto, preparePhoto); 39 if(x[i] == currentTimer) 40 timer[i] = setTimeout('rotatePics('+i+', '+x[i]+')', animDelay); 41 sem[i] = 0; 42} 43 44function animate(i, from, to, prepare) 45{ 46 var dc = $('.pslideshow-container').eq(i); 47 var animTransit = parseFloat(jQuery('dfn.transition', dc).text().replace(",", "."))*1000; 48 var animMethod = jQuery('dfn.effect', dc).text(); 49 var animProperties = new Object(); 50 animProperties[animMethod] = 'hide'; 51 52 $(".pslideshow li.img", dc).each(function (j) 53 { 54 switch(j) 55 { 56 case from: $(this).css('zIndex', '3'); break; 57 case to: $(this).css('zIndex', '2'); break; 58 default: $(this).css('zIndex', '0'); break; 59 } 60 }); 61 jQuery('.pslideshow li.img', dc).eq(from).animate(animProperties, animTransit, 'linear', function() { 62 $(".pslideshow li.img", dc).each(function (j) 63 { 64 switch(j) 65 { 66 case from: $(this).css('zIndex', '1'); break; 67 case to: $(this).css('zIndex', '3').fadeTo(1, 0.99); break; // Set opacity to 99% in an attemt to load the next image quicker 68 case prepare: $(this).css('zIndex', '2'); break; 69 default: $(this).css('zIndex', '0'); break; 70 } 71 }); 72 thisPhoto[i] = to; 73 jQuery(this).show(); 74 }); 75} 76 77//At this point document is already loaded and ready 78//jQuery(document).ready(function($) { 79jQuery(document).ready(function($) { 80 $(".pslideshow-container").each(function (i) { 81 var dc = $(this); 82 //$(this).attr('id', 'pslideshow-container_'+i); 83 var numberOfPhotos = jQuery('.pslideshow li.img', this).length; 84 var animDelay = parseFloat(jQuery('dfn.delay', this).text().replace(",", "."))*1000; 85 var imgActive = jQuery('dfn.img_active', this).text(); 86 $('.pslideshow_nav', this).css('zIndex', '3'); 87 $('.pslideshow_next', this).css('zIndex', '3'); 88 $('.pslideshow_prev', this).css('zIndex', '3'); 89 $('.listNav_0', this).attr("src", imgActive); 90 $('.pslideshow li.img', this).css('zIndex', '0'); 91 $('.pslideshow li.img', this).eq('0').css('zIndex', '2'); 92 $('.pslideshow_next', this).click( function() { rotatePics(i, -1, thisPhoto[i]+1); } ); 93 $('.pslideshow_prev', this).click( function() { rotatePics(i, -1, thisPhoto[i]-1); } ); 94 $('.pslideshow_nav img', this).each( function (j) 95 { 96 $(this).click( function() { rotatePics(i, -1, j); } ); 97 }); 98 thisPhoto[i] = 0; 99 x[i] = 1; 100 sem[i] = 0; 101 timer[i] = setTimeout(function(){rotatePics(i, x[i]);}, animDelay); 102 }); 103}); 104
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.