 
var xmlhttp

function loadHTMLDoc(url)
{
xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null)
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  
  if (xmlhttp.status==200)
    {
	
	htmlResponsed = String(xmlhttp.responseText);
	
	replcEmail = /@@EMAILCONTATO@@/gi;
	
	htmlResponsed = htmlResponsed.replace(replcEmail,$email_contato);
	 
	
   	document.getElementById('placeHTML').innerHTML=htmlResponsed;
	
    }
  else
    {
   document.getElementById('placeHTML').innerHTML= "Erro ao ler pagina!"
    }
  }
}
 
 
function getAtualPage(){
	tempTextUrl = String(location);//;"www.teste.com/index.php?page=2";
	arrTempTextURl = tempTextUrl.split("?");
	arrTempTextURl = String(arrTempTextURl[1]).split("=");
	resultTempTextURl = String(arrTempTextURl[1]);
	if(resultTempTextURl=="undefined"){
		arrLinks = String($varToPagsLinks).split("&");
		arrTempLinks = String(arrLinks[0]).split("=");
	
		resultTempTextURl=arrTempLinks[1];
	}
	
	
	loadHTMLDoc(resultTempTextURl+".html");

}


function validFormTmpl(){
		
		if(document.getElementById('nome').value.length < 3){
			alert("Por favor informa seu nome corretamente!");
			return false;
		}
		
		if(document.getElementById('email').value.length < 3 || String(document.getElementById('email').value).indexOf('@') == -1){
			alert("Por favor informa seu e-mail corretamente!");
			return false;
		}
		
		if(document.getElementById('assunto').value.length < 1){
			alert("Por favor informe o assunto de sua mensagem!");
			return false;
		}
		
		if(document.getElementById('mensagem').value.length < 1){
			alert("Por favor digite uma mensagem!");
			return false;
		}
		
		return true;
		
	}

window.onload = getAtualPage;