var PANES = {
    'HOME' : 1,
    'SHOWROOM': 2,
    'POSTER': 3
}
var current_pane = PANES.HOME;

$(document).ready(function(){
    $(window).resize();
});

$(window).resize(function(){
	resizeImage();
	setLefts();
});

function resizeImage() {
	var navWidth = $(window).width();
	var navHeightTOT = $(window).height();
	var navHeight = navHeightTOT - 60;
	var navRatio = navWidth / navHeight;
	
	var picWidth = 75;
	var picHeight = 100;
	picRatio = picWidth / picHeight;
	
	if (navRatio > picRatio) {
		var newWidth = (navHeight / picHeight) * picWidth;
		var newHeight = navHeight;
	}
	$('#image').css({height: newHeight, width: newWidth});
}
function calculateLefts() {
    var navWidth = $(window).width();
	var navHeightTOT = $(window).height();
	
	singleStart = navWidth - 30;
	
	if (current_pane == PANES.SHOWROOM) {
		galLeft = 30;
		singleLeft = navWidth - 30;
	}
	if (current_pane == PANES.POSTER) {
		singleLeft = 60;
	}
	if (current_pane == PANES.HOME) {
		galLeft = navWidth - 30;
		singleLeft = navWidth;
	}
}
function setLefts() {
	calculateLefts();
	
	$('#showroom').css({left: galLeft});
	$('#poster').css({left: singleLeft});

    $('#image_loader').css({
        'left':25 + ($('#image').width()/2.0)
    });
    $('#text_loader').css({
        'left': 55 + ($('#image').width()+$('#desc').width()/2.0)
    });
}


