var adArray = new Array();
var iTotalResults = 0;
var oRec = {
	links: function(a,b){
		if(typeof a.innerHTML != "undefined"){
			var aux=a.innerHTML;
			aux=aux.replace("<b>","");
			aux=aux.replace("<B>","");
			aux=aux.replace("</b>","");
			aux=aux.replace("</B>","");
			aux=escape(aux);
			a.href="http://mdi.busca.uol.com.br/framemdi.htm?name="+aux+"&star="+b+"&url="+a.href;
			return true;
		}else{
		return true;
		}
	}
}

function adjustBottom(){
	if( !document.getElementById('bottom') ) return;
	if( !document.getElementById('bottom-query') ) return;
	var bottom = document.getElementById('bottom');
	var bottomQuery = document.getElementById('bottom-query');
	bottom.action = 'http://dir.busca.uol.com.br/MDIbot.html';
	if( bottomQuery.name == "keyword" ){
		bottomQuery.name = "q";
		if(!bottom.elements['keywords']){
			var kw = document.createElement('input');
			kw.type = 'hidden';
			kw.name = 'keyword';
			bottomQuery.parentNode.appendChild(kw);
		}
	}
}

function init(){
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	if(!document.getElementsByTagName && !document.getElementById) return;

	lib.sBuscaAtiva = "rec";
	lib.fnOpcoesBusca();
	lib.fnBodyLoad();
	lib.fnDetalhada();
	lib.fnPaginacao();
	lib.fnOpenNewWindow();

	/*@cc_on @*/
	/*@if (@_win32)
		lib.fnIeMinWidth();
		addEvent(window,"resize",lib.fnIeMinWidth);
	/*@end @*/
	
	document.simples.keyword.disabled = "";
	document.simples.condition.disabled = "";
	document.simples.RequestType.disabled = ""

	lib.fnSetRecomendados();
	adjustBottom()
}

// for Mozilla
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", init, null);
}

// for IE
/*@cc_on @*/
/*@if (@_win32)
    document.write("<script defer src='http://stc.busca.uol.com.br/j/ie_load_rec.js'><"+"/script>");
/*@end @*/

// for other browsers
window.onload = init;
