var resolution =
{
	path: "/tours/files/",
	prefix: "tours",
	sizes: false,
	images: false,
	init: function()
	{
		this.sizes = Array();
			this.sizes[0] = {width:1920, height:1200};
			this.sizes[1] = {width:1680, height:1050};
			this.sizes[2] = {width:1440, height:900};
			this.sizes[3] = {width:1280, height:1024};
			this.sizes[4] = {width:1024, height:768};
			
		this.images = Array();
			this.images[0] = this.sizes[0].width + "x" + this.sizes[0].height + ".jpg";
			this.images[1] = this.sizes[1].width + "x" + this.sizes[1].height + ".jpg";
			this.images[2] = this.sizes[2].width + "x" + this.sizes[2].height + ".jpg";
			this.images[3] = this.sizes[3].width + "x" + this.sizes[3].height + ".jpg";
			this.images[4] = this.sizes[4].width + "x" + this.sizes[4].height + ".jpg";
	},
	getImageForSize: function(width, height)
	{
		var image = this.path + this.prefix;
		if(width <= this.sizes[4].width)
			image += this.images[4];
		else if(width <= this.sizes[3].width)
			image += this.images[3];
		else if(width <= this.sizes[2].width)
			image += this.images[2];
		else if(width <= this.sizes[1].width)
			image += this.images[1];
		else
			image += this.images[0];
		return image;
	}
};




var tours =
{
	init: function()
	{
		resolution.init();
		this.resize();
	},
	resize: function()
	{
		this.resizeBackground();
	},
	resizeBackground: function()
	{
		var newCSS = "url('" + resolution.getImageForSize($("body").width(), $(window).height()) + "')";
		$("body").css("background-image", newCSS);
	}
};



