var currLayerId = null;

function togLayer(id)
{
if(currLayerId) setDisplay(currLayerId, "none");
if(id)setDisplay(id, "block");
currLayerId = id;
}

function setDisplay(id,value)
{
var elm = document.getElementById(id);
elm.style.display = value;
}

function AddStyleToEtikettTable(objNode) 
{	
	
	if ( objNode == null ) 
	{
		alert("Nem létező objektumra való hivatkozás!");
	} 	
	else if ( objNode.tagName == 'TABLE' ) 
	{
		
		for ( var i = 1; i < objNode.rows.length; i+=2 ) 
		{
			var tr = objNode.rows[i];
			for ( var j = 0; j < tr.cells.length; ++j ) {				
				tr.cells[j].className = tr.cells[j].className + "_d";
			}
		}
	}
	
}	

function showMap(strUrl)
{	
 	var PictureMapWindowVar = window.open(strUrl,"PictureMapWindow","toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,alwaysRaised=yes,directories=no,height=600,width=600");
	PictureMapWindowVar.focus();

}	
	
function RedefineStyles(objNode, strStyle) 
{	
	
	if ( objNode == null ) 
	{
		alert("Nem létező objektumra való hivatkozás!");
	} 	
	else 
	{
		if ( objNode.className != null && objNode.className != "undefined" && objNode.className.match(/^redef/) ) 
		{	
	  		objNode.className =strStyle + "_" + objNode.className;
		}  	
		
		for ( var i = 0; i < objNode.childNodes.length; ++i ) 
		{
			RedefineStyles(objNode.childNodes[i],strStyle);
		}
	}
	
}	
	
function FindFirstSibling(objNode, strTagName) 
{	
	var sibling = objNode.previousSibling;	
	
	while ( sibling != null && sibling.tagName != strTagName ) 
	{	
		sibling = sibling.previousSibling;
	}	
	
	
	return(sibling);
}	
	
function PrintDOM(objNode)
{	
	alert(objNode.tagName);
	
	for ( var i = 0; i < objNode.childNodes.length; ++i ) 
	{	
		PrintDOM(objNode.childNodes[i]);
	}	
}	
	
function ClearText(objField)
{	
	if (objField.defaultValue == objField.value)
	{	
		objField.value = "";
	}	
}	
	
function AddCookie(strCookieName, strCookieValue, intExpires, strPath, strDomain, strSecure)
{	
	var strCookie = strCookieName + '=' + URLEncode(strCookieValue);
	
	
	if (intExpires != 0)
	{	
		intCurrent = (new Date()).getTime();
		strExpires = (new Date(intCurrent + (intExpires * 1000))).toGMTString();
		
		strCookie += ';expires=' + strExpires;
	}	
	
	if (strPath != 'null')
	{	
		strCookie += ';path=' + strPath;
	}	
	
	if (strDomain != 'null')
	{	
		strCookie += ';domain=' + strDomain;
	}	
	
	if (strSecure == 'true')
	{	
		strCookie += '; secure';
	}	
	
	document.cookie = strCookie;
}	
	
function SelectItem(objCtl, strVal)
{	
    if (navigator.appName == "Netscape")
    {
	for (var i = 0; i < objCtl.options.length; i++)
	{
	    if (objCtl.options[i].value == strVal)
		objCtl.options[i].selected = true;
	}
    }
    else
    {
	objCtl.value = strVal;
    }
}	

function addBookmark() {
	url='http://www.napidoktor.hu/';
	title='NapiDoktor';

	if (window.sidebar) {
		window.sidebar.addPanel(title, url,'');
	}
	if (window.external) {
		window.external.AddFavorite(url, title);
	}
	if(window.opera && window.print) {
		return true;
	}
}
function addHomePage() {
	alert('Ha a NapiDoktort szeretnéd kezdőlapként, húzd a fenti navigációs sávban lévő ikonját a házacskára!');
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function highlightLinks(obj) {
   var linkList = document.getElementById("ajanlatok_wrapp").getElementsByTagName("a");
   for (i = 0; i < linkList.length; i++) {
      linkList[i].className = "";
   }
   obj.className = "selected";
}

