1
0
forked from metin2/web
web/public/assets/mall/js/gf-original/74a2472b07741e6900b40d529efc36.js

1 line
15 KiB
JavaScript
Raw Normal View History

(function(aG){var ay,aq,ap,aD,aj,aA,ai,ax,am,al,au=0,aE={},aw=[],av=0,aF={},az=[],ag=null,ao=new Image,ae=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,k=/[^\.]\.(swf)\s*$/i,ad,ac=1,an=0,ar="",at,aB,aC=false,ak=aG.extend(aG("<div/>")[0],{prop:0}),ab=aG.browser.msie&&aG.browser.version<7&&!window.XMLHttpRequest,aa=function(){aq.hide();ao.onerror=ao.onload=null;ag&&ag.abort();ay.empty()},R=function(){if(false===aE.onError(aw,au,aE)){aq.hide();aC=false}else{aE.titleShow=false;aE.width="auto";aE.height="auto";ay.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');ah()}},af=function(){var d=aw[au],j,f,e,i,h,b;aa();aE=aG.extend({},aG.fn.fancybox.defaults,typeof aG(d).data("fancybox")=="undefined"?aE:aG(d).data("fancybox"));b=aE.onStart(aw,au,aE);if(b===false){aC=false}else{if(typeof b=="object"){aE=aG.extend(aE,b)}e=aE.title||(d.nodeName?aG(d).attr("title"):d.title)||"";if(d.nodeName&&!aE.orig){aE.orig=aG(d).children("img:first").length?aG(d).children("img:first"):aG(d)}if(e===""&&aE.orig&&aE.titleFromAlt){e=aE.orig.attr("alt")}j=aE.href||(d.nodeName?aG(d).attr("href"):d.href)||null;if(/^(?:javascript)/i.test(j)||j=="#"){j=null}if(aE.type){f=aE.type;if(!j){j=aE.content}}else{if(aE.content){f="html"}else{if(j){f=j.match(ae)?"image":j.match(k)?"swf":aG(d).hasClass("iframe")?"iframe":j.indexOf("#")===0?"inline":"ajax"}}}if(f){if(f=="inline"){d=j.substr(j.indexOf("#"));f=aG(d).length>0?"inline":"ajax"}aE.type=f;aE.href=j;aE.title=e;if(aE.autoDimensions){if(aE.type=="html"||aE.type=="inline"||aE.type=="ajax"){aE.width="auto";aE.height="auto"}else{aE.autoDimensions=false}}if(aE.modal){aE.overlayShow=true;aE.hideOnOverlayClick=false;aE.hideOnContentClick=false;aE.enableEscapeButton=false;aE.showCloseButton=false}aE.padding=parseInt(aE.padding,10);aE.margin=parseInt(aE.margin,10);ay.css("padding",aE.padding+aE.margin);aG(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){aG(this).replaceWith(aA.children())});switch(f){case"html":ay.html(aE.content);ah();break;case"inline":if(aG(d).parent().is("#fancybox-content")===true){aC=false;break}aG('<div class="fancybox-inline-tmp" />').hide().insertBefore(aG(d)).bind("fancybox-cleanup",function(){aG(this).replaceWith(aA.children())}).bind("fancybox-cancel",function(){aG(this).replaceWith(ay.children())});aG(d).appendTo(ay);ah();break;case"image":aC=false;aG.fancybox.showActivity();ao=new Image;ao.onerror=function(){R()};ao.onload=function(){aC=true;ao.onerror=ao.onload=null;aE.width=ao.width;aE.height=ao.height;aG("<img />").attr({id:"fancybox-img",src:ao.src,alt:aE.title}).appendTo(ay);P()};ao.src=j;break;case"swf":aE.scrolling="no";i='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+aE.width+'" height="'+aE.height+'"><param name="movie" value="'+j+'"></param>';h="";aG.each(aE.swf,function(l,m){i+='<param name="'+l+'" value="'+m+'"></param>';h+=" "+l+'="'+m+'"'});i+='<embed src="'+j+'" type="application/x-shockwave-flash" width="'+aE.width+'" height="'+aE.height+'"'+h+"></embed></object>";ay.html(i);ah();break;case"ajax":aC=false;aG.fancybox.showActivity();aE.ajax.win=aE.ajax.success;ag=aG.ajax(aG.extend({},aE.ajax,{url:j,data:aE.ajax.data||{},error:function(l){l.status>0&&R()},success:function(l,m,n){if((typeof n=="object"?n:ag).status==200){if(typeof aE.ajax.win=="function"){b=aE.ajax.win(j,l,m,n);if(b===false){aq.hide();return}else{if(typeof b=="string"||typeof b=="object"){l=b}}}ay.html(l);ah()}}}));break;case"iframe":P()}}else{R()}}},ah=function(){var b=aE.width,d=aE.height;b=b.toString().indexOf("%")>-1?parseInt((aG(window).width()-aE.margin*2)*parseFloat(b)/100,10)+"px":b=="auto"?"auto":b+"px";d=d.toString().indexOf("%")>-1?parseInt((aG(window).height()-aE.margin*2)*parseFloat(d)/100,10)+"px":d=="auto"?"auto":d+"px";ay.wrapInner('<div style="width:'+b+";height:"+d+";overflow: "+(aE.scrolling=="auto"?"auto":aE.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');aE.width=ay.width();aE.height=ay.height();P()},P=function(){var b,d;aq.hide();if(aD.is(":visible")&&false===aF.onCleanu