﻿
function ChangeColor(tableRow, highLight)
    {
    
    //If folded out, dont change color
    if(document.getElementById(tableRow.id+"sub0")!=null && document.getElementById(tableRow.id+"sub0").style.display=='')
        return;
        
    if (highLight)
    {
      tableRow.style.backgroundColor = '#f0e375';
      
    }
    else
    {
      tableRow.style.backgroundColor = 'white';
    }
}
function ChangeColor(tableRow, highLight,basecolor)
    {
    
    //If folded out, dont change color
    if(document.getElementById(tableRow.id+"sub0")!=null && document.getElementById(tableRow.id+"sub0").style.display=='')
        return;
        
    if (highLight)
    {
    this.lastBackColor = basecolor;
      tableRow.style.backgroundColor = '#f0e375';
      
    }
    else
    {
         if(basecolor==null){
         tableRow.style.backgroundColor = 'white';
           }
         else{
            tableRow.style.backgroundColor = basecolor;
         }
    }
}

function ShowHideExtendedEvent(nameofbaseevent)
{

    if(nameofbaseevent!=null){
    //fold ind
            if(document.getElementById(nameofbaseevent.id+"sub0").style.display==''){
            document.getElementById(nameofbaseevent.id).style.backgroundColor = this.lastBackColor;
            document.getElementById(nameofbaseevent.id+"sub0").style.display='none';
            }
            //fold ud
            else{
                rows = document.getElementsByTagName('tr');
                 
                for(var i=0 ; i<rows.length ; i++){
                    if(rows[i].id.indexOf('sub0')>=0){
                        if(rows[i].style.display==''){
                        rows[i].style.display = 'none';
                        
                        rows[i-1].style.backgroundColor = this.lastBackColor;
                        }
                        
                        }
                }
               
                document.getElementById(nameofbaseevent.id+"sub0").style.display = '';
                document.getElementById(nameofbaseevent.id).style.backgroundColor = "#f0e375";
                
            }
    }
}



function MoveProgressFlash(divToMove){
if(document.getElementById(divToMove)!=null){
var scHeight = window.screen.height;

var winHeight = document.body.clientHeight;

var toolHeight = parseInt(scHeight) - parseInt(winHeight);
var innerHeight = scHeight-toolHeight;

 var xPos = (894/2)-(parseInt(document.getElementById(divToMove).style.width)/2)+document.body.scrollLeft;
 var yPos = (innerHeight/2)-(parseInt(document.getElementById(divToMove).style.height)/2)+document.body.scrollTop;

document.getElementById(divToMove).style.left=xPos;
document.getElementById(divToMove).style.top=yPos;
}
}


