//otevreni noveho okna
function fShowNewWindow(strURL, strName, bReplace, nWidth, nHeight, nLeft, nTop, nResizable, nScrollbars)
{
	strFeatures = 'channelmode=0,directories=0,fullscreen=0,location=0,menubar=0,status=0,titlebar=1,toolbar=0';
	if (nWidth!=null) strFeatures += ',width=' + nWidth;
	if (nHeight!=null) strFeatures += ',height=' + nHeight;
	if (nLeft!=null) strFeatures += ',left=' + nLeft;
	if (nTop!=null) strFeatures += ',top=' + nTop;
	if (nResizable!=null) strFeatures += ',resizable=' + nResizable;
	if (nScrollbars!=null) strFeatures += ',scrollbars=' + nScrollbars;
// height = number Specifies the height of the window, in pixels. The minimum value is 100. 
// left = number Specifies the left position, in pixels. This value is relative to the upper-left corner of the screen. The value must be greater than or equal to 0.  
// resizable = { yes | no | 1 | 0 } Specifies whether to display resize handles at the corners of the window. The default is yes. 
// scrollbars = { yes | no | 1 | 0 } Specifies whether to display horizontal and vertical scroll bars. The default is yes. 
// top = number Specifies the top position, in pixels. This value is relative to the upper-left corner of the screen. The value must be greater than or equal to 0.  
// width = number 

	var nReturn = window.open(strURL, strName, strFeatures, bReplace);
	return nReturn;
}

//zvyraznovani radku v resultlistu metodou mouseover
function ofm(el, col)
{
	el.style.backgroundColor = col;
}

function onm(el)
{
	el.style.backgroundColor = "#F1E7CC";
}

//skryje nebo zobrazí pole elementu
function fSetElementsVisible(strElements, bVisible)
{
	for(var i=0;i<strElements.length;i++)
	{
		fSetVisible(strElements[i], bVisible);
	}
}

//skryje nebo zobrazí element
function fSetVisible(strElement, bVisible)
{
	var objElement = document.getElementById(strElement);
	if (objElement != null)
	{
		if (bVisible == null)
			bVisible = (objElement.style.display == 'none') ? true : false;
		if (bVisible) {
			objElement.style.visibility = 'visible';
			objElement.style.display = '';
		}
		else {
			objElement.style.visibility = 'hidden';
			objElement.style.display = 'none';
		}
	}
}
/*skryti/zobrazovani praveho menu*/
function webicp_ShowHideRightsub(strElement, oThis, strTagNameParentElement, strClassNameDown, strClassNameUp)
{
    var oEl = webnet_GetElementById(strElement);
    if (oEl==null)
        return;
    
    var oPar = oThis.parentElement;
    while (oPar.tagName.toUpperCase() != strTagNameParentElement)
        oPar = oPar.parentElement;
    
    if (('' + oEl.style.visibility == '') || ('' + oEl.style.visibility == 'visible'))
    {
        oEl.style.visibility = 'hidden';
        oEl.style.display = 'none';
        oPar.className = strClassNameDown;
    }
    else
    {
        oEl.style.visibility = 'visible';
        oEl.style.display = '';
        oPar.className = strClassNameUp;
    }
}

/*MENU PRODUCTS*/
var timer = null;
var menucount = 2;

var dom = document.getElementById ? true : false;
var ie4 = ((document.all) && (!dom)) ? true : false;
var ns4 = document.layers ? true : false;
var opera = navigator.userAgent.indexOf('Opera') != -1 ? true : false;
var dhtml = dom ? true : ie4 ? true : ns4 ? true : false;

function setVisibility(element,newVisibility) {
	if (dhtml) {
		if (dom) document.getElementById(element).style.display = newVisibility;
		else if (ie4) document.all[element].style.display = newVisibility;
		else if (ns4) eval('document.' + element + '.display = newVisibility');
	} 
}

function showMenu(id) {
	if (dhtml) {
		clearTimeout(timer);
		for (var i = 1; i <= menucount; i++)
			if (i != id) setVisibility('cMenu'+i,'none');
		setVisibility('cMenu'+id,'');
	}
}
function hideMenu(id)
{
	if (dhtml) {
		menuId = 'cMenu' + id;
		timer = setTimeout("setVisibility(menuId,'none')",50);
	}
}

function dontHideMenu()
{
	if (dhtml) clearTimeout(timer);
}

//	schovávání a rozbalování chlívků vpravo
function fExpandCollapse(oNode)
{
	var bExpand = oNode.src.toLowerCase().indexOf('expand') > -1;
	oNode.src = bExpand ? '../images/collapse.gif' : '../images/expand.gif';
	if (bExpand)
		oNode.parentNode.parentNode.parentNode.rows[1].style.display = '';
	else
		oNode.parentNode.parentNode.parentNode.rows[1].style.display = 'none';
}

//	schovávání a rozbalování chlívků vpravo - div verze
function fExpandCollapseDiv(oNode) {
    var elem = oNode; //.parentNode.parentNode;
	var par = elem;
	while (elem.nodeName.toLowerCase() != 'div')
	    elem = elem.nextSibling;
	
    if (('' + elem.style.visibility == '') || ('' + elem.style.visibility == 'visible'))
    {
        elem.style.visibility = 'hidden';
        elem.style.display = 'none';
        par.className = 'down';
    }
    else
    {
        elem.style.visibility = 'visible';
        elem.style.display = '';
        par.className = 'up';
    }
}

// To Favorites
function fBookmarkLink() {
    var title = "vssr.sk - verejná správa "; 
    var url = "http://www.vssr.sk/";
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera 
		return true; }
}

// To HomePage
function fHomepageLink(oThis) {
    var url = "http://www.vssr.sk/";
    if( window.external ) { // IE Favorite
        oThis.style.behavior='url(#default#homepage)';
        oThis.setHomePage(url); 
    } else
        return true;
}
