$(document).ready(function(){
  $("#campodebusca").keyup(function(){
    exibeLogo($("#campodebusca").val());
  });
  $("form").submit(function(){
    return false;
  });
  $("#lista a").click(linkAssociada_click);
  $("#lista img").css('opacity','0.4').hover(img_in,img_out);
});
function img_in(){
	$(this).animate({width:'177px',margin:'-5px',opacity:'1'},250);
}
function img_out(){
	$(this).animate({width:'167px',margin:'0px',opacity:'0.4'},250);
}
function exibeLogo(strInstituto){
    if(strInstituto != ''){
      $("a").hide();
      $(" a[rel*='"+ strInstituto.toUpperCase() +"']").show();
    }
}
function linkAssociada_click(){
	strHTML = "<img src='"+ this.href +"' /><a id='fechar' href='#' class='jqmClose'>X</a> "+$(this).parent().find('div').html();
	//alert(strHTML);
	$('#confirm').jqm({overlay: 50, modal: true, trigger: false,onShow:open , onHide:close});
    $('#confirm').jqmShow().html(strHTML).find('.jqmClose').click(function(){
		$('#confirm').jqmHide();
			 return false;
		})
      .end();
	return false;
}
var open=function(hash){ hash.w.css('opacity',0.88).show(1000); }; 
var close=function(hash) { hash.w.fadeOut('2000',function(){ hash.o.remove(); }); }; 