
var _TrRockActiveBgColor='#E7EFFF';
var _TrRockSelectBgColor='#CBE2FA'

function TrRockMouseOver(trobj){
	trobj._perbgc=trobj.style.backgroundColor;
	trobj.style.backgroundColor=_TrRockActiveBgColor;
	for(i=0;i<trobj.children.length;i++){
		if(trobj.children[i].tagName=='TD'){
			trobj.children[i]._perbgc=trobj.children[i].style.backgroundColor;
			trobj.children[i].style.backgroundColor=_TrRockActiveBgColor;
		}
	}//end for
}//end function TrRockMouseOver(trobj)

function TrRockMouseOut(trobj){
	trobj.style.backgroundColor=trobj._perbgc
	for(i=0;i<trobj.children.length;i++){
		if(trobj.children[i].tagName=='TD'){
			trobj.children[i].style.backgroundColor=trobj.children[i]._perbgc;
		}
	}//end for
}//end function TrRockMouseOut(trobj)

function TrRockClick(trobj,bstick){	
	var tag=trobj.parentNode;
	var s=window.event.srcElement.tagName;
	var t=window.event.srcElement.type;
	var found=false;
	
	if(tag._peractive!=trobj){
		if(bstick==false){
			if(s=='A'){
				found=true;
			}else if(s=='INPUT'){
				if(t=='checkbox' || t=='radio'){
					found=true;
				}
			}
		}else{
			found=true;
		}//end if(bstick==false)
		
		if(found==true){		
			if(tag._peractive!=null){
				tag._peractive._perbgc=tag._peractivebgc
				tag._peractive.style.backgroundColor=tag._peractive._perbgc
				for(i=0;i<tag._peractive.children.length;i++){
					if(tag._peractive.children[i].tagName=='TD'){
						tag._peractive.children[i].style.backgroundColor=tag._peractive.children[i]._perbgc2;
					}
				}
			}//end if(tag._peractive!=null)
			
			trobj.isselected=true;
			tag._peractive=trobj;
			tag._peractivebgc=trobj._perbgc;
			
					
			trobj.style.backgroundColor=_TrRockSelectBgColor;
			trobj._perbgc=trobj.style.backgroundColor;
			
			for(i=0;i<trobj.children.length;i++){
				if(trobj.children[i].tagName=='TD'){
					trobj.children[i]._perbgc2=trobj.children[i]._perbgc;
					trobj.children[i]._perbgc=_TrRockSelectBgColor;
					trobj.children[i].style.backgroundColor=_TrRockSelectBgColor;
				}
			}//end for

		}//end if(found==true)
	}//end if(tag._peractive!=trobj)
}//end function TrRockClick(trobj,bstick)


function TrRockSelect(trobj){	
	var found=false;
	
	if(trobj._isselected==true){
		trobj.style.backgroundColor=trobj._perbgc2;
		trobj._perbgc=trobj._perbgc2;
		for(i=0;i<trobj.children.length;i++){
			if(trobj.children[i].tagName=='TD'){
				trobj.children[i].style.backgroundColor=trobj.children[i]._perbgc2;
				trobj.children[i]._perbgc=trobj.children[i]._perbgc2;
			}
		}
		trobj._isselected=false;
	}else{
		trobj._isselected=true;
		trobj._perbgc2=trobj._perbgc;
		trobj.style.backgroundColor=_TrRockSelectBgColor;
		trobj._perbgc=_TrRockSelectBgColor;
		
		for(i=0;i<trobj.children.length;i++){
			if(trobj.children[i].tagName=='TD'){
				trobj.children[i]._perbgc2=trobj.children[i]._perbgc;
				trobj.children[i]._perbgc=_TrRockSelectBgColor;
				trobj.children[i].style.backgroundColor=_TrRockSelectBgColor;
			}
		}//end for		
	}
				
}//end function TrRockSelect(trobj)


function TrClearSelect(parentobj){
	var trobj=null;
	for(j=0;j<parentobj.children.length;j++){
		trobj=parentobj.children[j];
		if(trobj._isselected==true){
			trobj.style.backgroundColor=trobj._perbgc2;
			trobj._perbgc=trobj._perbgc2;
			for(i=0;i<trobj.children.length;i++){
				if(trobj.children[i].tagName=='TD'){
					trobj.children[i].style.backgroundColor=trobj.children[i]._perbgc2;
					trobj.children[i]._perbgc=trobj.children[i]._perbgc2;
				}//end if(trobj.children[i].tagName=='TD')
			}//end for i
			trobj._isselected=false;
		}//end if(trobj._isselected==true)
	}//end for j
}//end function TrClearSelect(parentobj)


function FindChild(parentObj,tagName,typeName){
	var result=null;
	var j=0;
	var tagname=tagName.toUpperCase();
	var typename=typeName.toUpperCase();	
	
	var childs=new Array();
	
	if(parentObj!=null){
		childs=parentObj.all.tags(tagname);
		if(typename!=''){
			result=new Array();
			j=0;
			for(i=0;i<childs.length;i++){
				if(childs[i].type.toUpperCase()==typename){
					result[j]=childs[i];
					j++;
				}
			}
		}else{
			result=childs;
		}
	}
	return result;
}





