// function to show/hide concept notes panel
function infoboxDisplay(state) {
	if(state == 'hide') {
		$('.infobox').animate({ 
			left:"-480px"
		},'normal','swing');
		$('body').append('<div id="infoShow" class="ui-corner-top">Show Concept Notes</div>');
		$('#infoShow').fadeIn('normal').click(function() {
			$('.infobox').animate({ left:"-10px"	},'normal','swing');
			$(this).fadeOut('fast');
		 });
	}
	if(state == 'show') {
		$('.infobox').animate({ 
			left:"-10px"
    },'normal','swing');
	}
	
}

// function to create infobox controls
function infoboxCreate() {
	$('.infobox').prepend('<div id="infoClose" class="ui-state-default ui-icon ui-icon-close" style="float:right; cursor:pointer;">Close</div>');
	$('.infobox #infoClose').hover(
		function() {
			$(this).addClass('ui-state-hover');
		},
		function() {
			$(this).removeClass('ui-state-hover');
		}// end infoClose.hover
	).click(function() {
		infoboxDisplay('hide');
	} // end infoClose.click
	);
}


// run these scripts when DOM is ready
$(document).ready(function() {
	infoboxCreate();
	infoboxDisplay('hide');
});
