function init() {

	var boxes = document.getElementById("box").childNodes;
	var maior = 0, maiorIn = 0, ind = 0;
	var pos = new Array();
	
	for( var k = 1 ; k < boxes.length ; k++ ) {
		if( boxes[k].className == "boxItem" ) {		
			pos[ind++] = k;			
			maior = boxes[k].offsetHeight > maior ? boxes[k].offsetHeight : maior;
			maiorIn = boxes[k].childNodes[1].offsetHeight > maiorIn ? boxes[k].childNodes[1].offsetHeight : maiorIn;
			if( pos.length % 3 == 0 ) {	
				for ( var i = pos.length-1 ; i > pos.length-4 ; i-- ) {
					boxes[pos[i]].style.height = maior - 35 + "px";
					boxes[pos[i]].childNodes[1].style.height = maiorIn - 25 + "px";
					boxes[pos[i]].childNodes[3].onclick = function() { window.location = boxes[pos[i]].childNodes[0].firstChild.href };
				}
				maior = 0;
				maiorIn = 0;
			}
		}
	}
	
}
function submitNews() {
	var node = document.newsletter;
	$("a#news").fancybox({ 'frameWidth' : 0 });
				
	if ( node.nome.value == "" ) {
		alert('Por favor digite seu nome!');
		node.nome.focus();
	} else if ( !node.email.value.match(/^[\w-]+(\.[\w-]+)*@(([\w-]{2,63}\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/) ) {
		alert('Por favor digite um email válido!');
		node.email.focus();
	} else {
		$("#news").attr("href", "actions/cadnews.php?n="+node.nome.value+"&e="+node.email.value);
		$("a#news").fancybox({'zoomSpeedIn':0, 'zoomSpeedOut':0, 'overlayShow' : true,'frameWidth':400, 'frameHeight':260});
		node.reset();
	}
	return false;
}