$(document).ready(function(){
	// Opens a link into a new window if it has a 'rel=external' tag applied
	$("a[rel='external']").live("click",function(){
		window.open(this.href);
		return false;
	});
	
	$("#portfolio").cycle({
		fx:			'fade',
		pause:		'true',
		next:		'.arrow-next, .portfolio',
		prev:		'.arrow-back',
		timeout:	9000,
		speed: 		700,
		slideExpr:  '.portfolioAjax'
	});

	
	if ($("a.arrow img").attr("disabled")!=true) {
	$("a.arrow img").live("mouseenter",function() {
		$(this).attr("src", function() {
			return "images/site/" + $(this).attr("class") + "-hover-trans.png";									 
		});
	}).live("mouseleave",function () {
		$(this).attr("src", function() {
			return "images/site/" + $(this).attr("class") + "-trans.png";										 
		});
	});
	}
	
	$("img.portfolio").live("mouseenter",function() {
		$("img.arrow-next").attr("src", function() {
			return "images/site/" + $(this).attr("class") + "-hover-trans.png";									 
		});
	}).live("mouseleave",function () {
		$("img.arrow-next").attr("src", function() {
			return "images/site/" + $(this).attr("class") + "-trans.png";										 
		});
	});
});