	var bkgArr = ["bgnd1.jpg","bgnd4.jpg","bgnd5.jpg","bgnd6.jpg","bgnd3.jpg","bgnd12.jpg","bgnd13.jpg"];
	var bkgArrRest = ["bgnd3.jpg","bgnd7.jpg","bgnd9.jpg","bgnd10.jpg","bgnd11.jpg"];
	var numRand;
	var kolkomicem=300;
	
	$(document).ready(function() {
		numRand = Math.floor(Math.random()*7);
		$("#background").attr('src','img/' + bkgArr[numRand]);
	    $("#background").fullBg();
	    
	    if ($('#pageContent').css('display')=='none') kolkomicem=1;
	    
	    $('#scrollContentWrapper').css('width',$('#maincont').width()-kolkomicem);
	    
		$('.scroll-pane').jScrollPane();
		
		
		if ($('#pageContentDiv').height()>290) $('.pageContent').jScrollPane();
		
		
	});
	
	$(function()
	{
	
		
			$('.scroll-pane').each(
			function()
			{
				
				var api = $(this).data('jsp');
				var throttleTimeout;
				$(window).bind(
					'resize',
					function()
					{
						
						 $('#scrollContentWrapper').css('width',$('#maincont').width()-kolkomicem);
						if ($.browser.msie) {
							// IE fires multiple resize events while you are dragging the browser window which
							// causes it to crash if you try to update the scrollpane on every one. So we need
							// to throttle it to fire a maximum of once every 50 milliseconds...
							if (!throttleTimeout) {
								throttleTimeout = setTimeout(
									function()
									{
										api.reinitialise();
										throttleTimeout = null;
									},
									50
								);
							}
						} else {
							api.reinitialise();
						}
					}
				);
			}
		)
	
	});
