window.myEmail = "chasemos"+"kal@gm"+"ail.com";
function injectMyEmail() { $('.myEmail').html('<a href="'+window.myEmail+'">'+window.myEmail+'</a>'); }

function isDescendant(A, B) { // Check if A is descendant of B.
	if (A!=B) { while(A.parentNode) {if((A=A.parentNode)==B)return true;} }
	return false;
}

function mouseScreenInteraction(hover, event) {
	if (hover)
		{ $('#screenButtons').stop(true,true); $('#screenButtons').animate({'height':'22px'},200); }
	else if ( !isDescendant(event.relatedTarget,document.getElementById('screenFrame')) )
		{ $('#screenButtons').stop(true,true); $('#screenButtons').animate({'height':'18px'},200); }
}


function screenSwitch(x) {
	var newLeft = -x * 720;
	newLeft = newLeft + 'px';
	$('#screenSpace').animate({'left':newLeft},300,"easeOutBack");
}

function contentSwitch(x) {
	$('#content').slideUp(200, "linear",function(){
		$('#content').html( $('#content_'+x).html() );
		$('#content').slideDown(200, "easeOutBack");
	});
}

$(document).ready(function(){
	injectMyEmail();
	contentSwitch('about');
});
