/*
*       Administrační skripty
*
*/

function setDetailHeight()
{  
  var height = document.documentElement.clientHeight;
  if (!height) 
    height = window.innerHeight;
     
  $('div.admin-wrapper').parent().css('top','0px').css('height',height+'px')
}

function adminDocumentLoad()
{
  // resize a posun detailu
  setTimeout(setDetailHeight, 100);
  
  // mce editor - velikost
  $('span.mceEditor table.mceLayout').css('width','100%').css('height','200px');
  
  // Dashboard
  var hideTimer=0;
  $('div.vyber-akce-obsah').mouseenter(function() 
    { 
      if (hideTimer)
      {
        clearTimeout(hideTimer); 
        hideTimer=0; 
      }
      else
        $('.vyber-akce-pop').fadeIn('fast'); 
    });
  $('div.vyber-akce-pop').mouseleave(    
    function() 
    {
      if (!hideTimer)
        hideTimer = setTimeout(function() { $('.vyber-akce-pop').fadeOut('fast'); hideTimer=0; }, 100);
    });
    
  // calendar
  $('.time .calendar').datepicker();
  $("div.time").hoverIntent({ 
    sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
    interval: 50,   // number = milliseconds for onMouseOver polling interval
    over: function() { $('.time .calendar').fadeIn('fast'); },     // function = onMouseOver callback (required)
    timeout: 300,   // number = milliseconds delay before onMouseOut
    out: function() { $('.time .calendar').fadeOut('fast'); }       // function = onMouseOut callback (required)
    });
  
  
  // corners
  //$('.rounded').corners();
  DD_roundies.addRule('.rounded', '5px', true);
  DD_roundies.addRule('.rounded-top', '5px 5px 0 0', true);
}

// resize a posun detailu
$(window).bind('resize', function() { setTimeout(setDetailHeight, 100); });


// document.onload
$(document).ready( function() { setTimeout(adminDocumentLoad, 100); } );
  

