function borderit(which,color){ 
//if IE 4+ or NS 6+ 

which.style.background=color

} 
function tamanhoDiv(div)
{
	x = document.getElementById(div).offsetHeight;
	document.getElementById('side').style.height = x+"px"; 
}
function tamanhoDivHome(div)
{

	x = document.getElementById(div).offsetHeight + document.getElementById('visual').offsetHeight ;
	document.getElementById('side').style.height = x+20+"px"; 
}
function tamanhoDivOthers(div)
{

	x = document.getElementById(div).offsetHeight  ;
	document.getElementById('side').style.height = x+10+"px"; 
}
function validaForm( local ){
	var localValidar = document.getElementById(local);
	var formulario = document.getElementsByTagName("input");
	for (var i=0; i < formulario.length; i++){
		if (formulario[i].value == ""){
			var aux = formulario[i].name.toUpperCase();
			alert ("O campo " + aux + " deve ser preenchido");
			formulario[i].focus();
			return false;
		}
	}
	return true;
}

function createLegenda(id, color, label) {
	html = 	"<li class=\"legenda-titulo\" id=\"legenda-" + 
			id +
			"\"><label class=\"quadradinho\" style=\"background-color: " +
			color +
			"\"></label><label class=\"legenda-texto\">" +
			label +
			"</label></li>";
	$("#legenda-lista").after(html);
}
