﻿function getNextSibling(obj)
{
	if(typeof(obj) == 'string')
		obj = document.getElementById(obj)

	var obj = obj.nextSibling
	while(obj != null && obj.tagName == undefined)
	{
		obj = obj.nextSibling
	}
	
	return obj
}

function getPreviousSibling(obj)
{
	if(typeof(obj) == 'string')
		obj = document.getElementById(obj)

	var obj = obj.previousSibling
	while(obj != null && obj.tagName == undefined)
	{
		obj = obj.previousSibling
	}
	
	return obj
}

function Show(obj)
{
	if(typeof(obj) == 'string')
		obj = document.getElementById(obj)
	
	obj.style.display = ''
}

function Hide(obj)
{
	if(typeof(obj) == 'string')
		obj = document.getElementById(obj)
	
	obj.style.display = 'none'
}

function ShowHide(obj)
{
	if(typeof(obj) == 'string')
		obj = document.getElementById(obj)
	
	if (obj.style.display == 'none')
	{
		obj.style.display = ''
	}
	else
	{
		obj.style.display = 'none'
	}
}

function abrePopup(url, largura, altura)
{
	pTop  = (window.screen.height / 2) - (altura / 2);
	pLeft = (window.screen.width / 2) - (largura / 2);
	window.open(url, 'popup', 'width=' + largura + ', height=' + altura + ', top=' + pTop + ', left=' + pLeft + ', scrollbars=yes');
}