$(function() {
//menu	
	$("#menu li").hover(function() {
		$(this).find("ul").stop().slideDown(400).show(400, function(){
			$(this).height("auto");
		});
		$(this).addClass("hover");
	} , function() {
		$(this).find("ul").slideUp(250);
		$(this).removeClass("hover");
	}); 
	
//menu left
	$("#left ul li a").hover(function() {
		$(this).stop().animate({ 
			paddingLeft: '15'
		}, 150);
	} , function() {
		$(this).stop().animate({
			paddingLeft: '10'
		}, 150);
	});
	$("#left ul li ul li a").hover(function() {
		$(this).stop().animate({ 
			paddingLeft: '30'
		}, 150);
	} , function() {
		$(this).stop().animate({
			paddingLeft: '25'
		}, 150);
	});
	
	$("#left ul li ul li ul li a").hover(function() {
		$(this).stop().animate({ 
			paddingLeft: '40'
		}, 150);
	} , function() {
		$(this).stop().animate({
			paddingLeft: '35'
		}, 150);
	});
	
	$("#left ul li ul li ul li ul li a").hover(function() {
		$(this).stop().animate({ 
			paddingLeft: '50'
		}, 150);
	} , function() {
		$(this).stop().animate({
			paddingLeft: '45'
		}, 150);
	});
	
//flash
	$("#topFlash").flash({
		src: 'swf/top.swf',
		id: 'top_flash',
		wmode: 'transparent',
		width: 970,
		height: 204 },
        { version: 8 }
    );
	
	if ($("ul#siteMap").length)
		$("ul#siteMap li ul li:last-child").addClass("last");
	
	if ($("ul#produkty").length)
		$("ul#produkty li:odd").addClass("odd");
		
	if ($("table").length)
		$("table tr:even").css("background-color","#f2f6fa");
		
	//home contact
	$('#bottom_form_kontakt').submit(function(){
		
		var old_html = $(this).html();
		var tresc = $('#tresc').val();
		var imie = $('#imie').val();
		var email = $('#mail').val();
		
		//if(tresc == 'Treść zapytania') return false;
		//if(imie == 'Imię i nazwisko') return false;
		//if(email == 'e-mail lub telefon') return false;
		
		$(this).html('<div style="text-align:left;"><img src="images/ajax_loader.gif" width="16" height="16" /></div>');
		
		$.post("index.php", { action: "home_contact", tresc: tresc, imie: imie, email: email },
			function(data){
				//process(data);
				$('#bottom_form_kontakt').html(data.html);
				$('#temp_button').click(function(){
			
					$('#bottom_form_kontakt').html(old_html);
					return false;
				
				});
			}, "json");

		return false;
		
	});
});


function ajax_home_contact(){

		

}

