function ToggleImg(ele, img)
{
	if (typeof(ele) == 'string')
	{
		var ele = document.getElementById(ele);
	}
	
	if ((ele != null) && (typeof(ele) == 'object'))
	{
		ele.src = img;
	}
}

function ShowErrorLogin()
{
	alert('Error de usuario y/o clave.');
}

function ShowGenericErrors(title, errores)
{
	msg = title + '\n\n';

	for (var i = 0; i < errores.length; i++)
	{
		msg += '- ' + errores[i] + '\n';
	}
	
	alert(msg);
}

function switchVideo(video, miniatura, width, height)
{
	var vidHtml = '';
	
	vidHtml += '<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="' + width + '" height="' + height + '">';
	vidHtml += '	<param name="movie" value="/video_player/player.swf" />';
	vidHtml += '	<param name="allowfullscreen" value="true" />';
	vidHtml += '	<param name="allowscriptaccess" value="always" />';
	vidHtml += '	<param name="flashvars" value="file=/videos/' + video + '&image=/videos/' + miniatura + '" />';
	vidHtml += '	<embed';
	vidHtml += '		type="application/x-shockwave-flash"';
	vidHtml += '		id="player"';
	vidHtml += '		name="player"';
	vidHtml += '		src="/video_player/player.swf" ';
	vidHtml += '		width="' + width + '" ';
	vidHtml += '		height="' + height + '" ';
	vidHtml += '		allowscriptaccess="always" ';
	vidHtml += '		allowfullscreen="true"';
	vidHtml += '		flashvars="file=/videos/' + video + '&image=/videos/' + miniatura + '"';
	vidHtml += '	/>';
	vidHtml += '</object>';
	
	var videoContainer = document.getElementById('cajaVideosMain');
	
	videoContainer.innerHTML = vidHtml;
}

function Buscar()
{
	var buscador 		= document.getElementById('textoBuscar');
	var textoBuscador 	= encodeURI(buscador.value);
	
	location.href = '/buscar/' + textoBuscador;
	
	return false;
}