$(document).ready(function(){
	$("#content-side img").fadeTo("fast", 0.6);

	$("#content-side img").hover(function(){
		$(this).fadeTo("fast", 1.0);
	},function(){
   		$(this).fadeTo("slow", 0.6);
	});

	$('#content-showcase').css("width","750px");
	$('#content-showcase').css("height","252px");

	//Ajax load
	$('#content-showcase').load('/wp-content/themes/razier/showcase.php', function() {
		$('#content-showcase').cycle({
			fx: 'fade',
			pause: true,
			timeout: 30000
		});
	});

	//$('#content-showcase').cycle({
	//	fx: 'fade',
	//	pause: true,
	//	timeout: 30000
	//});

	$(document).keydown(function(e){
	    if (e.keyCode == 37) {
	    
			if($('.imgprevious a').length){
				window.location = $('.imgprevious a').attr("href")+"#content-main";
				//$('#content-main').load($('.imgprevious a').attr("href")+"?ajax=true")
			}else{
				$('#content-showcase').cycle('next');
			}

	       return false;
	    }else if(e.keyCode == 39) { 

			if($('.imgnext a').length){
				window.location = $('.imgnext a').attr("href")+"#content-main";
				//$('#content-main').load($('.imgnext a').attr("href")+"?ajax=true")
			}else{
				$('#content-showcase').cycle('prev');
			}

	       return false;
	    }
	});
	
	//$('#content-main').load('http://razier.com/wp-content/themes/razier/ajax-showcase.php');


	/*$('#navigation a').click(function() {
		$('body').load($(this).attr("href"));
		return false;
	});*/

});
