var xmlMainDisp
var xmlPactotes
var myHeight;
//Muda o Display Principal
function loadXMLMain(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_ChangeMain
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null)
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}



function state_ChangeMain()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
  {

  document.getElementById("ofertasDiv").innerHTML=xmlhttp.responseText
  document.getElementById("ofertasDiv").style.width = "270px"
  }
  else
  {
  alert("Problem retrieving XML data:" + xmlhttp.statusText)
  }
  }
}



//Muda o display do login
function loadXMLPacotes(url)
{
xmlPactotes=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlPactotes=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlPactotes=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlPactotes!=null)
  {

  xmlPactotes.onreadystatechange=state_ChangePacotes
  xmlPactotes.open("GET",url,true)
  xmlPactotes.send(null)
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

function state_ChangePacotes()
{
// if xmlhttp shows "loaded"
if (xmlPactotes.readyState==4)
  {
  // if "OK"
  if (xmlPactotes.status==200)
  {
  //alert("XML data OK")
    document.getElementById("PacotesDiv").innerHTML=xmlPactotes.responseText
	document.getElementById("PacotesDiv").style.height = myHeight
  }
  else
  {
  alert("Problem retrieving XML data:" + xmlPactotes.statusText)
  }
  }
}

function loadOffers(lang) {
	mySrc="ofertas.php?idioma="+lang
	loadXMLMain(mySrc)
	myDivToChange = "ofertasDiv"
}

function loadPackages(lang) {
	mySrc="pacotes.php?idioma="+lang
	loadXMLPacotes(mySrc)

}
