// JavaScript Document

$(document).ready(function(){
	$('<div id="shadow-bottom"></div>').insertAfter('#main');
	bottomHeight();
	
	$(window).resize(function() {
		bottomHeight();
	});
	
	$('#billboard').hover(
  function () {
    $('.audio_link').css('left','10px');
  }, 
  function () {
    $('.audio_link').css('left','-9999px');
  }
);
	
	
var categoryName;	
if ($('.breadCrumb a').length > 1){
	categoryName = $('.breadCrumb a:eq(1)').text();
} else {
	var breadCrumbText = $('.breadCrumb').text();
	categoryName = breadCrumbText.substr(breadCrumbText.indexOf('>')+2);
}
	$('.inside #content_sub h2:first-child').html(categoryName);
	Cufon.replace('#content_sub h2', { fontFamily: 'Trade Gothic Bold 2' });
	categoryName = categoryName.replace(/&/g,'');
	var categoryClassName = categoryName.replace(/\s+/g,'_');
	$('body').addClass(categoryClassName);

});

function bottomHeight() {
	var contentHeight = $('#shadow-top').height() + $('#main').height() + 2 - 32 + 23;
	var windowHeight = $(window).height();
	var difference = windowHeight - contentHeight + 32;
	if (difference > 0) {
		$('#shadow-bottom').height(difference);
	}
}
