$(document).ready(function(){
	
		setFooter();
	
					$('.subnav_link').each(function(){
						 $(this).click(function(event){
								event.preventDefault();
								$('.footer').fadeOut();
								$('.subnav_link').removeClass('current-post');
								$(this).addClass('current-post');
								$('.post').css({display:'none'});
								var idnum = $(this).attr('rel');
								$('#post-'+idnum).css({display:'block'});												      
								$('.category_wrap').animate({ 
					        width: '960px'
					      }, 500 );
						 });
					});
					
					
					// LIGHTBOX CONFIG ==========================================
				$(function() {
				   $('a[@rel*=lightbox]').lightBox({
					overlayBgColor: '#FFF',
					overlayOpacity: 0.8,
					containerResizeSpeed: 0,
					containerBorderSize:0,
					txtImage: '',
					txtOf: '',
					imageLoading: 		'http://triciatreacy.com/wp-content/themes/fade/images/lightbox-ico-loading.gif',
					imageBtnPrev:			'http://triciatreacy.com/wp-content/themes/fade/images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
					imageBtnNext:			'http://triciatreacy.com/wp-content/themes/fade/images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
					imageBtnClose:		'http://triciatreacy.com/wp-content/themes/fade/images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
					imageBlank:				'http://triciatreacy.com/wp-content/themes/fade/images/lightbox-blank.gif'				
				   });
				});
					
});

$(window).load(function(){ setHome();	});

$(window).resize(function(){ setHome();	setFooter(); });

function setHome() {

var winx = $(window).width();
var winy = $(window).height();
var oW = 1024, oH = 768;

	if (winx/winy > oW/oH){
		winy = winx * oH / oW;
		winx = winx; 
	} else {
		winx = winy * oW / oH;
		winy = winy; 
	}

	$('#fullbg').css({ 
		width:winx, 
		height:winy,
		visibility:'visible'
	});

}

function setFooter() {
	var viewport = $(window).height();

	if (viewport > 600){
		$("#page").css({height:viewport});				
	} else {
		$("#page").css({height:'600px'});		
	}
}


