url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);


function parse_new (object) {
var shadowbox = document.getElementById(object);
var scripts = new Array();
scripts = shadowbox.getElementsByTagName("script");
if(scripts != null){
for(i=0; i < scripts.length; i++) {
if(scripts[i].getAttribute("type") == "text/javascript") {
eval(scripts[i].innerHTML);
}
}
}
}

function ajax_do (url) {
       
        if (url.substring(0, 4) != 'http') {
                url = base_url + url;
        }

        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;

        document.body.appendChild (jsel);
		
}

var i=0;

function ajax_get (url, el) {

		var obj = el;
   
        if (typeof(el) == 'string') {
                el = document.getElementById(el);
        }

    
        if (el == null) { return false; }

	

     
        if (url.substring(0, 4) != 'http') {
				url = "http://www.omegatecnologia.com/omegaweb/"+ url;
				
        }
	
  
        getfile_url =  base_url + "getfile.php?url=" + escape(url) + "&el=" + escape(el.id);

        
       

	  ajax_do (getfile_url);
	  
	  setTimeout("parse_new('"+obj+"');",1500);
	   
          return true;
}

function mostraCidade(object){

ajax_get("cidades_detalhes.php?codcid="+object+"","tdcidades");

}




