function procurar(valor){
	if (valor.name == 'buscar') {
		document.google.q.value = valor.value;
	} else {
		document.google.submit();
	}
}

function Salvar(form,div){ 
	var oEditor = FCKeditorAPI.GetInstance('editor'); 
	manch = oEditor.GetXHTML();
	document.getElementById('texto').value = manch;
	enviaReq(form,div);
}

function check(form) {   
	//percorre todos os checkboxes e seta se está ou não checado, conforme o valor do check mandatório
	//alert("***********ATENÇÃO***********\n\n* Pode existir registro já liguidado! *");
	for(var i = 0; i < form.elements.length; i++){
		if ((form.elements[i].type == "checkbox") && (form.elements[i].name == "reg[]") && (form.checkAll.checked == true) && (form.elements[i].disabled == false)) {
			form.elements[i].checked = true;
		} else if ((form.elements[i].type == "checkbox") && (form.elements[i].name == "reg[]") && (form.checkAll.checked == false) && (form.elements[i].disabled == false)) {
			form.elements[i].checked = false;
		}
	}
}

function mudaCor(id,cor){
        document.getElementById(id).style.background = cor;
}
function ancora(name) {
	this.location = "#" + name;
}

function addFav(){
    var url      = "http://www.araguanet.com.br";
    var title    = "AraguaNet - O portal de São Miguel do Araguaia";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}

function adiciona(tabela){  
	totals++;
	
	tbl = document.getElementById(tabela); 
	
	var novaLinha = tbl.insertRow(-1);  
	
	var novaCelula;
	
	novaCelula = novaLinha.insertCell(0);
	novaCelula.align = "right";
	novaCelula.innerHTML = "* Op&ccedil;&atilde;o "+totals+":";
	
	
	novaCelula = novaLinha.insertCell(1);
	novaCelula.innerHTML = "<input name='opcao[]' type='text' class='form' id='opcao[]' value='' size='15' maxlength='30' />";  
	novaCelula.align = "left";
}

function ver_votou(oForm){
	for(var i = 0; i < oForm.elements.length; i++){
		if ((oForm.elements[i].type == "radio") && (oForm.elements[i].checked)){
			carregar('enquete/vote.php?id_opcao='+oForm.elements[i].value+'&id_pergunta='+oForm.id_pergunta.value, 'enquete_div');
		}
	}
}