$(document).ready(function () {
  $('table.list tbody tr.stripped:odd').addClass('odd');
  $('table.list tbody tr.stripped:even').addClass('even');
  $('table.fieldset tbody tr:odd').addClass('odd');
  $('table.fieldset tbody tr:even').addClass('even');
	
	$('table.list tr.stripped').hover(function() {
		//hide others
		$('table.list tr.action').hide().removeClass('highlight');
		$('table.list tr').removeClass('highlight');
    $(this).addClass('highlight').find('+ tr.action').show().addClass('highlight');
  });
	
   $('a.editable_tb').click(function(){
     tb_show('Edycja', this.getAttribute('rel'), false);
   });

  // $('.wymeditor').wymeditor({ lang: 'pl', logoHtml: '', skin: 'compact' });

  $('a.cmptext-form-cancel').click(function() {
    $('#form_'+this.getAttribute('title')).hide();
    $('#slot_'+this.getAttribute('title')).show();
    return false;
  });

  $('form.cmptext-remote-form').submit(function() {
    var related_container = $(this).attr('id').replace('form_', '');
    var params = {};
    $(this).find("input, textarea")
    .each(function() {
      params[ this.name || this.parentNode.name ] = this.value;
    });
    $.post(this.getAttribute('action'),
          params,
          function(fromServer) {
           $('#form_'+related_container).hide();
           $('#slot_'+related_container).html(fromServer).show();
     });
     return false;
  })
  


  	$("a.fancy").fancybox({
  		'transitionIn'	:	'elastic',
  		'transitionOut'	:	'elastic',
  		'speedIn'		:	600, 
  		'speedOut'		:	200, 
  		'overlayShow'	:	false
  	});

})



