﻿

function LessonPlayer(id) {
    if (id == "BBP_FinalExam") {

        $(document).ready(function() {

            jQuery.fancybox({
                'padding': 0,
                'autoScale': false,
                'transitionIn': 'fade',
                'transitionOut': 'fade',
                'easingIn': 'swing',
                'easingOut': 'swing',
                'title': 'Bloodborne Pathogen Training Final Exam',
                'width': 740,
                'height': 550,
                'overlayOpacity': 0.9,
                'href': "/finalexam.aspx?id=" + id,
                'type': 'iframe',
                'titlePosition': 'outside',
                'overlayColor': '#000',
                'enableEscapeButton': 'true',
                onClosed: function(event, ui) { window.location = 'training.aspx'; }  //location.reload();                 
            });
        });

    }
    else if (id == "BBPES_FinalExam") {

        $(document).ready(function() {

            jQuery.fancybox({
                'padding': 0,
                'autoScale': false,
                'transitionIn': 'fade',
                'transitionOut': 'fade',
                'easingIn': 'swing',
                'easingOut': 'swing',
                'title': 'Examen Final de Enfermedades de Transmisión Sanguínea',
                'width': 740,
                'height': 550,
                'overlayOpacity': 0.9,
                'href': "/es/finalexam.aspx?id=" + id,
                'type': 'iframe',
                'titlePosition': 'outside',
                'overlayColor': '#000',
                'enableEscapeButton': 'true',
                onClosed: function(event, ui) { window.location = 'training.aspx'; }  //location.reload();                 
            });
        });

    }    
    else {
        var CourseId = "";
        var SlideNo = "0";
        var Title = (id.indexOf("BBPES")==0?"Enfermedades de Transmisión Sanguínea":"Bloodborne Pathogen Training");
    
        switch (id)
        {
           case "BBPDEMO_Title": CourseId = "bbpdemo"; SlideNo = "0"; Title = Title + " Demo";  break;
           case "BBPDEMO_Lesson1": CourseId = "bbpdemo"; SlideNo = "4"; Title = Title + " Demo"; break;

           case "BBPESDEMO_Title": CourseId = "bbpesdemo"; SlideNo = "0"; Title = Title + " Demo"; break;
           case "BBPESDEMO_Lesson1": CourseId = "bbpesdemo"; SlideNo = "4"; Title = Title + " Demo"; break;           
        
           case "BBP_Title": CourseId = "bbp"; SlideNo = "0"; break;
           case "BBP_Lesson1": CourseId = "bbp"; SlideNo = "4"; break;
           case "BBP_Lesson2": CourseId = "bbp"; SlideNo = "15"; break;
           case "BBP_Lesson3": CourseId = "bbp"; SlideNo = "23"; break;
           case "BBP_Lesson4": CourseId = "bbp"; SlideNo = "31"; break;
           case "BBP_Lesson5": CourseId = "bbp"; SlideNo = "59"; break;
           case "BBP_Lesson6": CourseId = "bbp"; SlideNo = "67"; break;

           case "BBPES_Title": CourseId = "bbpes"; SlideNo = "0"; break;
           case "BBPES_Lesson1": CourseId = "bbpes"; SlideNo = "4"; break;
           case "BBPES_Lesson2": CourseId = "bbpes"; SlideNo = "15"; break;
           case "BBPES_Lesson3": CourseId = "bbpes"; SlideNo = "23"; break;
           case "BBPES_Lesson4": CourseId = "bbpes"; SlideNo = "31"; break;
           case "BBPES_Lesson5": CourseId = "bbpes"; SlideNo = "59"; break;
           case "BBPES_Lesson6": CourseId = "bbpes"; SlideNo = "67"; break;           
       }

       $(document).ready(function() {
       
       jQuery.fancybox({
           'padding': 0,
           'autoScale': false,
           'transitionIn': 'fade',
           'transitionOut': 'fade',
           'easingIn': 'swing',
           'easingOut': 'swing',
           'title': Title,
           'width': 722,
           'height': 577,
           'overlayOpacity': 0.9,
           'href': "/courseplayer.aspx?courseId=" + CourseId + "&slideNo=" + SlideNo,
           'type': 'swf',
           'titlePosition': 'outside',
           'overlayColor': '#000',
           'enableEscapeButton': 'true',
           'swf': {
               'wmode': 'transparent',
               'allowfullscreen': 'true'
           }
       });
       });
                    
    }
}


