google.load("jquery", "1.5.0");
google.load("jqueryui", "1.8.9");

function swapImage(obj, imgsrc)
{
	var allrows = $("#contain-screenshots span");
	for(var i = 0; i < allrows.length; i++)
	{
		allrows[i].className = allrows[i].className.replace(/\-active/, '');
	}
	obj.parentNode.className = 'screenshot-label-active';
	$('#screenshot').attr("src", 'images/portfolio/' + imgsrc);
	currimg = imgsrc;
}

function showLarge()
{
	var currimg = $('#screenshot').attr("src");
	var popwin = window.open('portfolio_image.php?imgsrc='+currimg, 'popwin', 'width=400, height=300, status=0, scrollbars=0, toolbar=0, location=0, directories=0, resizable=0');
}

var current_testimonial = 1;
var total_testimonials = 10;
var testimonialInterval;
function displayTestimonial(displayID) {
	$(".testimonial-scroller").animate({marginTop: -((displayID*290)-290)}, 400, 'easeOutBounce');
	current_testimonial = displayID;
	window.clearInterval(testimonialInterval);
	testimonialInterval = window.setInterval("nextTestimonial()", 60000);
}

function nextTestimonial() {
	next_testimonial = current_testimonial+1;
	if(next_testimonial > total_testimonials) {
		next_testimonial = 1;
	}
	displayTestimonial(next_testimonial);
}

$(document).ready(function() {
	if($(".testimonial-scroller")) {
		testimonialInterval = window.setInterval("nextTestimonial()", 60000);
	}
	$(".portfolio-row").hover(function() { $(this).attr("className", "portfolio-row-hover"); }, function() { $(this).attr("className", "portfolio-row"); });
});
