jQuery(function() {
	/*$(function(){	
		//buttonsnap_addbuttons();
	})*/
	
	$('.read-more a').click(function()
	{
		//console.info('test')
		jQuery('.read-more-content, .comments-hidden').hide()
		jQuery('.post-meta .read-more').show()
		jQuery(this).parents('div.post').find('.read-more-content').show()
		jQuery(this).parents('div.post').find('.comments-hidden').show()
		jQuery(this).parent().hide('fast')
		return false
	})
	
	jQuery('.post-meta .comments a').click(function(){
		
		var hidden_comments = jQuery(this).parents('div.post').find('.comments-hidden');
		
		if(!hidden_comments.length)
			return false;
		else
			hidden_comments.show('fast');
		
		var post = jQuery(this).parents('.post')[0]
	
		jQuery('div.comments').each(function()
		{
			comments_post = jQuery(this).parents('.post')[0]
			if(comments_post.id != post.id)
				jQuery(this).hide()
			else
			{
				//console.info(post.id)
				jQuery(this).show()
				post_id = parseInt(post.id.substr(5))
				jQuery('#comments-form #error').html('')
				jQuery('#commentform textarea, #commentform p.input input').val('')
				
				//jQuery('#comments-form').insertAfter('#' + post.id + ' #commentlist' + post_id)
				jQuery('#comments-form').appendTo('#' + post.id + ' div.comments')
				jQuery('#commentform').show('')
				jQuery('#comment_post_ID').val(post_id)
				jQuery('#comments-form').show()
				
			}
		})
		
		return false
	})

	jQuery('.comments a.close').click(function(){
		jQuery('.comments-hidden').hide('fast')
		return false
	})
	
	jQuery('.post-meta .mail a').click(function(){
		jQuery('#tell-friend-form #usermessageb').html('')
		jQuery('#tell-friend-form .cf_li_err').removeClass('cf_li_err');
		jQuery('#tell-friend-form form ol li').val('')
		jQuery('#tell-friend-form form').show()
		jQuery('#tell-friend-form').insertAfter(jQuery(this).parent().parent().parent());
		
		jQuery('#tell-friend-form').show('fast')
		var data = jQuery(this).metadata();
		jQuery('#cf_field_5').val(data.url)
		jQuery('#cf_field_6').val(data.title)
		return false;
	});
	jQuery('#tell-friend-form a.close').click(function(){
		jQuery('#tell-friend-form').hide('fast')
		return false
	})
	
	var bmparams = { wmode: "transparent"};
	
	swfobject.embedSWF("/wp-content/themes/brivamute/swf/www_briva_mute_lv.swf", "www-briva-mute-lv-flash", "190", "198", "9", vvqexpressinstall, { wmode: "transparent" }, bmparams);
	
	swfobject.embedSWF("/wp-content/themes/brivamute/swf/briva_mute_musa.swf", "briva-mute-musa-flash", "190", "620", "9", vvqexpressinstall, { wmode: "transparent" }, bmparams);
});