// JavaScript Document

smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'gallery.htm';
scriptName = 'portfolio.js';
countX = 4;
countY = 5;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
						 
  new Array('Our Portfolio','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
		new Array('Arena','arena.jpg',448,298,''), 
		new Array('Bob riding Jack <br>in the large arena','Bob riding Jack in the large arena.jpg',550,400,''), 
		new Array('C-22 TRplan ride <br>Smurf w-kids','C-22 TRplan ride Smurf w-kids 057.jpg',448,298,''), 
		new Array('Fire','fire.jpg',550,400,''), 
		new Array('Happy Boarders','happy boarders.jpg',550,400,''), 
		new Array('More Happy Boarders','more happy boarders.jpg',550,400,''), 
		new Array('Our newly weds getting <br>congratulations <br>from their horse','Our newly weds getting congratulations from their horse.jpg',550,400,''), 
		new Array('Owners Phil and <br>Lyles Perkins','Owners Phil and Lyles Perkins.jpg',550,400,''), 
		new Array('Part of the december<br> party','part of the december party.jpg',550,400,''), 
		new Array('Ranch','ranch.jpg',448,298,''), 
		new Array('Roundpen','roundpen.jpg',448,298,''), 
		new Array('Some of us had serious<br> conversations at the<br> Holiday party','Some of us had serious conversations at the Holiday party.jpg',550,400,''), 
		new Array('Teaching in large<br> round pen','teaching in large round pen.jpg',550,400,''), 
		new Array('The perkins kids<br> enjoying the <br>Holiday party','The perkins kids enjoying the Holiday party.jpg',550,400,''), 
		new Array('We have some of <br>the friendliest horses','We have some of the friendliest horses.jpg',550,400,''), 
		new Array('Zack and Chicken','Zack_and_Chicken.jpg',550,400,''), 
		new Array('Zack\'s Head Shot','zacks head shot.jpg',550,400,''), 
		new Array('A visiting Neighbor','a visiting neighbor.jpg',300,448,''), 
		new Array('C-22 TRplan ride <br>Smurf w-kids','C-22 TRplan ride Smurf w-kids 041.jpg',250,491,''), 
		new Array('Dane and Gunnar <br> Half Pass','Dane_and_Gunnar_half_pass.jpg',300,420,''), 
		new Array('Dane and Gunnar','Dane-GunnerRGB.jpg',300,448,''), 
		new Array('Horses are <br>so happy here','Horses are so happy here.jpg',300,420,''), 
		new Array('New Boarder Cindy<br> and her horse Grover','New Boarder Cindy and her horse Grover.jpg',300,420,''), 
		new Array('Play Day event','Play Day event.jpg',300,420,''), 
		new Array('Riding in large <br>round pen','riding in large round pen.jpg',300,420,''), 
		new Array('Woody and Dane','Woody_and_Dane_1.jpg',300,420,''), 
		new Array('Yuko exercising <br>horse','Yuko exercising horse.jpg',300,420,''),
		new Array('Miss penny','miss penny.jpg',550,400,''), 
		new Array('Neal and Jess','nealjessbest.jpg',550,400,''), 
		new Array('Zion cantering','zion cantering.jpg',550,400,''),
		new Array('Neal and Jessica','nealjessica.jpg',300,420,''),
		new Array('Keri and Kota <br>jump','Keri and Kota jump 2.jpg',550,303,''),
		new Array('Bullewinkle','bullewinkle.jpg',550,400,''),
		new Array('Dane and Cognac','Dane_and_Cognac5.jpg',550,400,''),
		new Array('Dane and Gunnar','Dane_and_Gunnar.jpg',550,400,''),
		new Array('Matt Walsh','matt_walsh1.jpg',196,250,''),
		new Array('Steve clinic','steve clinic.jpg',550,400,''),
		new Array('Steve Workshop <br>Driving','stevewrkshpdriving2.jpg',550,400,''),
		new Array('Zion in ring','zion in ring.jpg',550,400,''),
		new Array('Angelo and bob riding','angeloand bob riding.jpg',550,400,''),
		new Array('Halloween','halloween_034.jpg',550,400,''),
		new Array('Mustang movement','mustang movement.jpg',550,400,''),
		new Array('Mustangs','mustangs.jpg',550,400,''),
		new Array('One of our legends!','One of our legends!.jpg',550,400,''),
		new Array('Robert and his mustang','Robert and his mustang.jpg',550,400,''),	   
		

		new Array('New Boarders','new_boarder1.jpg',196,250,''),	   
		new Array('New Boarders','new_boarder2.jpg',196,250,''),	   

		
		new Array('Back ground view mountains','backgroundview mountains.jpg',550,400,''),
		new Array('Colby cantering','Colby cantering.jpg',550,400,''),
		new Array('Colby collected','Colby collected.jpg',550,400,''),
		new Array('Felipe and Eddie','Felipe and Eddie.jpg',550,400,''),
		new Array('Granny trying out new tractors','granny trying out new tractors.jpg',550,400,''),
		new Array('Gunner in large arena','gunner in large arena.jpg',550,400,''),
		new Array('Jaun and Miss Penny','Jaun and Miss Penny.jpg',300,420,''),
		new Array('Kiwi lunging','kiwi lunging.jpg',550,400,''),	

		new Array('Follow the Leader<br>over the tarp','courtshipranch.com_follow_the_leader_over_the_tarp.jpg',550,400,''),	
		new Array('Im not so sure about<br> this thing','courtshipranch.com_im_not_so_sure_about_this_thing.jpg',400,350,''),	
		new Array('Stallions have to do<br> it with their eyes<br> closed','courtshipranch.com_stallions_have_to_do_it_with_their_eyes_closed.jpg',550,400,''),	
		new Array('','IMG_0588.jpg',550,400,''),	
		new Array('','IMG_0594.jpg',550,400,''),	
		new Array('','IMG_0602.jpg',550,400,''),	
		new Array('','IMG_0614.jpg',550,400,''),	
		new Array('','IMG_0659.jpg',300,448,''),	
		new Array('Vet shed','vet shed.jpg',550,400,'')		
		
	),0
  )
  
  /*
  ,
  new Array('Permeable Pavers','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
		new Array('','Permeable_Pavers_001.jpg',275,400,''), 
		new Array('','Permeable_Pavers_002.jpg',303,400,''), 
		new Array('','Permeable_Pavers_003.jpg',271,400,''), 
		new Array('','Permeable_Pavers_004.jpg',323,400,''), 
		new Array('','Permeable_Pavers_005.jpg',528,400,'') 
    ),0
  ),
  new Array('Walls & Pilasters','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
		new Array('','Walls_Pilasters_001.jpg',700,384,''), 
		new Array('','Walls_Pilasters_003.jpg',270,400,''), 
		new Array('','Walls_Pilasters_004.jpg',401,400,''), 
		new Array('','Walls_Pilasters_005.jpg',397,400,''), 
		new Array('','Walls_Pilasters_006.jpg',345,400,''), 
		new Array('','Walls_Pilasters_007.jpg',500,400,'') 
    ),0
  )
  */
)

