1 2// 3// stpt-pb.js 130619 4 5// timer code 6// from http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_infinite 7 8var t; 9 10function start_timer() 11{ 12//alert("in start_timer()"); 13timedCount(); 14} 15 16function timedCount() 17{ 18pb_dsp(); 19//alert("in timedCount()"); 20t=setTimeout("timedCount()",10000); 21} 22 23// 24// Photo Board code 25// 26 27var pb_img0; // current photo board image set index position 28 29// 30// initialization 31// 32 33function init_0() 34{ 35init(); 36pb_img0=Math.floor(Math.random()*pb_set); //alert("pb_img0= "+pb_img0); 37timedCount(); 38} 39 40 41// build image set for photo board 42 43var pb_str,pb_size=7,pb_set=17,rchars="",i,pbi; 44 45 46function pb_dsp() 47{ 48pb_str=bld_imgstr(pb_set); //alert("in pb_dsp(), pb_str= "+pb_str); 49//alert("pb_dsp(); pb_str= "+pb_str); 50// randomize string 51for(i=0;i<pb_size; ++i) 52 { 53 pbi=pb_str.substr(2*i,2); //alert("pb_str, i, pbi= "+pb_str+", "+i+", "+pbi); 54 document.getElementById("pb0"+(i+1).toString()).src="images/stpt-pb"+pbi+".jpg"; 55 } 56} 57 58 59function bld_imgstr(pbnum) 60{ 61var i,str,str_r; 62str=bld_str1D(pb_img0,pb_size,pb_set); pb_img0=(pb_img0+pb_size-1)%pb_set+1; 63str_r=str_rndmz(str); 64return str_r; 65} 66 67function str_rndmz(str) 68{ 69var i,len0=str.length,len,rpos,rchr,str0=str,str1,str2,str_r=""; 70 71for(i=1;i<=len0;++i) 72{ 73 len=str0.length/2; //Math.floor(str0.length/2); 74 rpos=Math.floor(Math.random()*len)+1; 75 str1=str0.substr(0,2*(rpos-1)); 76 rchr=str0.substr(2*(rpos-1),2); 77 str2=str0.substr(2*(rpos-1)+2,2*len-2*(rpos-1)-2); 78 //alert("in str_rndmz(); str0, rchr, str1, str2, str_r= "+str0+", "+rchr+", "+str1+", "+str2+", "+str_r); 79 str0=str1+str2; 80 str_r=str_r+rchr; 81} 82//alert("in str_rndmz(); str, str_r= "+str+", "+str_r); 83return str_r; 84 85} 86 87 88// 89// bld_str1D0(n) returns an ordered string of (n) 2 digit numbers ranging from (n) to (n+len), modulo 'modbase' 90// i.e.: "0304...09100102... (n+len%modbase)" which are accessable 91// as str.substr(2*(len-1),2). This string will be used to randomly select sets of images. 92// 93function bld_str1D(n,len,modbase) 94{ 95var i,str0,str; 96str=""; 97for(i=n;i<n+len;i++) 98 { 99 m=i%modbase+1; //alert("bld_imgstr1(); m= "+m); 100 str0=m.toString(); 101 if(str0.length==1){str0="0"+str0;} 102 str=str+str0; 103 } 104return str; 105} 106 107// end of stpt_pb.js
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.