google.setOnLoadCallback(function() {
	var uk_codes = Array('GB', 'IE', 'IM');
	
	var country_code = 'US';
	if (google.loader.ClientLocation) {
		var cl = google.loader.ClientLocation;
		country_code = cl.address.country_code;
	}
	
	var path = 'US';
	if ($.inArray(country_code, uk_codes) > -1)
		path = 'UK';
		
	$('div.banner').each(function(){
		var elm = $(this)[0];
		var query = escape(elm.className.replace('banner ', '').replace(/-/g, ' '));
		var width = 468, height = 60;
		if (query == 'musicbig1')
		{
			width = 468;
			height = 240;
		}
		else if (query == 'musicbig2')
		{
			width = 468;
			height = 336;
		}
		elm.innerHTML = '<iframe src="/banner/' + path + '/' +  query + '" marginwidth="0" marginheight="0" width="' + width + '" height="' + height + '" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe>';;
	});
	
	$('a.go').each(function(){
		var elm = $(this)[0];
		elm.href += '/' + path;
	});
});

function comment()
{
	var n = document.getElementById('comment_name').value;
	var c = document.getElementById('comment_text').value;
	
	if (n.length == 0 || c.length == 0)
	{
		alert('Please enter both a name and a comment.');
		return false;
	}
	
	if (c.toLowerCase().indexOf('<a ') > -1 || c.toLowerCase().indexOf('[url') > -1)
	{
		alert('Sorry, you may not post HTML in comments.');
		return false;
	}
	return true;
}