﻿function showVideo ( url )
{
	var video = '<object width="425" height="344"><param name="movie" value="';
		video += url;
		video += '"></param><param name="allowFullScreen" value="true"></param><embed src="';
		video += url;
		video += '" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>';
	
	getObj('cont_video_flash').innerHTML = url ? video : '';
}



function editVideoUrl ()
{
	getObj('video_edit').style.display = 'none';
	getObj('video_edit_editor').style.display = '';
	getObj('video_edit_edit').value = '';
	getObj('video_edit_edit').focus();
}


function cancelVideoUrl ()
{
	getObj('video_edit').style.display = '';
	getObj('video_edit_editor').style.display = 'none';
}



function saveVideoUrl ()
{
	var url = getObj('video_edit_edit').value;

	getByXajax(['users', 'myprofile_loading'],'page=xa_myprofile;nick='+nick + ';usertype=' + usertype + ';url=' + url);
}


function setVideoUrl( url )
{
	cancelVideoUrl();
	getObj('video_edit').innerHTML = url ? url : videoEmpty;
	showVideo ( url );
}



function thisVideoError ()
{
	a(videoError);
}
