$(document).ready(function(){
		// [ BROWSER BUGS ]
		//$(document).pngFix(); 
		
		var baseleft = 115;
		var baseheight = $("#main").height()
		
        if (typeof(window.ie6) !== "undefined") {
            baseleft = 5;
			baseheight += 118;
        }
        
        if (typeof(window.ie7) !== "undefined") {
            baseleft = 5;
			baseheight += 118;
        }
		
		// [ BACKGROUND INIT ]
		$("#swfcontainer, #menu").css("height", Math.max(baseheight,$(window).height()))
		$(window).load(function(){
			baseheight = $("#main").height()
        
	        if (typeof(window.ie6) !== "undefined") {
	            baseheight += 118;
	        }
	        
	        if (typeof(window.ie7) !== "undefined") {
	            baseheight += 118;
	        }
			$("#swfcontainer, #menu").css("height", Math.max(baseheight,$(window).height()))
		})
		
		// [ BACKGROUND RESIZE ]
		$(window).resize(function(){
			$("#swfcontainer, #menu").css("height", Math.max(baseheight,$(window).height()))
		})

        // [ PAINTINGS ]]
		
		if (typeof(paintings) != "undefined") {
			var zeroBasedSlideIndex = 0
			$("#paintingscontent .border").eq(0).width(paintings[0][1] + 4)
			$("#paintingscontent .border").eq(0).height(paintings[0][2] + 6)
			
			$("#next, #prev").click(function(){
				$("#paintingscontent img").eq(0).attr("src", "")
				
				if ($(this).attr("id") == "next") {
					var isNext = true
					var increment = 1
				}
				else {
					var isNext = false
					var increment = -1
				}
				
				zeroBasedSlideIndex = Math.min(paintings.length - 1, Math.max(0, zeroBasedSlideIndex += increment))
				
				var i = new Image();
				$(i).load(function(){
					$("#paintingscontent img").eq(0).attr("src", paintings[zeroBasedSlideIndex][0])
					$("#paintingscontent img").eq(0).attr("width", paintings[zeroBasedSlideIndex][1])
					$("#paintingscontent img").eq(0).attr("height", paintings[zeroBasedSlideIndex][2])
					
					$("#paintingscontent .border").eq(0).width(paintings[zeroBasedSlideIndex][1] + 4)
					$("#paintingscontent .border").eq(0).height(paintings[zeroBasedSlideIndex][2] + 6)
				}).attr('src', paintings[zeroBasedSlideIndex][0])
			})
		}
		// [ MULTICOLUMN ]
		
		if (typeof(MultiColumnSettings) !== "undefined") {
			multiColumnSettings = new MultiColumnSettings;
			multiColumnSettings.classNameScreen = 'columnized';
			
			if (document.getElementById("tekst")) {
				new MultiColumn(document.getElementById("tekst"), multiColumnSettings);
			}
		}
});