// JavaScript Document
$(document).ready(function() {
	$("#showBanner").fancybox({
		'width'				: 580,
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
});

function setBackground() {
  if (document.body) {
		var iNumber=Math.floor(Math.random()*3);
		var imagem = "images/backgrounds/";
		//iNumber = 6;
		
		if ((screen.width<=1024) && (screen.height<=768))
		{
			imagem += (iNumber+1) + "_1024_768.jpg"
		}
		else if ((screen.width>1024) && (screen.width<=1280) && (screen.height<=800))
		{
			imagem += (iNumber+1) + "_1280_800.jpg"
		}
		else if ((screen.width>1024) && (screen.width<=1280) && (screen.height>800) && (screen.height<=1024))
		{
			imagem += (iNumber+1) + "_1280_1024.jpg"
		}
		else if ((screen.width>1280) && (screen.width<=1440))
		{
			imagem += (iNumber+1) + "_1440_900.jpg"
		}
		else if ((screen.width>1440) && (screen.width<=1680))
		{
			imagem += (iNumber+1) + "_1680_1050.jpg"
		}
		else
		{
			imagem += (iNumber+1) + "_1680_1050.jpg"
		}
    document.body.style.backgroundImage = 'url('+imagem+')';
  }
}