section = getParameter(self.document.location.href, 'section');
if (isNaN(section) || (section=='') || (section<0) || (section>arImages.length))
  section = 0; 

ind = getParameter(self.document.location.href, 'ind');
if (isNaN(ind) || (ind=='') || (ind<0) || (ind>arImages[section][4].length))
  ind = 0; 

var arPreloadImages = new Array();
function preloadphotos() {
  if (arImages[section][2]!='') {
    for (i=ind;(i<(Number(ind)+Number(countX*countY))) && (i<arImages[section][4].length);i++) {
      arPreloadImages[i] = new Image(mediumSizes[0],mediumSizes[1]);
      arPreloadImages[i].src = arImages[section][2]+arImages[section][4][i][1];
    }
  }
}
  
function menu_portfolio() {
  var jp;
  document.write('<table border="0" cellspacing="0" cellpadding="0">');
  document.write('<tr><td>Choose a category:&nbsp;<select name="cat" class="select1" onChange="if (this.value.length!=0) window.location=this.value">');
  document.write('<option value="portfolio.htm">Categories Menu</option>');
  for (jp=0;jp<arImages.length;jp++) {
    document.write('<option value="'+pageName+'?section='+jp+'"'+((jp==section)?' selected':'')+'>'+arImages[jp][0]+'</option>');
  }  
  document.write('</select></td></tr>')
  document.write('</table>');
}  
  
function showImageMedium(number) {
  showImage('imagemedium',arImages[section][2]+arImages[section][4][number][1]);
  if (arImages[section][4][number][0]!='')
   showMessage('imagemediumname',arImages[section][4][number][0]);   
  else
   showMessage('imagemediumname','Photo '+Number(Number(number)+1));
}

function showImageBig(number) {
  showImagePopup(scriptName,section,number,arImages[section][4][number][2],
   arImages[section][4][number][3]);
}
