function ajaxMM(elemento,dir){
	elemento2 = elemento
	ajax(dir,elemento)
}

function ajax(str, elemento){
	elemento2 = elemento;
    if (str.length==0){ 
        document.getElementById(elemento2).innerHTML=""
        return
    }
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null){
        alert ("Seu Browser não suporta a tecnologia utilizada (AJAX)")
        return
    } 
    var url=str
    xmlHttp.onreadystatechange=stateChanged
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)

} 

function stateChanged(){ 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById(elemento2).innerHTML=xmlHttp.responseText 
		
     } else if (xmlHttp.readyState==1) {
			document.getElementById(elemento2).innerHTML="<table width='100%' align='center' height='405px'><TR><TD width='100%' height='100%' align='center' valign='top'></td></tr></table>"
	}

	
} 


function GetXmlHttpObject(){ 
    var objXMLHttp=null
    if (window.XMLHttpRequest){
        objXMLHttp=new XMLHttpRequest()
    } else if (window.ActiveXObject) {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    return objXMLHttp
} 
