$(document).ready(function(){
	 //START SITE SPECIFIC FUNCTIONS HERE//
	$('#maincarousel').cycle({
			fx: 'fade',
			pause: 1,
			timeout: 0,
			pager:  '#indnav',
			next:   'a.next', 
    		prev:   'a.prev'
	});
	

var mainWindow =   $(window).height();
	$('#footerwrapper').css({'position' : 'fixed', 'top' : mainWindow});
	//$('#homefooterwrapper').css({'position' : 'fixed', 'top' : mainWindow});
	

function FooterBottom(selector) {
    var newTop =   $(window).height() - 44;
    $(selector).css({'top': newTop });

//    $(selector).animate({
//	'top': newTop
//  }, 'fast', 'linear', function() {

//  });

}


//function FooterTop(selector) {
//    var newTop =   $(window).height() - 130;
//    $(selector).animate({
//	'top': newTop
//  }, 'fast', 'linear', function() {
//     	
//  });
//}


FooterBottom("#footerwrapper");
//FooterBottom("#homefooterwrapper");

// assure that it gets pushed when the page resizes
    $(window).resize(function(){
        FooterBottom('#footerwrapper');
		//pageblock(".contentblocks");
		 return false;
    });

$("#scroller li a").hover(
		function() {
		$("#workspace div:visible").hide();
		$(this).addClass('active');
		var activeTab = '#' + $(this).attr("rel"); //Find the rel attribute value to identify the active tab + content
		
		$(activeTab).fadeIn(); //Fade in the active content

	},
        function () {
			$(this).removeClass('active');
			
			$("#workspace div").hover(
						function() {
							var linker = $(this).find('a.readmore').attr("href");
							$(this).click(function(){
  								window.location = linker;
                        }); 

					},
						function () {
						$(this).fadeOut(); //Fade in the active content
					
						});

});

// initate thumb overlays and hover effects
var thumbSpd = 200;
$(".thumb_overlay").css("display", "block").fadeTo(0, 0);

$(".workimage").hover(function () {
    $(this).children("a").children(".thumb_overlay").fadeTo(thumbSpd, .8);
}, function () {
    $(this).children("a").children(".thumb_overlay").fadeTo(thumbSpd, 0);
});

	//END SITE SPECIFIC FUNCTIONS HERE//
});
