/* Random Gift Idea */
/* Modified by Steven Johal */

/* define image width and height */
/* define text to show on button */

var button_text="Random Gift Idea?";
if (document.images)
 {
     pic1= new Image();
     pic1.src="http://petsupplyfiles.com/imagefiles/randomgift/petsafepetfeeder.jpg";  
     pic2= new Image(); 
     pic2.src="http://petsupplyfiles.com/imagefiles/randomgift/floydlgbl.jpg"; 
     pic3= new Image();
     pic3.src="http://petsupplyfiles.com/imagefiles/randomgift/flingamastring.jpg";  
     pic4= new Image();
     pic4.src="http://petsupplyfiles.com/imagefiles/randomgift/doggiedriver.jpg";  
     pic5= new Image();
     pic5.src="http://petsupplyfiles.com/imagefiles/randomgift/chuckitball.jpg";  
     pic6= new Image();
     pic6.src="http://petsupplyfiles.com/imagefiles/randomgift/chewbrush5.jpg";  
     pic7= new Image();
     pic7.src="http://petsupplyfiles.com/imagefiles/randomgift/cattowerwarm.jpg";  
     pic8= new Image();
     pic8.src="http://petsupplyfiles.com/imagefiles/randomgift/catpackb1.jpg";  
     pic9= new Image();
     pic9.src="http://petsupplyfiles.com/imagefiles/randomgift/bumbleball.jpg";  
     pic10= new Image();
     pic10.src="http://petsupplyfiles.com/imagefiles/randomgift/bspreservefeeder.jpg";  
     pic11= new Image();
     pic11.src="http://petsupplyfiles.com/imagefiles/randomgift/berganturbotrack.jpg";  
     pic12= new Image();
     pic12.src="http://petsupplyfiles.com/imagefiles/randomgift/treatsbundles.jpg";  
     pic13= new Image();
     pic13.src="http://petsupplyfiles.com/imagefiles/randomgift/sleepblugrnmd.jpg";  
     pic14= new Image();
     pic14.src="http://petsupplyfiles.com/imagefiles/randomgift/ritared.jpg";  
     pic15= new Image();
     pic15.src="http://petsupplyfiles.com/imagefiles/randomgift/freshflow.jpg";  
	 pic16= new Image();
     pic16.src="http://petsupplyfiles.com/imagefiles/randomgift/runaboutball7m.jpg";  
     pic17= new Image();
     pic17.src="http://petsupplyfiles.com/imagefiles/randomgift/jwholeemolee5.jpg";  
     pic18= new Image();
     pic18.src="http://petsupplyfiles.com/imagefiles/randomgift/stocking7pc.jpg";  
     pic19= new Image();
     pic19.src="http://petsupplyfiles.com/imagefiles/randomgift/petstgsoccpichwtoylg.jpg";  
     pic20= new Image();
     pic20.src="http://petsupplyfiles.com/imagefiles/randomgift/wildtail.jpg";  
     pic21= new Image();
     pic21.src="http://petsupplyfiles.com/imagefiles/randomgift/eclseorcblck2gl.jpg";  
     pic22= new Image();
     pic22.src="http://petsupplyfiles.com/imagefiles/randomgift/shbeefsticks12pk.jpg";  
     pic23= new Image();
     pic23.src="http://petsupplyfiles.com/imagefiles/randomgift/bobalot.jpg";  
     pic24= new Image();
     pic24.src="http://petsupplyfiles.com/imagefiles/randomgift/hyperdog2ball.jpg";  
     pic25= new Image();
     pic25.src="http://petsupplyfiles.com/imagefiles/randomgift/cacatpo.jpg";  
     pic26= new Image();
     pic26.src="http://petsupplyfiles.com/imagefiles/randomgift/biddibuddiepalace.jpg";  
     pic27= new Image();
     pic27.src="http://petsupplyfiles.com/imagefiles/randomgift/sofkrate2home.jpg";  
     pic28= new Image();
     pic28.src="http://petsupplyfiles.com/imagefiles/randomgift/bdacleanstp.jpg";  
     pic29= new Image();
     pic29.src="http://petsupplyfiles.com/imagefiles/randomgift/ltblstroller.jpg";  
     pic30= new Image();
     pic30.src="http://petsupplyfiles.com/imagefiles/randomgift/k-hlctrosfthtdptbd1924.jpg";
	 
	 
	 
	 
 }    

