function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt) {
	var idx = carousel.index(i, mycarousel_itemList.length);
	carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};
function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt) {
	carousel.remove(i);
};
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
	scroll:1,
	animation:"slow",
	wrap:"both",
	auto:"5"
	});
});
function sfi(type, tag, parentId) {
	if (window.attachEvent) {
		window.attachEvent("onload", function() {
			var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);
			type(sfEls);
		});
	}
}
sfHover = function(sfEls) {
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
sfi(sfHover,"LI","nav");
sfi(sfHover,"TD","wp-calendar");
sfi(sfHover,"LI","content");
$(document).ready(function() {
	$('#enlarge').hide();
	$('.screenshot img').mouseover(function() {
		$('#enlarge').css("display","block").fadeTo(100,1);
		$('.screenshot img').fadeTo(100,0.25);
	});
	$('#enlarge').mouseout(function() {
		$('#enlarge').css("display","none");
		$('.screenshot img').fadeTo(100,1);
	});
	$('#bigpic').hide();
	$('#enlarge').click(function() {
		$('#bigpic').fadeIn("fast");
		$('.leftsec').css("display","none");
		$('.rightsec').css("display","none");
		$(this).hide();
		$('#bigpic').click(function() {
			$(this).fadeOut("fast",function(){
				$('.leftsec').css("display","block");
				$('.rightsec').css("display","block");
			});
		});
	});
	$('.tooltip').Tooltip( {
		track:true,
		showURL:false,
		showBody:"",
		delay:100
	});
	$('.lastbox img').mouseover(function() {
		$(this).fadeTo(250,0.25);
	});
	$('.lastbox img').mouseout(function() {
		$(this).fadeTo(250,1);
	});
	$('.catboximg').mouseover(function() {
		$(this).fadeTo(250,0.25);
	});
	$('.catboximg').mouseout(function() {
		$(this).fadeTo(250,1);
	});
	$("#randombtn").click(function() {
		$('#randombtn').attr("disabled","disabled");
		$('#randomajax').fadeTo("slow",0);
		$('#randomajax').load("/ps/wp-content/themes/pb/randomize.php");
		$("#randombtn").ajaxComplete(function() {
			$('#randomajax').fadeTo("slow",1);
			$('#randombtn').attr("disabled","");
		});
	});
});