function change_avatar() {
	if (!document.my_profile_avatar.user_avatar.value) {
		document.all.picture_avatar.src="images/noavatar.gif"; }
	else {
		document.all.picture_avatar.src="images/avatars/"+(document.my_profile_avatar.user_avatar.value)+".gif"; } }

function avatar_gallery() {
	var win = window.open('index.php?action=my_profile&option=gallery',"AvatarGallery",'width=650,height=650,left=50,top=50,resizable=0,scrollbars=yes,menubar=no');
	win.creator=self; }

function choose_avatar(avatar) {
	creator.my_profile_avatar.user_avatar.value = avatar;
	creator.my_profile_avatar.picture_avatar.src="images/avatars/" + avatar + ".gif";
	window.close(); }

var vote_urls = new Array('images/vote_star_blank.gif','images/vote_star_green.gif');
var vote_images = new Array();
for (var i = 0; i<vote_urls.length; ++i) {
	vote_images[i] = new Image();
	vote_images[i].url = vote_urls[i]; }

function set_vote(vote, status) {
	for (var i = 1; i<=vote; ++i) {
		var image = document.images['vote_' + i];
		if (image) { image.src = vote_urls[status]; } } }

function put_emoticon(emoticon) {
	document.emoticon_form.message_text.value  += ' ' + emoticon + ' ';
	document.emoticon_form.message_text.focus(); }

function report_show(type) {
	if (type == 'P') {
		report_show_plus.style.display = '';
		report_show_minus.style.display = 'none';
		report_show_statute.style.display = 'none'; }
	else if (type == 'M') {
		report_show_plus.style.display = 'none';
		report_show_minus.style.display = '';
		report_show_statute.style.display = 'none'; }
	else if (type == 'S') {
		report_show_plus.style.display = 'none';
		report_show_minus.style.display = 'none';
		report_show_statute.style.display = ''; } }

function share_show() {
	if (document.getElementById('video_share_show').style.display == 'none') {
		document.getElementById('video_share_show').style.display = ''; }
	else {
		document.getElementById('video_share_show').style.display = 'none'; } }

function search_add() {
	if (window.external && ("AddSearchProvider" in window.external)) {
		window.external.AddSearchProvider("http://www.wgrane.pl/search.xml"); } }