
jQuery(document).ready(function() {
		
				var thumbs = jQuery("#press a");
				var detailContainer = jQuery("#pressDetail");
				var detailImage = jQuery("#pressDetail img");
				var detailTitle = jQuery("#pressTitle");
				var pressTable = jQuery("#press");
				var pressNav = jQuery("#pressNav");
				
				thumbs.hover(
					function(){
						jQuery(this).animate({opacity: "0.7"}, 200);
					},
					function(){
						jQuery(this).animate({opacity: "1.0"}, 200);
					}
							 
				);
				
				thumbs.click(
						function(){
							var theSource = jQuery(this).attr("href");
							var title = jQuery(this).attr("title");
							detailContainer.fadeOut(300, function(){thefadeIn()});
							
							function thefadeIn(){
								detailImage.attr("src", theSource);
								detailTitle.html(title);
								detailContainer.fadeIn(300);
							}
							
							
							
							return false;
						}
						
				);
				
				function heightCheck(){
					if(pressTable.height() > 420){
							pressNav.css("display", "block");
							var currentPanel = 1;
							var panels = Math.ceil(pressTable.height()/420);
							
							function goDown(){
								if(currentPanel != panels){
									pressTable.animate({top: "-=420px"}, 700, "easeOutQuad");
									currentPanel = currentPanel+1;
								};
							}
							
							function goUp(){
								if(currentPanel != 1){
									pressTable.animate({top: "+=420px"}, 700, "easeOutQuad");
									currentPanel = currentPanel-1;
								}
							}
							
							jQuery("#next").click(
								function(){
									goDown();
									
									return false;
								}
							);
							
							jQuery("#prev").click(
								function(){
									goUp();
									
									return false;
								}
							);
							
							
					};
				}
				
				heightCheck();
						   
						   
});
