var J = jQuery.noConflict();
var AblockSM = new Array();
AblockSM["m0"]=false;AblockSM["m1"]=false;AblockSM["m2"]=false;
AblockSM["m3"]=false;AblockSM["m4"]=false;AblockSM["m5"]=false;
AblockSM["m6"]=false;AblockSM["m7"]=false;AblockSM["m8"]=false;

function equaColumn(parentCL,relChildCL,bottomMargin){
	maxHeight=0;
	J("."+parentCL).children().each(function(){
		if (maxHeight<this.offsetHeight){
			maxHeight = this.offsetHeight;
		}
	});
	J("."+relChildCL).height((maxHeight+bottomMargin)+"px");
}

function equaWidthSMenu(){
	maxWidth=0;
	var widthStep = 3;
	var strWidth = "";
	
	J(".smcontain").each(function(){
		strWidth += "\n > " + this.attributes['id'].value + " > " + this.offsetWidth + ":" + this.offsetHeight  ;
    J("#" + this.attributes['id'].value + ".smcontain").width(""+"200px");
    maxWidth=0
    //for each(child in this.children){
    
    for (cpt=0; cpt<this.children.length;cpt++){
      child = this.children[cpt];
      //if (child.localName == "li"){
        if (maxWidth<child.children[0].offsetWidth){maxWidth=child.children[0].offsetWidth}
        strWidth += "," + child.children[0].offsetWidth;
      //}
      //else{break;}
    }   
    J("#" + this.attributes['id'].value + ".smcontain").width((maxWidth+15)+"px");
    J("#" + this.attributes['id'].value + ".smcontain").parent().css("visibility","visible");
    J("#" + this.attributes['id'].value + ".smcontain").parent().css("display","none");
	});
}


J(document).ready(function(){
   equaWidthSMenu();     
    J('#menu_left .mme')
      .hover(function(e) {        
        J(this).children('ul').hoverFlow(e.type, {
            'height': 'show',
            'marginTop': 'show',
            'marginBottom': 'show',
            'paddingTop': 'show',
            'paddingBottom': 'show'
          },40);
        }, function(e) {
        J(this).children('ul').hoverFlow(e.type, {
            'height': 'hide',
            'marginTop': 'hide',
            'marginBottom': 'hide',
            'paddingTop': 'hide',
            'paddingBottom': 'hide'
          },80);
      });
       
});
