var flashIsLoaded = false;
var idPlaylist = "1";
var videoIndex = 0;

function getParams() {
	return flashvars;
}


function onFlashLoaded() {
	flashIsLoaded = true;
	return { id : idPlaylist, index : videoIndex };
}


function playVideo(id, index) {
    try {

        if (flashIsLoaded) {
            getMovie("videoPlayer2").loadPlaylist({ id: id, index: index });
        } else {
            idPlaylist = id;
            videoIndex = index;
        }
    }
    catch (e) {
        alert(e);
	}
}

function getMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        //return window[movieName];
        return document[movieName];
    } else {
		return document[movieName];
	}
}
