/**
 * @author brianlocicero
 */
Shadowbox.init({
    skipSetup: true,
    players: ["html", "swf"]
});


function openWebinar(webinarName){
    var webinarFlashVars = {};
    
    switch (webinarName) {
    
        case 1:
            webinarFlashVars.videoId = "71208309001";
            webinarFlashVars.webinarSkinLocation = "Swf/WebinarOculus1.swf";
            break;
            
        case 2:
            webinarFlashVars.videoId = "71218251001";
            webinarFlashVars.webinarSkinLocation = "Swf/WebinarOculus2.swf";
            break;
            
        case 3:
            webinarFlashVars.videoId = "71216948001";
            webinarFlashVars.webinarSkinLocation = "Swf/WebinarOculus3.swf";
            break;
            
        default:
            break;
    }
    
    //first get window size
    var myWidth = 0, myHeight = 0;
    if (typeof(window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    }
    else 
        if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
        }
        else 
            if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
            }
    
    if (myWidth < 1210 || myHeight < 720) {
        window.open('webinar.html?speaker=' + webinarName, 'webinar', config = 'height=630, width=940, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    }
    else {
        Shadowbox.open({
            content: 'Swf/BCWebinarLoader.swf',
            player: "swf",
            title: "",
            width: 940,
            height: 630,
            handleOversize: "resize",
            viewportPadding: 5,
            animate: true,
            autoDimensions: true,
            options: {
                flashVars: webinarFlashVars
            }
        });
    }
    
}

