﻿
function popUp(url,name) 
    {
        newWindow = window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=350,height=480,left=100,top=50');
        newWindow.focus();	
    }

function toggle(link, id)
    {
    
        var objLink = document.getElementById(link);
        
        var obj = document.getElementById(id);
        if(obj.style.display=="none")
        {
            obj.style.display="block";
            objLink.innerText = "-";
        }else
        {
            obj.style.display="none";
            objLink.innerText = "+";
        }
    }
    
	function showChild(prtID){
		var elParent = document.getElementById(prtID);
		var elChild = document.getElementById("child_"+prtID);
		if(elChild){
		    elChild.style.display="block";
			elChild.style.left = findPosX(elParent)+1 + "px";
			elChild.style.top = findPosY(elParent) + 17 + "px";
		}
	}
	function hideChild(prtID){
		var elChild = document.getElementById("child_"+prtID);
		if(elChild){
			elChild.style.display="none";
		}
	}
	
	function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }





