clients = {
  init: function() {
    jQuery("#clients ul li:not(:first)").css({opacity: 0, display: 'none'});
    setInterval(function() {
      jQuery("#clients ul li:first").animate({opacity: 0}, 'fast', function() {
        jQuery(this).css({display: 'none'}).clone().insertAfter(jQuery("#clients li:last"));
        jQuery(this).remove();
        jQuery("#clients ul li:first").css({display: 'block'}).animate({opacity: 1}, 'fast');
      });
    }, 3000);
  }
};

signup = {
  tinymce: function() {
    jQuery("textarea.tinymce").tinymce({
      script_url : '/javascripts/tinymce/tiny_mce.js',
      language: "pl",
      mode : "exact",
      theme : "advanced",
      skin: "wp_theme",
      width: "640px",
      height: "400px",
      plugins: "safari,pagebreak,style,layer,table,advimage,advlink,inlinepopups,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
      theme_advanced_toolbar_location: "top",
      theme_advanced_buttons1: "bold,italic,underline,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,image,|,undo,redo,pasteword,|,removeformat,fullscreen,code",
      theme_advanced_buttons2: "",
      theme_advanced_buttons3: "",
      theme_advanced_resizing: true,
      theme_advanced_statusbar_location : "bottom",
      theme_advanced_path: false
    });
  }
};

init_pretty_photo = function() {
   $.nyroModalSettings({
      processHandler: function(settings) {
        var from = settings.from;
        if (from && from.href && from.href.indexOf('http://www.youtube.com/watch?v=') === 0) {
          $.nyroModalSettings({
            type: 'swf',
            height: 504,
            width: 896,
            url: from.href.replace(new RegExp("watch\\?v=", "i"), 'v/')
          });
        }
      }
    });
  $(".prettyphoto").nyroModal();
};

jQuery(document).ready(function(){
  init_pretty_photo();  
});
