	/* CHAMA CPAINT*/
	
	var cp = new cpaint();
	cp.set_response_type('TEXT');
	
	function chamaProxima() {
		/*document=PAGINA *//*getElementById('')= REQUEST TODOS OS ELEMENTOS COM O NOME DO ID*/
		document.getElementById('fotosAjax').innerHTML = '<table><tr><td height="150">&nbsp;</td></tr></table>';
		/*innerHTML DENTRO DO HTML REQUEST OU RETURN*/

		idfoto = document.getElementById('idFoto').innerHTML;
		var table = document.getElementById('table').innerHTML;

		cp.call('ajax.php', 'chamaProxima_php', chamaProxima_retorno, idfoto, table);
	}
	
	function chamaProxima_retorno(retorno) {
		vetor = retorno.split('$$$');
		conteudo = vetor[0];
		proxima = parseInt(vetor[1]);
		 
		document.getElementById('fotosAjax').innerHTML = conteudo;
		document.getElementById('idFoto').innerHTML = proxima;
	}


	function chamaAnterior(){
		document.getElementById('fotosAjax').innerHTML = '<table><tr><td height="150"><font color="#FF0000">&nbsp;</strong></font></td></tr></table>';
		idfoto = document.getElementById('idFoto').innerHTML;
		var table = document.getElementById('table').innerHTML;
		
		cp.call('ajax.php', 'chamaAnterior_php', chamaAnterior_retorno, idfoto, table);
	}
		
	function chamaAnterior_retorno(retorno) {
		vetor = retorno.split('$$$');
		conteudo = vetor[0];
		anterior = parseInt(vetor[1]);
		
		document.getElementById('fotosAjax').innerHTML = conteudo;
		document.getElementById('idFoto').innerHTML = anterior;	
//		document.getElementById('teste').innerHTML = retorno;	
	}
	
	
	/* DIV QUE MONSTRA A IMAGEM NO ONMOUSEOVER */ 
	
	function fazImagem(id){
		document.getElementById('flutua').innerHTML = 'carregando...';
		cp.call('ajax.php', 'fazImagem', fazImagemRetorno, id);
		document.getElementById('first').className = '';
	}
	
	function fazImagemRetorno(retorno){
		var x = screen.width;
		var y = screen.height;
		
		var top = 0;
		switch(y){
			case 800:
				top = 44;
			break;
			default:
				top = 63;
			break;
			
		}
		if (navigator.appName == "Microsoft Internet Explorer") {
			
				switch(y){
					case 800:
						top = 51;
					break;
					case 600:
						top = 82;
					break;
					default:
						top = 63;
					break;

				}
		}

		//document.getElementById('flutua').style.top = top.toString().concat('%');
		//document.getElementById('flutua').style.left = '46%';
		if(retorno != 'noimg'){
			var img = '<img src="img_hover.php?id='+retorno+'" />';
			document.getElementById('flutua').innerHTML = img;
		} else {
			document.getElementById('flutua').innerHTML = 'Sem Imagem';
		}
	}
	
	function zeraImagem(){
		document.getElementById('flutua').innerHTML = '';
	}
	
	
	/* DIV QUE MOSTRA LOGOS NA ÁREA DE ATUAÇÃO */
	
	
	function atualizar(){
		cp.call('ajax.php', 'atualizar', atualizar_retorno);
	}
	
	function atualizar_retorno(retorno){
		document.getElementById('logos').innerHTML = retorno;
	}


