function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function fpreload(prlide,prlide2)
{
document.getElementById(prlide2).innerHTML='';
document.getElementById(prlide).style.visibility='visible';
}

function funpreload(prlide)
{
document.getElementById(prlide).style.visibility='hidden';
}

function textCounter(policko, pocpolicko, maxpocet)
{
if (policko.value.length > maxpocet) //pridlhe - odrez
policko.value = policko.value.substring(0, maxpocet);
//inac zmen pocet
else 
pocpolicko.value = maxpocet - policko.value.length;
}


function GobyusTextCounter(policko2, pocpolicko2, maxpocet2)
{
var Pocitadlotext=maxpocet2 - policko2.value.length;
pocpolicko2.innerHTML = Pocitadlotext;
}


function dataukaz_zozk2(m_dfurl, m_dfjaz, m_id1, m_selected1)
{
var httpRequest1;
var request_url=m_dfurl+"data_zozk2.php?subid="+m_id1+"&selected="+m_selected1+"&lg="+m_dfjaz;

	if (window.XMLHttpRequest)
	{ // Mozilla, Safari, ...
	httpRequest1 = new XMLHttpRequest();
		if (httpRequest1.overrideMimeType)
		{
		httpRequest1.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject)
	{ // IE
		try {
			httpRequest1 = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) {
					   try {
						   httpRequest1 = new ActiveXObject("Microsoft.XMLHTTP");
						   } 
						 catch (e) {}
					  }
	}


	if (!httpRequest1)
	{
	alert('Error 3');
	return false;
	}

httpRequest1.onreadystatechange = function() { g_rqdata1(httpRequest1); };
httpRequest1.open('GET', request_url, true);//T-ide dalej,F-caka
httpRequest1.send(null);
}

function g_rqdata1(httpRequest1)
{
		if (httpRequest1.readyState == 4)
		{
			if (httpRequest1.status == 200)
			{			
			var dddata1=httpRequest1.responseText;

				if(dddata1!='')//NP--
				{
				document.getElementById("maK2").innerHTML = dddata1;
				funpreload("prl02");
				}//--NP
			}
			else
			{
			alert('Error 4');
			}
		}
}
