/*!
jQThumb V2.1.5
Copyright (c) 2013-2014
Dual licensed under the MIT and GPL licenses.
Author : Pak Cheong
Version : 2.1.5
Repo : https://github.com/pakcheong/jqthumb
Demo : http://pakcheong.github.io/jqthumb/
Last Updated : Friday, September 26th, 2014, 4:19:54 PM
Requirements : jQuery >=v1.3.0 or Zepto (with zepto-data plugin) >=v1.0.0
*/
!function(a,b,c){function d(a,c){b.console&&"undefined"!=typeof a&&a&&"undefined"!=typeof c&&c&&(a=a.toLowerCase(),"error"==a?console.error(c):"log"==a?console.log(c):console.error('"'+a+'" is not supported as console type.'))}function e(a){return a.toString().match(/\d+/)[0]}function f(a,b){var c=a.toString().match(/(-*)+\d+/)[0];return"px"==g(a)?0>a?0:a>b?b:a:"%"==g(a)?0>c?"0%":c>100?"100%":a:void 0}function g(b){var c=b.toString().match(/\d+(.*)/i);if(c)switch(a.trim(c[1])){case"":return"px";case"px":return"px";case"%":return"%"}}function h(b,c){this.element=b,this.settings=a.extend({},n,c),this.settings.width=this.settings.width.toString().replace(/px/gi,""),this.settings.height=this.settings.height.toString().replace(/px/gi,""),this.settings.position.y=f(this.settings.position.y,this.settings.width),this.settings.position.x=f(this.settings.position.x,this.settings.height),this.settings.zoom=this.settings.zoom<0?0:this.settings.zoom,"string"==typeof c?"kill"==c.toLowerCase()&&this.kill(this.element):this.init()}var i=function(){{var a=c.createElement("div"),b="Khtml Ms O Moz Webkit".split(" ");b.length}return function(c){if(c in a.style)return!0;c=c.replace(/^[a-z]/,function(a){return a.toUpperCase()});for(var d in b)if(b[d]+c in a.style)return!0;return!1}}(),j="jqthumb",k=j+"-resize",l=j+"-original-styles",m={outputElems:[],inputElems:[]},n={classname:j,width:100,height:100,position:{x:"50%",y:"50%"},source:"src",responsive:20,zoom:1,show:!0,method:"auto",before:function(){},after:function(){},done:function(){}};h.prototype={init:function(){var a=this.settings.method.toLowerCase();"auto"==a?i("backgroundSize")===!1?this.native(this.element,this.settings):this.modern(this.element,this.settings):"modern"==a?this.modern(this.element,this.settings):"native"==a?this.native(this.element,this.settings):d("error",'Invalid method. Only "auto", "modern" and "native" are allowed.')},kill:function(c){var e=a(c);if(e.data(j)){var f=[],g=e.prev();if(g.data(j)!==j)return d("error","Could not find the element. It is probably due to one or more element has been added right before the image element after the plugin initialization or it was removed."),!1;f=[],a.each(m.outputElems,function(b,c){a(c)[0]!=g[0]&&f.push(m.outputElems[b])}),m.outputElems=f,f=[],a.each(m.inputElems,function(b,c){a(c)[0]!=e[0]&&f.push(m.inputElems[b])}),m.inputElems=f,g.data(k)&&(a(b).unbind("resize",g.data(k)),g.removeData(k)),g.remove(),e.removeAttr("style"),"undefined"!=typeof e.data(l)&&(e.attr("style",e.data(l)),e.removeData(l)),"undefined"!=typeof e.data(j)&&e.removeData(j)}},"native":function(c,d){d.before.apply(c,[c]);var f=this,h=a(c),i=a("");h.data(l,h.attr("style")),h.hide(),i.bind("load",function(){var l={obj:i,size:{width:this.width,height:this.height}},m=(g(d.width),g(d.height),d.responsive),n=a(l.obj),o=a("