
function printArticle( artUrl ){
    behind = window.open(artUrl ,'printwin','height=620,width=590,status=yes,toolbar=yes,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes');
}

function colCh(cellname,mOver) {
	if (document.all)
        document.all[cellname].style.background = (mOver)?"#A10000":"#700000";
	else if (document.getElementById)
		document.getElementById(cellname).style.background = (mOver)?"#A10000":"#700000" ;
}

function getAbsolutePos(el){
	for (var lx=0,ly=0;el!=null;
		lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
	return {x:lx,y:ly}
}

function showMenuLayer(catID,level,parentID) {

	if (submenuLayers[catID]) {
		
		// position the layer using a hidden image...
		//submnuimg-catID
		if (document.getElementById && document.getElementById("submnuimg-"+catID))	{
			theImage = document.getElementById("submnuimg-"+catID);
			pos = getAbsolutePos(theImage);
			if (level == 4) {
				initX = pos.x - 1;
				initY = pos.y +12;
			} else {
				initX = pos.x + 16;
				initY = pos.y -8;
			}
			// alert("x er " + initX + ", y er " + initY);
			// initY = y;
		} else {
			// ns 4
			initX = x;
			initY = y;
		}									  
				  
		// close active layer if exists
		closeActiveLayer(level);
				    					 
		submenuLayers[catID].moveTo(initX,initY);							   
		submenuLayers[catID].show();
		
		// preserve parent showing...
		if (parentID > 0) {
			keepMenuLayerOpen(parentID);
		}
		
		// set active id on this level
		activeID[level] = catID;
		
	} else {
		// hide active layer on this level....
		closeActiveLayer(level);
	}
}		 
		 
					 
function hideMenuLayer(catID,level) {
	timerArray[catID] = setTimeout("submenuLayers["+catID+"].hide()",2000);
}	

function closeActiveLayer(level) {
	if (activeID[level] > 0 ) {
		submenuLayers[activeID[level]].hide();
	}				  
	
	// close parents
	for (x=level;x < 12 ; x++) {
		if (activeID[x] > 0 ) {
			submenuLayers[activeID[x]].hide();
		}				  
	}
}

function closeAllActiveLayers() {
	closeActiveLayer(0);
}

function keepMenuLayerOpen(catID) {
	clearTimeout(timerArray[catID]);
}				 
					 
		 
function changeLinkColor(catID, mouseover) {
	if (document.getElementById && document.getElementById("link-"+catID))	{
	   	linkelement = document.getElementById("link-"+catID);
		if (mouseover == true) {
			linkelement.style.color = '#FFFFFF';
		} else {
			linkelement.style.color = '#887461';
		}
		
	}

}

