/* display year */
var date = new Date();
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

/* centered popUp window */
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


$(document).ready(function(){
	
	toggleTestimonial();
	footerHover();
	
	// write current year in footer
	$('.current-year').text(year);
	
	// open rel='external' links in a new window
	$('a[rel=external]').click(function(){ window.open(this.href); return false; });
	
	
});

function footerHover()
{
	$('#footer-icons a').css({opacity: .6});
	$('#footer-icons a').hover(
		function(){$(this).animate({opacity: 1},{queue: false, duration: 250});},
		function(){$(this).animate({opacity: .6},{queue: false, duration: 250});}
	);
}

function toggleTestimonial()
{
	$("a.showTestimonial").toggle(
		function(){
			$(this).text("Hide").addClass("hideTestimonial").prev("div.expandedTestimonial").slideDown(500);
		},
		function(){
			$(this).text("Continue Reading").removeClass("hideTestimonial").prev("div.expandedTestimonial").slideUp(500);
		}
	);
}
