﻿!window.jQuery && document.write(unescape('%3Cscript src="://static.puntoticket.cl/js/jquery-1.4.4.min.js"%3E%3C/script%3E'));

function LoadVideo(video, container, width, height) {
    if (window.jwplayer) {
        jwplayer(container).setup({
            autostart: true,
            bufferlength: 5,
            allowfullscreen: true,
            allowscriptaccess: "always",
            wmode: "opaque",
            skin: "http://static.puntoticket.cl/flash/bekle.zip",
            flashplayer: "http://static.puntoticket.cl/js/player.swf",
            file: video,
            height: height,
            width: width
        });
    }
}

function ShowVideo(video, container, width, height) {
    if (!window.jwplayer) {
        $.getScript("http://static.puntoticket.cl/js/jwplayer.js", function () {
            LoadVideo(video, container, width, height);
        });
    }
    else
        LoadVideo(video, container, width, height);
}

function LoadPlaylist(playlist, container, width, height) {
    if (window.jwplayer) {
        jwplayer(container).setup({
            autostart: true,
            bufferlength: 5,
            allowfullscreen: true,
            allowscriptaccess: "always",
            wmode: "opaque",
            skin: "http://static.puntoticket.cl/flash/bekle.zip",
            flashplayer: "http://static.puntoticket.cl/js/player.swf",
            playlistfile: playlist,
            "playlist.position": "bottom",
            "playlist.size": 180,
            shuffle: true,
            height: height,
            width: width
        });
    }
}

function ShowPlaylist(playlist, container, width, height) {
    if (!window.jwplayer) {
        $.getScript("http://static.puntoticket.cl/js/jwplayer.js", function () {
            LoadPlaylist(playlist, container, width, height);
        });
    }
    else
        LoadPlaylist(playlist, container, width, height);
}


function PageQuery(q) {
    if (q.length > 1)
        this.q = q.substring(1, q.length); else
        this.q = null; this.keyValuePairs = new Array(); if (q) { for (var i = 0; i < this.q.split("&").length; i++) { this.keyValuePairs[i] = this.q.split("&")[i]; } }
    this.getKeyValuePairs = function () { return this.keyValuePairs; }
    this.getValue = function (s) {
        for (var j = 0; j < this.keyValuePairs.length; j++) {
            if (this.keyValuePairs[j].split("=")[0] == s)
                return this.keyValuePairs[j].split("=")[1];
        }
        return false;
    }
    this.getParameters = function () {
        var a = new Array(this.getLength()); for (var j = 0; j < this.keyValuePairs.length; j++) { a[j] = this.keyValuePairs[j].split("=")[0]; }
        return a;
    }
    this.getLength = function () { return this.keyValuePairs.length; } 
}
function queryString(key) { var page = new PageQuery(window.location.search); return unescape(page.getValue(key)); }
