protectionIsGreat = "pcatanzariti";
protectionIsGreat = (protectionIsGreat + "@" + "gmail.com");

$(document).ready(function() {
	$('#header .menu ul li a').each(function() {
		
	});
	$('#header .menu ul li').hover(function() {
		$(this).addClass('hover');
		$('.explanations').html($(this).find('a').attr('rel'));
	}, function() {
		$(this).removeClass('hover');
		$('.explanations').html('');
	});
	$('.box-works .viewer').each(function() {
		$(this).hover(function() {
			$(this).find('.details h3, .details p').css({
				color: '#333',
				backgroundColor: '#fff'
			});
		}, function() {
			$(this).find('.details h3, .details p').css({
				color: '#fff',
				backgroundColor: '#333'
			});
		});
	});
	$('#header .frame').hover(function() {
		$('#header .frame .details').animate({
			top: '114px'
		}, 250);
	}, function() {
		$('#header .frame .details').stop();
		$('#header .frame .details').animate({
			top: '150px'
		}, 250);
	});
	$('#header .menu ul li a').hover(function() {
		section = $(this).attr('class');
		classes = $('body').attr('class');
		//console.log(classes);
		start = classes.indexOf('themey');
		//console.log('Start: '+start);
		end = classes.indexOf(' ', start);
		//console.log('End: '+end);
		
		original_class = classes.substr(start, (end-start));
		//console.log('Original class was '+original_class);
		$('body').removeClass(original_class).removeClass('sup');
		$('body').addClass('themey-'+section);
	}, function() {
		section = $(this).attr('class');
		$('body').removeClass('themey-'+section).addClass(original_class).addClass('sup');
		//console.log('Added '+original_class);
	});
	
	// qTips
	$('.mini-gallery .thumbnail').each(function() {
		$(this).qtip({
			id: 'mini-gallery-tooltip',
			//content: $(this).attr('alt'),
			content: 'Click to view full!',
			position: {
				my: 'bottom left',
				at: 'top left',
				adjust: {
					x: 5,
					y: 25
				}
			}
		});
	});
});

function runContact() {
	document.write("<a href=\"mailto:" + protectionIsGreat + "?subject=Message from patrickcatanzariti.com\" id=\"email-addy\">");
	document.write(protectionIsGreat);
	document.write("</a>");
}
