$(document).ready(function(){$.browser.msie||$("a").each(function(){var d,b=String($(this).attr("rel")),a=$(this).attr("href");if(a&&(d=b.match("imageAppear")))$(this).popUpImage(a);else if(a&&(d=b.match(/videoAppear\[([^\]]*)\]/)))$(this).popUpVideo(a,d[1]);else if(d=b.match(/boxAppear\[([^\]]*)\]/))$(this).popUpBox(d[1])})});$.popup={};$.popup.active=null;$.popup.next=null;$.popup.t=false;$.popup.c=false;
$.popup.go=function(){if($.popup.t)$.popup.c=true;else if($.popup.active){$.popup.t=true;$.popup.active.hide(function(){$.popup.t=false;$.popup.active=null;$.popup.go()})}else{var d=$.popup.active=$.popup.next;if(d){$.popup.t=true;$.popup.c=false;d.show(function(){$.popup.t=false;$.popup.c&&$.popup.go()});$.popup.next=null}}};$.spinner={};$.spinner.timeout=null;$.spinner.element=null;
$.spinner.show=function(){$.spinner.timeout=setTimeout(function(){if(!$.spinner.element)$.spinner.element=$(document.createElement("div")).css({position:"absolute",width:"64px",height:"64px"}).addClass("spinner").appendTo(document.body);$.spinner.element.css({top:window.innerHeight/2-32+window.scrollY+"px",left:window.innerWidth/2-32+window.scrollX+"px"});$.spinner.element.fadeIn("slow")},500)};$.spinner.hide=function(){clearTimeout($.spinner.timeout);$.spinner.element&&$.spinner.element.fadeOut("slow")};
$.fn.extend({createClose:function(){var d=$(this),b=$(document.createElement("a")).css({position:"absolute"}).attr("href","javascript:close();").addClass("frame-close").click(function(){$.popup.go()}).appendTo(document.body).hide();b.show=function(a,c){var e=d.offset();b.css({top:e.top-13+"px",left:e.left-13+"px"});b.width(26);b.height(26);b.fadeIn(a,c)};b.hide=function(a,c){b.fadeOut(a,c)};return b},popUpInfo:function(d){var b=$(this),a=d.to;d=$(d.from||b.children().get(0)||b);b=d.offset();var c=
window.innerHeight*0.8,e=a.height;a=a.width;var f=1;f=Math.min(window.innerWidth*0.8/a,f);f=Math.min(c/e,f);e*=f;a*=f;c=window.innerHeight/2-e/2+window.scrollY;f=window.innerWidth/2-a/2+window.scrollX;return{width:a,height:e,top:c,left:f,origin:[b.top-c+d.height()/2,b.left-f+d.width()/2]}},popUpImage:function(d){var b=$(this),a=null;b.show=function(c){$.spinner.show();var e=function(){$.spinner.hide();b._img.css({width:"auto",height:"auto"});a=b.popUpInfo({to:{width:b._img.width(),height:b._img.height()}});
b._container.css({top:a.top,left:a.left});b._img.css({width:a.width,height:a.height});b._img.show("scale",{origin:a.origin,easing:"easeOutSine",fade:true},300,function(){b._close.show("fast",c)})};if(b._popupSetup)e();else{b._container=$(document.createElement("a")).css({position:"absolute",display:"block"}).addClass("popup").attr("href","javascript:close();").click(function(){$.popup.go()}).appendTo(document.body);b._img=$(document.createElement("img")).attr("src",d).appendTo(b._container).hide().load(e);
b._close=b._img.createClose();b._popupSetup=true}};b.hide=function(c){b._close.hide("fast",function(){b._img.hide("scale",{origin:a.origin,easing:"easeInSine",fade:true},300,c)})};b.click(function(c){c.preventDefault();$.popup.next=b;$.popup.go()})},popUpVideo:function(d,b){var a=$(this),c=null;b=b.split(",");var e={width:parseInt(b[0]),height:parseInt(b[1])};a.show=function(f){if(!a._popupSetup){a._container=$(document.createElement("div")).css({position:"absolute",display:"block"}).addClass("popup").appendTo(document.body);
a._holder=$(document.createElement("div")).addClass("video").appendTo(a._container);a._close=a._holder.createClose();a._popupSetup=true}(function(){c=a.popUpInfo({to:e});a._container.css({top:c.top,left:c.left});if(!a._video){a._video=$(document.createElement("video"));if(a._video.get(0).canPlayType&&a._video.get(0).canPlayType("video/mp4"))a._video.attr({controls:"controls",autoplay:"autoplay"});else{a._video.remove();a._video=$(document.createElement("embed")).attr({type:"video/quicktime",pluginspage:"http://www.apple.com/quicktime/download/",
autoplay:"true",showlogo:"false",bgcolor:"000000",scale:"aspect",cache:"true"})}}if(a._video.get(0).nodeName.toLowerCase()=="embed")c.height+=16;a._holder.css({width:c.width,height:c.height});a._video.attr({src:d,width:c.width,height:c.height});a._holder.show("scale",{origin:c.origin,easing:"easeOutSine",fade:true},300,function(){a._close.show("fast",f);a._video.appendTo(a._holder)})})()};a.hide=function(f){a._close.hide("fast",function(){a._video.remove();a._video=null;a._holder.hide("scale",{origin:c.origin,
easing:"easeInSine",fade:true},300,f)})};a.ready(function(){var f=a.find("img");f.load(function(){a._overlay=$(document.createElement("span")).css({position:"absolute",width:f.width(),height:f.height()}).addClass("video-overlay").prependTo(a);$(document.createElement("span")).addClass("play").appendTo(a._overlay)})});a.click(function(f){f.preventDefault();$.popup.next=a;$.popup.go()})},popUpBox:function(d){d=d.split(",");var b=d[0];d=d[1];var a=$(this),c=null,e=$("#"+b).css({position:"absolute"});
b=e.find(".content");if(d){a.show=e.get(0).firstPopUpBox.show;a.hide=e.get(0).firstPopUpBox.hide}else{a.show=function(f){c=a.popUpInfo({to:{width:e.width(),height:e.height()}});e.css({top:c.top,left:c.left});e._close=e.createClose();b.css({visibility:"hidden"});e.show("scale",{origin:c.origin,easing:"easeOutSine",fade:true},300,function(){b.css({visibility:"visible"});b.hide();b.fadeIn("fast",f);e._close.show("fast")})};a.hide=function(f){e._close.hide("fast");b.fadeOut("fast",function(){b.show();
b.css({visibility:"hidden"});e.hide("scale",{origin:c.origin,easing:"easeOutSine",fade:true},300,f)})};e.get(0).firstPopUpBox=a}a.click(function(f){f.preventDefault();$.popup.next=a;$.popup.go()})}});function close(){}function information(){};
