function newWindow(elm)
{
	if (window.open(elm.href, elm.target, ''))
	{
  	return true;
  }

  return false;
}

function newWindowResize(elm, sirka, vyska)
{
	vlastnosti = "width="+sirka+", height="+vyska+", left=0, top=50";

  if (window.open(elm.href, elm.target, vlastnosti))
	{
  	return true;
  }
  
  return false;
}

function newWindowFull(elm, sirka, vyska)
{
	vlastnosti = "width="+sirka+", height="+vyska+", left=10, top=10, resizable=yes";

  if (window.open(elm.href, elm.target, vlastnosti))
	{
  	return true;
  }

  return false;
}

function newWindowPopup(elm, sirka, vyska)
{
	vlastnosti = "width="+sirka+", height="+vyska+", left=200, top=200";

  if (window.open(elm.href, elm.target, vlastnosti))
	{
  	return true;
  }

  return false;
}

function newWindowPrint(elm, sirka)
{
  vlastnosti = "width="+sirka+", left=0, top=0, menubar=yes, resizable=yes";
  
  if (window.open(elm.href, elm.target, vlastnosti))
	{
  	return true;
  }
  
  return false;
}

function newWindowInvex(elm, sirka, vyska)
{
  vlastnosti = "width="+sirka+", height="+vyska+", left=100, top=100";
  
  if (window.open(elm.href, elm.target, vlastnosti))
	{
  	return true;
  }

  return false;
}

function newWindowTutorial(elm, sirka, vyska)
{
  vlastnosti = "width="+sirka+", height="+vyska+", left=0, top=0, menubar=no, resizable=no";
  
  if (window.open(elm.href, elm.target, vlastnosti))
	{
  	return true;
  }

  return false;

}

function ClosePopupWindows()
{
    if (document.getElementById && document.getElementById("promotion"))
    {
        document.getElementById("promotion").style.visibility = "hidden";	
    }
}

function ShowPopupWindows()
{
    if (document.getElementById && document.getElementById("promotion"))
    {
        document.getElementById("promotion").style.visibility = "visible";	
    }
}

function UserChange(product)
{
	if(product != '110')
	{
		document.getElementById('UserData').style.display = "block";
	}
	else
	{
		document.getElementById('UserData').style.display = "none";
	}
}

function ShowFaqAnswer(faqquestion)
{
	if (faqquestion == null || faqquestion == "")
	{
		faqquestion = location.hash;
		faqquestion = faqquestion.replace("#", "");
	}

	if (faqquestion != null && faqquestion != "")
	{
		Hide('faqhide');
		document.getElementById(faqquestion).style.display = "block";
	}
}

function EditionSwitch(edition)
{
	var domain = location.hostname;
	
	if (domain == "www.zoner.com" || domain == "new.zoner.com")
	{
		Hide('pnlEdition');
		
		if (edition == null || edition == "")
		{
			edition = location.hash;
			edition = edition.replace("#", "");
		}
	
		if (edition != null && edition != "")
		{
			document.getElementById(edition).style.display = "block";
		}
	}
}

function getElementsByClass(searchClass, domNode, tagName)
{
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';

	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";

	for(i=0,j=0; i<tags.length; i++)
	{
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1) el[j++] = tags[i];
	}

	return el;
}

function Hide(styleclass)
{
	var elements = getElementsByClass(styleclass, document, 'div');

	for (var i = 0; i < elements.length; i++)
	{
		elements[i].style.display = "none";
	}
}

function ShowRaw()
{
	if(document.getElementById("raw").style.display == "block")
	{
		document.getElementById("raw").style.display = "none";
	}
	else
	{
		document.getElementById("raw").style.display = "block";
	}
	return false;
}

function ShowID(id)
{
    if (document.getElementById(id).style.display == "block")
	{
	    document.getElementById(id).style.display = "none";
	}
	else
	{
	    document.getElementById(id).style.display = "block";
	}
	return false;
}

function pnlRegionMouseOutHandler(event)
{
    var toElement = null;
    
    if (event.relatedTarget)
        toElement = event.relatedTarget;
    else if (event.toElement)
        toElement = event.toElement;

    while (toElement && toElement.id != 'pnlRegion')
    {
        toElement = toElement.parentNode;
    }

    if (!toElement)
    {
        if (document.getElementById)
        {
            document.getElementById('lstRegion').style.display = 'none';
        }
    }
}
