Converting mootools code into jQuery

Converting mootools code into jQuery

Can anyone please help me in converting this mootools code into jQuery:

  1. window.addEvent("load", function () {
  2.     if (window.ie6) {
  3.         $$("#horiz-menu li").each(function (e) {
  4.             e.addEvents({
  5.                 "mouseenter": function () { e.addClass("sfHover"); },
  6.                 "mouseleave": function () {
  7.                     e.removeClass("sfHover");
  8.                 }
  9.             });
  10.         });
  11.     }
  12. });
  13. window.addEvent("domready", function(){
  14. // necessary classes
  15.     Fx.Height = Fx.Style.extend({
  16.         initialize: function (el, options) {
  17.             $(el).setStyle('overflow', 'hidden');
  18.             this.parent(el, 'height', options);
  19.         },
  20.         toggle: function () {
  21.             var style = this.element.getStyle('height').toInt();
  22.             return (style > 0) ? this.start(style, 0) : this.start(0, this.element.scrollHeight);
  23.         },
  24.         show: function () {
  25.             return this.set(this.element.scrollHeight);
  26.         }
  27.     });
  28.     
  29.     Fx.Width = Fx.Style.extend({
  30.         initialize: function (el, options) {
  31.             this.element = $(el);
  32.             this.element.setStyle('overflow', 'hidden');
  33.             this.iniWidth = this.element.getStyle('width').toInt();
  34.             this.parent(this.element, 'width', options);
  35.         },
  36.         toggle: function () {
  37.             var style = this.element.getStyle('width').toInt();
  38.             return (style > 0) ? this.start(style, 0) : this.start(0, this.iniWidth);
  39.         },
  40.         show: function () {
  41.             return this.set(this.iniWidth);
  42.         }
  43.     });
  44.     
  45.     Fx.Opacity = Fx.Style.extend({
  46.         initialize: function (el, options) {
  47.             this.now = 1; this.parent(el, 'opacity', options);
  48.         },
  49.         toggle: function () {
  50.             return (this.now > 0) ? this.start(1, 0) : this.start(0, 1);
  51.         },
  52.         show: function () {
  53.             return this.set(1);
  54.         }
  55.     });
  56. var main = $("horiz-menu");
  57. var levels = new Array();
  58. var opacityFX = new Array();
  59. var heightFX = new Array();
  60.     var widthFX = new Array();
  61. main.getChildren().each(function(el,i){
  62. levels.push(new Array());
  63. opacityFX.push(new Array());
  64. heightFX.push(new Array());
  65.         widthFX.push(new Array());
  66. el.getElementsBySelector("ul").each(function(elm,j){
  67. levels[i].push(elm.getParent());
  68. opacityFX[i].push(new Fx.Opacity(elm, { duration: 180, transition: Fx.Transitions.linear }).set(0));
  69. heightFX[i].push(new Fx.Height(elm, { duration: 180, transition: Fx.Transitions.linear }).set(0));
  70. widthFX[i].push(new Fx.Width(elm, { duration: 180, transition: Fx.Transitions.linear }).set(0));
  71.         });
  72. });
  73. levels.each(function(e,k){
  74. e.each(function(a,l){
  75. a.addEvents({
  76. "mouseenter" : function(){
  77. a.getChildren()[1].setStyle("overflow","hidden");
  78. opacityFX[k][l].toggle();
  79. heightFX[k][l].toggle();
  80. widthFX[k][l].toggle();
  81.                     (function(){a.getChildren()[1].setStyle("overflow","")}).delay(180);
  82. },
  83. "mouseleave" : function(){
  84. a.getChildren()[1].setStyle("overflow","hidden");
  85. opacityFX[k][l].stop().set(0);
  86. heightFX[k][l].stop().set(0);
  87. widthFX[k][l].stop().set(0);
  88.                 }
  89. });
  90. });
  91. });
  92. });