    $(document).ready(function(){
			
			/* calculate height and width of current screen */
			var windowH = $('#main').height();
			var windowW = $('#main').width();

			/* make scrollable content in sidebar end 170px from the bottom of the calculated screen area,
			   so there is room to show page stats */			
			$("#fsidebar .content").css('height', (windowH-170) + "px");

			/* put footer at bottom of calculated screen area */						
			$("footer").css("margin-top", parseInt(windowH-89) + "px");

			var picH, picW;
			// fsidebar is 370 width
			picW = windowW - 370;
			picH = picW * picR;	
				
			var picTcenter = parseInt((picH-windowH)/2);
			
			/* set bigpic width */
			$("#bigpic").css("width", picW + "px");	
			
			/* position picture vertically based on vp variable (c=center, t=top, b=bottom) */
			if (vp == 'c') {
				offsetY = parseInt((windowH-picH)/2);
			} else if (vp == 't') {
				offsetY = 0;
			} else {
				offsetY = windowH-picH;
			}
			$("#bigpic").css("top", offsetY + "px");
	
			/* define action of scroll arrows at top and bottom of screen - to show rest of picture */
			if (windowH < picH) {
				$('#scrolldown').show();
				$('#scrollup').show();
				$('#scrollup').css('left', picW/2);
				$('#scrolldown').css('left', picW/2);
				$('#scrollup').mouseover(function() {
					$(this).css('opacity',1);
					$('#bigpic').animate({'top':34}, 1500);
				});
				$('#scrollup').mouseout(function() {
					$(this).css('opacity',0.3);
					$('#bigpic').stop();
				});
				$('#scrolldown').mouseover(function() {
					$(this).css('opacity',1);
					$('#bigpic').animate({'top':'-' + (picH-windowH) + 'px'}, 1500);
				});				
				$('#scrolldown').mouseout(function() {
					$(this).css('opacity',0.3);
					$('#bigpic').stop();
				});
				
			/* display only if needed */
			} else {
				$('#scrolldown').hide();
				$('#scrollup').hide();
			}

			/* show map with pushpin at location of this pic */				
      $("#smallmap").gmap3(
        { action: 'addMarker',
          latLng: [lat, lng],
          map:{
            center: true,
            zoom: 15
          },
          marker:{
            options:{
              draggable: false,
							icon:burl+'img/sm_pink_pushpin.png'
            }
          }
        }				
      );
			
			/* activate top dropdown menu */
			$("#nav-one").dropmenu();
			
			/* activate [more] / [less] inline text links */
			$(".complete").hide();
			$(".expandshrink").toggle(function(){
				 $(this).text("[less]").siblings(".complete").show();    
			}, function(){
				 $(this).text("[more]").siblings(".complete").hide();    
			});
				
		});
