function menumostralogo(id,ultimo,tipo){
	
	resetLogos(ultimo,tipo);
	if (tipo == 'portifolio') {
		document.getElementById('logoportifolio'+id).style.display = '';
	}
	else if(tipo == 'modulo'){
		document.getElementById('logomodulo'+id).style.display = '';
		
	}
}

function resetLogos(max,tipo){
	if (tipo == 'portifolio') {
		for(var x=1;x<=max;x++){
			document.getElementById('logoportifolio'+x).style.display ='none';
			//document.getElementById('link'+arr[x]).className ='btPaginacao replace';
		}
	}
	else if(tipo == 'modulo'){
		for(var x=1;x<=max;x++){
			document.getElementById('logomodulo'+x).style.display ='none';
			//document.getElementById('link'+arr[x]).className ='btPaginacao replace';
		}
	}
}

function menumostralogoduvidas(id,ultimo,tipo){
	
	resetLogos(ultimo,tipo);
	if (tipo == 'portifolio') {
		document.getElementById('logoportifolioduvidas'+id).style.display = '';
	}
	else if(tipo == 'modulo'){
		document.getElementById('logomoduloduvidas'+id).style.display = '';
		
	}
}

function resetLogosDuvidas(max,tipo){
	if (tipo == 'portifolio') {
		for(var x=1;x<=max;x++){
			document.getElementById('logoportifolioduvidas'+x).style.display ='none';
			//document.getElementById('link'+arr[x]).className ='btPaginacao replace';
		}
	}
	else if(tipo == 'modulo'){
		for(var x=1;x<=max;x++){
			document.getElementById('logomoduloduvidas'+x).style.display ='none';
			//document.getElementById('link'+arr[x]).className ='btPaginacao replace';
		}
	}
}

function menumostralogoBeneficio(id,ultimo){
	resetLogosBeneficios(ultimo);
	document.getElementById('logobeneficio'+id).style.display = '';
	
	
}

function resetLogosBeneficios(max){
	for(var x=1;x<=max;x++){
		document.getElementById('logobeneficio'+x).style.display ='none';
		//document.getElementById('link'+arr[x]).className ='btPaginacao replace';
	}
	
}



function swapI(obj,focus){
	if(focus){
		if(obj.value == obj.attributes["label"].value){
			obj.value = "";
		}
	} else {
		if(obj.value.trim() == ""){
			obj.value = obj.attributes["label"].value;
		}
	}
}
function swapP(obj,focus){
	if(focus){
		var pass = document.getElementById(obj.attributes["parent"].value);
		if(pass){
			obj.innerHTML = "";
			pass.focus();
		}
	} else {
		if(obj.value == ""){
			var div = document.getElementById("div"+obj.id);
			if(div){
				div.innerHTML = obj.attributes["label"].value;
			}
		}
	}
}
function addOption(obj_select,tmp_text,tmp_value){
	var option = document.createElement('option');
	option.value = tmp_value;
	option.text = tmp_text;
	
	try {//outros navegadores
		obj_select.add(option,null);
	} catch(ex) {//para IE
		obj_select.add(option);
	}
}


function loadCidade(tmp_idEstado){
	//alert('chegou');
	resetCidade();
	var a = new Ajax();
	a.onLoad = function(){
		var str = this.html;
		var cidade = document.getElementById("Cidade_CMB1");
		var arr = str.split("###");//separa por registro
		var arraux = new Array();
		for(var x = 0; x < arr.length; x++){
			arraux = arr[x].split("...");
			//alert(arraux[1]+" - "+arraux[0]);
			addOption(cidade,arraux[1],arraux[0]);
		}
	}
	a.get('../../inc/routines/routines.php?action=loadCidade&id_estado='+tmp_idEstado);
}
function resetCidade(){
	var assunto = document.getElementById('Cidade_CMB1');
	for(var x=assunto.length-1;x>=2;x--){
		assunto.remove(x);
	}
}
function cliquePalavra(id_palavra,palavra){
	var palavraid = id_palavra;
	var a = new Ajax();
	a.onLoad = function(){
		this.runJS(this.html);
		location.href = '../busca/index.php?busca='+palavra;
	}
	a.get('../../inc/routines/routines.php?action=cliquePalavra&id_palavra='+palavraid);
	//location.href = 'index.php';	
	
}

function pop(src,w,h){
	var p = new Popup(w,h);
	p.overflow = "hidden";
	p.open("../../inc/structure/pop.php?src="+src);
}

function popUp(src,w,h){
	var p = new Popup(w,h);
	p.overflow = "hidden";
	p.open(src);
}

