$(document).ready(function() {
	
	if ($('#nav').length > 0){
		$('#nav').find('li').wrapInner('<h5 class="fblack"></h5>');
		Cufon.replace('.fblack', { 
			fontFamily: 'Bombardier', 
			color: '-linear-gradient(#000000, #2f2f2f)'
		}); 
		$('#nav').find('li:last-child').addClass('last');
	}

	if ($('#footer-nav').length > 0){
		$('#footer-nav').find('li').wrapInner('<h5 class="fgreen"></h5>');
		Cufon.replace('.fgreen', { 
			fontFamily: 'Bombardier', 
			color: '-linear-gradient(#41731d, #6dc131)'
		});
	}

	if ($('#tour-dates').length > 0){
		$('#nextshows').append($('#tour-dates').find('.next').html());
	}

	if ($('#news-calendar').length > 0){
		$('#news-calendar .month').text($('#news-calendar').find('caption').text());
		$('#news-calendar').find('caption').remove();
	}
	
	if ($('.tubepress_thumbnail_area').length > 0){
		$('.tubepress_thumbnail_area > div:first-child').addClass('thumb-list');
		$('.tubepress_thumbnail_area .thumb-list').each(function() {
			var wi = $(this).find('.tubepress_thumb').length * 142;
			$(this).css('width', wi);
			$(this).children('.tubepress_thumb').addClass('shadow');
		});
	}

	if ($('#signup').length > 0 || $('#signup-footer').length > 0) {
		
		$(".txB").focus(function(srcc) {
			if ($(this).val() == $(this)[0].title) {
				$(this).val("");
			}
		});
		$(".txB").blur(function() {
			if ($(this).val() == "") {
				$(this).val($(this)[0].title);
			}
		});
		$(".txB").blur();  
			
	}

	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});

});

$(window).load(function() {

	if ($('#home').length > 0){
		var ht = $('.home-tour').outerHeight() - 28;
		var hn = $('.home-news').outerHeight() - 28;
		if (ht > hn) {
			$('.home-news').css('height', ht+'px');
		}else{
			$('.home-tour').css('height', hn+'px');
		}
		
		
	}

	$('#twitter-feed ul').innerfade({ speed: 'slow', timeout: 4000, type: 'sequence', containerheight: '30px' }); 
	
	if ($('.shadow').length > 0) {
		$('.shadow').each(function() {
			var hrWidth = $(this).outerWidth() - 22;
			var vrHeight = $(this).outerHeight() - 22;
			$(this).css("position","relative");
			$(this).append('<b class="tl"></b><b class="t" style="width:'+hrWidth+'px"></b><b class="tr"></b><b class="l" style="height:'+vrHeight+'px"></b><b class="r" style="height:'+vrHeight+'px"></b><b class="bl"></b><b class="b" style="width:'+hrWidth+'px"></b><b class="br"></b>');
		});
	}
	
});
