jQuery.fn.ImageRotator = function() {

	var obj = $(this);
	var curr = 0;
	var length = $(obj).find('img').length;

	if (length == 1) return;
	
	$(obj).find('img').css({position: 'absolute', display: 'none', top: '0px', right: '0px'});
	$(obj).find('img:eq(0)').css({display: 'block'});
	$(obj).css({position: 'relative'});

	var inter = setInterval(function(){

		if ($(obj).find('img:eq(' + curr + ')').length == 1)
		{
			$(obj).find('img:eq(' + curr + ')').fadeOut();
			curr++;
			if (curr == length) curr = 0;
			
			$(obj).find('img:eq(' + curr + ')').fadeIn();
		}
		else clearInterval(inter);
	}, 4000);

};

jQuery.fn.bubble = function(text) {

	$(this).each(function(){
		
		var obj = $(this);
		var position = $(this).position();
	
		var newDate = new Date;
		var id = newDate.getTime();
		
		position.top -= 94;
	
	
		$(this).after('<div id="bubble_' + id + '" class="bubble" style="left:' + position.left + 'px; top:' + position.top + 'px;">' + text + '</div>');
		
		$(this).hover(function(){ $('#bubble_' + id).show(); }, function(){ $('#bubble_' + id).stop().hide(); });
	});
};

function reinitialiseScrollPane()
{
	$('.styleScroll').jScrollPane();
	
}

$(document).ready(function(){
	
	$.ajaxSetup({ cache: false });

	
	var $_GET = [];

	document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
		function decode(s) {
			return decodeURIComponent(s.split("+").join(" "));
		}
	
		$_GET[decode(arguments[1])] = decode(arguments[2]);
	});
	
	$('a[rel=blank]').attr('target', '_blank');
	
	//$('#flags a').click(function(){ return false; });
});
