adres = location.toString();
poczatek = adres.indexOf("#");
poczatek = (poczatek == -1) ? adres.length : poczatek+1;
koniec = adres.indexOf("&", poczatek);
koniec = (koniec == -1) ? adres.length : koniec;
var num= adres.substring(poczatek,koniec);



		$(document).ready(function(){
				
                	
                    
                    var firmaok = $('input[value=firma]').attr('checked');
                   
                   
                   
                    if(firmaok==true){
                        $(".fir").show();
                       // $('#regosobapryw img').attr('src').replace('osobaprywatna.gif','osobaprywatna_off.gif');
                       // $('#regfirma img').attr('src').replace('firma.gif','firma_on.gif');
                        
                    }
                    
                
                    $('.logaPartner').cycle({
            		fx: 'scrollLeft'
            		});
                
                
                $("a.galeria").fancybox({
						'titleShow'		: true,
						'titlePosition' : 'over',
						'transitionIn' : 'elastic',
						'transitionOut': 'elastic',
						'overlayOpacity': 0.9,
						'overlayColor': '#000',
                        'autoScale' :false,
						'cyclic': true
					});
                    
                  	$("a.ramka").fancybox({
        				'width'				: '50%',
        				'height'			: '60%',
        				
        				'autoScale'     	: true,
        				'transitionIn'		: 'none',
        				'transitionOut'		: 'none',
        				'overlayOpacity': 0.8,
        				'overlayColor': '#000',
        				'titleShow'		: false,
        				'type'				: 'iframe'
        			});
            
            
                    $("a.ramka2").fancybox({
        				'width'				: '45%',
        				'height'			: '40%',
        				
        				'autoScale'     	: true,
        				'transitionIn'		: 'none',
        				'transitionOut'		: 'none',
        				'overlayOpacity': 0.8,
        				'overlayColor': '#000',
        				'titleShow'		: false,
        				'type'				: 'iframe'
        			});
                    
                    
              
                
				$('#phom').cycle({
						fx: 'fade',
						timeout: 5000,
						speed: 2000 
					});
	
            $(".zakladka").hide();
    
    
			switch(num){
			
				case'realizacje':
					$(".z4").show('4000');
                    $('#actv_z4').addClass('on');
				break;
				case'wnetrza':
					$(".z5").show('4000');
                    $('#actv_z5').addClass('on');
				break;
				default:
					$(".z1").show('4000');
					$('#actv_z1').addClass('on');
				break;
			
			}
  

		})
		
      
		$(function(){
		
			$('input[value=firma]').click(function(){
				$(".fir").show();
                im1 =  $('#regosobapryw').attr('src').replace('gfx/ico/osobaprywatna_on.gif','gfx/ico/osobaprywatna_off.gif');
                $('#regosobapryw').attr('src',im1);
                im2 = $('#regfirma').attr('src').replace('gfx/ico/firma_off.gif','gfx/ico/firma_on.gif');
                $('#regfirma').attr('src',im2);
			});			
			$('input[value=osoba]').click(function(){
				$(".fir").hide();
				im1 =  $('#regosobapryw').attr('src').replace('gfx/ico/osobaprywatna_off.gif','gfx/ico/osobaprywatna_on.gif');
                $('#regosobapryw').attr('src',im1);
                im2 = $('#regfirma').attr('src').replace('gfx/ico/firma_on.gif','gfx/ico/firma_off.gif');
                $('#regfirma').attr('src',im2);
                
			});
			
			$('#innawysylka').click(function(){
				var akcja = $(this).attr('checked');
				if(akcja==true){
					$(".iwys").show();
                    innawysylkaWybrana = "tak";
				}
				else{
					$(".iwys").hide();
                    innawysylkaWybrana = "nie";
				}
			});
		
            $('#zgoda1').click(function(){
				var akcja = $(this).attr('checked');
                var akcja2 = $('#zgoda2').attr('checked');
                
                 if(akcja==true && akcja2==true){
					$("#b_dalej").show();
				}
				else{
					$("#b_dalej").hide();
				}

			});


            $('#zgoda2').click(function(){
				var akcja2 = $(this).attr('checked');
               	var akcja = $('#zgoda1').attr('checked');
				if(akcja==true && akcja2==true){
					$("#b_dalej").show();
				}
				else{
					$("#b_dalej").hide();
				}
			});
            
            
            
            $('#zgoda3').click(function(){
				var akcja3 = $(this).attr('checked');
              
				if(akcja3==true){
					$("#b_dalej").show();
				}
				else{
					$("#b_dalej").hide();
				}
			});
     
		});

      
    

        
        $().ready(function() { 
            		// validacja
              
                    $("#daneUser").validate({
                		rules: {
                			imie: "required",
                			nazwisko: "required",
                            tel: {
                				required: true,
                				minlength: 9
                			},
                            emial: "required",
                            ulica:"required",
                            kod:"required",
                            miasto:"required",
                            kraj:"required",
                			imie: {
                				required: true,
                				minlength: 3
                			},
                            nazwisko: {
                				required: true,
                				minlength: 3
                			},
                            kod: {
                				required: true,
                				minlength: 6,
                                maxlength: 6
                			},
                		
                			email: {
                				required: true,
                				email: true
                			}
                            
                		//	agree: "required"
                		},
                		messages: {
                			imie: "Proszę podać imię",
                			nazwisko: "Proszę podać nazwisko",
                            tel: {
                				required: "Proszę podać nr telefonu kontaktowego",
                				minlength: "Nr telefonu musi mieć min 9 znaków"
                			},
                         
                            emial: "Proszę podać adres e-mail",
                            ulica:"Proszę podać nazwę ulicy i nr domu, mieszkania",
                            kod:{
                				required: "Proszę podać kod pocztowy",
                				minlength: "Kod pocztowy musi mieć min 6 znaków, format: xx-xxx",
                                maxlength: "Kod pocztowy musi mieć max 6 znaków, format: xx-xxx"
                			},
                            miasto:"Proszę podac nazwę miasta",
                            kraj:"Proszę podać nazwę kraju",
                           
                			email: "Proszę podać poprawny adres e-mail"
                		}
                       
                      
                       
                       
                       
                	});	
                    
                    
                    // rejestracja użytkownika
                    $("#regUser").validate({
                		rules: {
                			imie: "required",
                			nazwisko: "required",
                            tel: {
                				required: true,
                				minlength: 9
                			},
                            
                            password: {
                    				required: true,
                    				minlength: 5
                    			},
                    		confirm_password: {
                    				required: true,
                    				minlength: 5,
                    				equalTo: "#password"
                    			},

                            
                            emial: "required",
                            ulica:"required",
                            kod:"required",
                            miasto:"required",
                            kraj:"required",
                			imie: {
                				required: true,
                				minlength: 3
                			},
                            nazwisko: {
                				required: true,
                				minlength: 3
                			},
                            kod: {
                				required: true,
                				minlength: 6,
                                maxlength: 6
                			},
                		
                			email: {
                				required: true,
                				email: true
                			},
                			agree: "required"
                		},
                		messages: {
                			imie: "Proszę podać imię",
                			nazwisko: "Proszę podać nazwisko",
                            tel: {
                				required: "Proszę podać nr telefonu kontaktowego",
                				minlength: "Nr telefonu musi mieć min 9 znaków"
                			},
                           password: {
                				required: "Proszę podać hasło",
                				minlength: "Twoje hasło musi miec minimalnie 5 znaków"
                			},
                			confirm_password: {
                				required: "Prosze powtórzyć hasło",
                				minlength: "Twoje hasło musi miec minimalnie 5 znaków",
                				equalTo: "Proszę wpisać to samo hasło"
                			},


                            emial: "Proszę podać adres e-mail",
                            ulica:"Proszę podać nazwę ulicy i nr domu, mieszkania",
                            kod:{
                				required: "Proszę podać kod pocztowy",
                				minlength: "Kod pocztowy musi mieć min 6 znaków, format: xx-xxx",
                                maxlength: "Kod pocztowy musi mieć max 6 znaków, format: xx-xxx"
                			},
                          
                            miasto:"Proszę podac nazwę miasta",
                            kraj:"Proszę podać nazwę kraju",
                			email: "Proszę podać poprawny adres e-mail"
                		
                		}
                	});	
                    
         });   
        
        
		

	 // inna wysyłka
     /*	
      function innawysylkaValidate(){
       
  
        
            $("#daneUser").validate({
                		rules: {
                			innaWys_imie: "required",
                			innaWys_nazwisko: "required",
                            innaWys_tel: {
                				required: true,
                				minlength: 9
                			},
                            
                            innaWys_ulica:"required",
                            innaWys_kod:"required",
                            innaWys_miasto:"required",
                            innaWys_kraj:"required",
                			agree: "required"
                		},
                		messages: {
                			innaWys_imie: "Proszę podać imię",
                			innaWys_nazwisko: "Proszę podać nazwisko",
                            innaWys_tel: {
                				required: "Proszę podać nr telefonu kontaktowego",
                				minlength: "Nr telefonu musi mieć min 9 znaków"
                			},
                         
                           
                            innaWys_ulica:"Proszę podać nazwę ulicy i nr domu, mieszkania",
                            innaWys_kod:{
                				required: "Proszę podać kod pocztowy",
                				minlength: "Kod pocztowy musi mieć min 6 znaków, format: xx-xxx",
                                maxlength: "Kod pocztowy musi mieć max 6 znaków, format: xx-xxx"
                			},
                            innaWys_miasto:"Proszę podac nazwę miasta",
                            innaWys_kraj:"Proszę podać nazwę kraju"
                		}
                	});	
        
       
        
      }		
	*/	
 function otwoz(co) {
        if($('.zp li').hasClass('no')){
            $('.zp li').attr('class', 'no')
        }else{
            $('.zp li').attr('class', '')
        }
        
        $('#actv_'+co).addClass('on');
        
		$(".zakladka").hide();   
		$("." + co).show();  
		//document.title = co;
	}  
    
    
   function showhide(hid,co) {
		$("." + hid).hide('fade');   
		$("." + co).show('fade');  
	} 
    
    function pokaz(co){
        if(document.getElementById(co).style.display == 'none'){
            $("#" + co).show('fade'); 
        }else{
            $("#" + co).hide('fade'); 
        }
         
    }
      
