// zmenit barvu oznacene odpovedi
function fcChangeColor(pType, pRowID, pCount, pNum)
  {
    if(pType == "radio")
      {
        for(var i=0; i<pNum; ++i) 
          {
            document.getElementById("qtr_"+ pRowID +"_"+ i).bgColor = "white";
          }
        document.getElementById("qtr_"+ pRowID +"_"+ pCount).bgColor = "#CCFFCC";
      }
    else
      {
        if(document.getElementById("check_"+ pRowID +"_"+ pCount).checked)
          {
            document.getElementById("qtr_"+ pRowID +"_"+ pCount).bgColor = "#CCFFCC";
          }
        else
          {
            document.getElementById("qtr_"+ pRowID +"_"+ pCount).bgColor = "white";
          }
      }
  }

// Zobrazeni dynamickeho layotu
// pTitle     - nazev layeru
// pURL       - odkaz na stranku (URL) 
// pLWidth    - sirka layeru
// pLHeight   - vyska layeru
// pPWidth    - sirka stranky
// pXPosition - x-pozice layeru
// pYPosition - y-pozice layeru
// pCenter    - centrovani stranky na stred (neni pres cele window) true/false
// pView      - zobrazeni layeru true/false
function fcViewDynLayer(pTitle, pURL, pLWidth, pLHeight, pPWidth, pXPosition, pYPosition, pCenter, pView)
	{
		var myWidth = 0, myHeight = 0;
		var scrOfX = 0, scrOfY = 0;
		var xPosition = 0, yPosition = 0;
  	if(typeof( window.innerWidth ) == 'number' ) 
			{
    		//Non-IE
    		myWidth = window.innerWidth;
    		myHeight = window.innerHeight;
  		} 
		else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) 
			{
    		//IE 6+ in 'standards compliant mode'
    		myWidth = document.documentElement.clientWidth;
    		myHeight = document.documentElement.clientHeight;
  		} 
		else if(document.body && (document.body.clientWidth || document.body.clientHeight)) 
			{
    		//IE 4 compatible
    		myWidth = document.body.clientWidth;
    		myHeight = document.body.clientHeight;
  		}
			
		// Zjisteni posunu scrollBaru 
	  if(typeof( window.pageYOffset) == 'number') 
			{
	    	//Netscape compliant
	    	scrOfY = window.pageYOffset;
	    	scrOfX = window.pageXOffset;
	  	} 
		else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) 
			{
	    	//DOM compliant
	    	scrOfY = document.body.scrollTop;
	    	scrOfX = document.body.scrollLeft;
	  	} 
		else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) 
			{
	    	//IE6 standards compliant mode
	    	scrOfY = document.documentElement.scrollTop;
	    	scrOfX = document.documentElement.scrollLeft;
	  	}
	  	
	  // Konecna poloha layeru
	  xPosition = pXPosition + scrOfX;
		yPosition = pYPosition;
		// pokud neni stranka pres cele okno prohlizece a centrovane na stred
		if(pCenter)
			{
			 	xPosition = (myWidth / 2) - (pPWidth / 2) + pXPosition;
			}
		// posun layeru dle scrollBaru
		if((scrOfY > 0) && (scrOfY > pYPosition))
			{
				yPosition = scrOfY + 20;
			}
				
		document.getElementById('tTitle').innerHTML = pTitle;
		document.getElementById("popupLayer").style.top = yPosition +"px";
		document.getElementById("popupLayer").style.left = xPosition +"px";		
		document.getElementById("popupLayer").style.width = pLWidth +"px";
		document.getElementById("popupLayer").style.height = (pLHeight - 1) +"px";
		document.getElementById("myIFrame").style.height = parseInt(pLHeight - document.getElementById("myIFrame").offsetTop-27)+"px";
		myIFrame.location.href = pURL;
		if(pView)
			document.getElementById('popupLayer').style.visibility = 'visible';
	}
	
function fcDynLayerHidden()
	{
		document.getElementById('popupLayer').style.visibility = 'hidden';
		myIFrame.location.href = './source/blank.php';
    document.getElementById("popupLayer").style.top = 0 +"px";
		document.getElementById("popupLayer").style.left = 0 +"px";
		document.getElementById("popupLayer").style.width = 5 +"px";
		document.getElementById("popupLayer").style.height = 5 +"px";
	}

function fcDynLayerHiddenParent()
	{
		top.document.getElementById('popupLayer').style.visibility = 'hidden';
		myIFrame.location.href = './source/blank.php';
    top.document.getElementById("popupLayer").style.top = 0 +"px";
		top.document.getElementById("popupLayer").style.left = 0 +"px";
		top.document.getElementById("popupLayer").style.width = 5 +"px";
		top.document.getElementById("popupLayer").style.height = 5 +"px";
	}
