$(document).ready(function() {

	var res = screen.width+'x'+screen.height;
	
	$('#downloads .item').each(function() {
	
		if ($(this).find('a').html() == res) {

				$(this).addClass('hl');
				$('#content a.guid').attr('href',base_url+'.'+res+'.jpg');

		}
		
	});

	$('#content img').mouseover(function() {
	
		opacity = $('#downloads').css('opacity');
		if (opacity == '0') {
			$('h1').stop().animate({top: 12, left: 12,opacity: 0.5},400);
			$('h4').stop().animate({bottom: 12, right: 12,opacity: 0.5},400);
		}
	
	});

	$('#content img').mouseout(function() {

		$('h1').stop().animate({top: 12, left: 0,opacity: 0},400);
		$('h4').stop().animate({bottom: 12, right: 0,opacity: 0},400);
	
	});
	
	$('#header .top .button').mouseover(function() {
	
		$(this).parent('.top').stop().animate({opacity: 1,top: -24},100);
	
	});

	$('#header .top .button').mouseout(function() {
	
		$(this).parent('.top').stop().animate({opacity: 0.6,top: -27},100);
	
	});
	
	setTimeout(function() {
		$('h1').stop().animate({top: 12, left: 0,opacity: 0},400);
		$('h4').stop().animate({bottom: 12, right: 0,opacity: 0},400);
	},2000);

});

function displaySizes() {

	opacity = $('#downloads').css('opacity');
	text = $('.left.download a').html().substr(2,$('.left.download a').html().length);
	
	if (opacity != '0') {
		$('.left.download a').html('&uarr; '+text);
		$('#downloads').stop().animate({opacity: 0, height: 0},400);
	} else {
		$('.left.download a').html('&darr; '+text);
		$('#downloads').stop().animate({opacity: 0.5, height: 305},400);
	}

}
