// JavaScript Document
$(document).ready(function(){
	$('input.searchBtn').mouseover(function(){
		$(this).addClass('highlighted');		
	});
	$('input.searchBtn').mouseout(function(){
		$(this).removeClass('highlighted');		
	});
	$('#adobeinfo').hide();	
	$('#codeinfo').hide();
	$('div#photo').hide();
//	$('#secondary_top').hide();
//	$('#secondary_top').animate({ 
//			  opacity: 'show',
//			  height: 'show'
//			}, 2000);
//	$('#oadgmarquee').hide();
//	$('#oadgmarquee').animate({ 
//			  opacity: 'show',
//			  height: 'show'
//			}, 3000);
	
//	$('.mapinfo').hide();
	$('table.expandtable').hide();
	var browserName=navigator.appName; 

	//if (browserName!="Microsoft Internet Explorer"){
		$('<li><input type="button"  class="mapBtn" id="mapButton" value="Show Map" /></li><li>&nbsp;</li>')
		.insertAfter('#map1');		
	//}
	$('#newsButton').click(function(){
		if($(this).val()=='Hide All News'){
			$('.news_item').animate({ 
			  opacity: 'hide',
			  height: 'hide'
			}); 
			$(this).val('Show All News');
			$('#news h3').removeClass('down_arrow')
			.addClass('right_arrow')				  
		} else { 
			$('.news_item').animate({ 
			  opacity: 'show',
			  height: 'show'
			}); 
			$(this).val('Hide All News'); 
			$('#news h3').removeClass('right_arrow')
			.addClass('down_arrow')			  
		}
	  });	
  	// hide all the content panes when the page loads
  	$( '#news > ul' ).hide();
    $( '#news h3:first')
		.removeClass('right_arrow')
		.addClass('down_arrow');
 	 // uncomment the next line if you'd like the first pane to be visible by default
  	$('#news > ul:first').show();
//  	$('#news > ul:first')
//		.animate(
//		    {'height':'toggle'}, 3000, 'easeOutBounce');
  
 	$('#news h3').click(function() {
   	  $(this).next()
	 	.animate( 
		    //{'height':'toggle'}, 'slow', 'easeOutBounce');
		    //{'height':'toggle'}, 3000, 'easeOutBounce');	
		    {'height':'toggle'}, 3000);			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
    	.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
    	.addClass('right_arrow')		  
	  }
  	});
	
	$('#classBtn').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#horse').is(':visible')) {
		$('#horse').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#horse').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });

	$('#classBtn_1').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#tack').is(':visible')) {
		$('#tack').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#tack').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });
  
  	$('#classBtn_2').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#apparel').is(':visible')) {
		$('#apparel').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#apparel').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });
  
  	$('#classBtn_3').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#coach').is(':visible')) {
		$('#coach').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#coach').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });
  
  	$('#classBtn_4').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#lodge').is(':visible')) {
		$('#lodge').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#lodge').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });
  
  	$('#classBtn_5').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#other').is(':visible')) {
		$('#other').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#other').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });
    
  	$('#classBtn_6').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#farm').is(':visible')) {
		$('#farm').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#farm').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });
	$('#galleryBtn').click(function(){			
	  if ($(this).hasClass('right_arrow')){
		$(this).removeClass('right_arrow')
		.addClass('down_arrow')
	  }else{
		$(this).removeClass('down_arrow')
		.addClass('right_arrow')		  
	  }
	if($('#photo').is(':visible')) {
		$('#photo').animate({ 
		  opacity: 'hide',
		  height: 'hide'
		}, 'slow'); 	  
	} else { 
		$('#photo').animate({ 
		  opacity: 'show',
		  height: 'show'
		}, 'slow');    
	}
  });  	
  	// hide all the videos when the page loads
  	$( '#video > ul' ).hide();
    $( '#video h3:first')
		.removeClass('right_arrow')
		.addClass('down_arrow');
  
 	 // uncomment the next line if you'd like the first video to be visible by default
  	$('#video > ul:first').show();
  
 	$('#video h3').click(function() {
		
	// hide all the videos when h3 is clicked
  		$( '#video > ul' ).hide();
   		$( '#video h3')
			.removeClass('down_arrow')
			.addClass('right_arrow');
		
		// show only the video below clicked h3
   	 	$(this).next().show();			
		if ($(this).hasClass('right_arrow')){
			$(this).removeClass('right_arrow')
			.addClass('down_arrow')
		}else{
			$(this).removeClass('down_arrow')
			.addClass('right_arrow')		  
		}
  	});
	
	$('a[href="#"]').click(function(){
	$.scrollTo(0,'slow');
	return false;
	});
		
	$('table.stripe_table tbody tr:even').addClass('zebra');		
	$('table.expandtable tbody tr:even').addClass('zebra');
	
					
//	$('#example1').flickrGallery({
//		api_key: 'e298a304cce95b66226a6d1b61018a20',
//		user_id: '56548414@N03',
//		photoset_ids: [
//			'72157625517691748'
//		]
//	});
	 
  	$('#expandBtn_2').click(function(){			
		  if ($(this).hasClass('right_arrow')){
			$(this).removeClass('right_arrow')
			.addClass('down_arrow')
		  }else{
			$(this).removeClass('down_arrow')
			.addClass('right_arrow')		  
		  }
		if($('#ex_2').is(':visible')) {
			$('#ex_2').animate({ 
			  opacity: 'hide',
			  height: 'hide'
			}, 'slow'); 	  
		} else { 
			$('#ex_2').animate({ 
			  opacity: 'show',
			  height: 'show'
			}, 'slow');    
		}
	  });
	 
  	$('#expandBtn_1').click(function(){			
		  if ($(this).hasClass('right_arrow')){
			$(this).removeClass('right_arrow')
			.addClass('down_arrow')
		  }else{
			$(this).removeClass('down_arrow')
			.addClass('right_arrow')		  
		  }
		if($('#ex_1').is(':visible')) {
			$('#ex_1').animate({ 
			  opacity: 'hide',
			  height: 'hide'
			}, 'slow'); 	  
		} else { 
			$('#ex_1').animate({ 
			  opacity: 'show',
			  height: 'show'
			}, 'slow');    
		}
	  });
	  	  	 
  	$('#expandBtn').click(function(){			
		  if ($(this).hasClass('right_arrow')){
			$(this).removeClass('right_arrow')
			.addClass('down_arrow')
		  }else{
			$(this).removeClass('down_arrow')
			.addClass('right_arrow')		  
		  }
		if($('#ex').is(':visible')) {
			$('#ex').animate({ 
			  opacity: 'hide',
			  height: 'hide'
			}, 'slow'); 	  
		} else { 
			$('#ex').animate({ 
			  opacity: 'show',
			  height: 'show'
			}, 'slow');    
		}
	  });
	     
//	$('#mapButton').click(function(){
//		if($('.mapinfo').is(':visible')) {
//			$('.mapinfo').animate({ 
//			  opacity: 'hide',
//			  height: 'hide'
//			}, 'slow'); 
//			$(this).val('Show Map');	  
//		} else { 
//			$('.mapinfo').animate({ 
//			  opacity: 'show',
//			  height: 'show'
//			}, 'slow'); 
//			$(this).val('Hide Map');    
//		}
//	  });
	     
	$('#mapButton').click(function(){
		if($('.mapinfo').is(':visible')) {	
			$('.mapinfo').remove();
			$(this).val('Show Map');	  
		} else {
			//Munster Community Centre 
            //$('<small class="mapinfo"><a class="mapinfo" target="_new" href="http://maps.google.ca/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=58+dogwood,+munster,+ontario,+canada&amp;sll=50.625073,-97.119141&amp;sspn=42.152463,114.169922&amp;ie=UTF8&amp;hq=&amp;hnear=58+Dogwood+Dr,+Ottawa,+Ottawa+Division,+Ontario+K0A+3P0&amp;ll=45.162819,-75.938528&amp;spn=0.011726,0.027874&amp;z=14" style="text-align:left">View Larger Map</a></small>')
			//Dorothea Larsen's Home
			//$('<small class="mapinfo"><a  target="_new"  href="http://maps.google.ca/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=6096+3rd+Line+Road,+Ottawa,+Ontario&amp;sll=49.891235,-97.15369&amp;sspn=39.565062,57.919922&amp;ie=UTF8&amp;hq=&amp;hnear=6096+3+Line+Rd+N,+Ottawa,+Ottawa+Division,+Ontario+K0A+2T0&amp;ll=45.165895,-75.725507&amp;spn=0.02118,0.036478&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>')
			//Benhaven Farm			
			//$('<small class="mapinfo"><a target="_new"  href="http://maps.google.ca/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=1954+9th+Line,+Beckwith,+ON+K7C+3P2&amp;aq=0&amp;sll=58.585436,-113.774414&amp;sspn=16.324108,57.084961&amp;ie=UTF8&amp;hq=&amp;hnear=1954+9th+Line,+Beckwith,+Lanark+County,+Ontario+K7C+3P2&amp;ll=45.090975,-76.135254&amp;spn=0.169666,0.291824&amp;z=11&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>')
			//Pierre Paquette's Home
			//$('<small class="mapinfo"><a target="_new" href="http://maps.google.ca/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=1545+9th+Line++Metcalfe,+ON&amp;sll=49.891235,-97.15369&amp;sspn=39.643899,54.492187&amp;ie=UTF8&amp;hq=&amp;hnear=1545+9+Line+Rd,+Edwards,+Ontario+K0A+1V0&amp;ll=45.293441,-75.476744&amp;spn=0.084532,0.145912&amp;z=12&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>')
			//Cathy's Home
			$('<li><small class="mapinfo"><a target="_new" href="http://maps.google.ca/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=819+Drummond+Rd,+Mississippi+Mills,+ON+K7C+4A7&amp;aq=0&amp;sll=49.891235,-7.15369&amp;sspn=41.251906,54.492187&amp;ie=UTF8&amp;hq=&amp;hnear=819+Drummond+Rd,+Mississippi+Mills,+Lanark+County,+Ontario+K7C+4A7&amp;t=m&amp;vpsrc=6&amp;ll=45.197522,-76.1689&amp;spn=0.169349,0.291824&amp;z=11&amp;iwloc=A" style="color:#091f0e;text-align:left">View Larger Map</a></small></li>')
			.insertAfter('#map2');	
			//Munster Community Centre 	
            //$('<iframe class="mapinfo" width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=58+dogwood,+munster,+ontario,+canada&amp;sll=50.625073,-97.119141&amp;sspn=42.152463,114.169922&amp;ie=UTF8&amp;hq=&amp;hnear=58+Dogwood+Dr,+Ottawa,+Ottawa+Division,+Ontario+K0A+3P0&amp;ll=45.162819,-75.938528&amp;spn=0.011726,0.027874&amp;z=14&amp;output=embed"></iframe>')
			//Dorothea Larsen's Home
			//$('<iframe class="mapinfo" width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=6096+3rd+Line+Road,+Ottawa,+Ontario&amp;sll=49.891235,-97.15369&amp;sspn=39.565062,57.919922&amp;ie=UTF8&amp;hq=&amp;hnear=6096+3+Line+Rd+N,+Ottawa,+Ottawa+Division,+Ontario+K0A+2T0&amp;ll=45.165895,-75.725507&amp;spn=0.02118,0.036478&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br />')
			//Benhaven Farm			
			//$('<iframe class="mapinfo" width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=1954+9th+Line,+Beckwith,+ON+K7C+3P2&amp;aq=0&amp;sll=58.585436,-113.774414&amp;sspn=16.324108,57.084961&amp;ie=UTF8&amp;hq=&amp;hnear=1954+9th+Line,+Beckwith,+Lanark+County,+Ontario+K7C+3P2&amp;ll=45.090975,-76.135254&amp;spn=0.169666,0.291824&amp;z=11&amp;iwloc=A&amp;output=embed"></iframe><br />')
			//Pierre Paquette's Home
			//$('<iframe class="mapinfo" width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=1545+9th+Line++Metcalfe,+ON&amp;sll=49.891235,-97.15369&amp;sspn=39.643899,54.492187&amp;ie=UTF8&amp;hq=&amp;hnear=1545+9+Line+Rd,+Edwards,+Ontario+K0A+1V0&amp;ll=45.293441,-75.476744&amp;spn=0.084532,0.145912&amp;z=12&amp;iwloc=A&amp;output=embed"></iframe><br />')
			//Cathy's Home
			$('<li><iframe class="mapinfo" width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=819+Drummond+Rd,+Mississippi+Mills,+ON+K7C+4A7&amp;aq=0&amp;sll=49.891235,-97.15369&amp;sspn=41.251906,54.492187&amp;ie=UTF8&amp;hq=&amp;hnear=819+Drummond+Rd,+Mississippi+Mills,+Lanark+County,+Ontario+K7C+4A7&amp;t=m&amp;vpsrc=6&amp;ll=45.197522,-76.1689&amp;spn=0.169349,0.291824&amp;z=11&amp;iwloc=A&amp;output=embed"></iframe><br /></li>')
			.insertAfter('#map2');
			$(this).val('Hide Map');    
		}
	  });
	     
	$('#adobeButton').click(function(){
		if($('#adobeinfo').is(':visible')) {
			$('#adobeinfo').animate({ 
			  opacity: 'hide',
			  height: 'hide'
			}, 'slow'); 
			//$(this).val('Get Adobe Reader for pdf files');	  
		} else { 
			$('#adobeinfo').animate({ 
			  opacity: 'show',
			  height: 'show'
			}, 'slow'); 
			//$(this).val('Hide');    
		}
	  });

  //$('#oadgmarquee')
  //  .effect('shake', {times:4}, 300);
});
