Ads: Modal Window

!window.jQuery && document.write('<\/script>');

/*! Copyright (c) 2010 Brandon Aaron (https://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: https://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(https://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.4
*
* Requires: 1.2.2+
*/

(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);

/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: https://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* https://www.opensource.org/licenses/mit-license.php
* https://www.gnu.org/licenses/gpl.html
*/

;(function($) {
var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,

selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],

ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,

loadingTimer, loadingFrame = 1,

titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('')[0], { prop: 0 }),

isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,

/*
* Private methods
*/

_abort = function() {
loading.hide();

imgPreloader.onerror = imgPreloader.onload = null;

if (ajaxLoader) {
ajaxLoader.abort();
}

tmp.empty();
},

_error = function() {
if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
loading.hide();
busy = false;
return;
}

selectedOpts.titleShow = false;

selectedOpts.width = 'auto';
selectedOpts.height = 'auto';

tmp.html( '

The requested content cannot be loaded.
Please try again later.

' );

_process_inline();
},

_start = function() {
var obj = selectedArray[ selectedIndex ],
href,
type,
title,
str,
emb,
ret;

_abort();

selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));

ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);

if (ret === false) {
busy = false;
return;
} else if (typeof ret == 'object') {
selectedOpts = $.extend(selectedOpts, ret);
}

title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';

if (obj.nodeName && !selectedOpts.orig) {
selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
}

if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
title = selectedOpts.orig.attr('alt');
}

href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;

if ((/^(?:javascript)/i).test(href) || href == '#') {
href = null;
}

if (selectedOpts.type) {
type = selectedOpts.type;

if (!href) {
href = selectedOpts.content;
}

} else if (selectedOpts.content) {
type = 'html';

} else if (href) {
if (href.match(imgRegExp)) {
type = 'image';

} else if (href.match(swfRegExp)) {
type = 'swf';

} else if ($(obj).hasClass("iframe")) {
type = 'iframe';

} else if (href.indexOf("#") === 0) {
type = 'inline';

} else {
type = 'ajax';
}
}

if (!type) {
_error();
return;
}

if (type == 'inline') {
obj = href.substr(href.indexOf("#"));
type = $(obj).length > 0 ? 'inline' : 'ajax';
}

selectedOpts.type = type;
selectedOpts.href = href;
selectedOpts.title = title;

if (selectedOpts.autoDimensions) {
if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
selectedOpts.width = 'auto';
selectedOpts.height = 'auto';
} else {
selectedOpts.autoDimensions = false;
}
}

if (selectedOpts.modal) {
selectedOpts.overlayShow = true;
selectedOpts.hideOnOverlayClick = false;
selectedOpts.hideOnContentClick = false;
selectedOpts.enableEscapeButton = false;
selectedOpts.showCloseButton = false;
}

selectedOpts.padding = parseInt(selectedOpts.padding, 10);
selectedOpts.margin = parseInt(selectedOpts.margin, 10);

tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));

$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
$(this).replaceWith(content.children());
});

switch (type) {
case 'html' :
tmp.html( selectedOpts.content );
_process_inline();
break;

case 'inline' :
if ( $(obj).parent().is('#fancybox-content') === true) {
busy = false;
return;
}

$('')
.hide()
.insertBefore( $(obj) )
.bind('fancybox-cleanup', function() {
$(this).replaceWith(content.children());
}).bind('fancybox-cancel', function() {
$(this).replaceWith(tmp.children());
});

$(obj).appendTo(tmp);

_process_inline();
break;

case 'image':
busy = false;

$.fancybox.showActivity();

imgPreloader = new Image();

imgPreloader.onerror = function() {
_error();
};

imgPreloader.onload = function() {
busy = true;

imgPreloader.onerror = imgPreloader.onload = null;

_process_image();
};

imgPreloader.src = href;
break;

case 'swf':
selectedOpts.scrolling = 'no';

str = '';
emb = '';

$.each(selectedOpts.swf, function(name, val) {
str += '';
emb += ' ' + name + '="' + val + '"';
});

str += '';

tmp.html(str);

_process_inline();
break;

case 'ajax':
busy = false;

$.fancybox.showActivity();

selectedOpts.ajax.win = selectedOpts.ajax.success;

ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
url : href,
data : selectedOpts.ajax.data || {},
error : function(XMLHttpRequest, textStatus, errorThrown) {
if ( XMLHttpRequest.status > 0 ) {
_error();
}
},
success : function(data, textStatus, XMLHttpRequest) {
var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
if (o.status == 200) {
if ( typeof selectedOpts.ajax.win == 'function' ) {
ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);

if (ret === false) {
loading.hide();
return;
} else if (typeof ret == 'string' || typeof ret == 'object') {
data = ret;
}
}

tmp.html( data );
_process_inline();
}
}
}));

