var intCatMask;
var currentCatDiv;

initCatSubMenu()

function initCatSubMenu(){
	var menuArr = getElementsByClassName("criteres_popup");
	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);
}



////////////////////////////////////////////////////////////////////

var intCartActions
var currentCartActionsDiv



iniCartActions()


function iniCartActions(){
	var popArr = getElementsByClassName("cat_article_action");
	var nb = popArr.length;
	var n = 0;
	while(n < nb){
		var node = popArr[n];
		var popDiv = node.getElementsByTagName("div")[0];
		if(popDiv){		
			//var Atag = node.getElementsByTagName("a")[0];
			var Atag = node.getElementsByTagName("a");
			for(e in Atag){
				if(Atag[e].className == "_plus"){
					Atag = Atag[e];
					break;
				}
			}
			
			
			
			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);
}


