function equalizeFooter() 
{
	var currentWrapperHeight = $('body').height();
	var currentFooterHeight = $('footer').height();
	//var currentDocHeight = currentWrapperHeight + currentFooterHeight;
	var currentWindowHeight = $(document).height();
	//alert("Window: "+currentWindowHeight + "\n\nBody: "+currentWrapperHeight);
	var diff = currentWindowHeight - currentWrapperHeight + 60;
	if (diff > 0)
	{
		var newFooterHeight = currentFooterHeight + diff;
		$('footer').css('height', newFooterHeight+'px');
	}
};

$(document).ready(function() {
		
	
	// Slideshow	
	$('#slideshow #frame ul#slides').cycle({
		fx:     'scrollLeft',
		speed:    700, 
    	timeout:  4400, 
		pause: true,
		next: '.arrowRight',
		prev: '.arrowLeft'
	});
	
	$(".product").hover(function() {
		$(this).find(".prodBG").fadeIn("fast");
		$(this).find("a").animate({ color: "#ffffff" }, 400);
	},function() {
		$(this).find(".prodBG").fadeOut("fast");
		$(this).find("a").animate({ color: "#6d6059" }, 400);
	});
	
	$(function() {

		$("#newsletterButton span").hide();

		$("#newsletterButton").hover(function () {
			$(this).find("span").fadeIn("fast");
		},
		function () {
			$(this).find("span").fadeOut("fast");
		});
	});
	
	
	// Make entire div linked
	$("#slideshow ul li, .product").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});
	
	$('input:text').focus(function(){
	var newValue = $(this).val();
	if($(this).val() == 'email address'){
	$(this).attr('value','');
	} else {
	$(this).val(newValue);
	}
	});
	
	$('input:text').blur(function(){
	var newValue = $(this).val();
	if($(this).val() == ''){
	$(this).attr('value','email address');
	} else {
	$(this).val(newValue);
	}
	});
	
	
	$('#customSlides').cycle({ 
		    fx:    'fade', 
		    speed:    700, 
    		timeout:  4400, 
			pause: true,
		    next:   '#next',
		    prev:   '#prev',
		   
			activePagerClass: 'activeSlide',
			pager:  '#customNav',
		    pagerAnchorBuilder: function(idx, slide) {
		    	if (idx == 0)
		    	{
			        return '<li class=""><a href="javascript:void(0);"><img src="/assets/images/fpo-custom.jpg"></a></li>';
				}
				else if (idx == 1)
				{
			        return '<li class=""><a href="javascript:void(0);"><img src="/assets/images/custom_owl_thumb.jpg"></a></li>';
				}
				else if (idx == 2)
				{
			        return '<li class=""><a href="javascript:void(0);"><img src="/assets/images/custom_paisley_thumb.jpg"></a></li>';
				}
				else if (idx == 3)
				{
			        return '<li class=""><a href="javascript:void(0);"><img src="/assets/images/custom_theory_thumb.jpg"></a></li>';
				}
		    }
		});

	
	equalizeFooter();
	
});





















