jQuery.noConflict();

jQuery.fn.slideFadeIn = function(speed, easing, callback) {
  return this.animate({opacity: 'show', height: 'show'}, speed, easing, callback);  
};
jQuery.fn.slideFadeOut = function(speed, easing, callback) {
  return this.animate({opacity: 'hide', height: 'hide'}, speed, easing, callback);  
};

jQuery.fn.tabIn = function(speed, easing, callback) {
  return this.animate({
    borderTopColor:'#008D90',
    borderLeftColor:'#008D90',
    borderBottomWidth:'0',
    color:'#000000'
  }, speed, easing, callback);  
};
jQuery.fn.tabOut = function(speed, easing, callback) {
  return this.animate({
    borderTopColor:'#999999',
    borderLeftColor:'#999999',
    borderBottomWidth:'1px',
    color:'#999999'
  }, speed, easing, callback);  
};

jQuery(document).ready(function() {
  jQuery('body').removeClass('nojs').addClass('js');
  jQuery('#menu > .menuitem').hover(
  function(){
    jQuery('> ul',this).stop(true).removeAttr("style").slideFadeIn(600);
    jQuery('td > ul',this).stop(true).removeAttr("style").slideFadeIn(600);
  },  
  function(){
    jQuery('> ul',this).stop(true).slideFadeOut(600);
    jQuery('td > ul',this).stop(true).slideFadeOut(600);
  });  

  jQuery('.tab-list>li').contents().filter(function(){ return this.nodeType != 1; }).wrap('<div class="tab-list-item"/>');
  jQuery('.tab-list>li').addClass('tab-list-closed').hover(
  function(){
    jQuery(this).stop(true).removeAttr("style").tabIn(600,function(){jQuery(this).removeClass('tab-list-closed')});
    jQuery('> ul',this).stop(true).removeAttr("style").slideFadeIn(600);
  },  
  function(){
    jQuery(this).stop(true).tabOut(600,function(){jQuery(this).addClass('tab-list-closed')});
    jQuery('> ul',this).stop(true).slideFadeOut(600);
  });
  jQuery('.tab-list').append('<div style="clear:both"></div>');

  jQuery('.toggle-box').each(function(){
    var box=this;
    jQuery('.csc-header',this).click(function(){
      jQuery('.content-box',box).slideToggle('600',function(){
        jQuery(box).toggleClass('toggle-box-open');
      });
    });
  });
  
  jQuery('a.lightbox').fancybox();
  jQuery('a.ajaxbox').fancybox({
    ajax : {
      type : "POST",
      data : 'type=300'
    }
  });
  
});