break;

case 'iframe':
_show();
break;
}
},

_process_inline = function() {
var
w = selectedOpts.width,
h = selectedOpts.height;

if (w.toString().indexOf('%') > -1) {
w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';

} else {
w = w == 'auto' ? 'auto' : w + 'px';
}

if (h.toString().indexOf('%') > -1) {
h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';

} else {
h = h == 'auto' ? 'auto' : h + 'px';
}

tmp.wrapInner('');

selectedOpts.width = tmp.width();
selectedOpts.height = tmp.height();

_show();
},

_process_image = function() {
selectedOpts.width = imgPreloader.width;
selectedOpts.height = imgPreloader.height;

$("").attr({
'id' : 'fancybox-img',
'src' : imgPreloader.src,
'alt' : selectedOpts.title
}).appendTo( tmp );

_show();
},

_show = function() {
var pos, equal;

loading.hide();

if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
$.event.trigger('fancybox-cancel');

busy = false;
return;
}

busy = true;

$(content.add( overlay )).unbind();

$(window).unbind("resize.fb scroll.fb");
$(document).unbind('keydown.fb');

if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
wrap.css('height', wrap.height());
}

currentArray = selectedArray;
currentIndex = selectedIndex;
currentOpts = selectedOpts;

if (currentOpts.overlayShow) {
overlay.css({
'background-color' : currentOpts.overlayColor,
'opacity' : currentOpts.overlayOpacity,
'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
'height' : $(document).height()
});

if (!overlay.is(':visible')) {
if (isIE6) {
$('select:not(#fancybox-tmp select)').filter(function() {
return this.style.visibility !== 'hidden';
}).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
this.style.visibility = 'inherit';
});
}

overlay.show();
}
} else {
overlay.hide();
}

final_pos = _get_zoom_to();

_process_title();

if (wrap.is(":visible")) {
$( close.add( nav_left ).add( nav_right ) ).hide();

pos = wrap.position(),

start_pos = {
top : pos.top,
left : pos.left,
width : wrap.width(),
height : wrap.height()
};

equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);

content.fadeTo(currentOpts.changeFade, 0.3, function() {
var finish_resizing = function() {
content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
};

$.event.trigger('fancybox-change');

content
.empty()
.removeAttr('filter')
.css({
'border-width' : currentOpts.padding,
'width' : final_pos.width - currentOpts.padding * 2,
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
});

if (equal) {
finish_resizing();

} else {
fx.prop = 0;

$(fx).animate({prop: 1}, {
duration : currentOpts.changeSpeed,
easing : currentOpts.easingChange,
step : _draw,
complete : finish_resizing
});
}
});

return;
}

wrap.removeAttr("style");

content.css('border-width', currentOpts.padding);

if (currentOpts.transitionIn == 'elastic') {
start_pos = _get_zoom_from();

content.html( tmp.contents() );

wrap.show();

if (currentOpts.opacity) {
final_pos.opacity = 0;
}

fx.prop = 0;

$(fx).animate({prop: 1}, {
duration : currentOpts.speedIn,
easing : currentOpts.easingIn,
step : _draw,
complete : _finish
});

return;
}

if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
title.show();
}

content
.css({
'width' : final_pos.width - currentOpts.padding * 2,
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
})
.html( tmp.contents() );

wrap
.css(final_pos)
.fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
},

_format_title = function(title) {
if (title && title.length) {
if (currentOpts.titlePosition == 'float') {
return '' + title + '';
}

return '' + title + '';
}

return false;
},

_process_title = function() {
titleStr = currentOpts.title || '';
titleHeight = 0;

title
.empty()
.removeAttr('style')
.removeClass();

if (currentOpts.titleShow === false) {
title.hide();
return;
}

titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);

if (!titleStr || titleStr === '') {
title.hide();
return;
}

title
.addClass('fancybox-title-' + currentOpts.titlePosition)
.html( titleStr )
.appendTo( 'body' )
.show();

