_doc = jQuery(document);
_win = jQuery(window);
_docHeight = _doc.height();
_winHeight = _win.height();
_winWidth = _win.width();

_container = jQuery('<div />')
.attr('id', 'warningBody')
.addClass('sd_container')
.prependTo(document.body);

var w = $('#adult-warning').css('width');
var h = $('#adult-warning').css('height');
var pos = [(_docHeight > _winHeight) ? _winWidth/2 - parseInt(w)/2 - 18: _winWidth/2 - parseInt(w)/2,
      _doc.scrollTop() + _winHeight/2 - parseInt(h)/2];

_container
.css({
  position: 'absolute',
  left: pos[0] + 'px',
  top: pos[1] + 'px',
  width: w,
  height: h,
  zIndex: 2000,
  textAlign: 'center'
})
.html($('#adult-warning').html())
.show();

jQuery('<div />')
.attr('id', 'shader')
.addClass('sd_overlay')
.css({
  position: 'absolute',
  width: '100%',
  height: _docHeight,
  opacity: 0.9,
  zIndex: 1000
})
.appendTo(document.body);

$(document).ready(function () {
	_doc = jQuery(document);
	_docHeight = _doc.height();
    $('#shader').css('height', _docHeight);
});