﻿//$.noConflict();
//jQuery(document).ready(function($) {

$(document).ready(function() {

	/*
	 * 
	 * PLYWAJACY FORMULARZ KONTAKTOWY
	 *
	 */

	$('.col-121p-3').makeFloat({x:'current',y:'current',alwaysVisible:true, alwaysTop:true});

	/*
	 * 
	 * EFEKT ROLLOVER W MENU BOCZNYM
	 *
	 */



    function hoverImage (e) {
	
		var src    = $(e).attr ('src');
            
		if (src.match (/_act\.jpg/)) {
			src    = src.replace (/_act\.jpg/, '.jpg');
		}
		else {
			if (!src.match (/_act\.jpg/)) {
				src    = src.replace (/\.jpg/, '_act.jpg');
			}
		}
		$(e).attr ('src', src); 
    }

	$('.side-menu-img').hover (
		function () { 
			hoverImage (this);
		}
	);
	

	/*
	 * 
	 * EFEKT ROLLOVER DUZYCH BUTTONOW NA STRONIE GLOWNEJ
	 *
	 */

	$('img[src$="front_main_button_1_01.jpg"]').hover (
			function () { 
			$(this).attr ('src', 'fileadmin/templates/images/front_main_button_1_act.jpg');
		},
		function () { 
			$(this).attr ('src', 'fileadmin/templates/images/front_main_button_1.jpg');
		}
	);
	
	$('img[src$="front_main_button_2_01.jpg"]').hover (
			function () { 
			$(this).attr ('src', 'fileadmin/templates/images/front_main_button_2_act.jpg');
		},
		function () { 
			$(this).attr ('src', 'fileadmin/templates/images/front_main_button_2.jpg');
		}
	);	


	/*
	 * 
	 * ZMIANA DOMYŚLNEGO TEKSTU W POLACH FORMULARZA
	 *
	 */
	 

	 
		$('input#mailformKto').focus(function() {
			if($(this).val() == "Imię i Nazwisko :") {
				$(this).val("");
			}
		});
	
		$('input#mailformKto').focusout(function() {
			if($(this).val() == "") {
				$(this).val("Imię i Nazwisko :");
			}
		});
		
		$('input#mailformTelefon').focus(function() {
			if($(this).val() == "Nr telefonu :") {
				$(this).val("");
			}
		});
	
		$('input#mailformTelefon').focusout(function() {
			if($(this).val() == "") {
				$(this).val("Nr telefonu :");
			}
		});	
		
		$('input#mailformEmail').focus(function() {
			if($(this).val() == "E-mail :") {
				$(this).val("");
			}
		});
	
		$('input#mailformEmail').focusout(function() {
			if($(this).val() == "") {
				$(this).val("E-mail :");
			}
		});		
		
		$('textarea#mailformInformacja').focus(function() {
			if($(this).val() == "Dodatkowe informacje :") {
				$(this).val("");
			}
		});
	
		$('textarea#mailformInformacja').focusout(function() {
			if($(this).val() == "") {
				$(this).val("Dodatkowe informacje :");
			}
		});	

	/*
	 * 
	 * ZMIANA SZEROKOSCI ELEMENTOW LISTY DO SZEROKOSCI OBRAZKA
	 *
	 */		

	$("div#content-bottom li").each(function() { 
		var $t = $(this); 
		$t.width($t.find("img").width());  
	}); 
	
	
	/*
	 * 
	 * ZNIAMACJA NAPISÓW NA BANNERZE
	 *
	 */		
	//$("span.top-text-1").fadeIn("slow");
	
	
	

    $("span.top-text-1").fadeIn("slow").delay(1300).fadeOut("slow", function() {
		$("span.top-text-2").fadeIn("slow").delay(1300).fadeOut("slow", function() {
			$("span.top-text-3").fadeIn("slow").delay(1300).fadeOut("slow", function() {
				$("span.top-text-4").fadeIn("slow");
			});
		});
    });

	
	
	
	
	
	
	

});


