function popup(_w, _h, _src)
{
	var _left = (screen.width - _w) / 2;
	altura = ((screen.height - _h) / 2)-50;
	var _top = (altura>0?altura:0);
	
	//, toolbar=yes, location=no, status=no, menubar=yes, scrollbars=yes, resizable=no
	
	win = window.open(_src+'&popup=1', "popup_carolina", 'width='+_w+', height='+_h+', top='+_top+', left='+_left+', scrollbars=0');
	
	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

function pop_img(_w, _h, _src)
{
	var _left = (screen.width - _w) / 2;
	altura = ((screen.height - _h) / 2)-50;
	var _top = (altura>0?altura:0);
	
	//, toolbar=yes, location=no, status=no, menubar=yes, scrollbars=yes, resizable=no
	
	win = window.open('?pg=ampliar_imagem&src='+_src+'&popup=1', "popup_carolina", 'width='+_w+', height='+_h+', top='+_top+', left='+_left+', scrollbars=0');
	
	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

function amp_img(_w, _h, _src)
{
	var _left = (screen.width - _w) / 2;
	altura = ((screen.height - _h) / 2)-50;
	var _top = (altura>0?altura:0);
	
	//, toolbar=yes, location=no, status=no, menubar=yes, scrollbars=yes, resizable=no
	
	win = window.open('?pg=ampliar&src='+_src+'&popup=1', "ampliar_carolina", 'width='+_w+', height='+_h+', top='+_top+', left='+_left+', scrollbars=0');
	
	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

function pacotes(_src)
{
	_w = 800;
	_h = 600;
	var _left = (screen.width - _w) / 2;
	altura = ((screen.height - _h) / 2)-50;
	var _top = (altura>0?altura:0);
	
	//, toolbar=yes, location=no, status=no, menubar=yes, scrollbars=yes, resizable=no
	
	win = window.open('?pg=pacotes&src='+_src+'&popup=1', "pacotes_carolina", 'width='+_w+', height='+_h+', top='+_top+', left='+_left+', scrollbars=1');
	
	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

function imprensa(_w, _h, _id)
{
	var _left = (screen.width - _w) / 2;
	altura = ((screen.height - _h) / 2)-50;
	var _top = (altura>0?altura:0);
	
	//, toolbar=yes, location=no, status=no, menubar=yes, scrollbars=yes, resizable=no
	
	win = window.open('?pg=imprensa&id='+_id+'&popup=1', "imprensa_carolina", 'width='+_w+', height='+_h+', top='+_top+', left='+_left+', scrollbars=1');
	
	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

function contar_char(campo, tecla, maxi, t1, t2)
{
	e = tecla.keyCode;
	
	conta = (maxi-campo.value.length);
	if(e==13)
	   return false;
	
	if((conta>=0) || (e==8 || e==46 || e==116))
	{
		if(conta<0)
		   conta = 0;
		document.getElementById("char_Disp").innerHTML = t1 + " " + conta + " " + t2;
		return true;
	}
	else
	{
		return false;
	}
}

function verificar(form, frase)
{
	msg = frase+"\n";
	erro = true;
	for (i=0;i<form.length;i++)
	{
		if(form[i].getAttribute("obrigatorio")!=null)
		{
			if(form[i].value=='' || form[i].value==form[i].title)
			{
				msg += "- " + form[i].getAttribute("obrigatorio") + "\n";
				if(erro){foco=i}
				erro = false;
			}
		}
	}
	if(!erro){
		alert(msg);
		form[foco].focus();
	}
	return erro;
}