var opcao_expandida="";function expande(id){if(opcao_expandida==id&&document.getElementById(opcao_expandida).style.display=='block'){document.getElementById(opcao_expandida).style.display='none'}else{document.getElementById(id).style.display='block'}if(opcao_expandida!=""){if(opcao_expandida!=id){document.getElementById(opcao_expandida).style.display='none'}}opcao_expandida=id}function troca_banner_home(id_produto,path_image,atual,total_banners){var url="page/produtos/controller/index.php?fc=troca_banner_home&id_produto="+id_produto;var html=$.ajax({type:"GET",url:url,async:false}).responseText;var retorno=Array();retorno=html.split("#");var image_banner=retorno[0].replace("%20","");document.getElementById('img_banner').src='imagens_produtos/'+image_banner;$("#nome_produto").html(retorno[1]+"-"+image_banner);$("#preco_venda").html(retorno[2]);$("#preco8").html(retorno[3]);document.getElementById('link_promocoes').href='page/produtos/detalhes/?id='+id_produto;for(xb=0;xb<total_banners;xb++){if(atual!=xb){document.getElementById('bt_'+xb).style.color='#000000';document.getElementById('bt_'+xb).style.fontWeight='normal';document.getElementById('bt_'+xb).style.borderColor='#cccccc'}else{document.getElementById('bt_'+xb).style.color='#990000';document.getElementById('bt_'+xb).style.fontWeight='bold';document.getElementById('bt_'+xb).style.borderColor='#990000'}}}function destroy(_url){if(confirm('Deseja excluir?')){window.location=_url}else{return false}}function get_id(id){return document.getElementById(id)}function get_value(id){return document.getElementById(id).value}function set_value(id,_value){document.getElementById(id).value=_value}function set_focus(id){document.getElementById(id).focus()}function zebra(id_tabela){$(function(){var $t=$(id_tabela);$('tr:odd',$t).addClass('row0');$('tr:even',$t).addClass('row1');$('tr',$t).hover(function(){$(this).addClass('row_hover')},function(){$(this).removeClass('row_hover')})})}function valida_data(data){var dia=0;var mes=0;var ano=0;if(data.length==10){dia=parseInt(data.substring(0,2));mes=parseInt(data.substring(3,5));ano=parseInt(data.substring(6,10))}if((dia>0&&dia<32)&&(mes>0&&mes<13)&&(ano>1900)&&data.length==10){return true}else{return false}}