jQuery(function(){
	var i=0;
	jQuery('.vcard').each(function(){
		if(i/2 == Math.floor(i/2)){
			jQuery(this).addClass('left');
		}
		i++;
	});	
		
		jQuery("#slideshow").cycle({ 
			pager: '#pager',
			fx: 'fade',
			timeout: 7000,
		speed: 1000,
		pause: 1,
		cleartypeNoBg: true,
		fit: 1,
		easing: 'easeInOutQuad',
		/*pagerClick: navPager,*/
		before: beforeSlide
	});
	function beforeSlide(current, next, options, flag){
		for(i=0; i<descriptions.length; i++){
			if('img-'+descriptions[i].index == jQuery(next).attr('class')){
				var desc = descriptions[i].desc;
				var title = descriptions[i].title;
				break;
			}
		}	
		jQuery('#feature h1').fadeOut(500, function(){
			jQuery(this).html(title);
			jQuery(this).fadeIn(500);
		});
		jQuery('#feature p').fadeOut(500, function(){
			jQuery(this).html(desc);
			jQuery(this).fadeIn(500);
		});
			
	}
	jQuery('#rss-3 li a, #rss-4 li a, .sidebar-events li a').click(function(){
		var clicked = jQuery(this).attr('href');
				/*
				Shadowbox.open({
				content: clicked,
				player: "iframe",
				width: 940,
				height: 560,
				//title: jQuery(data).find('h2').html(),
				options: { onFinish: function(){check(clicked)}}
				});
				*/
		var event = window.open(clicked, 'event', "height=240, width=600, scrollbars=false");
		event.focus();
		
		return false;
	});
	jQuery('#subnav li:first-child a').css({
		'margin-left': '0',
		'padding-left': '0'
	});
	jQuery('#subnav li:last-child a').css({
		'margin-right': '0',
		'width': '120px',
		'padding-right': '22px'
	});
	jQuery('#subnav li:last-child').css({
		'background': 'none'
	});
	jQuery('#linkcat-2 img').load(function(){
		jQuery(this).pixastic("hsl", {hue:0,saturation:-100,lightness:0});
	}).parent('a').hover(function(){
		if(jQuery(this).children('canvas')[0]) jQuery(this).html('<img src="/wp-content/themes/goodshepherd/js/'+jQuery(this).children('canvas')[0].imgsrc+'"/>');	
	},
	function(){
		jQuery(this).children('img').pixastic("hsl", {hue:0,saturation:-100,lightness:0});
	}).each(function(){
		jQuery(this).children('img').pixastic("hsl", {hue:0,saturation:-100,lightness:0});
	});
	
});
function check(target){
	console.log(target);
	console.log(jQuery('#sb-content body').html());
}
Cufon.replace('#middle h6', {textShadow: '0px 1px #000'});

