function updateBackground(){
		var windowWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth);
		if (old != windowWidth){
			old = windowWidth;
			if (windowWidth <= resolutions[0])	imageSize = resolutions[0];
			if (resolutions[resolutions.length-1]<windowWidth) imageSize = resolutions[resolutions.length-1];
			if (windowWidth > resolutions[0] && resolutions[resolutions.length-1]>windowWidth)
				for(i=0;i<resolutions.length;i++)
					if ( resolutions[i] < windowWidth && windowWidth <= resolutions[i+1] ) imageSize  = resolutions[i+1];

			document.getElementById('mainBody').style.backgroundImage = "url('/www1/assets/images/backgrounds/"+ theme +"-" + imageSize +".jpg')";

		}
		setTimeout('updateBackground()', 200);
}


function background(){
	updateBackground();
}


$(document).ready(function(){

	// TOOL TIPS
	$('.location')
	.hover(function(e){
	  // Hover over code
	  var titleText = $(this).attr('title');
	  $(this)
	    .data('tipText', titleText)
	    .attr('title','')
	    .removeAttr('title');
	    
	  $('<p class="tooltip"></p>')
	    .text(titleText)
	    .appendTo('body')
	    .css('top', (e.pageY - 0) + 'px')
	    .css('left', (e.pageX + 10) + 'px')
	    .fadeIn('fast');
	}, function() {
	  // Hover out code
	  $(this).attr('title', $(this).data('tipText'));
	  $('.tooltip').remove();
	}).mousemove(function(e){
	  // Mouse move code
	  $('.tooltip')
	    .css('top', (e.pageY - 0) + 'px')
	    .css('left', (e.pageX + 10) + 'px');
	});	
	
});




	var old;
	var resolutions = ["1100","1200","1300","1400","1500","1600","1700"];
