
	jQuery(document).ready(function()
	{
		blobs(); // shows random paint-blobs on the screen
		
		// start thickbox
		tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox
		imgLoader = new Image(); // preload image
		imgLoader.src = tb_pathToImage;
		
		stretchCol();
	});
	
	function blobs()
	{
		jQuery('#nav_main li a.sub').hover(function()
		{
			var numero = rand(1,6);
			var x = rand(225, 600);
			var y = rand(0,300);
			
			var blob = '<div id="blob"><img src="'+ absolute_sitepath +'img/blob'+numero+'.png" alt="" /></div>';
			
			jQuery(blob).appendTo(document.body).css(
			{
				position: 'absolute',
				top: y,
				left: x,
				visibility: 'hidden'
			});
			
			if (jQuery.browser.msie)
			{
				if(jQuery.browser.version < 7)
				{
					alphaPNG();
				}
			}

			jQuery('#blob').css('visibility', 'visible');
		},
		function()
		{
			jQuery('#blob').remove();
		});
	}
	
	function rand(min, max)
	{
		if (max) {
			return Math.floor(Math.random() * (max-min+1)) + min;
		} else {
			return Math.floor(Math.random() * (min+1));
		}
	}
	
	function stretchCol()
	{
		var offset = $('#col-a .inner').offset();
		var col_height = $('#col-b').height();
		var doc_height = $(document).height();
		var win_height = $(window).height();

		if (col_height+offset['top'] > win_height)
		{
			$('#col-a .inner').css('height', doc_height-offset['top']+'px');
		}
		else
		{
			$('#col-a .inner').css('height', win_height-offset['top']+'px');
		}
	}
