$(document).ready(function(){

  	// silce menu
	$("#subMenu ul").treeview({	
    collapsed: true,
		animated: "medium",
		unique: true
	});
	
	
	// fancybox
  $(".lightbox").fancybox({
	 overlayOpacity: 0.8
	});
	

  $("a.targetblank").attr("target","_blank");
	
	/*
	    // -------------------------------- init contact form validate
    $("form#formularz_kontaktowy").validate({
	   rules: {
			formEmail: {
				required: true,
	      email: true

			},
			formTresc: {
				required: true
			}
		}
	 });		
	 
    $("form#formularz_kontaktowy_firma").validate({
  	   rules: {
  			formNazwaFirmy: {
  				required: true
  			},
  			formNazwa: {
  				required: true
  			},
  			formTelefon: {
  				required: true
  			},
  			formEmail: {
  				required: true,
  	      email: true
  
  			},
  			formAdres: {
  				required: true
  			},
  			formTresc: {
  				required: true
  			}
  		}
	  });		
	 */
});
	
// -------------------------------- created gallery
function init_gallery(id){
  $("#gallery_"+id +" .showMorePhoto").click(function () {
    if ($("#gallery_"+id +" .morePhoto").is(":hidden")) {
      $("#gallery_"+id +" .morePhoto").slideDown("slow");
      $(this).html("ukryj zdjęcia" );
      $(this).addClass("hidePhoto");
    } 
    else {
      $("#gallery_"+id +" .morePhoto").slideUp("slow");
      $(this).html("więcej zdjęć" );
      $(this).removeClass("hidePhoto");
    }
  });
}
       
function init_gallery2(id){
  $(function() {
     $("#movieGallaery_"+id+" .galleryListElement").jCarouselLite({
        speed: 1000,
        visible: 3,
        scroll: 3,
        btnNext: "#movieGallaery_"+id+" .next",
        btnPrev: "#movieGallaery_"+id+" .prev",
        vertical: false,
        circular:false
    });
  });
}


  sIFR.compatMode = true;
  sIFR.activate();
  
  sIFR.replace({
    selector: '#sub ul li .sifr', 
    src: 'swf/sifr.swf', 
    highsrc: 'swf/sifr.swf',
    wmode: 'transparent',
    css: {
      '.sIFR-root' : {'color': '#4a4a4a',  'vertical-align': 'bottom'
},
      'a': { 'text-decoration': 'none' },
      'a:link': { 'color': '#4a4a4a' },
      'a:hover': { 'color': '#4a4a4a' }
    }
  });

