	function validarContato(){
		if(document.contato.Nome.value==''){
			alert("ATENÇÃO!\nNome - Campo obrigatório.");
			document.contato.Nome.focus();
			return false;
		}
		if(document.contato.Email.value==''){
			alert("ATENÇÃO!\nE-mail - Campo obrigatório.");
			document.contato.Email.focus();
			return false;
		}else{
			if(isEmail(document.contato.Email.value)==false){
				alert("ATENÇÃO!\nE-mail inválido.");
				document.contato.Email.focus();
				return false;
			}
		}
		if(document.contato.Mensagem.value==''){
			alert("ATENÇÃO!\nMensagem - Campo obrigatório.");
			document.contato.Mensagem.focus();
			return false;
		}
		return true;
	}
	function banner(IdCliente){
		if(IdCliente == undefined){
			IdCliente = '';
		}
		
		var tam, linha, c0;
		
		var nameNode, nameTextNode, url;
		
		var xmlhttp   = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
	    	xmlhttp = new XMLHttpRequest();
	        if(xmlhttp.overrideMimeType){
	        	xmlhttp.overrideMimeType('text/xml');
			}
		}else if (window.ActiveXObject){ // IE
			try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				try{
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	            } catch (e) {}
	        }
	    }
	    
	    url = "xml/clientes.php?IdCliente="+IdCliente;
		xmlhttp.open("GET", url,true);
		xmlhttp.onreadystatechange = function(){ 
			if(xmlhttp.readyState == 4){ 
				if(xmlhttp.status == 200){
					if(xmlhttp.responseText != 'false'){		
						document.getElementById('tabelaBanner').deleteRow(0);	
											
						tam 	= document.getElementById('tabelaBanner').rows.length;
						
						var i = aleatorio(0,xmlhttp.responseXML.getElementsByTagName("IdCliente").length);
		
						var ExtFoto, Nome, Url;
				
						nameNode = xmlhttp.responseXML.getElementsByTagName("IdCliente")[i]; 
						nameTextNode = nameNode.childNodes[0];
						IdCliente = nameTextNode.nodeValue;
						
						nameNode = xmlhttp.responseXML.getElementsByTagName("ExtFoto")[i]; 
						nameTextNode = nameNode.childNodes[0];
						ExtFoto = nameTextNode.nodeValue;	
						
						nameNode = xmlhttp.responseXML.getElementsByTagName("Nome")[i]; 
						nameTextNode = nameNode.childNodes[0];
						Nome = nameTextNode.nodeValue;
						
						nameNode = xmlhttp.responseXML.getElementsByTagName("Url")[i]; 
						nameTextNode = nameNode.childNodes[0];
						Url = nameTextNode.nodeValue;
						
						tam 	= document.getElementById('tabelaBanner').rows.length;
						linha	= document.getElementById('tabelaBanner').insertRow(tam);
					
						linha.accessKey = IdCliente; 
						
						c0	= linha.insertCell(0);	
						c1	= linha.insertCell(1);	
						
						linkIni	=	"<a href='"+Url+"'>";
						linkFim	=	"</a>";
						
						
						c0.innerHTML = linkIni + "<img style='margin:0; padding:0' src='img/clientes/"+IdCliente+"."+ExtFoto+"' alt='"+Nome+"'>" + linkFim;
						c0.style.textAlign = "center";
						c0.style.cursor = "pointer";
						
						c1.innerHTML = linkIni + "<B>" + Nome + "</B>" + linkFim;
						c1.style.textAlign = "center";
						c1.style.width = "100px";
						c1.style.padding = "0 5px 0 5px";
					}	
					
					if(window.janela != undefined){
						window.janela.close();
					}
				}
			} 
			return true;
		}
		xmlhttp.send(null);
		
		setTimeout("banner("+IdCliente+")",4000);
	}
	
	function banner2(IdCliente){
		if(IdCliente == undefined){
			IdCliente = '';
		}
		
		var tam, linha, c0;
		
		var nameNode, nameTextNode, url;
		
		var xmlhttp   = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
	    	xmlhttp = new XMLHttpRequest();
	        if(xmlhttp.overrideMimeType){
	        	xmlhttp.overrideMimeType('text/xml');
			}
		}else if (window.ActiveXObject){ // IE
			try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				try{
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	            } catch (e) {}
	        }
	    }
	    
	    url = "xml/clientes.php?IdCliente="+IdCliente;
		xmlhttp.open("GET", url,true);
		xmlhttp.onreadystatechange = function(){ 
			if(xmlhttp.readyState == 4){ 
				if(xmlhttp.status == 200){
					if(xmlhttp.responseText != 'false'){		
						document.getElementById('tabelaBanner2').deleteRow(0);	
											
						tam 	= document.getElementById('tabelaBanner2').rows.length;
						
						var i = aleatorio(0,xmlhttp.responseXML.getElementsByTagName("IdCliente").length);
		
						var ExtFoto, Nome, Url;
				
						nameNode = xmlhttp.responseXML.getElementsByTagName("IdCliente")[i]; 
						nameTextNode = nameNode.childNodes[0];
						IdCliente = nameTextNode.nodeValue;
						
						nameNode = xmlhttp.responseXML.getElementsByTagName("ExtFoto")[i]; 
						nameTextNode = nameNode.childNodes[0];
						ExtFoto = nameTextNode.nodeValue;	
						
						nameNode = xmlhttp.responseXML.getElementsByTagName("Nome")[i]; 
						nameTextNode = nameNode.childNodes[0];
						Nome = nameTextNode.nodeValue;
						
						nameNode = xmlhttp.responseXML.getElementsByTagName("Url")[i]; 
						nameTextNode = nameNode.childNodes[0];
						Url = nameTextNode.nodeValue;
						
						tam 	= document.getElementById('tabelaBanner2').rows.length;
						linha	= document.getElementById('tabelaBanner2').insertRow(tam);
					
						linha.accessKey = IdCliente; 
						
						c0	= linha.insertCell(0);	
						c1	= linha.insertCell(1);	
						
						linkIni	=	"<a href='"+Url+"'>";
						linkFim	=	"</a>";
						
						
						c0.innerHTML = linkIni + "<img style='margin:0; padding:0' src='img/clientes/"+IdCliente+"."+ExtFoto+"' alt='"+Nome+"'>" + linkFim;
						c0.style.textAlign = "center";
						c0.style.cursor = "pointer";
						
					
					}	
					
					if(window.janela != undefined){
						window.janela.close();
					}
				}
			} 
			return true;
		}
		xmlhttp.send(null);
		
		setTimeout("banner2("+IdCliente+")",4000);
	}