switch (currentOpts.titlePosition) {
case 'inside':
title
.css({
'width' : final_pos.width - (currentOpts.padding * 2),
'marginLeft' : currentOpts.padding,
'marginRight' : currentOpts.padding
});

titleHeight = title.outerHeight(true);

title.appendTo( outer );

final_pos.height += titleHeight;
break;

case 'over':
title
.css({
'marginLeft' : currentOpts.padding,
'width' : final_pos.width - (currentOpts.padding * 2),
'bottom' : currentOpts.padding
})
.appendTo( outer );
break;

case 'float':
title
.css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
.appendTo( wrap );
break;

default:
title
.css({
'width' : final_pos.width - (currentOpts.padding * 2),
'paddingLeft' : currentOpts.padding,
'paddingRight' : currentOpts.padding
})
.appendTo( wrap );
break;
}

title.hide();
},

_set_navigation = function() {
if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
$(document).bind('keydown.fb', function(e) {
if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
e.preventDefault();
$.fancybox.close();

} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
e.preventDefault();
$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
}
});
}

if (!currentOpts.showNavArrows) {
nav_left.hide();
nav_right.hide();
return;
}

if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
nav_left.show();
}

if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
nav_right.show();
}
},

_finish = function () {
if (!$.support.opacity) {
content.get(0).style.removeAttribute('filter');
wrap.get(0).style.removeAttribute('filter');
}

if (selectedOpts.autoDimensions) {
content.css('height', 'auto');
}

wrap.css('height', 'auto');

if (titleStr && titleStr.length) {
title.show();
}

if (currentOpts.showCloseButton) {
close.show();
}

_set_navigation();

if (currentOpts.hideOnContentClick) {
content.bind('click', $.fancybox.close);
}

if (currentOpts.hideOnOverlayClick) {
overlay.bind('click', $.fancybox.close);
}

$(window).bind("resize.fb", $.fancybox.resize);

if (currentOpts.centerOnScroll) {
$(window).bind("scroll.fb", $.fancybox.center);
}

if (currentOpts.type == 'iframe') {
$('').appendTo(content);
}

wrap.show();

busy = false;

$.fancybox.center();

currentOpts.onComplete(currentArray, currentIndex, currentOpts);

_preload_images();
},

_preload_images = function() {
var href,
objNext;

if ((currentArray.length -1) > currentIndex) {
href = currentArray[ currentIndex + 1 ].href;

if (typeof href !== 'undefined' && href.match(imgRegExp)) {
objNext = new Image();
objNext.src = href;
}
}

if (currentIndex > 0) {
href = currentArray[ currentIndex - 1 ].href;

if (typeof href !== 'undefined' && href.match(imgRegExp)) {
objNext = new Image();
objNext.src = href;
}
}
},

_draw = function(pos) {
var dim = {
width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),

top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
};

if (typeof final_pos.opacity !== 'undefined') {
dim.opacity = pos < 0.5 ? 0.5 : pos;
}

wrap.css(dim);

content.css({
'width' : dim.width - currentOpts.padding * 2,
'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
});
},

_get_viewport = function() {
return [
$(window).width() - (currentOpts.margin * 2),
$(window).height() - (currentOpts.margin * 2),
$(document).scrollLeft() + currentOpts.margin,
$(document).scrollTop() + currentOpts.margin
];
},

_get_zoom_to = function () {
var view = _get_viewport(),
to = {},
resize = currentOpts.autoScale,
double_padding = currentOpts.padding * 2,
ratio;

if (currentOpts.width.toString().indexOf('%') > -1) {
to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
} else {
to.width = currentOpts.width + double_padding;
}

if (currentOpts.height.toString().indexOf('%') > -1) {
to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
} else {
to.height = currentOpts.height + double_padding;
}

if (resize && (to.width > view[0] || to.height > view[1])) {
if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
ratio = (currentOpts.width ) / (currentOpts.height );

if ((to.width ) > view[0]) {
to.width = view[0];
to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
}

if ((to.height) > view[1]) {
to.height = view[1];
to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
}

} else {
to.width = Math.min(to.width, view[0]);
to.height = Math.min(to.height, view[1]);
}
}

to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);

return to;
},

_get_obj_pos = function(obj) {
var pos = obj.offset();

pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;

pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;

pos.width = obj.width();
pos.height = obj.height();

return pos;
},

