function autoslide() {
	var x = document.x;
	var t = x + 1;
	var z = x;
	var s = t;

	if (x == document.slider_count)
		s = 1;

	/*
	 * $("#ja-scroll_"+x).animate( {opacity: 0},2000,function(){
	 * //$("#ja-scroll_"+z).css( "left", "482px" ); $("#ja-scroll_"+s).animate(
	 * {opacity: 100},10000 ); } );
	 */

	$("#ja-scroll_" + x).hide(1000, function() {
		$("#ja-scroll_" + s).show(1000);
	});

	if (x < document.slider_count)
		x++;
	else
		x = 1;
	document.x = x;
}

$(document).ready(function() {
	document.x = 1;
	document.slider_count = $(".slider_item").length;
	setInterval("autoslide()", 24000);

	if ($('#title_photo')) {
		$('#title_photo').jqFancyTransitions( {
			width : 438,
			height : 294,
			effect : "curtain",
			delay : 12000
		});
	}

	if ($('#gallery_photo')) {
		$('#gallery_photo').jqFancyTransitions( {
			width : 186,
			height : 279,
			effect : "curtain",
			delay : 12000
		});
	}

	if ($('#archive_table')) {
		var e = 1;
		$('#archive_table tr').each(function(index) {

			if (e)
				$(this).addClass("even");
			e = (!e) ? 1 : 0;
		});

		$("#archive_table tr").hover(function() {
			$(this).addClass("trhover");
		}, function() {
			$(this).removeClass("trhover");
		});
	}
	
	$("#xxx").click(function(){
		$("#test").animate({width:'toggle'},600);
	});
	
	$('a#projects').nyroModal();
});
