// JavaScript Document
$(document).ready(function(){
	$(window).load(loadComplete);
	//main
	$('#contents').accordion({
		autoHeight: false,
		active:2, //0 - 2
		navigation: true,
		header: '.sectionTitle'
	})
	

	//links
	$('.thumb').mouseup(loadPopup);
	$('.hole').mousemove(function(e){
		moveCaption(e.pageX,e.pageY);
	}).mouseover(function(e){
		var msg = $(this).attr('alt');										
		showCaption(msg);	
	}).mouseout(hideCaption)
	
	//works table help
	$('table.works tr').mouseover(function(e){
		$(this).css({backgroundColor:'#e6d9c7'});								
	}).mouseout(function(e){
		$(this).css({backgroundColor:''});								
	})
	initPopup();
});

function loadComplete(e){
	$('#container').fadeIn(1000)	
}
function showCaption(msg){
	$('div#captionBox').css({visibility:'visible'});
	$('div#captionBox').html(msg);
}
function moveCaption(x,y){
	$('div#captionBox').css({top:y-10,left:x+20});
}
function hideCaption(e){
	$('div#captionBox').css({visibility:'hidden'});
	$('div#captionBox').html("");
}