_get_zoom_from = function() {
var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
from = {},
pos,
view;

if (orig && orig.length) {
pos = _get_obj_pos(orig);

from = {
width : pos.width + (currentOpts.padding * 2),
height : pos.height + (currentOpts.padding * 2),
top : pos.top - currentOpts.padding - 20,
left : pos.left - currentOpts.padding - 20
};

} else {
view = _get_viewport();

from = {
width : currentOpts.padding * 2,
height : currentOpts.padding * 2,
top : parseInt(view[3] + view[1] * 0.5, 10),
left : parseInt(view[2] + view[0] * 0.5, 10)
};
}

return from;
},

_animate_loading = function() {
if (!loading.is(':visible')){
clearInterval(loadingTimer);
return;
}

$('div', loading).css('top', (loadingFrame * -40) + 'px');

loadingFrame = (loadingFrame + 1) % 12;
};

/*
* Public methods
*/

$.fn.fancybox = function(options) {
if (!$(this).length) {
return this;
}

$(this)
.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
.unbind('click.fb')
.bind('click.fb', function(e) {
e.preventDefault();

if (busy) {
return;
}

busy = true;

$(this).blur();

selectedArray = [];
selectedIndex = 0;

var rel = $(this).attr('rel') || '';

if (!rel || rel == '' || rel === 'nofollow') {
selectedArray.push(this);

} else {
selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
selectedIndex = selectedArray.index( this );
}

_start();

return;
});

return this;
};

$.fancybox = function(obj) {
var opts;

if (busy) {
return;
}

busy = true;
opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};

selectedArray = [];
selectedIndex = parseInt(opts.index, 10) || 0;

if ($.isArray(obj)) {
for (var i = 0, j = obj.length; i < j; i++) {
if (typeof obj[i] == 'object') {
$(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
} else {
obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
}
}

selectedArray = jQuery.merge(selectedArray, obj);

} else {
if (typeof obj == 'object') {
$(obj).data('fancybox', $.extend({}, opts, obj));
} else {
obj = $({}).data('fancybox', $.extend({content : obj}, opts));
}

selectedArray.push(obj);
}

if (selectedIndex > selectedArray.length || selectedIndex < 0) {
selectedIndex = 0;
}

_start();
};

$.fancybox.showActivity = function() {
clearInterval(loadingTimer);

loading.show();
loadingTimer = setInterval(_animate_loading, 66);
};

$.fancybox.hideActivity = function() {
loading.hide();
};

$.fancybox.next = function() {
return $.fancybox.pos( currentIndex + 1);
};

$.fancybox.prev = function() {
return $.fancybox.pos( currentIndex - 1);
};

$.fancybox.pos = function(pos) {
if (busy) {
return;
}

pos = parseInt(pos);

selectedArray = currentArray;

if (pos > -1 && pos < currentArray.length) {
selectedIndex = pos;
_start();

} else if (currentOpts.cyclic && currentArray.length > 1) {
selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
_start();
}

return;
};

$.fancybox.cancel = function() {
if (busy) {
return;
}

busy = true;

$.event.trigger('fancybox-cancel');

_abort();

selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);

busy = false;
};

// Note: within an iframe use - parent.$.fancybox.close();
$.fancybox.close = function() {
if (busy || wrap.is(':hidden')) {
return;
}

busy = true;

if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
busy = false;
return;
}

_abort();

$(close.add( nav_left ).add( nav_right )).hide();

$(content.add( overlay )).unbind();

$(window).unbind("resize.fb scroll.fb");
$(document).unbind('keydown.fb');

content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');

if (currentOpts.titlePosition !== 'inside') {
title.empty();
}

wrap.stop();

function _cleanup() {
overlay.fadeOut('fast');

title.empty().hide();
wrap.hide();

$.event.trigger('fancybox-cleanup');

content.empty();

currentOpts.onClosed(currentArray, currentIndex, currentOpts);

currentArray = selectedOpts = [];
currentIndex = selectedIndex = 0;
currentOpts = selectedOpts = {};

busy = false;
}

if (currentOpts.transitionOut == 'elastic') {
start_pos = _get_zoom_from();

var pos = wrap.position();

final_pos = {
top : pos.top ,
left : pos.left,
width : wrap.width(),
height : wrap.height()
};

if (currentOpts.opacity) {
final_pos.opacity = 1;
}

title.empty().hide();

fx.prop = 1;

$(fx).animate({ prop: 0 }, {
duration : currentOpts.speedOut,
easing : currentOpts.easingOut,
step : _draw,
complete : _cleanup
});

} else {
wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
}
};

