﻿$(document).ready(function() {

	

	$('#container').pngFix();



	// Curves
	
			addEvent(window, 'load', initCorners);

				function initCorners() {
					var settings = {
						tl: { radius: 6 },
						tr: { radius: 6 },
						bl: { radius: 6 },
						br: { radius: 6 },
						antiAlias: true
					}
				curvyCorners(settings, "#photos, .box, .oval, .photo");
				}


			


	// Flash animation

			$('.anim').flash({
		    	src: 'flash/top.swf',
		   	 	width: 943,
		    	height: 143,
		    	wmode: 'transparent',
		    	expressInstall: true
		    });







	// Focus border remove

			$("a").focus(function() {
				$(this).blur();
			});
		
	
	
	
	
	// Lightbox

		//	$("#gallery a, .lightbox, #photos div a").lightBox({fixedNavigation:true});
		
		$("#gallery a, #photos div a, .lightbox").lightbox({
			    fitToScreen: true,
			    imageClickClose: false
		    });

	



	// Menu Drop-Down:
	
			$(".menu_head").click(function() {
				$(this).next(".menu_body").slideToggle(300).siblings(".menu_body").slideUp("fast");	
			});
		
		
			$(".hit").next(".menu_body").slideToggle(300).siblings(".menu_body").slideUp("fast");
	





	// Menu Hover Effect:
		
			$("#menu a")
				.css({ backgroundPosition: '0 4px' })
				.hover(
					function () {
						$(this).animate({ backgroundPosition: '0 0' }, 150);
					}, 
					function () {
						$(this).animate({ backgroundPosition: '0 4px' }, 150);
					}
			);
			
	





	// Opacity
			var opacity = 1, toOpacity = 0.9, duration = 250;
			$('.fade')
				.hover(function() {
					$(this).fadeTo(duration,toOpacity);
				},
				function() {
					$(this).fadeTo(duration,opacity);
				}
			);




	// Rest
	
			// Remove border in last element
			
				$("#submenu a:last").css({ border: 'none' });
				$("#foot .links a:last").css({ border: 'none' });

				
			// Remove margin in last element
			
				$("#buttons a:eq(1), #buttons a:eq(3)").css({ marginRight: '0' });
				$('#gallery .photo:eq(4), #gallery .photo:eq(9), #gallery .photo:eq(14), #gallery .photo:eq(19)').css({ marginRight: '0' });
				$("#materialy dd:last").css({ paddingBottom: '0' });


			// Remove background in h1 on start
				$("#intro").next().css({ backgroundImage:"none" });
				


});



