var timeoutID = null;

/* Must pass in the "anchors" ID so that Lytebox can call the correct "onclick" handler... */
function loadLytebox() {
  if (typeof myLytebox != 'undefined') {
    // if the myLytebox object exists, start it up!
    var a = document.createElement("a");
    a.href = '/user/upload_media_gadget?mediaType=UV';
    a.rel = 'lyteframe';
    a.title = 'Upload Media';
    a.rev = 'width: 750px; height: 600px; scrolling: auto;';
    myLytebox.start( a, false, true);
  } else {
    // wait 1/10th of a second and attempt loading again...
    if (timeoutID) { clearTimeout(timeoutID); }
    timeoutID = setTimeout('loadLytebox()', 100);
  }
}