var pics= new Array(30); 
   pics[0]=pic1.src;
   pics[1]=pic2.src;
   pics[2]=pic3.src;
   pics[3]=pic4.src;
   pics[4]=pic5.src;
   pics[5]=pic6.src;
   pics[6]=pic7.src;
   pics[7]=pic8.src;
   pics[8]=pic9.src;
   pics[9]=pic10.src;
   pics[10]=pic11.src;
   pics[11]=pic12.src;
   pics[12]=pic13.src;
   pics[13]=pic14.src;
   pics[14]=pic15.src;
   pics[15]=pic16.src;
   pics[16]=pic17.src;
   pics[17]=pic18.src;
   pics[18]=pic19.src;
   pics[19]=pic20.src;
   pics[20]=pic21.src;
   pics[21]=pic22.src;
   pics[22]=pic23.src;
   pics[23]=pic24.src;
   pics[24]=pic25.src;
   pics[25]=pic26.src;
   pics[26]=pic27.src;
   pics[27]=pic28.src;
   pics[28]=pic29.src;
   pics[29]=pic30.src;


var imgLinks = new Array(30);
 imgLinks[0] = "petsafepetfeeder.html";
 imgLinks[1] = "floydlgbl.html";
 imgLinks[2] = "flingamastring.html";
 imgLinks[3] = "doggiedriver.html";
 imgLinks[4] = "chuckitball.html";
 imgLinks[5] = "chewbrush5.html";
 imgLinks[6] = "cattowerwarm.html";
 imgLinks[7] = "catpackb1.html";
 imgLinks[8] = "bumbleball.html";
 imgLinks[9] = "bspreservefeeder.html";
 imgLinks[10] = "berganturbotrack.html";
 imgLinks[11] = "treatsbundles.html";
 imgLinks[12] = "sleepblugrnmd.html";
 imgLinks[13] = "ritared.html";
 imgLinks[14] = "freshflow.html";
  imgLinks[15] = "runaboutball7m.html";
 imgLinks[16] = "jwholeemolee5.html";
 imgLinks[17] = "stocking7pc.html";
 imgLinks[18] = "petstgsoccpichwtoylg.html";
 imgLinks[19] = "wildtail.html";
 imgLinks[20] = "eclseorcblck2gl.html";
 imgLinks[21] = "shbeefsticks12pk.html";
 imgLinks[22] = "bobalot.html";
 imgLinks[23] = "hyperdog2ball.html";
 imgLinks[24] = "cacatpo.html";
 imgLinks[25] = "biddibuddiepalace.html";
 imgLinks[26] = "sofkrate2home.html";
 imgLinks[27] = "bdacleanstp.html";
 imgLinks[28] = "ltblstroller.html";
 imgLinks[29] = "k-hlctrosfthtdptbd1924.html";




var numpics=30;
var thenum=0;
imgName="img1";
linkName="link1";

function change_it()
 {
   if (document.images)
    {
      document.write("<a href=\"" + imgLinks[thenum]+"\" id=\"link1\"><img src=\""+pics[thenum]+"\" border=\"0\" name=\"img1\"></a>\n");
      document.write("<br /><form><input type='button' value='"+button_text+"' onClick='change_it2()'></form>");
   }
}

function change_it2()
 {
         var x=0;
         thenum+=1;

         if (thenum>numpics-1)
         { 
           document[imgName].src=pics[0];
           document.getElementById(linkName).href=imgLinks[0];
           thenum=0;
           }
         else
         {
           document[imgName].src=pics[thenum];
           document.getElementById(linkName).href=imgLinks[thenum];
           x+=1;
          }
 }
