function CVideo(stream, download, relativeURL, descargaCurso, sizeCurso, local)
{
    this.streamServer = stream;
    this.downloadServer = download;
    this.relative = relativeURL;
    this.globalDownload = true;
    this.descarga = descargaCurso;
    this.size = sizeCurso;
    if (local == undefined)
        this.EsLocal = (location.protocol == "file:");
    else
        this.EsLocal = local
}

function CVideo.prototype.EnlaceVideo(nombre, descarga)
{
    if (this.EsLocal)
        return this.relative + nombre + ".wmv";
    else
        if (descarga == true)
            return this.downloadServer + nombre + ".wmv"; 
        else
            return this.streamServer + nombre + ".wmv";
}
    
function CVideo.prototype.Video(nombre,texto,descripcion, descarga)
{
    var enlace = new String();
    enlace = "<img src=\"Images/Flecha.gif\"/>&nbsp;" + "<a href=\"" + this.EnlaceVideo(nombre, false) + "\">" + texto + "</a> "; 
    if (descripcion != undefined)
        enlace += descripcion;

    var download = descarga && this.globalDownload;    

    if ((this.EsLocal == false) && (download == true))
        enlace += "&nbsp; <a href=\"" + this.EnlaceVideo(nombre, true) + "\"> (Descargar)</a>";   
    
    return enlace;
}

function CVideo.prototype.DescargaCurso()
{
	var html = new String();
	if (this.EsLocal)
		html = "";
	else
		html = "Puedes descargar si lo deseas el curso completo y realizarlo sin conexión a Internet: <a href=\"" + this.descarga + "\">Descargar curso completo (" + this.size + "Mb)</a>";

        return html;
}

// Crea el objecto global, CVideo(string servidorStream, string servidorDescargas,string Relativo, string descargaCurso, string size, bool [opcional local]); 
var video = new CVideo("http://media.desarrollaconmsdn.com/CursosOnline/Curso_VBNET_para_VB6/Videos/", "http://media.desarrollaconmsdn.com/CursosOnline/ForceDownload.aspx?video=Curso_VBNET_para_VB6/Videos/", "../Videos/", "http://media.desarrollaconmsdn.com/CursosOnline/Curso_VBNET_para_VB6/Curso_VBNET_para_VB6.zip", "270");