    $(function() {
        $('.contact_box').hover(
            function () {
                $(this).stop().animate({'marginLeft':'0px'},400);
                $(this).css("z-index", 20);
                $('.fb_box').css("z-index", 9);
            },
            function () {
               $(this).stop().animate({'marginLeft':'-298px'},400);
               $(this).css("z-index", 10);
             }
        );
    });
    $(function() {
        $('.fb_box').hover(
            function () {
                $(this).stop().animate({'marginLeft':'0px'},400);
                $(this).css("z-index", 20);
                $('.contact_box').css("z-index", 9);
            },
            function () {
               $(this).stop().animate({'marginLeft':'-298px'},400);
               $(this).css("z-index", 10);
             }
        );
    });


$(document).ready(function() {
    $('#kredyty').click(function() {
        if($('#calc_kredyty').attr('class') == 'inactive') {
            $('#calc_kredyty').removeClass();
            $('#calc_lokaty').removeClass();
            $('#calc_lokaty').addClass('inactive');
            $('#calc_kredyty').addClass('active');
        }
        else if($('#calc_kredyty').attr('class') == 'active') {
            $('#calc_kredyty').removeClass();
            $('#calc_kredyty').addClass('inactive');
        }
        return false;
    });
    
    $('#lokaty').click(function() { 
        if($('#calc_lokaty').attr('class') == 'inactive') {
            $('#calc_kredyty').removeClass();
            $('#calc_kredyty').addClass('inactive');
            $('#calc_lokaty').removeClass();
            $('#calc_lokaty').addClass('active');
        }
        else if($('#calc_lokaty').attr('class') == 'active') {
            $('#calc_lokaty').removeClass();
            $('#calc_lokaty').addClass('inactive');
        }
        return false;
    });
    function parseURL()
    {
          var str =window.location.search;
          if(parseURL.arguments.length == 1)
            str = parseURL.arguments[0];
          if(str.length < 2)
            throw new Error('No aruments in URL');
          var arr = str.substring(1).split('&');
          var key = '';
          var val = '';
          for(var part in arr)
          {
            key = arr[part].split('=')[0];
            val = unescape(arr[part].substring(key.length + 1));
            this[key] = val;
          }
     }
     // var _GET = new parseURL(); alert(_GET['id']);

    //$('#pl1').click(function() {alert('aaa'); });
    String.prototype.escapeDiacritics = function()
    {
        return this.replace(/ą/g, 'a').replace(/Ą/g, 'A')
            .replace(/ć/g, 'c').replace(/Ć/g, 'C')
            .replace(/ę/g, 'e').replace(/Ę/g, 'E')
            .replace(/ł/g, 'l').replace(/Ł/g, 'L')
            .replace(/ń/g, 'n').replace(/Ń/g, 'N')
            .replace(/ó/g, 'o').replace(/Ó/g, 'O')
            .replace(/ś/g, 's').replace(/Ś/g, 'S')
            .replace(/ż/g, 'z').replace(/Ż/g, 'Z')
            .replace(/ź/g, 'z').replace(/Ź/g, 'Z');
    }
    //var test = new String(text);
    
    $('#map-pl li').click(function() {
        
            if($(this).hasClass('active-region')) {
                $('#woj').val('');
            
            } 
        
    });
    
    
    if(window.location.search != "") {
        var _GET = new parseURL();
        $('#woj').val(_GET['cashpoint_region_id']); 
    }
    


    //Zerowanie p�l tekstowych
    $('input[removable]').focus(function() {
        if(this.value == this.defaultValue) this.value = '';
        if(this.value != this.defaultValue) this.select();
    });
    $('input[removable]').blur(function() {
        if(this.value == '') this.value = this.defaultValue;
    });
    $('input[selectable]').focus(function() {
        this.select();
    });
    
    
    $(".radio").change(function(){
		if($(this).is(":checked")){
                        $(this).next("label").addClass("etykieta");
			$(this).next("label").addClass("etykieta_wybrana");
		}else{
			$(this).next("label").removeClass("etykieta_wybrana");
		}
	});
        
});
