var slidecounter=1;
var runslideshow;
Cufon('.header');
Cufon('.mmnget ul li');
Cufon('.gih .txt');
Cufon('.titlenfaces');
Cufon('.main .video', {
	hover: {
		color: '#67368b',
		borderBottom: 'solid 1px #67368b'
	}
});
Cufon('.main .right .panel2');
Cufon('.main .right .panel3');
Cufon('.main .right .panel4');
Cufon('.main .right .panel1 .paneltitle');
Cufon('.main .right .panel1 .manyothers', {
	hover: {
		borderBottom: 'solid 1px #67368b'
	}
});
Cufon('.prefooter', {
	hover: {
		color: '#67368b'
	}
});
function slideSwitch() {
	var $active = $('#slideshow li.active');
	if ( $active.length == 0 ) $active = $('#slideshow li:last');
	var $next =  $active.next().length ? $active.next()
	: $('#slideshow li:first');
	$active.addClass('last-active');
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
	});
	slidecounter++;
	if (slidecounter==5) {
		slidecounter=1;
	}
	for (x=1;x<5;x++) {
		if (document.getElementById('bar'+x)!=null) {
			document.getElementById('bar'+x).src='images/blacktab.jpg';
		}
	}
	if (document.getElementById('bar'+slidecounter)!=null) {
		document.getElementById('bar'+slidecounter).src='images/selectedblacktab.png';
	}
}
$(document).ready(function(){
	$(".shadowhc").css("height", $(document).height()).hide();
	$('.featurevideo').click(function(){
		$(".emcontent").html('<object width="560" height="348" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="howcastplayer"><param name="movie" value="http://www.howcast.com/flash/howcast_player.swf?file=488468&theme=black"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent" /><param name="flashVars" value="autoplay=true&&fs=true"></param><embed src="http://www.howcast.com/flash/howcast_player.swf?file=488468&theme=black" type="application/x-shockwave-flash" width="560" height="348" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" flashVars="autoplay=true&&fs=true"></embed></object>');
		$(".shadowhc").toggle();
		$('.embedded-howcast-video').css('display','block');
		$('.embedded-howcast-videoclose').css('display','block');
		$(".shadowhc").css('zIndex', '9000')
		$(".embedded-howcast-video").css('zIndex', '9005')
		var left = ($(window).width() - $(".embedded-howcast-video").outerWidth()) / 2;
		$(".embedded-howcast-video").css("left", left+'px');		
	});
	$('.embedded-howcast-videoclose').click(function(){
		$(".shadowhc").toggle();
		$('.embedded-howcast-video').css('display','none');
		$('.embedded-howcast-videoclose').css('display','none');
		$(".emcontent").html('');
	});
	runslideshow = setInterval( "slideSwitch()", 5000 );
});

