jQuery(document).ready(function($) {

  $('.popup').addClass('pseudo').click(function(e){
		e.preventDefault();
		var $target=$(this).attr('rel');
		$($target).fadeToggle('slow');
	});
	$('.close','#login-form').click(function(e){
		e.preventDefault();
		$(this).closest('#login-form').fadeOut('slow');
	});
  
  $('.toggle').addClass('pseudo');
  $('#comments ul .reply-form').remove();
  
  $('#comments .push-form').addClass('pseudo').click(function(e) {
    e.preventDefault();
    if ($(this).next('.reply-form').length) {
      $(this).next('.reply-form').slideUp(200, function() { $(this).remove(); })
    } else {
      $('#comments ul .reply-form').remove();
      $reply = $('#comments .reply-form').hide().clone();
      $reply.insertAfter(this).slideDown(200);
    }
  });
	
	$('.faq-list .expand').click(function(e){
		e.preventDefault();
		$(this).slideUp('fast').prev('.full').slideDown('fast');
	});
	
	$('.setter[rel]').overlay({
		mask:{
			color:'#000',
			opacity:.6,
			zIndex:100
		}
	});
	
	$('.tip').tooltip({
		position: 'center right'
	});

  $('#comment-form').hide();
  
  $('#comments h3 a.toggle').click(function(e) {
    e.preventDefault();
    $('#comment-form').slideToggle(200);
  });

});
