function radioButtonChecker(button)
{
	var radio_choice = false;
	//alert(button);
	for (counter = 0; counter < button.length; counter++)
	{
		if (button[counter].checked)
			radio_choice = true; 
	}
	if (!radio_choice)
		return (false);
	return (true);
}

// ##############################################
// ########## PopUp Window for Image script #####
// ##############################################
function imagePopup(url)
{
	if(typeof(url)!="object")
	{
		window._w = window.open("","","width=30,height=30,scrollbars=no,resizable=yes");
		window._w.document.open();
		window._w.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1257"><title></title></head><body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" text="#000000"><table border="0" cellpadding="0" cellspacing="0" background="" align="center"><tr><td><a href="#" onclick="self.close(); return false;"><img src="'+url+'" border="0" alt="Uždaryti langą? / Close window?" onLoad="opener.imagePopup(this);" /></a></td></tr></table></body></html>');
		window._w.document.close();
	}
	else
	{
		if (document.layers)
			window._w.resizeTo(url.width,url.height);		
		else
			window._w.resizeTo(url.width+10,url.height+30);
	}
}

function mteoswitch (enable, disable) 
{
	document.getElementById('mteocont'+disable).style.display='none';
	document.getElementById('mteomnu'+disable).className='';
	document.getElementById('mteomnu'+enable).className='mteocurr';
	document.getElementById('mteocont'+enable).style.display='block';
	return false;
}
/* MENU */
startList = function() {
 if (document.getElementById('q')) {
	document.getElementById('q').onmouseover = function() {this.focus();}
 }
 if (document.getElementById('mteomnu1')) 
 {
	document.getElementById('mteomnu1').onclick = function() {return mteoswitch (1, 2)}
	document.getElementById('mteomnu2').onclick = function() {return mteoswitch (2, 1)}
 }
 if (document.all && document.getElementById && document.getElementById("nav")) {
  navRoot = document.getElementById("nav");
  for (i=0; i<navRoot.childNodes.length; i++) {
   node = navRoot.childNodes[i];
   if (node.nodeName=="LI") {
    node.onmouseover=function() {this.className+=" over";}
    node.onmouseout=function() {this.className=this.className.replace(" over", ""); }
   }
  }
 }
 // dynamic text replacement
	x = document.getElementsByTagName('h1');
	var r = document.createElement('img');
	for (var i=0;i< x.length;i++)
	{
		txt = x[i].firstChild.nodeValue;
		ntxt = '';
		for (j=0; j < txt.length; j++)
		{
			ntxt += (txt.charCodeAt(j) > 256? "&#" + txt.charCodeAt(j) + ";": txt.charAt(j));
		}
		words = ntxt.split(' ');
		x[i].title = x[i].firstChild.nodeValue;
		x[i].removeChild(x[i].firstChild);
		for (j=0; j < words.length; j++)
		{
			var y = r.cloneNode(true);
			y.src = '/fonts/h1.php?text='+escape(words[j]+' ');
			x[i].appendChild(y);
		}
	}
}
window.onload=startList;
