Cufon.replace('.cufon');
Cufon.replace('.published');
Cufon.replace('.gabinet h3');
Cufon.replace('.entry-content h3');


  

$(document).ready(function() {

    $('a[rel*=external]').click( function() {
        window.open(this.href);
        return false;
    });


  if ($('#video-main').length) {
    var flashvars = {
      movie: stylesheet_directory + "/flash/video/odcinek4.f4v",
      autostart: true,
      startThumb: stylesheet_directory + "/flash/video/odcinek4-startThumb.jpg",
      endThumb: stylesheet_directory + "/flash/video/odcinek4-endThumb.jpg",
      fillColor: "0xCDE4F6",
      mainColor: "0xef38ed",
      bufferBarColor: "0xf85cf6",
      progressBarColor: "0xc121bf",
      unbufferedBarColor: "0xef38ed",
      iconColor: "0xFFFFFF",
      playRepeatIconColor: "0xFFFFFF",
      playRepeatIconAlpha: "0.8"
    };
    
    var params = {
      allowfullscreen: true
    };
    
    swfobject.embedSWF(stylesheet_directory + "/flash/player.swf", "video-main", "340", "191", "10", "/flash/expressInstall.swf", flashvars, params);
  }
  
  
  
  if ($('#video-blog').length) {
  
    var flashvars = {
      movie: stylesheet_directory + "/flash/video/" + $('#video-blog').attr('class') + ".f4v",
      autostart: true,
      startThumb: stylesheet_directory + "/flash/video/" + $('#video-blog').attr('class') + "-startThumb.jpg",
      endThumb: stylesheet_directory + "/flash/video/" + $('#video-blog').attr('class') + "-endThumb.jpg",
      fillColor: "0xCDE4F6",
      mainColor: "0xef38ed",
      bufferBarColor: "0xf85cf6",
      progressBarColor: "0xc121bf",
      unbufferedBarColor: "0xef38ed",
      iconColor: "0xFFFFFF",
      playRepeatIconColor: "0xFFFFFF",
      playRepeatIconAlpha: "0.8"
    };
    
    var params = {
      allowfullscreen: true
    };
    
    if ($('.home').length) {
      swfobject.embedSWF(stylesheet_directory + "/flash/player.swf", "video-blog", "560", "315", "10", "/flash/expressInstall.swf", flashvars, params);
    } else {
      swfobject.embedSWF(stylesheet_directory + "/flash/player.swf", "video-blog", "665", "375", "10", "/flash/expressInstall.swf", flashvars, params);
    }
    
    
    $('#video-list a').click(function(){
	    var flashvars = {
	      movie: stylesheet_directory + "/flash/video/" + $(this).attr('class') + ".f4v",
	      autostart: true,
	      startThumb: stylesheet_directory + "/flash/video/" + $(this).attr('class') + "-startThumb.jpg",
	      endThumb: stylesheet_directory + "/flash/video/" + $(this).attr('class') + "-endThumb.jpg",
	      fillColor: "0xCDE4F6",
	      mainColor: "0xef38ed",
	      bufferBarColor: "0xf85cf6",
	      progressBarColor: "0xc121bf",
	      unbufferedBarColor: "0xef38ed",
	      iconColor: "0xFFFFFF",
	      playRepeatIconColor: "0xFFFFFF",
	      playRepeatIconAlpha: "0.8"
	    };
	    
	    var params = {
	      allowfullscreen: true
	    };
	    
      if ($('.home').length) {
        swfobject.embedSWF(stylesheet_directory + "/flash/player.swf", "video-blog", "560", "315", "10", "/flash/expressInstall.swf", flashvars, params);
      } else {
        swfobject.embedSWF(stylesheet_directory + "/flash/player.swf", "video-blog", "665", "375", "10", "/flash/expressInstall.swf", flashvars, params);
      }
    });
    
  }
  
  

	$('.columns').columnize();
  
//  if ($('.gabinety').length) {
//    var regionSelected = false;
//    var regions = {
//        'dolnoslaskie' : [],
//        'kujawsko-pomorskie': [],
//        'lubelskie': [],
//        'lubuskie': [],
//        'lodzkie': [],
//        'malopolskie': [],
//        'mazowieckie': [],
//        'opolskie': [],
//        'podkarpackie': [],
//        'podlaskie': [],
//        'pomorskie': [],
//        'slaskie': [],
//        'swietokrzyskie': [],
//        'warminsko-mazurskie': [],
//        'wielkopolskie': [],
//        'zachodniopomorskie': []
//    };
//
//    $.each($(".vcard") , function(key, value) { 
//      var city = $(this).children('.adr').children('span.locality').html();
//      var region = $(this).children('.adr').children('abbr.region').attr('title'); 
//      regions[region].push(city);
//      jQuery.unique(regions[region]);
//      regions[region].sort();
//    });
//
//
//    $.each($('#localities').children('optgroup'), function(Skey, Svalue) 
//    {
//      $.each(regions, function(key, value) 
//      {     
//        if($(Svalue).attr('id') == 'localities_'+key)
//        {
//          $.each(value, function(Mkey, Mvalue) 
//          {
//            $(Svalue).append('<option>'+Mvalue+'</option>').attr({value : Mvalue});
//          });
//        }
//        
//      });
//      
//      //$(this).css('display','none');
//      
//    });
//
//
//
//    $('#regions').change(function(el) {
//      regionSelected = $(this).val();
//      $('#map').hide();
//      $.each($(".vcards") , function(key, value) { 
//         if($(this).attr('class') != 'vcards vcards-' + regionSelected) {
//           $(this).hide();
//         } else {
//            $(this).children('.vcard').show();
//            $(this).show();
//         }
//      });
//      $('#localities').attr({value: 'wybierz miasto'});
//      
//      // po wybraniu elementu, ma pokazac miasta tylko z aktualnie wybranego.
//      $.each( $('#localities optgroup'), function(Skey, Svalue) 
//      {
//        // console.log($(Svalue).attr('id'));
//        if($(Svalue).attr('id') != 'localities_'+regionSelected) {
//          $(Svalue).hide();
//        } else {
//          $(Svalue).show();
//        }
//      });
//      Cufon.now();
//    });
//
//
//
//    $('#localities').change(function(el) 
//    {
//      var citySelected = $(this).val();
//
//      var regionSelected = $("option:contains('"+citySelected+"')").parent().attr('id').split('_');
//      regionSelected = regionSelected[1];
//      $('#regions').attr({value: regionSelected})
//      
//      $('#regions').trigger('change');
//      $(this).attr({value: citySelected});
//      
//      // console.log(regionSelected);
//      $.each($(".vcard") , function(key, value) 
//      { 
//        
//        var city = $(this).children('.adr').children('span.locality').html();
//        var region = $(this).children('.adr').children('abbr.region').attr('title'); 
//        
//        var something = true;
//        if(( $.trim(region) == $.trim(regionSelected)) && ( $.trim(city) == $.trim(citySelected)))
//        {
//          something = false;
//          $(this).fadeIn();
//        }
//        else if( ( $.trim(region) == $.trim(regionSelected)) && ( $.trim(city) != $.trim(citySelected)) )
//        {
//          something = false;
//          $(this).fadeOut();
//        }
//        else if ( ( $.trim(region) != $.trim(regionSelected)) && ( $.trim(city) == $.trim(citySelected)) )
//        {
//          something = false;
//          $(this).fadeOut();
//        }
//        //console.log(something);
//        
//      });
//        
//        
//    });
//    
//  }
  
  

  
  
});

