// JavaScript Document
$(document).ready(function(){
						   
						   
	//////clear absolutes///////////
	var $pgH = $('#pageOverlapText').height();
	if($pgH > 645){
	//alert($pgH);
	var $htH = $('#homeTiles').height();
	var $newHtH = $('#pageOverlapText').height() - 250;
	$('#homeTiles').css('height', $newHtH);
	}
	var $pgH = $('#homeContentText').height();
	var $htH = $('#homeTiles').height();
	var $newHtH = $('#homeContentText').height();
	$('#homeTiles').css('height', $newHtH);
	
	var $pgpgH = $('#pgContentText').height();
	var $pghtH = $('#pgTiles').height();
	var $pgnewHtH = $('#pgContentText').height();
	$('#pgTiles').css('height', $pgnewHtH);
	/////////////////////////////////
	
	
	//alert($pgH+" " +$htH);
	//alert($('#pageOverlapText').height() + 350);
	//$('#wrapper').animate({opacity:'show'},500);
	//$('#footWrap').animate({opacity:'show'},500);
	$('#content').animate({opacity:'show'},750);
	$('#content-photo').animate({opacity:'show'},750);
	$('#about').animate({opacity:'show'},750);
	$('#about').find(".moretext").hide();
	$('#about').find(".readMore").show();
	
	
	$("ul.homeNav li").hover(function() { //When trigger is clicked...
		var $width = $(this).width() ;
		var $x = $width + 10;
		
		$(this).find("ul.subNav").css('margin-left',$x)
		//alert($x);
		$(this).find("ul.subNav").show();
		//$(this).find("ul.subNav").animate({width: 'show',opacity: 'show'}, 'fast'); //Drop down the subnav on click
	},function(){
			//$(this).find("ul.subNav").animate({width:'hide',opacity: 'hide'}, 'fast');
			$(this).find("ul.subNav").hide();
	});
	
	
	$("ul.topMenu li").hover(function() { //When trigger is clicked...
		
		//$(this).find("ul.subNav").css('margin-left',$x)
		//alert($x);
		$(this).find("ul.sub-menu").animate({height: 'show', opacity: 'show'}, 'fast')
		//$(this).find("ul.subNav").animate({width: 'show',opacity: 'show'}, 'fast'); //Drop down the subnav on click
	},function(){
			//$(this).find("ul.subNav").animate({width:'hide',opacity: 'hide'}, 'fast');
			$(this).find("ul.sub-menu").animate({height:'hide',opacity: 'hide'}, 'normal');
	});
	
	
	$('#about').find(".readMore").hover(function (){								  
			$(this).css('color','#ffffff')		  
		}, function(){
			 $(this).css('color','#DDD8CB')	 
		});
	
	$('#about').find(".readLess").hover(function (){								  
			$(this).css('color','#ffffff')		  
		}, function(){
			 $(this).css('color','#DDD8CB')	 
		});
	
	$('#about').find(".readMore").click(function(){
		$(this).hide();
		$('#about').find(".readLess").show();
		$('#about').find(".moretext").slideDown();
	});
	
	$('#about').find(".readLess").click(function(){
		$(this).hide();
		$('#about').find(".readMore").show();
		$('#about').find(".moretext").slideUp();
	});
	
	
	
});
