function selCurAct(obj, stClName){
		
		var actRowList = document.getElementsByName("actRow");		
		var i=0;		
		while(i < actRowList.length) {
			var actRow = actRowList.item(i);
			actRow.className = "timeSlotRow";
			i++;
		}				
		//obj.className = stClName;
		var parentDiv = obj.parentNode.parentNode;
		parentDiv.className = stClName;
}

function selectActAvailRow() {
        var rrows = document.getElementsByName("av_actRow");
        for(var rowN=0;rrows.length;rowN++){
            if (rrows[rowN].lastChild) {
                if (rrows[rowN].lastChild.firstChild.firstChild.checked) {
                    rrows[rowN].className = rrows[rowN].className + " " + "selected";
                } else {
                    rrows[rowN].className = rrows[rowN].className.replace("selected", "");
                }
            }
        }
}

function findTable(panels){
	var table =  panels.getElementsByTagName("table");
	return table[0];
}


function selectActRow(obj, stClName) {		
    var actRowList = document.getElementsByName("actRow");		
    var i = 0;		
    while (i < actRowList.length) {
        var actRow = actRowList.item(i);
        actRow.className = "timeSlotRow";
        i++;
    }				
    
    var row = obj.parentNode.parentNode.parentNode.parentNode;   
    for (var j = 0; j < row.cells.length; j++) {
        var cellDiv = row.cells.item(j).firstChild;
        cellDiv.className = stClName;
    }    
}
 	
function selCurMAct(obj, stClName){		
		
		var parentDiv = obj.parentNode;
		while(parentDiv!=null && "actMRow"!=parentDiv.id){
			parentDiv=parentDiv.parentNode;
		}			
		parentDiv.className = parentDiv.className+" "+stClName;		
		var actRowList = document.getElementsByName("actMRow");		
		var i=0;		
		while(i < actRowList.length) {			
			var actRow = actRowList.item(i);			
			if(parentDiv!=actRow){
				while(actRow.className.indexOf(stClName)!=-1){
                    actRow.className=actRow.className.replace(stClName," ");
                }
				resetMenuComp(actRow);				
			}
			i++;
		}				
}  	

function resetMenuComp(parent){
	var childs=parent.childNodes;
	var i = 0;
	while(i < childs.length) {
		if((childs.item(i).tagName+"").toLowerCase() == "select"){			
			childs.item(i).selectedIndex = 0;			
		}else{
			resetMenuComp(childs.item(i));
		}
		i++;
	}
}
