var intCatMask;
var currentCatDiv;


initCatSubMenu()

function initCatSubMenu(){
	var menuArr = getElementsByClassName("rss_xml");
	var nb = menuArr.length;
	var n = 0;
	while(n < nb){
		var node = menuArr[n];
		var popDiv = node.getElementsByTagName("div")[0];
		if(popDiv){		
			var Atag = node.getElementsByTagName("a")[0];
			Atag.div = popDiv;
			Atag.onmouseover = function(){
					showCatPop(this.div);
			}
			Atag.onmouseout = function(){
					maskCatPop(this.div);
			}
			popDiv.onmouseover = function(){
					showCatPop(this);
			}
			popDiv.onmouseout = function(){
					maskCatPop(this);
			}
		}
		n++;	
	}
}

function showCatPop(e){
	if(e){
		clearCatInt();
		maskElement(currentCatDiv);
		showElement(e);
		currentCatDiv = e;	
	}
}
function maskCatPop(e){
	if(e){
		clearCatInt();
		setCatInt(e);
	}
}

function clearCatInt(){
	clearTimeout(intCatMask);
}
function setCatInt(e){
	intCatMask = setTimeout(function(){maskElement(e)},300);
}
