function jpt(c,u) {
	//var is = document.getElementById('IMG'+c);
	var ts = document.getElementById('LST'+c);
	if(ts.innerHTML != "") {
		if(ts.style.display == 'none') {
			/*
			var arr = ts.parentNode.parentNode.childNodes;
			var tam = arr.length;
			for(var i = 0; i < tam; i+=3) {
				var ig = arr[i].childNodes[0].childNodes[0];
				var ln = arr[i+2].childNodes[0];
				if(ln && ig && ln.style.display == '') {
					ig.src = "i/25.gif";
					ln.style.display = 'none';
				}
			}
			*/
			//is.src="i/72.gif";
			ts.style.display='';
		} else {
			//is.src = "i/25.gif";
			ts.style.display='none';
		}
	} else {
		window.location=u;
	}
}

function oL(c) {
	//var is = document.getElementById('IMG'+c);
	var ts = document.getElementById('LST'+c);
	if(ts.innerHTML != "") {
		if(ts.style.display == 'none') {
			var arr = ts.parentNode.parentNode.childNodes;
			var tam = arr.length;
			/*
			for(var i = 0; i < tam; i+=3) {
				var ig = arr[i].childNodes[0].childNodes[0];
				var ln = arr[i+2].childNodes[0];
				if(ln.style.display == '') {
					ig.src = "i/25.gif";
					ln.style.display = 'none';
				}
			}
			*/
			//is.src="i/72.gif";
			ts.style.display='';
		} else {
			//is.src = "i/25.gif";
			ts.style.display='none';
		}
	} else {
		window.location=pagCat+"&cop="+c;
	}
}

function lmp() {document.fnews.email.value = ''}
function goEm() {if(tstNews(document.fnews))document.fnews.submit()}
function tstEmail(email) {
	if(!email.value.match(/.*?@.*?\.[a-zA-Z][a-zA-Z]/) || email.value.match(/www/)) return false;
	return true;
}

function e(mess, obj) {
	alert(mess);
	if(obj) obj.focus();
	return false;
}

function tstNum() {
	var tc = event.keyCode;
	//alert(tc);
	if(event.ctrlKey || event.altKey) return;
	if(tc == 38 || tc == 35 || tc == 37 || tc == 36 || tc == 39 || tc==40 || tc==41 || tc==43 || tc==45 || tc==46 || tc==127 || tc <= 31 || (tc >= 48 && tc <= 57) || (tc>=96 && tc<=105)) return;
	event.returnValue=false;
}

function tstTel() {
	var tel = event.keyCode;
	//alert(tc);
	if(event.ctrlKey || event.altKey) return;
	if(tel == 38 || tel == 35 || tel == 37 || tel == 36 || tel == 39 || tel==40 || tel==41 || tel==43 || tel==45 || tel==46 || tel==127 || tel <= 31 || (tel >= 48 && tel <= 57) || (tel>=96 && tel<=105) || tel == 109 || tel == 189 || tel == 187 || tel == 32 || tel == 190) return;
	event.returnValue=false;
}

function tstCP() {
	var tc = event.keyCode;
	if(event.ctrlKey || event.altKey) return;
	if(tc == 38 || tc == 35 || tc == 37 || tc == 36 || tc == 39 || tc==40 || tc==41 || tc==43 || tc==45 || tc==46 || tc==127 || tc==109 || tc==189 || tc <= 31 || (tc >= 48 && tc <= 57) || (tc>=96 && tc<=105)) return;
	event.returnValue=false;
}

function tstct(f) {
	if(f.nome.value=='') return e('Indique o seu nome', f.nome);
	if(f.telefone.value == '' && f.email.value == '') return e('Indique o seu contacto ou endere�o de correio electr�nico', f.telefone);
	if(f.email.value != '' && !tstEmail(f.email)) return e('Indique correctamente o seu endere�o de correio electr�nico', f.email);
	if(f.assunto.value == '') return e("Indique o assunto do seu contacto");
	return true;
}

function tstNews(f){if(!tstEmail(f.email)) return e('Indique correctamente o endere�o de correio electr�nico.', f.email);return true}

function ow(co, w, h) {
	var wd = window.open("img2.php?co="+co, "IMG", "width="+w+",height="+(h+30)+",location=no,menubar=no,personalbar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no");
	wd.focus();
}

function tstDataFinal(data) {
	var res = null;
	if(!(res = data.value.split(/-/)) || res.length!=3) return e("Data Inv�lida", data);
	var dia = parseInt(res[0], 10);
	var mes = parseInt(res[1], 10);
	var ano = parseInt(res[2], 10);
	if(dia > 31) return e("Indique correctamente o dia da data", data);
	if(mes > 12) return e('Indique correctamente o m�s da data', data);
	if(ano < 1900) return e('Indique correctamente o ano da data', data);
	return true;
}

function tstsnd(f,rd) {
	if (rd.checked) return true;
	else for (x = 0; x < rd.length; x++) if (rd[x].checked) return true;
	return e("Por favor, selecione uma resposta");
}
function tstCB(rd) {
	if(rd.checked) return true;
	else for (x = 0; x < rd.length; x++) if (rd[x].checked) return true;
	return false;
}

