if(typeof(Shadowbox)!="undefined"){
	Shadowbox.init({
		skipSetup: true,
		players:    ["iframe","img"]
	});
}
$(document).ready(function(){
	if(typeof(Shadowbox)!="undefined"){
		$('#pop-video').click(function(){
			Shadowbox.open({
				content:    '/inc/video.inc.php',
				player:		["iframe"],
				title:      '',
				height:     510,
				width:      853
			});
		});
		if($('#carousel img').size()>0){
			$('#carousel img').each(function(){
				var t=$(this);
				t.click(function(){
					Shadowbox.open({
						content:    t.attr("src").replace(".jpg","-large.jpg"),
						player:		["img"],
						title:      t.attr("alt").length>0?t.attr("alt"):""
					});
				});
			});
		}
		if($('.pop-image').size()>0){
			$('.pop-image').each(function(){
				var t=$(this);
				t.click(function(){
					Shadowbox.open({
						content:    t.attr("src").replace(".jpg","-large.jpg"),
						player:		["img"],
						title:      t.attr("alt").length>0?t.attr("alt"):""
					});
				});
			});
		}
	}
	$("#carousel .carousel").jcarousel({
		scroll:1,
		wrap:"last",
		initCallback:callback
	});
	$('a[rel=blank]').attr("target","_blank");
	$('ul#portfolio').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'sequence',
		containerheight: '220px'
	});
	if($('#p7TMnav div').size()>0){
		P7_TMopen();
		$('#p7TMnav a.title').each(function(){
			$(this).click(function(){ P7_TMenu(this); });
		});
	}
	$('#header li').each(function(){
		var t=$(this);
		if(!t.hasClass('active')){
			t.mouseover(function(){ t.addClass("active"); }).mouseout(function(){ t.removeClass(); }).click(function(){ document.location.href=t.find('a').attr('href'); });
		}
	});
});
function callback(carousel){
	$(".carousel-container .nav a.prev").click(function(){
		carousel.prev();
		return false;
	});
	$(".carousel-container .nav a.next").click(function(){
		carousel.next();
		return false;
	});
}
