Fixed a conflict with [http://wordpress.org/extend/themes/ifeature iFeature] theme.

* workaround for "img { height: auto; }" style
 * workaround for "body { position: relative; }" style
This commit is contained in:
attosoft committed 2012-06-17 13:33:25 +00:00
1 parent 3e930e1c0c
commit 1f02b9683b
2 files changed
+44 -28

No files matched your search

+17 -2
View File
@@ -224,6 +224,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
if (!imageGroup || !caption)
jQuery("#TB_window").addClass("TB_singleLine");
var size = tb_getSize(jQuery("#TB_Image"), "margin");
if (size[1] < imageHeight) size[1] += imageHeight; // workaround for "img { height: auto; }" style
TB_WIDTH = size[0];
TB_HEIGHT = size[1] + tb_getSize(jQuery("#TB_closeWindow"), "margin")[1];
@@ -294,7 +295,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
}
}
if (id && title && handler) {
var height = tb_getSize(jQuery("#TB_Image"), "margin")[1];
var height = size[1];
jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+id+"' title='"+title+"' style='height:"+height+"px;'><span></span></a></div>");
jQuery("#"+id).click(handler);
}
@@ -333,7 +334,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
}
}
if ((id && title && handler) || (id2 && title2 && handler2)) {
var height = tb_getSize(jQuery("#TB_Image"), "margin")[1];
var height = size[1];
var link = link2 = "";
if (id && title && handler) link = "<a href='' id='"+id+"' class='TB_ImageLeft' title='"+title+"' style='height:"+height+"px;'></a>";
if (id2 && title2 && handler2) link2 = "<a href='' id='"+id2+"' class='TB_ImageRight' title='"+title2+"' style='height:"+height+"px;'></a>";
@@ -683,6 +684,20 @@ function tb_position() {
if ( ! isIE6 ) { // take away IE6
jQuery("#TB_window").css({marginTop: marginTop + 'px'});
}
// workaround for "body { position: relative; }" style
if (jQuery("body").css("position") == "relative") {
if (!isIE6) {
var top = parseInt((jQuery(window).innerHeight() - height) / 2, 10);
if (jQuery("#TB_window").css("position") == "absolute")
top += jQuery(document).scrollTop();
jQuery("#TB_window").css({marginTop: '', top: top + 'px'});
} else {
marginLeft = parseInt((jQuery(window).innerWidth() - width) / 2, 10) + jQuery(document).scrollLeft();
marginTop = parseInt((jQuery(window).innerHeight() - height) / 2, 10) + jQuery(document).scrollTop();
jQuery("#TB_window").css({marginLeft: marginLeft + 'px', marginTop: marginTop + 'px', top: '0', left: '0'});
}
}
}
function tb_parseQuery ( query ) {
+27 -26
View File
@@ -8,27 +8,27 @@ function tb_show(a,c,b){try{"undefined"===typeof document.body.style.maxHeight?(
"close"==tb_options.click_bg&&jQuery("#TB_overlay").click(tb_remove));tb_detectMacXFF()?jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack"):jQuery("#TB_overlay").addClass("TB_overlayBG");jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");0==parseInt(jQuery("#TB_load").css("marginLeft"))&&jQuery("#TB_load").css("marginLeft",-jQuery("#TB_load").outerWidth()/2);0==parseInt(jQuery("#TB_load").css("marginTop"))&&jQuery("#TB_load").css("marginTop",-jQuery("#TB_load").outerHeight()/
2);jQuery("#TB_load").show();var d=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$|\.webp$/,e=(-1!==c.indexOf("?")?c.substr(0,c.indexOf("?")):c).toLowerCase().match(d);if(".jpg"==e||".jpeg"==e||".png"==e||".gif"==e||".bmp"==e||".webp"==e){TB_imageCount=TB_NextHTML=TB_NextURL=TB_NextCaption=TB_PrevHTML=TB_PrevURL=TB_PrevCaption="";TB_FoundURL=!1;TB_LastURL=TB_LastCaption=TB_FirstURL=TB_FirstCaption="";if(b){TB_TempArray=jQuery("a[rel="+b+"]").get();for(TB_Counter=0;TB_Counter<TB_TempArray.length&&""===TB_NextHTML;TB_Counter++)TB_TempArray[TB_Counter].href.toLowerCase().match(d),
("object"==typeof a?TB_TempArray[TB_Counter]!=a:TB_TempArray[TB_Counter].href!=c)?TB_FoundURL?(TB_NextCaption=TB_TempArray[TB_Counter],TB_NextURL=TB_TempArray[TB_Counter].href,TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>"+thickboxL10n.next+"</a></span>"):(TB_PrevCaption=TB_TempArray[TB_Counter],TB_PrevURL=TB_TempArray[TB_Counter].href,TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>"+thickboxL10n.prev+"</a></span>"):(TB_FoundURL=!0,TB_imageCount=thickboxL10n.image+" "+(TB_Counter+
1)+" "+thickboxL10n.of+" "+TB_TempArray.length);TB_FirstCaption=TB_TempArray[0];TB_FirstURL=TB_TempArray[0].href;TB_LastCaption=TB_TempArray[TB_TempArray.length-1];TB_LastURL=TB_TempArray[TB_TempArray.length-1].href}imgPreloader=new Image;imgPreloader.onload=function(){imgPreloader.onload=null;var d=c.replace(/^[^\?]+\??/,""),e=tb_parseQuery(d),j=tb_getPageSize(),d=j[0]-150,j=j[1]-150,m=e.width?Math.min(e.width*1,imgPreloader.width):imgPreloader.width,h=e.height?Math.min(e.height*1,imgPreloader.height):
imgPreloader.height;if(tb_options.auto_resize)if(m>d){h=h*(d/m);m=d;if(h>j){m=m*(j/h);h=j}}else if(h>j){m=m*(j/h);h=j;if(m>d){h=h*(d/m);m=d}}typeof a=="object"&&(a=tb_caption(a));TB_Image="<img id='TB_Image' src='"+c+"' width='"+m+"' height='"+h+"' alt='"+a+"'/>";if(tb_options.click_img=="close"||!b&&tb_options.click_end=="close")TB_Image="<a href='' id='TB_ImageOff' title='"+thickboxL10n.close+"'>"+TB_Image+"</a>";TB_Caption="<div id='TB_caption'>"+a+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+
1)+" "+thickboxL10n.of+" "+TB_TempArray.length);TB_FirstCaption=TB_TempArray[0];TB_FirstURL=TB_TempArray[0].href;TB_LastCaption=TB_TempArray[TB_TempArray.length-1];TB_LastURL=TB_TempArray[TB_TempArray.length-1].href}imgPreloader=new Image;imgPreloader.onload=function(){imgPreloader.onload=null;var d=c.replace(/^[^\?]+\??/,""),e=tb_parseQuery(d),f=tb_getPageSize(),d=f[0]-150,i=f[1]-150,j=e.width?Math.min(e.width*1,imgPreloader.width):imgPreloader.width,f=e.height?Math.min(e.height*1,imgPreloader.height):
imgPreloader.height;if(tb_options.auto_resize)if(j>d){f=f*(d/j);j=d;if(f>i){j=j*(i/f);f=i}}else if(f>i){j=j*(i/f);f=i;if(j>d){f=f*(d/j);j=d}}typeof a=="object"&&(a=tb_caption(a));TB_Image="<img id='TB_Image' src='"+c+"' width='"+j+"' height='"+f+"' alt='"+a+"'/>";if(tb_options.click_img=="close"||!b&&tb_options.click_end=="close")TB_Image="<a href='' id='TB_ImageOff' title='"+thickboxL10n.close+"'>"+TB_Image+"</a>";TB_Caption="<div id='TB_caption'>"+a+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+
TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='"+tb_closeImage+"' /></a></div>";tb_options.effect_cap!="none"&&(TB_Caption="<div id='TB_CaptionBar'>"+TB_Caption+"</div>");switch(tb_options.position_cap){case "top":jQuery("#TB_window").append(TB_Caption+TB_Image).addClass("TB_imageContent TB_captionTop");break;case "bottom":jQuery("#TB_window").append(TB_Image+TB_Caption).addClass("TB_imageContent TB_captionBottom");
break;case "none":jQuery("#TB_window").append(TB_Image).addClass("TB_imageContent")}(!b||!a)&&jQuery("#TB_window").addClass("TB_singleLine");d=tb_getSize(jQuery("#TB_Image"),"margin");TB_WIDTH=d[0];TB_HEIGHT=d[1]+tb_getSize(jQuery("#TB_closeWindow"),"margin")[1];if(TB_WIDTH<e.width*1){TB_WIDTH=e.width*1;jQuery("#TB_Image").css({marginLeft:"auto",marginRight:"auto"})}TB_HEIGHT<e.height*1&&(TB_HEIGHT=e.height*1);e.modal=="true"&&jQuery("#TB_overlay").unbind();jQuery("#TB_closeWindowButton").click(tb_remove);
if(TB_PrevHTML!==""){var l=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_PrevCaption,TB_PrevURL,b);return false};jQuery("#TB_prev").click(l);var o=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_FirstCaption,TB_FirstURL,b);return false}}if(TB_NextHTML!==""){var p=function(){jQuery(document).unbind(".thickbox");
jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_NextCaption,TB_NextURL,b);return false};jQuery("#TB_next").click(p);var q=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_LastCaption,TB_LastURL,b);return false}}if(b&&tb_options.click_img=="next"){var k,n,f;if(TB_NextHTML!=""){k="TB_ImageNext";n=thickboxL10n.next;f=p}else if(tb_options.click_end==
"close"){k="TB_ImageClose";n=thickboxL10n.close;f=tb_remove}else if(tb_options.click_end=="loop"&&TB_PrevHTML!=""){k="TB_ImageFirst";n=thickboxL10n.first;f=o}if(k&&n&&f){d=tb_getSize(jQuery("#TB_Image"),"margin")[1];jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+k+"' title='"+n+"' style='height:"+d+"px;'><span></span></a></div>");jQuery("#"+k).click(f)}}else if(b&&tb_options.click_img=="prev_next"){var g,i,r;if(TB_PrevHTML!=""){k="TB_ImagePrev";n=thickboxL10n.prev;f=l}if(TB_NextHTML!=
""){g="TB_ImageNext";i=thickboxL10n.next;r=p}if(TB_PrevHTML=="")if(tb_options.click_end=="close"){k="TB_ImageClose";n=thickboxL10n.close;f=tb_remove}else if(tb_options.click_end=="loop"&&TB_NextHTML!=""){k="TB_ImageLast";n=thickboxL10n.last;f=q}if(TB_NextHTML=="")if(tb_options.click_end=="close"){g="TB_ImageClose2";i=thickboxL10n.close;r=tb_remove}else if(tb_options.click_end=="loop"&&TB_PrevHTML!=""){g="TB_ImageFirst";i=thickboxL10n.first;r=o}if(k&&n&&f||g&&i&&r){d=tb_getSize(jQuery("#TB_Image"),
"margin")[1];j=link2="";k&&(n&&f)&&(j="<a href='' id='"+k+"' class='TB_ImageLeft' title='"+n+"' style='height:"+d+"px;'></a>");g&&(i&&r)&&(link2="<a href='' id='"+g+"' class='TB_ImageRight' title='"+i+"' style='height:"+d+"px;'></a>");jQuery("#TB_window").append("<div id='TB_ImageClick'>"+j+link2+"</div>");j&&jQuery("#"+k).click(f);link2&&jQuery("#"+g).click(r);jQuery.browser.msie&&parseInt(jQuery.browser.version)<=7&&jQuery("#TB_ImageClick > a").focus(function(){this.blur()})}}jQuery(document).bind("keydown.thickbox",
function(a){a.stopImmediatePropagation();e.modal!="true"&&jQuery.inArray(a.which,tb_options.keys_close)!=-1?jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove():jQuery.inArray(a.which,tb_options.keys_prev)!=-1||a.shiftKey&&jQuery.inArray(a.which,tb_options.keys_prev.shift)!=-1?TB_PrevHTML!=""&&l():jQuery.inArray(a.which,tb_options.keys_next)!=-1?TB_NextHTML!=""&&p():jQuery.inArray(a.which,tb_options.keys_first)!=-1?TB_PrevHTML!=""&&o():jQuery.inArray(a.which,
tb_options.keys_last)!=-1&&TB_NextHTML!=""&&q();return false});b&&tb_options.wheel_img=="prev_next"&&jQuery("#TB_window").bind("mousewheel.thickbox",function(a){a.stopImmediatePropagation();a=0;if(!event)event=window.event;event.wheelDelta?a=event.wheelDelta:event.detail&&(a=-event.detail);if(a>0){if(TB_PrevHTML!=""){l();return false}}else if(a<0&&TB_NextHTML!=""){p();return false}});tb_options.move_img&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,"image")});if(tb_options.resize_img){tb_resize_init();
jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,"image")})}if(tb_options.effect_cap!="none"){jQuery("#TB_Image").css("margin",jQuery("#TB_Image").css("marginLeft"));tb_options.effect_cap=="zoom"&&jQuery("#TB_CaptionBar").css({left:"50%",marginLeft:-TB_WIDTH/2});jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap,
true)})}tb_position();jQuery("#TB_load").remove();(tb_options.click_img=="close"||!b&&tb_options.click_end=="close")&&jQuery("#TB_ImageOff").click(tb_remove);tb_open()};imgPreloader.src=c}else{var s=c.replace(/^[^\?]+\??/,""),l=tb_parseQuery(s);TB_WIDTH=1*l.width||600;TB_HEIGHT=1*l.height||400;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;"object"==typeof a&&(a=tb_caption(a,tb_options.ref_title));TB_Title="<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+a+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+
thickboxL10n.close+"'><img src='"+tb_closeImage+"' /></a></div></div>";if(-1!=c.indexOf("TB_iframe"))if(ajaxContentW+=2*("\v"=="v"?10:8),ajaxContentH+=2*("\v"=="v"?15:8),urlNoQuery=c.split(/[?&]TB_/),jQuery("#TB_iframeContent").remove(),TB_Iframe="<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(1E3*Math.random())+"' onload='tb_showIframe()' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'>"+thickboxL10n.noiframes+"</iframe>",
"true"!=l.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+TB_Iframe).addClass("TB_iframeContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Iframe+TB_Title).addClass("TB_iframeContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent");else if("block"!=jQuery("#TB_window").css("display"))if(TB_Ajax=
"<div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>","true"!=l.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+TB_Ajax).addClass("TB_ajaxContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Ajax+TB_Title).addClass("TB_ajaxContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent TB_titleNone")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent"),
jQuery("#TB_ajaxContent").addClass("TB_modal");else jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px",jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px",jQuery("#TB_ajaxContent")[0].scrollTop=0,jQuery("#TB_ajaxWindowTitle").html(a);if(-1!=c.indexOf("TB_iframe"))TB_WIDTH+=2*("\v"=="v"?10:8),TB_HEIGHT+=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1];else{var o=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),q=tb_getSize(jQuery("#TB_ajaxContent"));TB_WIDTH+=o[0]-q[0];TB_HEIGHT+=
o[1]-q[1]+tb_getSize(jQuery("#TB_title"))[1]}jQuery("#TB_closeWindowButton").click(tb_remove);if(-1!=c.indexOf("TB_inline"))jQuery("#TB_ajaxContent").append(jQuery("#"+l.inlineId).children()),jQuery("#TB_window").bind("tb_unload",function(){jQuery("#"+l.inlineId).append(jQuery("#TB_ajaxContent").children())}),tb_position(),jQuery("#TB_load").remove(),tb_open(),tb_roundCorner("iframe");else if(-1!=c.indexOf("TB_iframe"))tb_position(),!("onload"in jQuery("#TB_iframeContent")[0])&&"function"!=typeof jQuery("#TB_iframeContent")[0].onload&&
tb_showIframe();else{var t=-1==c.indexOf("?")?"?":"&";jQuery("#TB_ajaxContent").load(c+=t+"random="+(new Date).getTime(),function(){tb_position();jQuery("#TB_load").remove();tb_open();tb_roundCorner("ajax")})}tb_options.move_content&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,c.indexOf("TB_iframe")!=-1?"iframe":"ajax")});tb_options.resize_content&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,c.indexOf("TB_iframe")!=
-1?"iframe":"ajax")}));"none"!=tb_options.effect_title&&(jQuery("#TB_title").addClass("hover"),"zoom"==tb_options.effect_title&&jQuery("#TB_title").css({left:"50%",marginLeft:-TB_WIDTH/2}),jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title,true)}));"true"!=l.modal&&jQuery(document).bind("keyup.thickbox",function(a){if(jQuery.inArray(a.which,tb_options.keys_close)!=
-1){a.stopImmediatePropagation();jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove();return false}})}}catch(u){tb_options.debug&&alert(u)}}
break;case "none":jQuery("#TB_window").append(TB_Image).addClass("TB_imageContent")}(!b||!a)&&jQuery("#TB_window").addClass("TB_singleLine");d=tb_getSize(jQuery("#TB_Image"),"margin");d[1]<f&&(d[1]=d[1]+f);TB_WIDTH=d[0];TB_HEIGHT=d[1]+tb_getSize(jQuery("#TB_closeWindow"),"margin")[1];if(TB_WIDTH<e.width*1){TB_WIDTH=e.width*1;jQuery("#TB_Image").css({marginLeft:"auto",marginRight:"auto"})}TB_HEIGHT<e.height*1&&(TB_HEIGHT=e.height*1);e.modal=="true"&&jQuery("#TB_overlay").unbind();jQuery("#TB_closeWindowButton").click(tb_remove);
if(TB_PrevHTML!==""){var m=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_PrevCaption,TB_PrevURL,b);return false};jQuery("#TB_prev").click(m);var o=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_FirstCaption,TB_FirstURL,b);return false}}if(TB_NextHTML!==""){var p=function(){jQuery(document).unbind(".thickbox");
jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_NextCaption,TB_NextURL,b);return false};jQuery("#TB_next").click(p);var r=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_LastCaption,TB_LastURL,b);return false}}if(b&&tb_options.click_img=="next"){var l,n,g;if(TB_NextHTML!=""){l="TB_ImageNext";n=thickboxL10n.next;g=p}else if(tb_options.click_end==
"close"){l="TB_ImageClose";n=thickboxL10n.close;g=tb_remove}else if(tb_options.click_end=="loop"&&TB_PrevHTML!=""){l="TB_ImageFirst";n=thickboxL10n.first;g=o}if(l&&n&&g){d=d[1];jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+l+"' title='"+n+"' style='height:"+d+"px;'><span></span></a></div>");jQuery("#"+l).click(g)}}else if(b&&tb_options.click_img=="prev_next"){var h,k,q;if(TB_PrevHTML!=""){l="TB_ImagePrev";n=thickboxL10n.prev;g=m}if(TB_NextHTML!=""){h="TB_ImageNext";k=thickboxL10n.next;
q=p}if(TB_PrevHTML=="")if(tb_options.click_end=="close"){l="TB_ImageClose";n=thickboxL10n.close;g=tb_remove}else if(tb_options.click_end=="loop"&&TB_NextHTML!=""){l="TB_ImageLast";n=thickboxL10n.last;g=r}if(TB_NextHTML=="")if(tb_options.click_end=="close"){h="TB_ImageClose2";k=thickboxL10n.close;q=tb_remove}else if(tb_options.click_end=="loop"&&TB_PrevHTML!=""){h="TB_ImageFirst";k=thickboxL10n.first;q=o}if(l&&n&&g||h&&k&&q){d=d[1];f=link2="";l&&(n&&g)&&(f="<a href='' id='"+l+"' class='TB_ImageLeft' title='"+
n+"' style='height:"+d+"px;'></a>");h&&(k&&q)&&(link2="<a href='' id='"+h+"' class='TB_ImageRight' title='"+k+"' style='height:"+d+"px;'></a>");jQuery("#TB_window").append("<div id='TB_ImageClick'>"+f+link2+"</div>");f&&jQuery("#"+l).click(g);link2&&jQuery("#"+h).click(q);jQuery.browser.msie&&parseInt(jQuery.browser.version)<=7&&jQuery("#TB_ImageClick > a").focus(function(){this.blur()})}}jQuery(document).bind("keydown.thickbox",function(a){a.stopImmediatePropagation();e.modal!="true"&&jQuery.inArray(a.which,
tb_options.keys_close)!=-1?jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove():jQuery.inArray(a.which,tb_options.keys_prev)!=-1||a.shiftKey&&jQuery.inArray(a.which,tb_options.keys_prev.shift)!=-1?TB_PrevHTML!=""&&m():jQuery.inArray(a.which,tb_options.keys_next)!=-1?TB_NextHTML!=""&&p():jQuery.inArray(a.which,tb_options.keys_first)!=-1?TB_PrevHTML!=""&&o():jQuery.inArray(a.which,tb_options.keys_last)!=-1&&TB_NextHTML!=""&&r();return false});b&&
tb_options.wheel_img=="prev_next"&&jQuery("#TB_window").bind("mousewheel.thickbox",function(a){a.stopImmediatePropagation();a=0;if(!event)event=window.event;event.wheelDelta?a=event.wheelDelta:event.detail&&(a=-event.detail);if(a>0){if(TB_PrevHTML!=""){m();return false}}else if(a<0&&TB_NextHTML!=""){p();return false}});tb_options.move_img&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,"image")});if(tb_options.resize_img){tb_resize_init();jQuery("#TB_Resize").bind("mousedown.thickbox",
function(a){return tb_resize(a,"image")})}if(tb_options.effect_cap!="none"){jQuery("#TB_Image").css("margin",jQuery("#TB_Image").css("marginLeft"));tb_options.effect_cap=="zoom"&&jQuery("#TB_CaptionBar").css({left:"50%",marginLeft:-TB_WIDTH/2});jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap,true)})}tb_position();jQuery("#TB_load").remove();
(tb_options.click_img=="close"||!b&&tb_options.click_end=="close")&&jQuery("#TB_ImageOff").click(tb_remove);tb_open()};imgPreloader.src=c}else{var s=c.replace(/^[^\?]+\??/,""),i=tb_parseQuery(s);TB_WIDTH=1*i.width||600;TB_HEIGHT=1*i.height||400;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;"object"==typeof a&&(a=tb_caption(a,tb_options.ref_title));TB_Title="<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+a+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+
"'><img src='"+tb_closeImage+"' /></a></div></div>";if(-1!=c.indexOf("TB_iframe"))if(ajaxContentW+=2*("\v"=="v"?10:8),ajaxContentH+=2*("\v"=="v"?15:8),urlNoQuery=c.split(/[?&]TB_/),jQuery("#TB_iframeContent").remove(),TB_Iframe="<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(1E3*Math.random())+"' onload='tb_showIframe()' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'>"+thickboxL10n.noiframes+"</iframe>","true"!=i.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+
TB_Iframe).addClass("TB_iframeContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Iframe+TB_Title).addClass("TB_iframeContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent");else if("block"!=jQuery("#TB_window").css("display"))if(TB_Ajax="<div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>",
"true"!=i.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+TB_Ajax).addClass("TB_ajaxContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Ajax+TB_Title).addClass("TB_ajaxContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent TB_titleNone")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent"),jQuery("#TB_ajaxContent").addClass("TB_modal");else jQuery("#TB_ajaxContent")[0].style.width=
ajaxContentW+"px",jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px",jQuery("#TB_ajaxContent")[0].scrollTop=0,jQuery("#TB_ajaxWindowTitle").html(a);if(-1!=c.indexOf("TB_iframe"))TB_WIDTH+=2*("\v"=="v"?10:8),TB_HEIGHT+=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1];else{var m=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),o=tb_getSize(jQuery("#TB_ajaxContent"));TB_WIDTH+=m[0]-o[0];TB_HEIGHT+=m[1]-o[1]+tb_getSize(jQuery("#TB_title"))[1]}jQuery("#TB_closeWindowButton").click(tb_remove);
if(-1!=c.indexOf("TB_inline"))jQuery("#TB_ajaxContent").append(jQuery("#"+i.inlineId).children()),jQuery("#TB_window").bind("tb_unload",function(){jQuery("#"+i.inlineId).append(jQuery("#TB_ajaxContent").children())}),tb_position(),jQuery("#TB_load").remove(),tb_open(),tb_roundCorner("iframe");else if(-1!=c.indexOf("TB_iframe"))tb_position(),!("onload"in jQuery("#TB_iframeContent")[0])&&"function"!=typeof jQuery("#TB_iframeContent")[0].onload&&tb_showIframe();else{var t=-1==c.indexOf("?")?"?":"&";
jQuery("#TB_ajaxContent").load(c+=t+"random="+(new Date).getTime(),function(){tb_position();jQuery("#TB_load").remove();tb_open();tb_roundCorner("ajax")})}tb_options.move_content&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,c.indexOf("TB_iframe")!=-1?"iframe":"ajax")});tb_options.resize_content&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,c.indexOf("TB_iframe")!=-1?"iframe":"ajax")}));"none"!=tb_options.effect_title&&
(jQuery("#TB_title").addClass("hover"),"zoom"==tb_options.effect_title&&jQuery("#TB_title").css({left:"50%",marginLeft:-TB_WIDTH/2}),jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title,true)}));"true"!=i.modal&&jQuery(document).bind("keyup.thickbox",function(a){if(jQuery.inArray(a.which,tb_options.keys_close)!=-1){a.stopImmediatePropagation();jQuery(document).triggerHandler("wp_CloseOnEscape",
[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove();return false}})}}catch(u){tb_options.debug&&alert(u)}}
function tb_open(){"hidden"==jQuery("#TB_window").css("visibility")&&jQuery("#TB_window").css("visibility","visible");var a=jQuery("#TB_window").is(".TB_Transition")?tb_options.effect_trans:tb_options.effect_open;tb_effectView(a,!1);var c=function(){tb_effectView(a)};switch(a){case "zoom":jQuery("#TB_window").height(jQuery("#TB_window").height());"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_window").css({marginTop:-jQuery("#TB_window").height()/2,top:jQuery(window).height()/2+jQuery(document).scrollTop()});
jQuery("#TB_Image").hide().show(tb_options.effect_speed);jQuery("#TB_window").show(tb_options.effect_speed,c);break;case "slide":"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_window").css({marginTop:-jQuery("#TB_window").height()/2,top:jQuery(window).height()/2+jQuery(document).scrollTop()});jQuery("#TB_window").slideDown(tb_options.effect_speed,c);break;case "fade":jQuery("#TB_window").fadeIn(tb_options.effect_speed,c);break;default:jQuery("#TB_window").show()}"none"==jQuery("#TB_window").css("display")&&
jQuery("#TB_window").css("display","block");jQuery("#TB_title").height(Math.max(jQuery("#TB_title").height(),jQuery("#TB_ajaxWindowTitle").height()+13))}
@@ -38,16 +38,17 @@ d=jQuery("#TB_iframeContent").contents(),a=0==d.length||c.width()<d.width(),c=0=
borderRadius:0}).after("<div id='TB_ajaxContentMarginTop'></div>"),jQuery("#TB_ajaxContentMarginTop").css({height:b,borderTopLeftRadius:b,borderTopRightRadius:b})}}function tb_effectView(a,c){"none"!=a&&(("boolean"==typeof c?c:1)?jQuery("#TB_ImageClick").show():jQuery("#TB_ImageClick").hide())}function tb_showIframe(){jQuery("#TB_load").remove();tb_open();tb_roundCorner("iframe")}
function tb_remove(){tb_effectView(tb_options.effect_close,!1);var a=function(){jQuery("#TB_window,#TB_overlay,#TB_HideSelect").trigger("tb_unload").unbind().remove();"undefined"==typeof document.body.style.maxHeight&&(jQuery("body","html").css({height:"auto",width:"auto"}),jQuery("html").css("overflow",""))};switch(tb_options.effect_close){case "zoom":jQuery("#TB_Image").hide(tb_options.effect_speed);jQuery("#TB_window").hide(tb_options.effect_speed,a);break;case "slide":jQuery("#TB_window").slideUp(tb_options.effect_speed,
a);break;case "fade":jQuery("#TB_window").fadeOut(tb_options.effect_speed,a);break;default:a()}jQuery("#TB_load").remove();jQuery(document).unbind(".thickbox");return!1}
function tb_position(){var a=TB_WIDTH+jQuery("#TB_window").outerWidth()-jQuery("#TB_window").width(),c=TB_HEIGHT+jQuery("#TB_window").outerHeight()-jQuery("#TB_window").height(),a=-parseInt(a/2,10),c=-parseInt(c/2,10),b="undefined"===typeof document.body.style.maxHeight;!b&&"absolute"==jQuery("#TB_window").css("position")&&(a+=jQuery(document).scrollLeft(),c+=jQuery(document).scrollTop());jQuery("#TB_window").css({marginLeft:a+"px",width:TB_WIDTH+"px"});b||jQuery("#TB_window").css({marginTop:c+"px"})}
function tb_position(){var a=TB_WIDTH+jQuery("#TB_window").outerWidth()-jQuery("#TB_window").width(),c=TB_HEIGHT+jQuery("#TB_window").outerHeight()-jQuery("#TB_window").height(),b=-parseInt(a/2,10),d=-parseInt(c/2,10),e="undefined"===typeof document.body.style.maxHeight;!e&&"absolute"==jQuery("#TB_window").css("position")&&(b+=jQuery(document).scrollLeft(),d+=jQuery(document).scrollTop());jQuery("#TB_window").css({marginLeft:b+"px",width:TB_WIDTH+"px"});e||jQuery("#TB_window").css({marginTop:d+"px"});
"relative"==jQuery("body").css("position")&&(e?(b=parseInt((jQuery(window).innerWidth()-a)/2,10)+jQuery(document).scrollLeft(),d=parseInt((jQuery(window).innerHeight()-c)/2,10)+jQuery(document).scrollTop(),jQuery("#TB_window").css({marginLeft:b+"px",marginTop:d+"px",top:"0",left:"0"})):(a=parseInt((jQuery(window).innerHeight()-c)/2,10),"absolute"==jQuery("#TB_window").css("position")&&(a+=jQuery(document).scrollTop()),jQuery("#TB_window").css({marginTop:"",top:a+"px"})))}
function tb_parseQuery(a){var c={};if(!a)return c;for(var a=a.substring(a.indexOf("?")+1),a=a.split(/[;&]/),b=0;b<a.length;b++){var d=a[b].split("=");if(d&&2==d.length){var e=unescape(d[0]),d=unescape(d[1]),d=d.replace(/\+/g," ");c[e]=d}}return c}function tb_getPageSize(){var a=document.documentElement;return arrayPageSize=[window.innerWidth||self.innerWidth||a&&a.clientWidth||document.body.clientWidth,window.innerHeight||self.innerHeight||a&&a.clientHeight||document.body.clientHeight]}
function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(-1!=a.indexOf("mac")&&-1!=a.indexOf("firefox"))return!0}function tb_move(a,c){if("image"==c){if(jQuery(a.target).parent().is("#TB_prev, #TB_next, #TB_closeWindowButton"))return!0}else if(!jQuery(a.target).closest("#TB_title").length||jQuery(a.target).parent().is("#TB_closeWindowButton"))return!0;return tb_drag(a,c,"move")}
function tb_resize(a,c){var b;switch(a.target.id){case "TB_ResizeN":b="n-resize";break;case "TB_ResizeE":b="e-resize";break;case "TB_ResizeW":b="w-resize";break;case "TB_ResizeS":b="s-resize";break;case "TB_ResizeNE":b="ne-resize";break;case "TB_ResizeNW":b="nw-resize";break;case "TB_ResizeSE":b="se-resize";break;case "TB_ResizeSW":b="sw-resize";break;default:return!0}return tb_drag(a,c,b)}
function tb_resize_init(){jQuery("#TB_window").append("<div id='TB_Resize'><div id='TB_ResizeN'></div><div id='TB_ResizeE'></div><div id='TB_ResizeW'></div><div id='TB_ResizeS'></div><div id='TB_ResizeNE'></div><div id='TB_ResizeNW'></div><div id='TB_ResizeSE'></div><div id='TB_ResizeSW'></div></div>");"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_ResizeE, #TB_ResizeW").height(jQuery("#TB_window").height())}
function tb_drag(a,c,b){if(1!=a.which)return!0;TB_THRESHOLD=5;MIN_WIDTH=MIN_HEIGHT=100;var d=jQuery("#TB_window").offset().left-parseInt(jQuery("#TB_window").css("marginLeft")),e=jQuery("#TB_window").offset().top-parseInt(jQuery("#TB_window").css("marginTop"));"undefined"!=typeof document.body.style.maxHeight&&"absolute"!=jQuery("#TB_window").css("position")&&(d-=jQuery(document).scrollLeft(),e-=jQuery(document).scrollTop());var s=a.clientX,l=a.clientY,o=!1,q=jQuery("#TB_window, #TB_overlay, "+("image"==
c?"#TB_window a":"#TB_closeWindowButton")),t="move"==b||"w-resize"==b||"nw-resize"==b||"sw-resize"==b,u="move"==b||"n-resize"==b||"ne-resize"==b||"nw-resize"==b,w="move"!=b&&"n-resize"!=b&&"s-resize"!=b,x="move"!=b&&"e-resize"!=b&&"w-resize"!=b;if("move"!=b){var j=jQuery("#TB_window").width(),m=jQuery("#TB_window").height(),h=jQuery("image"==c?"#TB_Image":"iframe"==c?"#TB_iframeContent":"#TB_ajaxContent"),y=h.width(),z=h.height(),p="e-resize"==b||"ne-resize"==b||"se-resize"==b?1:-1,v="s-resize"==
b||"se-resize"==b||"sw-resize"==b?1:-1;if("undefined"==typeof document.body.style.maxHeight)var k=jQuery("#TB_window").css("marginTop")}jQuery(document).bind("mousemove.thickbox",function(a,f,g){var f=f?f:a.clientX,g=g?g:a.clientY,a=f-s,i=g-l;if(!o){a=a>TB_THRESHOLD?a-TB_THRESHOLD:a<-TB_THRESHOLD?a+TB_THRESHOLD:0;i=i>TB_THRESHOLD?i-TB_THRESHOLD:i<-TB_THRESHOLD?i+TB_THRESHOLD:0;if(Math.abs(a)>0||Math.abs(i)>0){o=true;s=f;l=g;q.css("cursor",b)}}if(o){f=skipMoveY=false;if(w){g=j+a*p;if(g<MIN_WIDTH)f=
true;else{jQuery("#TB_window").width(g);h.width(y+a*p)}}if(x){g=m+i*v;if(g<MIN_HEIGHT)skipMoveY=true;else{jQuery("#TB_window").height(g);h.height(z+i*v);c=="image"&&jQuery("#TB_ImageClick > a").height(jQuery("#TB_Image").outerHeight(true));typeof document.body.style.maxHeight=="undefined"&&jQuery("#TB_window").css("marginTop",k)}}t&&!f&&jQuery("#TB_window").css("left",d+a);u&&!skipMoveY&&jQuery("#TB_window").css("top",e+i)}return false});jQuery(document).bind("mouseup.thickbox",function(a){jQuery(document).unbind("mousemove.thickbox mouseup.thickbox");
c=="iframe"&&jQuery("#TB_iframeContent").contents().unbind("mousemove.thickbox mouseup.thickbox");if(!o)return true;q.css("cursor","");var b=jQuery(a.target);if(b.is("html"))return false;b.is(".TB_ImageLeft, .TB_ImageRight")||(b=b.parent());if((a=b.data("events"))&&a.click){var d=[];jQuery.each(a.click,function(a,b){d[d.length]=b.handler||b});if(d.length>0)b.unbind("click").one("click",function(a){a.preventDefault();a.stopImmediatePropagation?a.stopImmediatePropagation():a.stopPropagation();for(a=
function tb_drag(a,c,b){if(1!=a.which)return!0;TB_THRESHOLD=5;MIN_WIDTH=MIN_HEIGHT=100;var d=jQuery("#TB_window").offset().left-parseInt(jQuery("#TB_window").css("marginLeft")),e=jQuery("#TB_window").offset().top-parseInt(jQuery("#TB_window").css("marginTop"));"undefined"!=typeof document.body.style.maxHeight&&"absolute"!=jQuery("#TB_window").css("position")&&(d-=jQuery(document).scrollLeft(),e-=jQuery(document).scrollTop());var s=a.clientX,i=a.clientY,m=!1,o=jQuery("#TB_window, #TB_overlay, "+("image"==
c?"#TB_window a":"#TB_closeWindowButton")),t="move"==b||"w-resize"==b||"nw-resize"==b||"sw-resize"==b,u="move"==b||"n-resize"==b||"ne-resize"==b||"nw-resize"==b,v="move"!=b&&"n-resize"!=b&&"s-resize"!=b,w="move"!=b&&"e-resize"!=b&&"w-resize"!=b;if("move"!=b){var f=jQuery("#TB_window").width(),x=jQuery("#TB_window").height(),j=jQuery("image"==c?"#TB_Image":"iframe"==c?"#TB_iframeContent":"#TB_ajaxContent"),y=j.width(),z=j.height(),p="e-resize"==b||"ne-resize"==b||"se-resize"==b?1:-1,r="s-resize"==
b||"se-resize"==b||"sw-resize"==b?1:-1;if("undefined"==typeof document.body.style.maxHeight)var l=jQuery("#TB_window").css("marginTop")}jQuery(document).bind("mousemove.thickbox",function(a,g,h){var g=g?g:a.clientX,h=h?h:a.clientY,a=g-s,k=h-i;if(!m){a=a>TB_THRESHOLD?a-TB_THRESHOLD:a<-TB_THRESHOLD?a+TB_THRESHOLD:0;k=k>TB_THRESHOLD?k-TB_THRESHOLD:k<-TB_THRESHOLD?k+TB_THRESHOLD:0;if(Math.abs(a)>0||Math.abs(k)>0){m=true;s=g;i=h;o.css("cursor",b)}}if(m){g=skipMoveY=false;if(v){h=f+a*p;if(h<MIN_WIDTH)g=
true;else{jQuery("#TB_window").width(h);j.width(y+a*p)}}if(w){h=x+k*r;if(h<MIN_HEIGHT)skipMoveY=true;else{jQuery("#TB_window").height(h);j.height(z+k*r);c=="image"&&jQuery("#TB_ImageClick > a").height(jQuery("#TB_Image").outerHeight(true));typeof document.body.style.maxHeight=="undefined"&&jQuery("#TB_window").css("marginTop",l)}}t&&!g&&jQuery("#TB_window").css("left",d+a);u&&!skipMoveY&&jQuery("#TB_window").css("top",e+k)}return false});jQuery(document).bind("mouseup.thickbox",function(a){jQuery(document).unbind("mousemove.thickbox mouseup.thickbox");
c=="iframe"&&jQuery("#TB_iframeContent").contents().unbind("mousemove.thickbox mouseup.thickbox");if(!m)return true;o.css("cursor","");var b=jQuery(a.target);if(b.is("html"))return false;b.is(".TB_ImageLeft, .TB_ImageRight")||(b=b.parent());if((a=b.data("events"))&&a.click){var d=[];jQuery.each(a.click,function(a,b){d[d.length]=b.handler||b});if(d.length>0)b.unbind("click").one("click",function(a){a.preventDefault();a.stopImmediatePropagation?a.stopImmediatePropagation():a.stopPropagation();for(a=
0;a<d.length;a++)b.click(d[a]);return false})}});"iframe"==c&&jQuery("#TB_iframeContent").contents().bind("mousemove.thickbox",function(a){a.clientX=a.clientX+(jQuery("#TB_iframeContent").offset().left-jQuery(document).scrollLeft());a.clientY=a.clientY+(jQuery("#TB_iframeContent").offset().top-jQuery(document).scrollTop());jQuery(document).trigger("mousemove.thickbox",[a.clientX,a.clientY])}).bind("mouseup.thickbox",function(){jQuery(document).trigger("mouseup.thickbox")});return!1}
function tb_getSize(a,c){var b,d,e=function(){switch(c){case "padding":b=a.innerWidth();d=a.innerHeight();break;case "border":b=a.outerWidth();d=a.outerHeight();break;case "margin":b=a.outerWidth(!0);d=a.outerHeight(!0);break;default:b=a.width(),d=a.height()}};"none"==jQuery("#TB_window").css("display")&&(0<tb_versionCompare("1.4.4")||0<tb_versionCompare("1.6.2")&&c)?jQuery.swap(jQuery("#TB_window")[0],{position:"absolute",visibility:"hidden",display:"block"},e):e();return[b,d]}
function tb_versionCompare(a,c){c=c||jQuery.fn.jquery;if(a!=c)for(var b=a.split("."),d=c.split("."),e=0;e<b.length||e<d.length;e++){if(b[e]&&!d[e]||b[e]>d[e])return 1;if(!b[e]&&d[e]||b[e]<d[e])return-1}return 0}