// Funciones requeridas por main_index.tpl

// Globales
var se_obj = null ;
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

// Envío del form del suggest
function sub_form_suggest(formulario,i) {
	str = formulario.elements["dominio"].value+"cod.search/" ;
	if (formulario.elements[formulario.elements.length-1].value == "" && formulario.elements[0].value != "") str = str.concat("buscar."+formulario.elements[se_obj.inputText[i].name].value+"/") ;
	if (formulario.elements[formulario.elements.length-1].value != "") str = str.concat("id_buscar."+formulario.elements[formulario.elements.length-1].value+"/") ;
    str = str.concat("lang."+formulario.elements["lang"].value+"/") ;

	//string generado directo a location de la página
	self.location.href = str ;
    return(false) ;
}

// Interface function to fold/unfold Suggest Layer...
function create_suggestEngine(php_call, lang, txt1, txt2, url, tipo_zona,docObj) {
	se_obj = new SuggestEngineClass() ;
	se_obj.set_debug(true) ; //poner a false...
	se_obj.set_suggestIframe(document.getElementById("capaSuggestIframeFicha")) ;
/*
	if (document.all) iFrameDocument = document.capaSuggestIframeFicha.document ;
	else iFrameDocument = document.getElementById("capaSuggestIframeFicha").contentDocument ;
*/

	se_obj.set_suggestLayer(docObj.getElementById("capaSugerencia")) ;
	se_obj.set_inputText(document.getElementById("buscar")) ;
	se_obj.set_hiddenInputValues("") ;
	se_obj.set_phpUrl(php_call) ;
	se_obj.set_phpFunction("getMatching") ;
	se_obj.set_autoFill(false, false) ;
	se_obj.set_justStarting(true) ;
	se_obj.set_autoBold(false, false) ;
	se_obj.set_language(lang) ;
    se_obj.set_tipo_zona(tipo_zona) ;
	se_obj.set_staticText(txt1, txt2) ;
	se_obj.set_destinationURL("", "");
	se_obj.initEventHandler(url) ;
}
