// JavaScript Document RVS2008 SwapThumbs.js
// Single Frame swap n = +1 or -1 called from Up or Dn button
// Frame Strip swap  n = +5 or -5 called from PgUp or PgDn button
// First Frame No. ffn is incremented or decremented by +-n
// Maximum First Frame No. is set to thumbs array length -6
// ffn is global variable used by SetPageView(fr) in Commercial-Art.html page code.
// where fr is the filmstrip frame no clicked - 0 to 5.

    var n = 0;
	var ffn = 0;
    var ffnmax = thms.length - 6;

	function swapThumbs(n)	
	   { 
	     ffn += n; z = 0; 	
		 if (ffn < 1)
		 {
		     ffn = 0 
		 }		
		 
		 if (ffn > ffnmax )
		 {
		     ffn = ffnmax 
		 }		 
		 
      	 z = ffn + 0; document.images.Fr1.src = thms[z];
      	 z = ffn + 1; document.images.Fr2.src = thms[z];
		 z = ffn + 2; document.images.Fr3.src = thms[z];
		 z = ffn + 3; document.images.Fr4.src = thms[z];
		 z = ffn + 4; document.images.Fr5.src = thms[z];
	     z = ffn + 5; document.images.Fr6.src = thms[z];
	   
	    // messageBox("z= %s and ffn= %s and ffnmax= %s", z, ffn, ffnmax)
		 
		
        }
