var myLightWindow = null;
function initLightWindow() {
    myLightWindow = new lightwindow({
			fileTypes: {
				page: ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php4', 'php3', 'php', 'php5', 'phtml', 'rhtml', 'shtml', 'txt', 'vbs', 'rb', 'jsp', 'video', ''],
				image: ['bmp', 'gif', 'jpg', 'png', 'tiff']
			}
		});
  
    
    
    
}
/*
var old = lightwindow.prototype.deactivate.bind(this);
lightwindow.prototype.deactivate = function() {

  old();

  var video = $('viFrame');
  if (video) { 
    video.remove();
  }

}*/

lightwindow.prototype.deactivate = (function(originalConstructor) { 
  return function() {
    try {
      (originalConstructor.bind(lightwindow.prototype))();
    }
    catch (e) {
      // For some reason the above method throws an error. It works fine and would have taken too much time to fix.
    }

    var video = $('viFrame');
    if (video) { 
      video.remove();
    }
  }
})(lightwindow.prototype.deactivate);

