// JavaScript Document
jQuery().ready(function(){	
  // Arrastar blocos
  jQuery('a.closeEl').bind('click', toggleContent); 
  jQuery('div.item').Sortable({
    accept:      'grupoItem',
    helperclass: 'posicaoAjuda',
    activeclass: 'sortableactive',
    hoverclass:  'sortablehover',
    handle:      'h2.capa',
    tolerance:   'pointer',
    revert:      true,
    opacity:     0.8,
    zIndex:      1000,
    onChange:    function(ser)
    {
    },
    onStart:     function()
    {
      jQuery.iAutoscroller.start(this, document.getElementsByTagName('body'));
    },
    onStop:      function()
    {
      jQuery.iAutoscroller.stop();
    }
  });

});	

var toggleContent = function(e)
{
  var targetContent = jQuery('div.sap-content', this.parentNode.parentNode);
  if(targetContent.css('display') == 'none')
  {
    targetContent.slideDown(300);
    jQuery(this).html('[-]');
  }
  else
  {
    targetContent.slideUp(300);
    jQuery(this).html('[+]');
  }
  return false;
}

