jQuery.noConflict();

jQuery(document).ready(function($){

$('input,textarea').focus(function(){
 $(this).parent('li').addClass('focus');
})
$('input,textarea').blur(function(){
 $(this).parent('li').removeClass('focus');
})
/*---------------- OHEKOVÁNÍ BUTTONU EPUBLISHE * -------------*/
 var imagesUrl='/epcommon_3_5/_gfx/';

 var editButtons=new Array(
  new Array('btnEditActive','page_white_edit.gif','page_edit.gif'),
  new Array('btnSortUpActive','arrow_up_green.gif','arrow_up_red.gif'),
  new Array('btnSortUpInactive','arrow_up_grey.gif','arrow_up_grey.gif'),
  new Array('btnSortDownActive','arrow_down_green.gif','arrow_down_red.gif'),
  new Array('btnSortDownInactive','arrow_down_grey.gif','arrow_down_grey.gif'),
  new Array('btnVisibleActive','eye_visible.gif','eye_invisible.gif'),
  new Array('btnInvisibleActive','eye_invisible.gif','eye_visible.gif'),
  new Array('btnDeleteActive','delete.gif','cross.gif'),
  new Array('btnAddActive','add.gif','add_blue.gif')
 );
 $('.btnIco').css({backgroundColor:'transparent',backgroundPosition:'center bottom',backgroundRepeat:'no-repeat',display:'block',height:'16px',textEecoration:'none',width:'20px',padding:'0px 0px',margin:'0px 0px',border:'none'});

 $('.ep_adminTools_button,.ep_adminTools_button_noActive').css({backgroundImage:'none',fontFamily:'"Verdana CE", Verdana, "Arial CE", Arial, "Lucida Grande CE", lucida, "Helvetica CE", sans-serif',padding:'0px 0px',margin:'0px 0px',fontSize:'11px',fontWeight:'normal',textTransform:'none',display:'inline',lineHeight:'1.4',float:'none',border:'none'});
 $('.ep_adminTools_button_noActive').css('background-color','#c58888');
 $('.dark_green').css('background-color','#00c500');


 $('.ep_adminTools_button').hover(
  function(){
   $(this).css('background-color','#f80');
  },
  function(){
   $(this).css('background-color','#c50000');
  }
 )

 for(i=0;i<editButtons.length;i++){
  $('.'+editButtons[i][0]).css('background-image','url('+imagesUrl+editButtons[i][1]+')');
  $('.'+editButtons[i][0]).attr('rel',i);
  $('.'+editButtons[i][0]).hover(
   function(){
    $(this).css('background-image','url('+imagesUrl+editButtons[$(this).attr('rel')][2]+')');
   },
   function(){
    $(this).css('background-image','url('+imagesUrl+editButtons[$(this).attr('rel')][1]+')');
   }
  );
 }

/*---------------- HACKNUTÍ KALENDÁŘŮ -------------*/
$('#calendar').css('margin-left','-'+($('#container .bookassist').offset().left)+'px');

$('#arr_cal_icon,#dep_cal_icon').click(function(){
 $('#calendar').css('margin-left','-'+($('#container .bookassist').offset().left)+'px');
});

/*---------------- HLAVNÍ MENU * -------------*/
$('#main-menu').superfish({
    hoverClass:    'sfHover',          // the class applied to hovered list items
    pathClass:     'overideThisToUse', // the class you have applied to list items that lead to the current page
    pathLevels:    1,                  // the number of levels of submenus that remain open or are restored using pathClass
    delay:         3,                // the delay in milliseconds that the mouse can remain outside a submenu without it closing
    speed:         'fast',           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method
    autoArrows:    false,               // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance
    dropShadows:   false,               // completely disable drop shadows by setting this to false
    disableHI:     false              // set to true to disable hoverIntent detection
});

 $('a[target=_blank]').click(function(){
  window.open($(this).attr('href'),'name','scrollbars=yes,height=450,width=750');
  return false;
 })

});

