$(document).ready(function() {
	init_cufon();	
	init_splash_positioning();
	
	$(window).bind('resize', function(){
		init_splash_positioning();
	});

	preload([
		'/img/link_boa_hover.jpg',
		'/img/link_gecko_hover.jpg',
		'/img/link_python_hover.jpg'
	]);	
});



function preload(arrayOfImages) {
    $(arrayOfImages).each(function(){
        $('<img/>')[0].src = this; 
    });
}

function init_cufon() {
	Cufon.now();
	Cufon.replace('#secondary_nav a', {
		hover: true,
		fontFamily: 'Calibri'
	});	
}

function init_splash_positioning() {
	if ($(window).width() < 930)
		var $center_x = 930/2;
	else
		var $center_x = $(window).width()/2;
	$('#link_gecko').css('left', $center_x -337 + 'px');
	$('#link_python').css('left', $center_x + 66 + 'px');
	$('#link_boa').css('left', $center_x + 88 + 'px');
	$('#secondary_nav').css('left', $center_x - 150 + 'px');	
}
