var DetectZoom={mediaQueryBinarySearch:function(property,unit,a,b,maxIter,epsilon){var matchMedia,head,style,div,binarySearch;binarySearch=function(a,b,maxIter){var mid=(a+b)/2;if(maxIter==0||b-aimg.getAttribute("scale")&&targetSize<=naturalSize) targetSize=thisVal;if(naturalSizeimg.getAttribute("scale")&&targetSize<=img.naturalWidth) targetSize=$2;if($2!=targetSize) return $1+targetSize;});} else if(img.src.match(/^https?:\/\/([^\/.]+\.)*(wp|wordpress)\.com\/imgpress\?(.+)/)){var imgpressSafeFunctions=["zoom","url","h","w","fit","filter","brightness","contrast","colorize","smooth","unsharpmask"];var qs=RegExp.$3.split('&');for(var q in qs){q=qs[q].split('=')[0];if(imgpressSafeFunctions.indexOf(q)==-1){return false;}} img.width=img.width;img.height=img.height;if(scale==1) newSrc=img.src.replace(/\?(zoom=[^&]+&)?/,'?');else newSrc=img.src.replace(/\?(zoom=[^&]+&)?/,'?zoom='+scale+'&');} else if(img.src.match(/^https?:\/\/([^\/.]+\.)*(wp|wordpress)\.com\/latex\.php\?(latex|zoom)=(.+)/)){img.width=img.width;img.height=img.height;if(scale==1) newSrc=img.src.replace(/\?(zoom=[^&]+&)?/,'?');else newSrc=img.src.replace(/\?(zoom=[^&]+&)?/,'?zoom='+scale+'&');} else if(img.src.match(/^https?:\/\/[^\/]+\/.*[-@]([12])x\.(gif|jpeg|jpg|png)(\?|$)/)){img.width=img.width;img.height=img.height;var currentSize=RegExp.$1,newSize=currentSize;if(scale<=1) newSize=1;else newSize=2;if(currentSize!=newSize) newSrc=img.src.replace(/([-@])[12]x\.(gif|jpeg|jpg|png)(\?|$)/,'$1'+newSize+'x.$2$3');} else{return false;} if(newSrc!=img.src){var prevSrc,origSrc=img.getAttribute("src-orig");if(!origSrc){origSrc=img.src;img.setAttribute("src-orig",origSrc);} if(img.complete) prevSrc=img.src;else prevSrc=origSrc;img.onerror=function(){img.src=prevSrc;if(img.getAttribute("scale-fail")