$.fancybox.resize = function() {
if (overlay.is(':visible')) {
overlay.css('height', $(document).height());
}

$.fancybox.center(true);
};

$.fancybox.center = function() {
var view, align;

if (busy) {
return;
}

align = arguments[0] === true ? 1 : 0;
view = _get_viewport();

if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
return;
}

wrap
.stop()
.animate({
'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
}, typeof arguments[0] == 'number' ? arguments[0] : 200);
};

$.fancybox.init = function() {
if ($("#fancybox-wrap").length) {
return;
}

$('body').append(
tmp = $(''),
loading = $(''),
overlay = $(''),
wrap = $('')
);

outer = $('')
.append('')
.appendTo( wrap );

outer.append(
content = $(''),
close = $(''),
title = $(''),

nav_left = $(''),
nav_right = $('')
);

close.click($.fancybox.close);
loading.click($.fancybox.cancel);

nav_left.click(function(e) {
e.preventDefault();
$.fancybox.prev();
});

nav_right.click(function(e) {
e.preventDefault();
$.fancybox.next();
});

if ($.fn.mousewheel) {
wrap.bind('mousewheel.fb', function(e, delta) {
if (busy) {
e.preventDefault();

} else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
e.preventDefault();
$.fancybox[ delta > 0 ? 'prev' : 'next']();
}
});
}

if (!$.support.opacity) {
wrap.addClass('fancybox-ie');
}

if (isIE6) {
loading.addClass('fancybox-ie6');
wrap.addClass('fancybox-ie6');

$('').prependTo(outer);
}
};

$.fn.fancybox.defaults = {
padding : 10,
margin : 40,
opacity : false,
modal : false,
cyclic : false,
scrolling : 'auto', // 'auto', 'yes' or 'no'

width : 560,
height : 340,

autoScale : true,
autoDimensions : true,
centerOnScroll : false,

ajax : {},
swf : { wmode: 'transparent' },

hideOnOverlayClick : true,
hideOnContentClick : false,

overlayShow : true,
overlayOpacity : 0.7,
overlayColor : '#777',

titleShow : true,
titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
titleFormat : null,
titleFromAlt : false,

transitionIn : 'fade', // 'elastic', 'fade' or 'none'
transitionOut : 'fade', // 'elastic', 'fade' or 'none'

speedIn : 300,
speedOut : 300,

changeSpeed : 300,
changeFade : 'fast',

easingIn : 'swing',
easingOut : 'swing',

showCloseButton : true,
showNavArrows : true,
enableEscapeButton : true,
enableKeyboardNav : true,

onStart : function(){},
onCancel : function(){},
onComplete : function(){},
onCleanup : function(){},
onClosed : function(){},
onError : function(){}
};

$(document).ready(function() {
$.fancybox.init();
});

})(jQuery);

a#subs {display:none;}
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: https://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* https://www.opensource.org/licenses/mit-license.php
* https://www.gnu.org/licenses/gpl.html
*/

#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
width: 40px;
height: 40px;
margin-top: -20px;
margin-left: -20px;
cursor: pointer;
overflow: hidden;
z-index: 1104;
display: none;
}

#fancybox-loading div {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 480px;
background-image: url('fancybox.png');
}

#fancybox-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1100;
display: none;
}

#fancybox-tmp {
padding: 0;
margin: 0;
border: 0;
overflow: auto;
display: none;
}

#fancybox-wrap {
position: absolute;
top: 0;
left: 0;
padding: 20px;
z-index: 1101;
outline: none;
display: none;
}

#fancybox-outer {
position: relative;
width: 100%;
height: 100%;
background: #fff;
}

#fancybox-content {
width: 0;
height: 0;
padding: 0;
outline: none;
position: relative;
overflow: hidden;
z-index: 1102;
border: 0px solid #fff;
}

#fancybox-hide-sel-frame {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
z-index: 1101;
}

#fancybox-close {
position: absolute;
top: -15px;
right: -15px;
width: 30px;
height: 30px;
background: transparent url('https://prospect.org/sites/default/files/fancy_close_0.png') -30px 0px;
cursor: pointer;
z-index: 1103;
display: none;
}

