$(document).ready(function() {
	
	fadeinout();
	popup();
	loading();
	minigraphs();
	
});

function loading() {
			
	$('.loading').show();
	$('.loaded').hide();
	
	$(window).load(function() {
			$('.loading').hide();
			$('.loaded').show();
	});
}

function popup() {
	
	$(".popup").bind("click", function() {
		
		$(this).attr('target', ''); // disable non-javascript behaviour
		window.open($(this).attr('href'), '', 'top=300,left=100,width=700,height=400,menubar=no,toolbar=no,location=yes,status=no,scrollbars=yes,resizable=yes');
		return false;
	});
}

function fadeinout() {
	$(".fadeinout").slideUp(400);
}

function minigraphs() {
	
	$('.minigraph-returns').sparkline('html', {
		type: 'line',
		width: '50px',
		height: '30px',
		lineColor: '#64825A',
		fillColor: '#DCDCD2',
		spotColor: 'black',
		spotRadius: 2,
		minSpotColor: 'red',
		maxSpotColor: 'green'
	}); 
	
	//$('.minigraph-returns').sparkline([0,0], {type: 'line', composite: true, lineColor: 'black', spotColor: false}); 
}

