var widget = document.getElementById('widget_catalogo');widget.setAttribute('style','width:200px'); var comboTipo = document.createElement('select');comboTipo.id = "ddlTipo";comboTipo.setAttribute("onchange","getFamilias(document.getElementById('ddlFamilia'),this.value);");comboTipo.setAttribute('style','width:192px');var comboFamilia = document.createElement('select');comboFamilia.id = "ddlFamilia";comboFamilia.setAttribute("onchange","getCategorias(document.getElementById('ddlCategoria'),this.value);");comboFamilia.setAttribute('style','width:192px');var comboCategoria = document.createElement('select');comboCategoria.id = "ddlCategoria";comboCategoria.setAttribute("onchange","getMateriais(document.getElementById('ddlMaterial'),this.value);");comboCategoria.setAttribute('style','width:192px');var comboMaterial = document.createElement('select');comboMaterial.id = "ddlMaterial";comboMaterial.setAttribute('style','width:192px');var br = document.createElement('br');var br2 = document.createElement('br');var br3 = document.createElement('br');var br4 = document.createElement('br');var br5 = document.createElement('br');var br6 = document.createElement('br');var p = document.createElement('p');var p2 = document.createElement('p');var p3 = document.createElement('p');var p4 = document.createElement('p');var p5 = document.createElement('p');var p6 = document.createElement('p');var lblTipo = document.createElement('label');txtTipo = document.createTextNode("Tipo");lblTipo.appendChild(txtTipo);lblTipo.appendChild(br);lblTipo.appendChild(comboTipo);widget.appendChild(lblTipo);widget.appendChild(p);var lblFamilia = document.createElement('label');txtFamilia = document.createTextNode("Família");lblFamilia.appendChild(txtFamilia);lblFamilia.appendChild(br2);lblFamilia.appendChild(comboFamilia);widget.appendChild(lblFamilia);widget.appendChild(p2);var lblCategoria = document.createElement('label');txtCategoria = document.createTextNode("Categoria");lblCategoria.appendChild(txtCategoria);lblCategoria.appendChild(br3);lblCategoria.appendChild(comboCategoria);widget.appendChild(lblCategoria);widget.appendChild(p3);var lblMaterial = document.createElement('label');txtMaterial = document.createTextNode("Material");lblMaterial.appendChild(txtMaterial);lblMaterial.appendChild(br4);lblMaterial.appendChild(comboMaterial);widget.appendChild(lblMaterial);widget.appendChild(p4);var lblCidade = document.createElement('label');txtCidade = document.createTextNode("Cidade");lblCidade.appendChild(txtCidade);lblCidade.appendChild(br5);inpCidade = document.createElement('input');inpCidade.type="text";inpCidade.id="txtCidade";lblCidade.appendChild(inpCidade);widget.appendChild(lblCidade);widget.appendChild(p5);var lblPalavra = document.createElement('label');txtPalavra = document.createTextNode("Palavra-chave");lblPalavra.appendChild(txtPalavra);lblPalavra.appendChild(br6);inpPalavra = document.createElement('input');inpPalavra.type="text";inpPalavra.id="txtCidade";lblPalavra.appendChild(inpPalavra);widget.appendChild(lblPalavra);widget.appendChild(p6);var button = document.createElement('input');button.type = "button";button.id = "btnBuscar";button.setAttribute("value","Buscar");button.setAttribute("onclick","buscarClicked();");widget.appendChild(button);getTipos(comboTipo);getFamilias(comboFamilia,comboTipo.value);getCategorias(comboCategoria,comboFamilia.value);getMateriais(comboMaterial,comboCategoria.value);function atualizaUrl(){ddlTipo = document.getElementById('ddlTipo');ddlFamilia = document.getElementById('ddlFamilia');ddlCategoria = document.getElementById('ddlCategoria');ddlMaterial = document.getElementById('ddlMaterial');url = "http://www.catalogosustentavel.com.br/index.php?page=Busca&tipo="+ddlTipo.value+"&familia="+ddlFamilia.value+"&categoria="+ddlCategoria.value+"&material="+ddlMaterial.value;	return url;}function buscarClicked(){	url = atualizaUrl();window.open(url,'_blank');}var e=document.getElementById('divBuscaCatalogo');var f=document.createElement("iframe");var b={name:"ifrBuscaCatalogo",src:b,frameBorder:0,width:200,height:600,marginWidth:"0",marginHeight:"0",
hspace:"0",vspace:"0",allowTransparency:"true",scrolling:"no"};for(var h in b)f.setAttribute(h,b[h]);if(e !== null)e.appendChild(f);
