		IE4 = (document.all && !document.getElementById) ? true : false;
		NS4 = (document.layers) ? true : false;
		IE5 = (document.all && document.getElementById) ? true : false;
		NS6 = (!document.all && document.getElementById) ? true : false;
		FF=(navigator.userAgent.indexOf("Firefox")!=-1)
	function TableAlternateColor(TableId,OddRowClass,EvenRowClass,NumRowToSkip){
        if(document.getElementsByTagName){  
            var table = document.getElementById(TableId);
            if (!table) return;
            var rows = table.getElementsByTagName("tr");
            var visiblerowcount=0;
            for(i = 0; i < rows.length; i++){
                row=rows[i];
                if (IE4) { oStyle = row.style; }
			    if (NS6 || IE5) { oStyle = row.style }
			    if (NS4){ oStyle = row; }

                //manipulate rows
                if (i>=NumRowToSkip)
                {
                    if (oStyle.visibility=='visible' || (!oStyle.visibility) )
                    {
                        if(visiblerowcount % 2 == 0)
                        {
                            row.className = EvenRowClass;
                        }
                        else
                        {
                            row.className = OddRowClass;
                        }
                        visiblerowcount++;
                    }
                }
            }
        }
    }
	function Master_OnClick(linkID,TableId, RowKey,OddRowClass,EvenRowClass,NumRowToSkip)
	{
		MasterDetailChangeText(linkID);
		MasterDetailShowDetails(TableId, RowKey,OddRowClass,EvenRowClass,NumRowToSkip);
	}
	
	function MasterDetailShowDetails(TableId, RowKey,OddRowClass,EvenRowClass,NumRowToSkip)
	{
		IE4 = (document.all && !document.getElementById) ? true : false;
		NS4 = (document.layers) ? true : false;
		IE5 = (document.all && document.getElementById) ? true : false;
		NS6 = (!document.all && document.getElementById) ? true : false;

		//x = 0;
		childseq = 1
        founddetail=true; // Assume there is a child
        while(founddetail)
        {
            //detailID=''+arguments[x]+childseq;
            detailID=RowKey+childseq;
            displayblockFlag="block";
            displaynoneFlag="none";
            if (IE4) { detailrow=document.all(detailID); }
            if (NS6 || IE5) { detailrow=document.getElementById(detailID); }
			if (NS4){ detailrow = document.layers(detailID); }
            if (detailrow) {
         	    if (IE4) { prefix = document.all(detailID).style; }
			    if (NS6 || IE5) { prefix = document.getElementById(detailID).style }
			    if (NS4){ prefix = document.layers(detailID); }
			    if (FF)
			    {
					displayblockFlag=null;
					displaynoneFlag="none";
				}
			    
			    //if (prefix.display == "block")
			    if (prefix.visibility == "visible")
			    {
					prefix.display=displaynoneFlag;
				    prefix.visibility = "hidden";
                    prefix.fontSize = "0";
                }
			    else
			    {
					prefix.display=displayblockFlag;
				    prefix.visibility = "visible";
				    prefix.fontSize = "16";
			    }
			    childseq++;
			}
			else
			{
			    founddetail=false;
			}
        }
        if (TableAlternateColor)
        {
            TableAlternateColor(TableId,OddRowClass,EvenRowClass,1);
        }
	}

	function MasterDetailChangeText(linkID)
	{
		//link += "link";
		linkObject = document.getElementById(linkID);
		if (!linkObject) return;
		//if (linkObject.firstChild.nodeValue == "Show Details")
		if (linkObject.innerHTML != "Hide Details")
		{
		    linkObject.innerHTML = "Hide Details";
		}
		else
		{
		    linkObject.innerHTML = "Show Details";
		}
	}

    function showActionTaken(JSTN,JAREA,JDATE,JTIME1,JTIME2,JCACT)
    {
		url='TrackActionTaken.aspx?S='+JSTN+'&A='+JAREA+'&D='+JDATE+'&T='+JTIME1+':'+JTIME2+'&AT='+JCACT;
		PopupWindow2(url,400,360,true,0,0,'winAT','location=no,scrollbars=yes,resize=no,status=no');
    }