$(window).bind('load',function(){
	$('#loading').fadeOut('fast', function(){$('#loading').remove();});
});
$(document).ready(function(){
	$('#loading').show();
	$('#landing a').mouseover(function(){
		var img = $('img:first', $(this).parent());
		var src = img.attr('src');
		//replace src with the rollover one
		src = src.replace(/\./, "_rollover.");
		img.attr('src', src);
	});
	$('#landing a').mouseout(function(){
		var img = $('img:first', $(this).parent());
		var src = img.attr('src');
		//replace src with the rollover one
		src = src.replace(/_rollover\./, ".");
		img.attr('src', src);
	});
	$('#landing a').click(function(){
		var title = $(this).attr('title');
		var site = '';
		if(title.search(/uk/i) != -1)
		{
			site = 'uk';
		}
		else if(title.search(/usa/i) != -1)
		{
			site = 'usa';
		}
		else
		{
			site = 'au';	
		}
		$.post('/ajax/actions/set_site.php', 'site='+site, function(html){
			self.location.href = '/home.php';
		});
		return false;
	});
	$('.bottom a').click(function(){
		$.get($(this).attr('href')+'?'+new Date().getTime(), function(html){
			$('.ajax').remove();
			$('#pageContainer').append(html);
		});
		return false;
	});
	if($('#info').html() != undefined)
	{
		$('#info').cBox({
			width:421,
			height:416
		});
	}
});