// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
var navegador; 
navegador = navigator.appName;

function correctPNG(){
	//alert(navegador);
   	for(var i=0; i<document.images.length; i++)
	      {
		  var img = document.images[i]
		  var imgName = img.src.toUpperCase()
		  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		     {
			 var imgID = (img.id) ? "id='" + img.id + "' " : ""
			 
			 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			 
			 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			 
			 var imgStyle = "display:inline-block;" + img.style.cssText 
			 
			 if (img.align == "left") imgStyle = "float:left;" + imgStyle
			 
			 if (img.align == "right") imgStyle = "float:right;" + imgStyle
			 
			 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
			 
			 var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			 img.outerHTML = strNewHTML
			 i = i-1
		     }
	      }
   }
   
  function CarregaPNG(){
  	if(navegador=='Microsoft Internet Explorer'){
		correctPNG();
	}
  }
  
  
  //Para conferir os formularios
  function confereForm(){
  	
	if(gE("nome").value==""){
		alert("Preencha seu Nome corretamente.");
		
		return false;
	}
	
	if(gE('endereco').value==""){
		alert("Preencha seu Endereço corretamente.");
		
		return false;
	}
	if(gE('bairro').value==""){
		alert("Preencha seu Bairro corretamente.");
		
		return false;
	}
	if(gE('cep').value==""){
		alert("Preencha seu CEP corretamente.");
		
		return false;
	}
	if(gE('cidade').value==""){
		alert("Preencha sua Cidade corretamente.");
		
		return false;
	}
	if(gE('telefone').value==""){
		alert("Preencha seu Telefone corretamente.");
		
		return false;
	}
	
	if(gE('dtNasc').value=="" || gE('dtNasc').value=="dd/mm/aaaa"){
		alert("Preencha sua Data de Nascimento corretamente.");
		
		return false;
	}
	if(gE('rg').value.lentgh<7){
		alert("Preencha seu RG corretamente.");
		
		return false;
	}
	
	
	return true;

  }
  function gE(id){
  	return document.getElementById(id);
  }
