// JavaScript Document
function valida(){
	var texto = $('#pesq').val();
	if(texto==''){
		alert('Selecione uma categoria');
		return false;
	}else{
		return true;
	}
}

function marcasb(){
	var texto = document.getElementById('pesq').value;
	if(texto==3){
		document.getElementById('marcasb').style.display='block';
		document.getElementById('marcasc').style.display='none';
	}else{
		document.getElementById('marcasb').style.display='none';
		document.getElementById('marcasc').style.display='block';
	}
}

function getRepres(estado){
	$.ajax({
		type:"GET",
		url:"repre.php?estado="+estado,
		success:function(texto){
				$("#repres").html(texto);
			}
	})	
}

function getT(pagina){
	$.ajax({
		   type:"GET",
		   url:'t'+pagina+'.php',
		   success:function(texto){
			   	$("#troca").html(texto);
		   		}
		   })
	}

function gmaps(pont){
	var divgmap = document.getElementById('gmaps');
	if(pont==1){
		divgmap.style.display='block';
		divgmap.innerHTML = '<small><center><a href="javascript:gmaps(0);" style="color:#0000FF;text-align:center">Fechar</a></center></small><iframe width="740" height="440" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;geocode=&amp;q=Av.+Paran%C3%A1,+2879+Cajur%C3%BA+-+Sorocaba+-+S.P.&amp;sll=-17.811456,-46.054687&amp;sspn=56.985074,79.101563&amp;ie=UTF8&amp;s=AARTsJqDIkD7p3bUIgz_RBy8wUwDVjVsUQ&amp;ll=-23.399535,-47.38163&amp;spn=0.03466,0.063515&amp;z=14&amp;iwloc=addr&amp;output=embed"></iframe>';
		}
	else{
		divgmap.style.display='none';
		divgmap.innerHTML='';
		}
	}

function troca(id,pont){
	var gettr = document.getElementById(id).style;
	if(pont==1){
		gettr.backgroundColor="#004677";
		gettr.color="#FFFFFF";
		gettr.cursor="pointer";
		}
	else{
		gettr.backgroundColor="#E6E6E6";
		gettr.color="#000000";
		}
	}
	
	
function changeFoto(valor){
	document.getElementById('largeImg').src=valor;
}