#fancybox-error {
color: #444;
font: normal 12px/20px Arial;
padding: 14px;
margin: 0;
}

#fancybox-img {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: none;
outline: none;
line-height: 0;
vertical-align: top;
}

#fancybox-frame {
width: 100%;
height: 100%;
border: none;
display: block;
}

#fancybox-left, #fancybox-right {
position: absolute;
bottom: 0px;
height: 100%;
width: 35%;
cursor: pointer;
outline: none;
background: transparent url('blank.gif');
z-index: 1102;
display: none;
}

#fancybox-left {
left: 0px;
}

#fancybox-right {
right: 0px;
}

#fancybox-left-ico, #fancybox-right-ico {
position: absolute;
top: 50%;
left: -9999px;
width: 30px;
height: 30px;
margin-top: -15px;
cursor: pointer;
z-index: 1102;
display: block;
}

#fancybox-left-ico {
background-image: url('fancybox.png');
background-position: -40px -30px;
}

#fancybox-right-ico {
background-image: url('fancybox.png');
background-position: -40px -60px;
}

#fancybox-left:hover, #fancybox-right:hover {
visibility: visible; /* IE6 */
}

#fancybox-left:hover span {
left: 20px;
}

#fancybox-right:hover span {
left: auto;
right: 20px;
}

.fancybox-bg {
position: absolute;
padding: 0;
margin: 0;
border: 0;
width: 20px;
height: 20px;
z-index: 1001;
}

#fancybox-bg-n {
top: -20px;
left: 0;
width: 100%;
background-image: url('fancybox-x.png');
}

#fancybox-bg-ne {
top: -20px;
right: -20px;
background-image: url('fancybox.png');
background-position: -40px -162px;
}

#fancybox-bg-e {
top: 0;
right: -20px;
height: 100%;
background-image: url('fancybox-y.png');
background-position: -20px 0px;
}

#fancybox-bg-se {
bottom: -20px;
right: -20px;
background-image: url('fancybox.png');
background-position: -40px -182px;
}

#fancybox-bg-s {
bottom: -20px;
left: 0;
width: 100%;
background-image: url('fancybox-x.png');
background-position: 0px -20px;
}

#fancybox-bg-sw {
bottom: -20px;
left: -20px;
background-image: url('fancybox.png');
background-position: -40px -142px;
}

#fancybox-bg-w {
top: 0;
left: -20px;
height: 100%;
background-image: url('fancybox-y.png');
}

#fancybox-bg-nw {
top: -20px;
left: -20px;
background-image: url('fancybox.png');
background-position: -40px -122px;
}

#fancybox-title {
font-family: Helvetica;
font-size: 12px;
z-index: 1102;
}

.fancybox-title-inside {
padding-bottom: 10px;
text-align: center;
color: #333;
background: #fff;
position: relative;
}

.fancybox-title-outside {
padding-top: 10px;
color: #fff;
}

.fancybox-title-over {
position: absolute;
bottom: 0;
left: 0;
color: #FFF;
text-align: left;
}

#fancybox-title-over {
padding: 10px;
background-image: url('fancy_title_over.png');
display: block;
}

.fancybox-title-float {
position: absolute;
left: 0;
bottom: -20px;
height: 32px;
}

#fancybox-title-float-wrap {
border: none;
border-collapse: collapse;
width: auto;
}

#fancybox-title-float-wrap td {
border: none;
white-space: nowrap;
}

#fancybox-title-float-left {
padding: 0 0 0 15px;
background: url('fancybox.png') -40px -90px no-repeat;
}

#fancybox-title-float-main {
color: #FFF;
line-height: 29px;
font-weight: bold;
padding: 0 0 3px 0;
background: url('fancybox-x.png') 0px -40px;
}

#fancybox-title-float-right {
padding: 0 0 0 15px;
background: url('fancybox.png') -55px -90px no-repeat;
}

/* IE6 */

.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://prospect.org/sites/default/files/fancy_close_0.png', sizingMethod='scale'); }

.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }

.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }

.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
height: expression(this.parentNode.clientHeight + "px");
}

#fancybox-loading.fancybox-ie6 {
position: absolute; margin-top: 0;
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
}

#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }

/* IE6, IE7, IE8 */

.fancybox-ie .fancybox-bg { background: transparent !important; }

.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }

