function OpenVideo(sPath) 
{
	window.open(sPath, 'Video_Player', 'width=700,height=500,directories=no,menubar=no,location=no,resizable=no,scrollbars=no');
}
function galleryOpen1(nameToOpen,nameOfWindow)
{
	window.open(nameToOpen,nameOfWindow,'width=750,height=450,directories=no,menubar=no,location=no,resizable=no,scrollbars=no');
}

function LoadVideo(fileName, width, height, preview) {
    var path = '/media/VideoPlayer.asp?Video=' + fileName
    if (preview != null)
        path += '&Preview=' + preview;

    window.open(path, 'VideoPlayer', 'width=' + width + ',height=' + height + ',directories=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no,toolbar=no');
}

function addMethod(object, name, fn){
    var old = object[ name ];
    object[ name ] = function(){
        if ( fn.length == arguments.length )
            return fn.apply( this, arguments );
        else if ( typeof old == 'function' )
            return old.apply( this, arguments );
    };
}

addMethod(this, "PlayVideo", function(fileName, width, height) {
    LoadVideo(fileName, width, height, null);
});

addMethod(this, "PlayVideo", function(fileName, width, height, preview) {
    LoadVideo(fileName, width, height, preview);
});