
var launch = {
    fullscreen: function (b) {
     var overlayCSS = {
        'background-color':'#000',
        'cursor':'pointer',
        'display':'none',
        'height':'6000px',
        'left':'0',
        'position':'absolute',
        'top':'0',
        'width':'100%',
        'z-index':'100000'
         };
      var holderCSS = {  
        //'background-color':'#FFF',
        'display':'none',
        'height':'auto',
        'padding':'10px',
        'position':'fixed',
        'width':'auto',
        'z-index':'200000'
        };
      var closeCSS = {  
        'height':'30px',
        'position':'absolute',
        'right':'-15px',
        'top':'-15px',
        'width':'30px'
        };  
        var popup = $(b);
        var overlay = '<div id="fs_overlay"></div>';
        var holder = '<div id="fs_holder"></div>';
        var close = '<div id="fs_close"><img src="/media/23662/close.png" /></div>';
           
      
    
        $('#popup_holder_inside_form').append(holder);
        $('#popup_holder_inside_form').append(overlay);
        $('#fs_holder').prepend(close);
        $('#fs_holder').append(popup);
        $('#fs_overlay').css(overlayCSS);
        $('#fs_overlay').fadeTo('fast', 0.8);
        $('#fs_holder').css(holderCSS);
        $('#fs_close').css(closeCSS);
        window.scrollTo(0, 5000);
        $('#fs_holder').show();
        $(popup).show();
        $('#fs_overlay').show();
      
         $('#fs_close').click(function() {
           $('body').prepend(popup);
           $(popup).hide();
           $('#fs_holder').remove();
           $('#fs_overlay').remove();
          });  
           
        
          $(window).resize(function () {
             centerPopup();
          });
          $(window).scroll(function () {
              centerPopup();
          });

            function closePopup() {
                $('#fs_holder').hide();
                $('#fs_overlay').hide();
                }
            
            function centerPopup() {
                if (typeof(window.innerWidth) == 'number') {
                    winW = window.innerWidth;
                    winH = window.innerHeight;
                } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                    winW = document.documentElement.clientWidth;
                    winH = document.documentElement.clientHeight;
                } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    winW = document.body.clientWidth;
                    winH = document.body.clientHeight;
                }
                winW = winW / 2;
                winH = winH / 2;
                PopupW = $(popup).width() / 2;
                PopupH = $(popup).height() / 2;
                PopupL = Math.round((winW - PopupW));
                PopupT = Math.round((winH - PopupH));
                $('#fs_holder').css({
                    "left": PopupL,
                    "top": PopupT
                });
              
            }     
   
    centerPopup();

      
    }
}


/*
    var launch = {
    fullscreen: function (b) {
      var closebtn = '/media/644089/close.png';
      var overlayCSS = {
        'background-color':'#000',
        'cursor':'pointer',
       'display':'none',
        'height':'6000px',
        'left':'0',
        'position':'absolute',
        'top':'0',
        'width':'100%',
        'z-index':'100000'
         };
      var holderCSS = {  
        'background-color':'#FFF',
        'display':'none',
        'height':'auto',
        'padding':'10px',
        'position':'fixed',
        'width':'auto',
        'z-index':'200000'
        };
      var closeCSS = {  
        'height':'30px',
        'position':'absolute',
        'right':'-15px',
        'top':'-15px',
        'width':'30px',
        'background-image': 'url('+closebtn+')'
        };  
      var popup = $(b);
        overlay = $('<div>', {
            id: 'fs_overlay'
        });
        holder = $('<div>', {
           id: 'fs_holder'
        });
        close = $('<div>', {
            id: 'fs_close'
        });
        $('#popup_holder_inside_form').prepend(holder);
        $('#popup_holder_inside_form').prepend(overlay);
        $(holder).prepend(close);
        $(holder).append(popup);
        $(overlay).css(overlayCSS);
        $(overlay).fadeTo('fast', 0.8);
        $(holder).css(holderCSS);
       $(close).css(closeCSS);
        window.scrollTo(0, 0);
        $(holder).show();
        $(popup).show();
        $(overlay).show();
      
         $(close).click(function() {
           $('body').prepend(popup);
           $(popup).hide();
           $(holder).remove();
           $(overlay).remove();
          });  
           
        
          $(window).resize(function () {
              centerPopup();
          });
          $(window).scroll(function () {
              centerPopup();
          });

            function closePopup() {
                $(holder).hide();
                $(overlay).hide();
                }
            
            function centerPopup() {
                if (typeof(window.innerWidth) == 'number') {
                    winW = window.innerWidth;
                    winH = window.innerHeight;
                } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                    winW = document.documentElement.clientWidth;
                    winH = document.documentElement.clientHeight;
                } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    winW = document.body.clientWidth;
                    winH = document.body.clientHeight;
                }
                winW = winW / 2;
                winH = winH / 2;
                PopupW = $(popup).width() / 2;
                PopupH = $(popup).height() / 2;
                PopupL = Math.round((winW - PopupW));
                PopupT = Math.round((winH - PopupH));
                $(holder).css({
                    "left": PopupL,
                    "top": PopupT
                });
              
            }     

      centerPopup();
      
    }
}

 */





