jQuery(document).ready(function() {
  $('a',$('#upload_button')).click(function() {
    var dTop = ( $(window).height() - 350) / 2 + $(window).scrollTop();
    var dLeft = ($(window).width() - 350) / 2  + $(window).scrollLeft();
    var hdrText = $('<h4>Holbrook &amp; Manter Secure File Upload</h4>').css({'margin-right':'30px'});
    var closeWin = $('<a>x</a>').attr('href', '#').css({display: 'block', 'float':'right', padding: '2px', background: '#92650F', height: '16px', width:'16px', 'margin-top':'-5px', 'margin-right': '-5px' });
    //overlay
    /*
    position: absolute;
     height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
     */
     if(jQuery.browser.msie && parseInt(jQuery.browser.version) < 7)
     {
       var overlayCSS = {position: 'absolute', height: $('body').height(), top:0, left:0, zIndex: 99, "background-color":"#005348", opacity:.5,width: $(window).width() };
     } else {
       var overlayCSS = {height: $(window).height(), width: $(window).width(), position:'fixed', top:0, left:0, zIndex: 99, "background-color":"#005348", opacity:.5};
     }
    $('<div>').attr('id', 'overlay').css(overlayCSS).click(function(){
      $('#uploader').empty().remove();
      $(this).remove();
    }).appendTo('body'); //endoverlay
    
    $('<div>').attr('id', 'uploader').css({
      top: dTop, 
      left: dLeft,
      height: 350, 
      width:350,
      background: '#F5F4F2',
      border: '5px solid #92650F', 
      position:'absolute',
      overflow: 'hidden',
      zIndex: 100
    }).append($('<iframe></iframe>').css({
        background: '#F5F4F2', 
        overflow: 'hidden', 
        display: 'block'
      }).attr({
        id:'file_upload_iframe',
        name:'file_upload',
        width:350,
        height:350,
        align:'middle', 
        marginWidth:0,
        marginHeight:10,
        frameborder:0,
        border:0,
        src: 'https://www.yousendit.com/v1/ibox.php?sitebox=1087034&sh=f5ea0c943cd76cd4f8df542d889e153e&send_notification=true&custom_redirect=true',
        allowtransparency:'true'
      })).appendTo('body');
    var hdr = $('<div></div>').css({'border-bottom': '2px solid #92650F',background: '#005348', color:'#F5F4F2', 'font-size':'14px', padding: '5px'}).prependTo('#uploader');
    hdr.append(closeWin.click(function(){$('#uploader').empty().remove(); $('#overlay').remove();})).append(hdrText);
   
    return false;
  }); // END click
});
/*
<iframe style="margin-left:20px;background-color:#339933;overflow-x:hidden;" id="file_upload_iframe" name="file_upload_iframe" src="https://www.yousendit.com/v1/ibox.php?sitebox=1087034&sh=f5ea0c943cd76cd4f8df542d889e153e&send_notification=true&custom_redirect=true" style="display:block;" width="350" height="350" marginwidth="0" align="middle" frameborder="0" allowtransparency="true"></iframe>
*/