$(function() {
  $('body').delegate('#btnMPerfil_albuns','click', function(event) {
	  $('#albunsOuvinte').slideToggle();

var oScrollbar5 = $('#scrollAlbuns');
oScrollbar5.tinyscrollbar();

//some operation that changes the viewport content...

oScrollbar5.tinyscrollbar_update();	  
  });
/////
  $('body').delegate('#btnMPerfil_gostoMusical','click', function(event) {
	  $('#divGostoMusical').slideToggle();

var oScrollbar5 = $('#divGostoMusical');
oScrollbar5.tinyscrollbar();

//some operation that changes the viewport content...

oScrollbar5.tinyscrollbar_update();	  
	  
  });

////
	$('.nyroModal').nyroModal({debug:true});
			$.nmObj({embedlyUrl: 'js/nyro/embedlyProxy.php', embedly: {key: 'php'}});
		
		$('.nyroModal').nyroModal({
			callbacks: {
				afterShowCont: function(nm) {
					$('.resizeLink', nm.elts.cont).click(function(e) {
						e.preventDefault();
						nm.sizes.initW = Math.random()*1000+200;
						nm.sizes.initH = Math.random()*1000+200;
						nm.resize();
					});
				}
			}
		});
		
		$('.embedly').nm({stack: true});


		$('body').delegate('.imgMiniFoto','click',function(e){	  
    $.nmManual('visualizadorFoto.php?idLink='+$(this).attr('rel'),{
		  sizes: {	// Size information
    initW: 200,	// Initial width
    initH: undefined,	// Initial height
    w: 200,		// width
    h: undefined,		// height
    minW: undefined,	// minimum width
    minH: undefined,	// minimum height
    wMargin: undefined,	// Horizontal margin
    hMargin: undefined	// Vertical margin
		  }
				});
				
    e.preventDefault();
  });
  //////

  $('body').delegate('#verQuemComentou','click', function(event) {

		$(this).next('#divQuemComentouFoto').slideToggle();
		$(this).toggleClass('contrai');
		
  })  
  //////
  $('body').delegate('.boxAmigo','click', function(event) {

		$(this).next('.boxAmigoExtra').slideToggle();
		$(this).toggleClass('contrai');
		
  })
  ///////
    $('body').delegate('.relSugeridasResposta','click', function(event) {
		
		if($(this).text()=='Sim'){
			resposta='Sim';
		}else{
			resposta='Nao';			
		}
		idRel=$(this).attr("rel");
		
 	$.ajax({type: "POST", url: "ajaxPerfil.php",
    data: "funcao=checaRelacaoFirmar&resposta="+resposta+"&idRelacao=" + idRel,
	  dataType: "json",
				success:
					function(data){
						if(data.valido>1){
							$('#relacao_'+idRel).fadeOut();
						}
					},
				error:
					function(){
						
					}
			}); 
	});
  
  /////
});

