﻿//----- Class Definition ------------------------------

var VideoInformation = Class.create({

    initialize: function() {
    },

    getByURL: function(videoURL, product, force) {
        return this.setVideoInformation('/Request/VideoInformation?pageUrl=' + escape(videoURL) + "&product=" + product + "&force=" + force);
    },

    setVideoInformation: function(url) {
        var objVideoInfo;
        new Ajax.Request(url, {
            method: 'post',
            asynchronous: false,
            onSuccess: function(transport) {
                objVideoInfo = transport.responseText.evalJSON();
            },
            onFailure: function(transport) {
                objVideoInfo = null;
            }
        });
        return objVideoInfo;
    }
});
