//>> Social Media Blocks
var tspan_socialblock;
jQuery(window).scroll(function(){
	if(!tspan_socialblock) tspan_socialblock = jQuery('#SocialBlock');
	tspan_socialblock.stop().animate({"marginTop": (jQuery(window).scrollTop() + 25) + "px"}, "slow" );
});

jQuery(window).resize(function(){ 
	resizewindow(); 
});

jQuery(document).ready(function() {
	jQuery().framerate();

	var list = jQuery('#SocialBlock div a');
	list.css('opacity', '0').show().fadeTo(2000, .5);
	list.each(function() { jQuery(this).hover( function() { jQuery(this).stop().fadeTo('slow', .99); }, function() { jQuery(this).stop().fadeTo('slow', .5); }); });
	resizewindow();

	var ribbonlist = jQuery('.Ribbon');
	//>> distribute the ribbons vertically
	var curHeight = 0;
	ribbonlist.each(function(idx,itm) {
		var obj = jQuery(this);
		if(curHeight > 0) {
			obj.css('top',curHeight);
		}
		curHeight = obj.position().top + obj.height();
		obj.attr('ribbonIndex',idx);
	});

});

function resizewindow() {
	var contentHeight = jQuery('#PageWrapper').height();
	var windowHeight = jQuery(window).height();
	if(windowHeight > contentHeight) {
		var setHeight = (contentHeight > windowHeight ? contentHeight : windowHeight);
		jQuery('html').css({'height': setHeight + 'px'});
		jQuery('body').css({'height': setHeight + 'px'});
		jQuery('#PageWrapper').css({'height': setHeight + 'px'});
	}
}