$(document).ready(function() {

$("#subs").fancybox({
'hideOnContentClick': false,
'scrolling': 'no'
});
setTimeout( function(){ $("#subs").trigger('click');} , 5000);

});

This shows content of element who has id="data"

 

The Glocks Are Falling! The Glocks Are Falling!

Flickr/Alex P. Yeremenko

The gun crowd is so paranoid about the erosion of their Second Amendment rights that they make Chicken Little look like an actuary.

The president’s recent gun proposals include initiatives such as expanded background checks, a ban on certain military-type rifles, and limits on the size of magazines. But if you listen to the gun folks, even these tepid proposals are—to quote a past president of the National Rifle Association—“unconstitutional schemes to gut the Second Amendment.” Iowa Senator Charles Grassley accused Obama of thinking “the Second Amendment can be tossed aside.” Any skeptical glance in the direction of that Glock on their hip is worth a Second Amendment yelp.

These objections are overblown. There is little question that Obama’s current proposals would withstand constitutional review. (I was one of about 50 law professors who signed a recent letter saying just that.) The reason is that a constitutional right is not violated every time it is burdened. Sure, where the line is drawn between burden and violation is sometimes hazy. But as we debate the question with regard to guns, progressives can be confident—because the best arguments we have are the ones that conservatives have been using against us in the abortion wars for 40 years.

Let me back up for a moment.

The typical story of a constitutional right goes something like this. Stage 1: For a significant period of time, the right either doesn’t exist at all or only exists in narrow circumstances. The right to free speech, for example, was a sliver of its current self for most of the country’s history, generally thought only to prohibit the government from censoring newspapers or books before they were published. Punishing speech after the fact was fine and dandy, even if it meant that speech was chilled significantly.

Stage 2: The Supreme Court recognizes or drastically expands the right, usually in a situation where its exercise has been banned or prohibited outright. The best example here is Roe v Wade, in which the Court recognized the right to an abortion in ruling against a statute that made it criminal to perform one. Another example is the Court’s 2008 decision in District of Columbia v. Heller, which struck down a D.C. anti-gun ordinance that was the strictest in the nation, recognizing a personal right to “bear arms” under the Second Amendment. Both Roe and Heller articulated constitutional rights that had not been recognized before.

Stage 2 questions get the most ink. Next month’s Supreme Court arguments over marriage equality, for example, will consider whether states can ban same-sex couples from receiving a marriage license, and whether the United States can refuse to recognize same-sex marriages for purposes of federal benefits.

But the devil’s details of constitutional law are at Stage 3, where the contours and limits of the right are determined in thousands of concrete cases. No right is absolute; they are defined only in the context of myriad applications, and every right is subject to counterbalancing by public interests. In real life, constitutional questions do not usually arise because of some blanket prohibition, but around the burdens—sometimes slight, sometimes severe—of exercising it. Stage 3 is where courts, and constitutional law professors, spend most of their time. Are ID checks at a polling place a burden on the right to vote? The Supreme Court says no. Are limits on independent campaign expenditures a burden on free speech rights? The Court says yes.

We are just at the beginning of Stage 3 with guns. The gun advocates won a clear Stage 2 victory in Heller, but the Stage 3 battles about what constitutes an unconstitutional burden on gun rights are just beginning. These are fights progressives can still win.

I’m confident of future victories over guns because of past defeats over abortion. After losing at State 2 of the abortion fight, abortion opponents have amassed victory after victory in Stage 3. They have argued that a woman’s right to choose does not require the choice to be accessible or easy, and the Supreme Court generally agrees. It upheld Roe in the 1992 case Planned Parenthood v Casey, validating the Stage 2 victory. But it sowed the seeds of the Stage 3 defeats, saying that the abortion right would be violated only by “undue burdens.” Now, an undue burden is as rare as a decent Liam Neeson movie.

State legislatures have successfully imposed waiting periods, parental notification requirements, and bans on specific procedures. Some states simply make it difficult for clinics to operate by imposing a daunting array of regulatory obligations—Virginia, for example, regulates the width of clinic hallways. In four states—North and South Dakota, Arkansas, and Mississippi—only one abortion clinic is available. Oklahoma, particularly creative, passed a law several years ago protecting doctors who choose not to tell mothers when the fetus has birth defects. According to Time magazine’s recent cover story on abortion, “Getting an abortion in America is, in some places, harder today than at any point since it became a constitutionally protected right 40 years ago.”

