$(document).ready
	(
		
		function()
			{
				configSubnav();
				initPosition();
    			$("#newsletter-form").validate();
				$(".hidden").hide();
				$(".hidden").before("<p class='readmore'><a href='#'>Read more...</a></p>");
				$(".readmore").live(
					"click",
					function () {
						if ($(this).next(".hidden").is(":visible")) {
							$(this).next(".hidden").hide();
							$(this).children("a").text("Read more...");					
						}
						else {	
							$(this).next(".hidden").fadeIn();
							$(this).children("a").text("Read less...");				
						}
						return false;
					}
				); 
				$("a.enlarge").fancybox();
			}
	);
	
function configSubnav()
	{
		var url = document.URL.split("/");
		$("#nav a").each
			(
				function ()
					{
						$(this).attr("class", "off");
						if($(this).attr("href") == url[url.length-1])	
							{
								$(this).attr("class", "on");
							}
					}
			);
	}
	
	
	/* VERTICALLY & HORIZONTALLY CENTERS AN ELEMENT WITH ID = "page-wrapper"
**  
** CALL THIS FUNCTION IN $(document).ready()
**
** INCLUDE THE FOLLOWING SCRIPT IN DOCUMENT HEADER TO ACCOMMODATE BROWSER RESIZING
** $(window).resize(function(){initPosition();});
-------------------------------------------------*/

function initPosition()
  {
    
    var containerWidth = $("#page-wrapper").width();
    // ...FIND THE WIDTH OF THE VIEWPORT... 
    var winWidth = $(window).width();
    //alert(winWidth);
    // ...AND DIVIDE THE AVAILABLE HORIZONTAL SPACE IN TWO. 
    var horizOffset = (winWidth-containerWidth)/2;
    //alert(horizOffset);
    // IF PAGE IS WIDER THAN VIEWPORT, POSITION AT LEFT EDGE, ... 
    if (horizOffset < 0)
      horizOffset = 0;
    // ...OR IF VIEWPORT IS WIDER THAN PAGE, CENTER THE PAGE HORIZONTALLY 
    $("#page-wrapper").css
    	(
    		{
    			left:horizOffset,
    			marginLeft: "0"
    		}
    	);
  }