As a constitutional matter, the argument was best made by Tony Lauinger, chairman of the anti-abortion group Oklahomans for Life, when his state passed the most aggressive forced ultrasound bill in the country: “The ultrasound law does not prohibit abortion. It regulates abortion.”

The same argument is available to gun opponents. The exercise of gun rights comes with risks to life, as abortion opponents assert about abortion. Burdens on the gun right can take these risks into account, as courts have upheld regulations that take into account the life of the fetus.

One thing we know for sure: As a constitutional matter, one could go much further in regulating firearms than anything currently proposed without coming close to imposing an “undue burden” on Second Amendment rights.Background checks and limits on the types and lethality of weapons are nothing compared to the severity and breadth of the limits on abortions. With guns, we could be discussing waiting periods, training and licensing requirements for gun buyers, strict liability for gun sellers, or a host of other restrictions. We can paraphrase the Oklahoma right-to-lifer and argue these rules would not prohibit guns but would regulate guns. And we could co-opt Bill Clinton’s aphorism about abortion: guns should be “safe, legal, and rare.”

Of course the real reason stricter gun restrictions are not on the table is political, not constitutional. But the Chicken Littles of the gun movement often use warnings of constitutional calamity as cover for their political mechanizations. No reason to let them.

Comments

"I’m confident of future victories over guns because [...]"

You don't need to get into why, my friend.

Your side has been winning for years and years and years. In fact, your side wins almost every time.

The anti- side won on getting to call semi-autos "assault rifles" (they're not).

The anti- side got away with making it "cool" to be totally ignorant of firearms generally (anybody who does is portrayed as an incestuous Tea-Partier redneck imbecile). In fact, the anti- side won when they managed to get an "assault" weapon bill passed in 1994 that banned cosmetic features like barrel shrouds.

The anti- side got away with the whole "armor piercing bullets" thing.

The anti- side got away with reporting on shootings and managing to omit defensive gun use (see MSNBC coverage of the Oregon Mall shooting, where defensive use of a handgun was ENTIRELY omitted).

They got away with saying polymer pistols can go through metal detectors (see Rachel Maddow).

They got away with stirring up histrionics and emotion by standing on the graves of dead children (see Piers, who said -- incredibly -- that no one needs a "machine gun" in America. As if acquiring one were simply a matter of a quick trip to the store. Assault weapons, which have killed 2 people in the last 80 years, have been HEAVILY regulated since 1986).

Now we see Joe Biden telling people that they don't need an AR-15 for home defense -- people should buy shotguns. This, despite the fact that the pro-gun folks to whom he is preaching KNOW the FBI crime stats show that shotguns kill MORE people every year than semiautomatic rifles. (And knowing that, take it a step further -- it not only kills his credibility, it also tells us that any ban isn't about saving lives. Here we go again.)

So, bottom line, don't worry. We may have facts and two recent Supreme Court decisions on our side, but you anti-gun folks will win the war.

After this will come "sniper rifles." Bolt action hunting rifles are sometimes used as sniper rifles. They were in Vietnam. One day, a Liberal will wake up, realize this, and sound the alarm.

Then will come "high caliber assault shotguns." A 12 gauge shotgun used for hunting is, technically, a .73 caliber weapon. Some time in the future, once again, some clever Liberal will convince us all that shotguns gotta go, too.

Oh I know, I know. You don't seek a ban. I know. I know all about it. Never mind that here in CT, a Senate Bill has been introduced to ONLY allow "single shot" pistols, rifles, and shotguns. I know that one day, your clever reading of Heller will extend to ammo bans. After all, it's still Constitutional to burden a right -- in this case, by levying a 9,000% tax on ammunition. Maybe not now, but the suggestion will be raised once again (it was a popular idea in the 90's).

You'll just keep on winning, redefining the terms, ignoring statistics, dismissing facts, creating new, nuanced readings of Heller that could conceivably pass Constitutional muster while cracking down on the law-abiding. Self-defense is just a bizarre abstraction to you, like sex is to Roman Catholic clergy.

What the heck do I know, though. I'm just a chicken little crying 'the Glocks are falling!' Just some illiterate redneck imbecile scr-wing my sister, living in a trailer park, listening to country music, easily dismissed by the media, and now easily dismissed by you as well.

You need to be logged in to comment.
(If there's one thing we know about comment trolls, it's that they're lazy)

Connect
Advertisement