BAHA_EGG

BAHA EGG.js

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://sleazyfork.org/scripts/28799-baha-egg/code/BAHA_EGG.js?version=186855

/**
 * Copyright 2010, Oneup Network Corporation http://www.gamer.com.tw/
 * 
 * Includes Sizzle.js (1.5.1-18) http://sizzlejs.com/ Copyright 2011, The Dojo
 * Foundation Released under the MIT, BSD, and GPL Licenses.
 */

/*
 * ! Sizzle CSS Selector Engine Copyright 2011, The Dojo Foundation Released
 * under the MIT, BSD, and GPL Licenses. More information: http://sizzlejs.com/
 */

!function(){var e=function(t,n){return new e.selector(t,n)};e.selector=function(e,t){var n;return n="string"==typeof e?Sizzle(e,t):e&&e.Egg?e.get():e,this._isXML=Sizzle.isXML(t),this.get=function(e){var t=void 0!==e;if(!n)return t?void 0:[];if(isNaN(n.length)){var o=[];return o.push(n),t?n:o}return t?n[e]:n},this.find=function(e){return n=Sizzle(e,this.get(0)),this},this.filter=function(e){return n=Sizzle.matches(e,this.get()),this},this.Egg="1.0",this},e.browser=new function(){var e=navigator.userAgent.toLowerCase();this.chrome=e.match(/chrome/),this.safari=!e.match(/chrome/)&&e.match(/safari/),this.webkit=e.match(/webkit/),this.opera=window.opera,this.ie5=e.match(/msie 5/),this.ie6=e.match(/msie 6/),this.ie7=e.match(/msie 7/),this.ie8=e.match(/msie 8/),this.ie9=e.match(/msie 9/),this.ie11=e.match(/trident\/.*rv:([0-9]{1,}[.0-9]{0,})/),this.ie=e.match(/msie/),this.kkman=e.match(/kkman/),this.firefox2=e.match(/firefox\/2/),this.firefox3=e.match(/firefox\/3/),this.firefox=e.match(/firefox/)},e.each=function(e,t){if(e)if(e.Egg&&(e=e.get()),void 0===e.length)t.call(e,e);else for(var n,o=0;n=e[o];o++)t.call(n,n)},e.method=e.selector.prototype,e.method.size=function(){return this.get().length},e.method.each=function(t){return e.each(this,t),this},e.method.css=function(t,n){var o=function(e){return"float"==e?"cssFloat":e.replace(/-([a-z])/,function(e,t){return t.toUpperCase()})};if(void 0!==n)e.each(this,function(e){e.style[o(t)]=n});else{if("string"==typeof t)return this.get(0)&&this.get(0).style[o(t)]||void 0;e.each(this,function(e){for(var n in t)e.style[o(n)]=t[n]})}return this},e.method.opacity=function(t){return t=parseFloat(t),0>t&&(t=0),t>1&&(t=1),e.each(this,function(n){n.style.opacity=t,e.browser.ie&&(n.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+100*t+")")}),this.attr("eggOpacity",t),this},e._displayMap={li:"list-item",table:"table",tr:"table-row",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",col:"table-column",colgroup:"table-column-group",th:"table-cell",td:"table-cell",caption:"table-caption",button:"inline-block",textarea:"inline-block",input:"inline-block",select:"inline-block"},e._blockTags=["html","address","blockquote","body","dd","div","dl","dt","embed","fieldset","form","frame","frameset","h1","h2","h3","h4","h5","h6","noframes","object","ol","p","ul","center","dir","hr","menu","pre"],e.method.show=function(){return e.each(this,function(t){if(t.eggDisplay&&"none"!=t.eggDisplay)t.style.display=t.eggDisplay;else{var n=t.tagName.toLowerCase();if(n.inArray(e._blockTags))t.style.display="block";else{var o="inline";e._displayMap[n]&&(o=e.browser.ie6||e.browser.ie7?"block":e._displayMap[n]),t.style.display=o}}t.eggDisplay&&t.removeAttribute("eggDisplay")}),this},e.method.hide=function(){return e.each(this,function(e){e.eggDisplay=e.style.display,e.style.display="none"}),this},e.method.pos=function(){for(var e=this.get(0),t=e.offsetLeft,n=e.offsetTop;e.offsetParent;)e=e.offsetParent,t+=e.offsetLeft,n+=e.offsetTop;return{x:t,y:n}},e.method.addEvent=function(t,n){return e.event.add(this.get(),t,n),this},e.method.removeEvent=function(t,n){return e.event.remove(this.get(),t,n),this},e.each("abort beforeunload blur change click contextmenu dblclick error focus keydown keypress keyup load mousedown mousemove mouseout mouseover mouseup reset resize scroll select submit unload".split(" "),function(t){e.method[t]=function(n){return n?e.event.add(this.get(),t,n):e.event.trigger(this.get(),t),this}}),e.method.hover=function(t,n){var o=this.get();return e.event.add(o,"mouseover",t),e.event.add(o,"mouseout",n),this},e.method.html=function(t){return void 0===t?this.get(0).innerHTML:("function"==typeof t&&(t=t.call(this)),e.each(this.get(),function(e){e.innerHTML=t}),this)},e.method.outterHtml=function(){if(0===this.size()||!document.body)return"";var t=document.createElement("div");this.appendTo(t),e(t).attr("id","eggTemp").css({visibility:"hidden",left:"-10000px",top:"-10000px"}).appendTo(document.body);var n=e("#eggTemp").html();return document.body.removeChild(t),n},e.method.val=function(t){var n,o=3,r=4;if(this._isXML){if(void 0===t){if(n=[],e.each(this.get(),function(e){e.nodeType!=o&&e.nodeType!=r&&(e=e.firstChild),e.nodeType==o||e.nodeType==r?n.push(e.nodeValue):n.push(void 0)}),0===n.length)return;return 1==n.length?n[0]:n}return e.each(this.get(),function(e){e.nodeType!=o&&e.nodeType!=r&&(e=e.firstChild),(e.nodeType==o||e.nodeType==r)&&("function"==typeof t&&(t=t.call(e)),e.nodeValue=t)}),this}if(void 0===t){if(n=[],e.each(this.get(),function(e){n.push(e.value)}),0===n.length)return;return 1==n.length?n[0]:n}return"function"==typeof t&&(t=t.call(this)),e.each(this.get(),function(e){e.value=t}),this},e.method.attr=function(t,n){if(void 0!==n)e.each(this.get(),function(e){e[t]=n});else{if("string"==typeof t){if(this.get(0))return this.get(0)[t];return}e.each(this.get(),function(e){for(var n in t)e[n]=t[n]})}return this},e.method.removeAttr=function(t){return"string"==typeof t&&(t=[t]),e.each(this.get(),function(e){for(var n=0,o=t.length;o>n;n++)e.removeAttribute(t[n])}),this},e.method.appendTo=function(t){return t.Egg&&(t=t.get(0)),e.each(this.get(),function(e){try{t.appendChild(e)}catch(n){}}),this},e.method.removeFrom=function(t){return t.Egg&&(t=t.get(0)),e.each(this.get(),function(e){try{t.removeChild(e),e=null}catch(n){}}),this},e.tooltip={counter:0,_getCursorPos:function(t,n){var o=e.body(),r=e.browser.webkit?document.body.scrollTop:o.scrollTop,i=e.browser.webkit?document.body.scrollLeft:o.scrollLeft,a=t.clientY+r+10,s=t.clientX+i+10,c=n.attr("offsetWidth"),l=n.attr("offsetHeight");return s+c>o.clientWidth+i&&(s-=c+20),a+l>o.clientHeight+r&&(a-=l+20),{x:s,y:a}}},e.method.tooltip=function(t,n){(typeof t).inArray(["string","function"])||(n=t,t=void 0),n=n||{};var o,r;switch(n.trigger){case"click":o=this.mousedown,r=this.mouseup;break;case"input":o=this.focus,r=this.blur;break;case"hover":}o=o||this.mouseover,r=r||this.mouseout;var i;return o.call(this,function(o){o=window.event||o;var r=e(o.srcElement||o.target),a=e(document.createElement("div")),s="egg_tip"+ ++e.tooltip.counter;r.attr("egg_my_tooltip_id",s);var c="cursor",l="cursor";if(n.position){n.position=n.position.toLowerCase();var u=n.position.split(" ");2==u.length&&(c=u[1],l=u[0]),c.inArray(["cursor","top","center","bottom","before","after"])||(c=parseInt(c,10),isNaN(c)&&(c="cursor")),l.inArray(["cursor","left","center","right","before","after"])||(l=parseInt(l,10),isNaN(l)&&(l="cursor"))}("cursor"==l||"cursor"==c)&&(i=function(t){t=window.event||t;var n=e.tooltip._getCursorPos(t,a);"cursor"==l&&a.css("left",n.x+"px"),"cursor"==c&&a.css("top",n.y+"px")},r.mousemove(i)),a.attr("id",s),n.className||n.css?(n.className&&a.attr("className",n.className),n.css&&a.css(n.css)):a.css({border:"solid 1px #b46600","background-color":"#fffad2",color:"#464646"});var f=t;"function"==typeof f&&(f=f.call(r)),f||(f=r.attr("title"))&&(r.attr("originalTitle",r.attr("title")),r.attr("title","")),f=f||"",a.css({"z-index":30,position:"absolute",visibility:"hidden"}).html(f).appendTo(document.body);var d,g,p=r.pos(),h=e.tooltip._getCursorPos(o,a);if("string"==typeof c)switch(c){case"top":d=p.y;break;case"center":d=parseInt(p.y+r.attr("offsetHeight")/2-a.attr("offsetHeight")/2,10);break;case"bottom":d=p.y+r.attr("offsetHeight")-a.attr("offsetHeight");break;case"before":d=p.y-a.attr("offsetHeight");break;case"after":d=p.y+r.attr("offsetHeight");break;case"cursor":d=h.y}else d=c;if("string"==typeof l)switch(l){case"left":g=p.x;break;case"center":g=parseInt(p.x+r.attr("offsetWidth")/2-a.attr("offsetWidth")/2,10);break;case"right":g=p.x+r.attr("offsetWidth")-a.attr("offsetWidth");break;case"before":g=p.x-a.attr("offsetWidth");break;case"after":g=p.x+r.attr("offsetWidth");break;case"cursor":g=h.x}else g=l;n.offset&&"cursor"!=l&&(g+=parseInt(n.offset[0],10)),n.offset&&"cursor"!=c&&(d+=parseInt(n.offset[1],10));var m=function(){a.css({left:g+"px",top:d+"px",visibility:"visible"}),n.onShow&&n.onShow.call(r,a)};n.delay&&parseInt(n.delay,10)>0?setTimeout(m,n.delay):m()}),r.call(this,function(t){t=window.event||t;var o=e(t.srcElement||t.target);e("#"+o.attr("egg_my_tooltip_id")).removeFrom(document.body),e.tooltip.counter--,o.attr("title",o.attr("originalTitle")),o.removeEvent("mousemove",i),n.onHide&&n.onHide.call(o)}),this},e.cookie={get:function(e){e="; "+e+"=";var t="; "+document.cookie,n=t.indexOf(e,0);if(-1==n)return"";var o=t.indexOf(";",n+1);return-1==o&&(o=t.length),unescape(t.substring(n+e.length,o))},set:function(e,t,n,o,r,i){if(void 0===e||void 0===t)return!1;var a=e+"="+escape(t);if(n&&(a+=";domain="+n),"number"==typeof r){var s=new Date;s.setDate(s.getDate()+r),a+=";expires="+s.toGMTString()}else r&&(a+=";expires="+r);return o&&(a+=";path="+o),i&&(a+=";secure"),document.cookie=a,!0},del:function(e,t,n){if(void 0===e)return!1;var o=e+"=";return void 0!==t&&(o+=";domain="+t),o+=";expires=Thu, 01-Jan-1970 00:00:01 GMT",void 0!==n&&(o+=";path="+n),document.cookie=o,!0}},e.event={add:function(t,n,o){e.each(t,function(t){try{t.attachEvent?t.attachEvent("on"+n,o):e.browser.opera?t["on"+n]=o:t.addEventListener(n,o,!1)}catch(r){}})},remove:function(t,n,o){e.each(t,function(e){try{e.detachEvent?e.detachEvent("on"+n,o):e.removeEventListener(n,o,!1)}catch(t){}})},trigger:function(t,n,o){o=o||{},e.each(t,function(){try{if(this.fireEvent)this.fireEvent("on"+n);else{var e=null;switch(n){case"abort":case"change":case"error":case"load":case"reset":case"resize":case"scroll":case"select":case"submit":case"unload":e=document.createEvent("Event"),e.initEvent(n,!0,!0);break;case"keydown":case"keypress":case"keyup":e=document.createEvent("KeyboardEvent"),e.initKeyEvent(n,!0,!0,window,o.ctrlKey||!1,o.altKey||!1,o.shiftKey||!1,o.metaKey||!1,o.keyCode||0,o.charCode||0);break;case"click":case"dblclick":case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"mouseout":e=document.createEvent("MouseEvent"),e.initMouseEvent(n,!0,!0,window,o.detail||0,o.screenX||0,o.screenY||0,o.clientX||0,o.clientY||0,o.ctrlKey||!1,o.altKey||!1,o.shiftKey||!1,o.metaKey||!1,o.button||0,o.relatedTarget||null);break;case"focus":case"blur":e=document.createEvent("UIEvent"),e.initUIEvent(n,!0,!0,window,o.detail||0);break;default:return}this.dispatchEvent(e)}}catch(t){}})},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},stop:function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}},e.body=function(e){return e=e||document,e.compatMode&&"CSS1Compat"==e.compatMode?e.documentElement:e.body},e.lightbox=function(t,n){if(n=n||{},!n._ajaxCompleted&&t.match&&t.match(/^\/(?:ajax|editor)\/.+$/))return void e.ajax({url:t,method:n.ajaxMethod||"GET",param:n.ajaxParam||"",success:function(t){n._ajaxCompleted=!0,e.lightbox(t,n)}});var o=e.body(),r=e(document.createElement("div")),i=o.clientWidth>o.scrollWidth?o.clientWidth:o.scrollWidth,a=o.clientHeight>o.scrollHeight?o.clientHeight:o.scrollHeight;r.attr("id","egg_mask").opacity(.7).css({position:"absolute",top:"0px",left:"0px",zIndex:95,backgroundColor:n.maskBgColor||"black",width:i+"px",height:a+"px"});var s;s="none"==n.closeTrigger?function(e){}:"function"==typeof n.closeTrigger?n.closeTrigger:e.lightbox.close,r.click(s);var c=e(document.createElement("div")),l=n.absolute?"absolute":"fixed";e.browser.ie&&(l="absolute",n.absolute||e.browser.ie6||!document.compatMode||"CSS1Compat"!=document.compatMode||(l="fixed")),c.attr("id","egg_box").css({position:l,textAlign:"center",zIndex:96,visibility:"hidden"}),n.hide&&c.attr("egg-data",n.hide),n.className&&c.attr("className",n.className),n.css&&c.css(n.css),"object"==typeof t?(c.html(""),e(t).appendTo(c)):(t.match&&t.match(/^[#\.][A-Za-z][A-za-z0-9-_:\.]*$/)&&(t=e(t).html()),c.html(t)),c.attr({originalScrollWidth:i,originalScrollHeight:a});var u=n.hide||"select, object, embed";return e(u).css("visibility","hidden"),r.appendTo(document.body),c.appendTo(document.body),this.refresh=e.lightbox.refresh,this.close=s,this.refresh(),c.css("visibility","visible"),this},e.lightbox.open=e.lightbox,e.lightbox.close=function(){var t=e("#egg_box").attr("egg-data")||"select, object, embed";e(t).css("visibility","visible"),e("#egg_mask").removeFrom(document.body),e("#egg_box").removeFrom(document.body)},e.lightbox.refresh=function(t,n){var o=e("#egg_box"),r=e.body();if(0!==o.size()){if(void 0!==t){var i=n?e(n):o;"object"==typeof t?(i.html(""),e(t).appendTo(i)):(t.match&&t.match(/^[#\.][A-Za-z][A-za-z0-9-_:\.]*$/)&&(t=e(t).html()),i.html(t))}var a,s,c,l;a=o.get(0).offsetWidth,s=o.get(0).offsetHeight,c=Math.floor(r.clientHeight/2-s/2),"absolute"==o.css("position")&&(c+=e.browser.webkit?document.body.scrollTop:r.scrollTop),c+s>o.attr("originalScrollHeight")&&(c=o.attr("originalScrollHeight")-s),0>c&&(c=0),l=Math.floor(r.clientWidth/2-a/2),0>l&&(l=0),o.css({left:l+"px",top:c+"px"});var u=r.clientWidth>r.scrollWidth?r.clientWidth:r.scrollWidth,f=r.clientHeight>r.scrollHeight?r.clientHeight:r.scrollHeight;e("#egg_mask").css({width:u+"px",height:f+"px"})}},e.bahabox=function(t,n,o,r){if(r=r||{},!r._ajaxCompleted&&t.match&&t.match(/^\/(?:ajax|editor)\/.+$/))return void e.ajax({url:t,method:r.ajaxMethod||"GET",param:r.ajaxParam||"",success:function(t){r._ajaxCompleted=!0,e.bahabox(t,n,o,r)}});var i="open_win"==r.className,a="";n&&(a+=i?'<h1 class="open_wintitle"><img src="https://i2.bahamut.com.tw/h1_img.gif">'+n+"</h1>":'<p class="BH-poptitle">'+n+"</p>"),"object"==typeof t?t=e(t).outterHtml():t.match&&t.match(/^[#\.][A-Za-z][A-za-z0-9-_:\.]*$/)&&(t=e(t).html()),a+=i?"<div>"+t+"</div>":'<div class="BH-popintxt">'+t+"</div>";var s,c=[];for(var l in o)c.push(document.createElement("button")),s=c[c.length-1],s.onclick=o[l]||function(){},s.innerHTML=l;r.closeButton=void 0===r.closeButton?!0:r.closeButton,r.closeButton&&(c.push(document.createElement("button")),s=c[c.length-1],s.onclick=function(){e.lightbox.close()},s.innerHTML="關閉");var u=i?"open_winbtn":"BH-popbtns";(o||r.closeButton)&&(a+='<p class="'+u+'"></p>'),r.className=r.className||"BH-popup";var f=e.lightbox(a,r);return f.refresh=e.bahabox.refresh,e("."+u).size()&&e(c).appendTo(e("."+u)),f},e.bahabox.refresh=function(t){e.lightbox.refresh(t,".BH-popintxt")},e.bahabox.option=function(t,n){if("string"==typeof t){var o={};o[t]=n,t=o}for(var r in t)switch(r){case"css":e("#egg_box").css(t[r]);break;case"width":e("#egg_box").css("width",t[r]);break;case"title":e(".BH-poptitle").html(t[r]);break;case"buttons":if(0===e(".BH-popbtns").size())break;var i,a=t[r];for(var s in a){var c=e(".BH-popbtns button:contains("+s+")");c.size()?c.get(0).onclick=a[s]:(i=document.createElement("button"),i.onclick=a[s],i.innerHTML=s,e(i).appendTo(e(".BH-popbtns")))}}},e.mutbox=function(t,n,o,r){r=r||{},r.className="open_win",e.bahabox(t,n,o,r)},e.mutbox.refresh=function(t){e.lightbox.refresh(t,".open_win > div:eq(0)")},e.mutbox.option=function(t,n){e.bahabox.option(t,n)},e.msgbox=function(t,n){if(!(e("#egg_msgbox").size()>0)){n=n||e.msgbox.configure||{};var o,r,i=e.body();n.modeless||(r=e(document.createElement("div")),r.attr("id","egg_msgbox_mask").opacity(0).css({position:"absolute",top:"0px",left:"0px",zIndex:97,"background-color":"black",width:i.scrollWidth+"px",height:i.scrollHeight+"px"}).appendTo(document.body));var a=n.width||350,s=n.height||22,c=n.absolute?"absolute":"fixed";o=e(document.createElement("div")),e.browser.ie&&(c="absolute",n.absolute||e.browser.ie6||!document.compatMode||"CSS1Compat"!=document.compatMode||(c="fixed")),o.css({"background-color":"white",position:c,zIndex:98,border:"solid 1px #CCCCCC","border-top":"none",width:a+"px",visibility:"hidden"}).html(e.msgbox._getBasicLayout).attr({id:"egg_msgbox",originalScrollWidth:i.scrollWidth,originalScrollHeight:i.scrollHeight}).appendTo(document.body);var l=e("#egg_msgbox_content"),u=e("#egg_msgbox_title"),f=e("#egg_msgbox_title_text"),d=e("#egg_msgbox_closeButton"),g=e("#egg_msgbox_buttons");l.html(t),f.html(n.title||"訊息"),u.mousedown(e.msgbox._drag),u.css({width:"100%",height:"30px","line-height":"30px","background-image":"url(https://i2.bahamut.com.tw/h1_bg.gif)","vertical-align":"middle",color:"#117e96","font-weight":"bold","font-family":"Arial","font-size":"12pt",cursor:"move"}),d.css({cursor:e.browser.ie?"hand":"pointer"}).mousedown(e.msgbox.close).attr("title","關閉"),l.css({width:"100%",color:"black",height:s+"px","vertical-align":"middle","line-height":"24px","font-family":"Arial","font-size":"15px",padding:"15px"});var p='<table cellspacing="0" cellpadding="0" border="0" width="100%">';p+='<tr id="egg_msgbox_btn_table"></tr></table>',g.css({width:"100%","text-align":"center",padding:"0 10px 10px 10px"}).html(p);var h=e("#egg_msgbox_btn_table").get(0);n.buttons&e.msgbox.OK&&e.msgbox._createButton("確定",n.onOk).appendTo(h),n.buttons&e.msgbox.YES&&e.msgbox._createButton("是",n.onYes).appendTo(h);for(var m in n.customButtons){var b=n.customButtons[m];e.msgbox._createButton(b.label,b.click,b.config).appendTo(h)}n.buttons&e.msgbox.NO&&e.msgbox._createButton("否",n.onNo).appendTo(h),n.buttons&e.msgbox.CANCEL&&e.msgbox._createButton("取消",n.onCancel||e.msgbox.close).appendTo(h),e.msgbox._setMsgBoxPosition(o),o.css("visibility","visible");var v={box:o,title:u,content:l};n.onShow&&(ret=n.onShow.call(v)),n.buttons||n.customButtons||n.onHide?r&&r.click(e.msgbox._notify):e.msgbox._fadeOutTimer=setTimeout(e.msgbox._fadeOut,2500)}},e.msgbox.OK=1,e.msgbox.CANCEL=2,e.msgbox.YES=4,e.msgbox.NO=8,e.msgbox._isDragging=!1,e.msgbox._fadeOutTimer=0,e.msgbox.configure={},e.msgbox.setConfigure=function(t){e.msgbox.configure=t||{}},e.msgbox.close=function(){clearTimeout(e.msgbox._fadeOutTimer);var t=e("#egg_msgbox");if(0!==t.size()){var n={box:t,title:e("#egg_msgbox_title"),content:e("#egg_msgbox_content")},o=!0;e.msgbox.configure.onHide&&(o=e.msgbox.configure.onHide.call(n)),o&&e("#egg_msgbox,#egg_msgbox_mask").removeFrom(document.body)}},e.msgbox._drag=function(t){t=window.event||t;var n=e.browser.ie?1:0;if(t.button===n){e.msgbox._isDragging=!0;var o=e("#egg_msgbox"),r=e.body(),i=t.clientX+r.scrollLeft,a=t.clientY+r.scrollTop,s=e(document.createElement("div"));s.opacity(0).attr({id:"egg_msgbox_cover",unselectable:"on",eggMsgboxDragLeft:i-o.attr("offsetLeft"),eggMsgboxDragTop:a-o.attr("offsetTop")}).css({backgroundColor:"red",width:"150px",height:"150px",position:"absolute",left:i-75+"px",top:a-75+"px",zIndex:99,cursor:"move"}).mousemove(e.msgbox._dragging).mouseup(e.msgbox._drop).mouseout(e.msgbox._drop).appendTo(document.body),e.event.preventDefault(t)}},e.msgbox._drop=function(t){t=window.event||t,e.msgbox._isDragging=!1,e("#egg_msgbox_cover").removeFrom(document.body),e.event.preventDefault(t)},e.msgbox._dragging=function(t){if(e.msgbox._isDragging){t=window.event||t;var n=e("#egg_msgbox_cover"),o=e.body(),r=t.clientX+o.scrollLeft,i=t.clientY+o.scrollTop;e("#egg_msgbox").css({left:r-n.attr("eggMsgboxDragLeft")+"px",top:i-n.attr("eggMsgboxDragTop")+"px"}),n.css({left:r-75+"px",top:i-75+"px"}),e.event.preventDefault(t)}},e.msgbox._notify=function(){var t=e("#egg_msgbox"),n=0,o=function(){var e=t.attr("eggOpacity")||1;e=1==parseFloat(e)?.5:1,t.opacity(e),5>n&&(n++,setTimeout(o,80))};o()},e.msgbox._fadeOut=function(t){e.browser.ie&&e.msgbox.close(),t=t||30;var n=function(){var o=e("#egg_msgbox");if(0!==o.size()){var r=o.attr("eggOpacity");void 0===r&&(r=1),r-=.2,r=Math.round(100*r)/100,0>r&&(r=0),o.opacity(r),r>0?setTimeout(n,t):e.msgbox.close()}};n()},e.msgbox._setMsgBoxPosition=function(t){var n,o,r,i,a=e.body();n=t.attr("offsetWidth"),o=t.attr("offsetHeight"),r=Math.floor(a.clientHeight/2-o/2),"absolute"==t.css("position")&&(r+=a.scrollTop),r+o>t.attr("originalScrollHeight")&&(r=t.attr("originalScrollHeight")-o),0>r&&(r=0),i=Math.floor(a.clientWidth/2-n/2),0>i&&(i=0),t.css({left:i+"px",top:r+"px"}),e("#egg_msgbox_mask").css({width:a.scrollWidth+"px",height:a.scrollHeight+"px"})},e.msgbox._getBasicLayout=function(){var e="";return e+='<div id="egg_msgbox_title">',e+='<img style="float:right; margin:9px 5px 0 0;" id="egg_msgbox_closeButton" src="https://i2.bahamut.com.tw/close.gif" />',e+='<img style="float:left; margin-right:5px;" src="https://i2.bahamut.com.tw/h1_img.gif" />',e+='<span id="egg_msgbox_title_text"></span>',e+="</div>",e+='<div id="egg_msgbox_content"></div>',e+='<div id="egg_msgbox_buttons"></div>'},e.msgbox._createButton=function(t,n,o){o=o||{};var r=e(document.createElement("td"));r.css({"text-align":"center"});var i=e(document.createElement("input"));return i.attr({type:"button",value:t}).css("width","80px"),"function"==typeof n&&i.click(n),o.css&&i.css(o.css),o.className&&i.attr("className",o.className),i.appendTo(r.get(0)),r},e._ajaxFunctions={},e.ajaxLoading=function(t){e._ajaxFunctions.loading=t},e.ajaxLoaded=function(t){e._ajaxFunctions.loaded=t},e.ajaxCompleted=function(t){e._ajaxFunctions.completed=t},e.ajax=function(t){var n=null,o=!1,r=/^\/(?:ajax|editor)\/.+/;if(!t.url.match(r))throw"url incorrect";try{n=new window.XMLHttpRequest}catch(i){n=new ActiveXObject("Microsoft.XMLHTTP")}if(null===n)throw"create XmlHttpRequest instance failed!";n.onreadystatechange=function(){switch(n.readyState){case 1:!o&&t.loading&&t.loading.call(t.context,n),!o&&e._ajaxFunctions.loading&&e._ajaxFunctions.loading.call(t.context,n);break;case 2:t.loaded&&t.loaded.call(t.context,n),e._ajaxFunctions.loaded&&e._ajaxFunctions.loaded.call(t.context,n);break;case 4:if(o=!0,e._ajaxFunctions.completed&&e._ajaxFunctions.completed.call(t.context,n),200==n.status){if(t.success){var r=n.getResponseHeader("content-type"),i=-1!=r.indexOf("xml")?n.responseXML:n.responseText;t.success.call(t.context,i,n)}}else t.fail&&t.fail(t.context,n.status,n)}},t.param&&(t.data=t.param),t.data=t.data||null,t.method=t.method||"GET",t.async=t.async||"","SYNC"==t.async?t.async=!1:t.async=!0,t.cache===!1&&(t.data?t.data+="&_="+(new Date).getTime():t.data="_="+(new Date).getTime()),t.method=t.method.toUpperCase(),"GET"==t.method&&t.data&&(t.url+="?"+t.data,t.data=null),t.username?n.open(t.method,t.url,t.async,t.username,t.password):n.open(t.method,t.url,t.async),n.setRequestHeader("content-type","application/x-www-form-urlencoded"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(t.data),t.timeout&&t.timeout>0&&setTimeout(function(){if(n&&!o)throw n.abort(),"timeout"},t.timeout)},e.get=function(t,n,o,r){e.ajax({method:"GET",url:t,data:n,cache:r,success:o})},e.post=function(t,n,o,r){e.ajax({method:"POST",url:t,data:n,cache:r,success:o})},e.sprintf=function(t){return e.sprintf._sprintf_(t,arguments,1)},e.sprintf.FREGEXP=/^([^%]*)%([-+])?(0)?(\d+)?(\.(\d+))?([doxXcsf])(.*)$/,e.sprintf.HDIGITS=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],e.sprintf._empty=function(e){return void 0===e||null===e?!0:""===e?!0:!1},e.sprintf._int_=function(e){return Math.floor(e)},e.sprintf._printf_num_=function(t,n,o,r,i){if(t=parseInt(t,10),isNaN(t))return"NaN";var a=0>t?-t:t,s="";if(0===a)s="0";else for(;a>0;)s=e.sprintf.HDIGITS[a%n]+s,a=e.sprintf._int_(a/n);return 0>t&&(s="-"+s),"-"==r&&(o=" "),e.sprintf._printf_str_(s,o,r,i,-1)},e.sprintf._printf_float_=function(e,t,n,o,r){if(void 0===r){if(parseInt(e,10)!=e)return""+e;r=5}var i=Math.pow(10,r),a=""+Math.round(e*i),s=a.length-r;return 0===s?"0."+a.substr(s,r):a.substr(0,s)+"."+a.substr(s,r)},e.sprintf._printf_str_=function(e,t,n,o,r){var i;if(void 0===e)return"(undefined)";if(null===e)return"(null)";if((i=o-e.length)>0)if("-"==n)for(;i>0;)e+=t,i--;else for(;i>0;)e=t+e,i--;return r>0?e.substr(0,r):e},e.sprintf._sprintf_=function(t,n,o){var r,i,a,s="";for(i=t.split("\n"),r=0;r<i.length;r++){for(r>0&&(s+="\n"),t=i[r];a=e.sprintf.FREGEXP.exec(t);){var c="",l=" ";e.sprintf._empty(a[1])||(s+=a[1]),e.sprintf._empty(a[2])||(c=a[2]),e.sprintf._empty(a[3])||(l="0");var u=a[4],f=a[6],d=a[7];if(t=a[8],o>=n.length)s+="[missing parameter for type '"+d+"']";else{var g=n[o++];switch(d){case"d":s+=e.sprintf._printf_num_(g,10,l,c,u);break;case"o":s+=e.sprintf._printf_num_(g,8,l,c,u);break;case"x":s+=e.sprintf._printf_num_(g,16,l,c,u);break;case"X":s+=e.sprintf._printf_num_(g,16,l,c,u).toUpperCase();break;case"c":s+=String.fromCharCode(parseInt(g,10));break;case"s":s+=e.sprintf._printf_str_(g,l,c,u,f);break;case"f":s+=e.sprintf._printf_float_(g,l,c,u,f);break;default:s+="[unknown format '"+d+"']"}}}s+=t}return s},e.extend=e.selector.prototype,window.egg=window.$=e}(),String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")},String.prototype.equals=function(e,t){return t?this==e:this.trim().toLowerCase()==e.trim().toLowerCase()},String.prototype.inArray=function(e,t){var n=this;t&&(n=n.toLowerCase());for(var o=0;o<e.length;o++)if(t&&(e[o]=e[o].toLowerCase()),n==e[o])return!0;return!1},String.prototype.utf8Length=function(){var e=this.match(/[^\x00-\xff]/gi);return null===e?this.length:this.length+2*e.length},function(){function e(e,t,n,o,r,i){for(var a=0,s=o.length;s>a;a++){var c=o[a];if(c){var l=!1;for(c=c[e];c;){if(c.sizcache===n){l=o[c.sizset];break}if(1!==c.nodeType||i||(c.sizcache=n,c.sizset=a),c.nodeName.toLowerCase()===t){l=c;break}c=c[e]}o[a]=l}}}function t(e,t,n,o,r,i){for(var a=0,s=o.length;s>a;a++){var c=o[a];if(c){var u=!1;for(c=c[e];c;){if(c.sizcache===n){u=o[c.sizset];break}if(1===c.nodeType)if(i||(c.sizcache=n,c.sizset=a),"string"!=typeof t){if(c===t){u=!0;break}}else if(l.filter(t,[c]).length>0){u=c;break}c=c[e]}o[a]=u}}}var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,o=0,r=Object.prototype.toString,i=!1,a=!0,s=/\\/g,c=/\W/;[0,0].sort(function(){return a=!1,0});var l=function(e,t,o,i){o=o||[],t=t||document;var a=t;if(1!==t.nodeType&&9!==t.nodeType)return[];if(!e||"string"!=typeof e)return o;var s,c,d,g,h,m,b,x,y=!0,_=l.isXML(t),w=[],T=e;do if(n.exec(""),s=n.exec(T),s&&(T=s[3],w.push(s[1]),s[2])){g=s[3];break}while(s);if(w.length>1&&f.exec(e))if(2===w.length&&u.relative[w[0]])c=v(w[0]+w[1],t);else for(c=u.relative[w[0]]?[t]:l(w.shift(),t);w.length;)e=w.shift(),u.relative[e]&&(e+=w.shift()),c=v(e,c);else if(!i&&w.length>1&&9===t.nodeType&&!_&&u.match.ID.test(w[0])&&!u.match.ID.test(w[w.length-1])&&(h=l.find(w.shift(),t,_),t=h.expr?l.filter(h.expr,h.set)[0]:h.set[0]),t)for(h=i?{expr:w.pop(),set:p(i)}:l.find(w.pop(),1!==w.length||"~"!==w[0]&&"+"!==w[0]||!t.parentNode?t:t.parentNode,_),c=h.expr?l.filter(h.expr,h.set):h.set,w.length>0?d=p(c):y=!1;w.length;)m=w.pop(),b=m,u.relative[m]?b=w.pop():m="",null==b&&(b=t),u.relative[m](d,b,_);else d=w=[];if(d||(d=c),d||l.error(m||e),"[object Array]"===r.call(d))if(y)if(t&&1===t.nodeType)for(x=0;null!=d[x];x++)d[x]&&(d[x]===!0||1===d[x].nodeType&&l.contains(t,d[x]))&&o.push(c[x]);else for(x=0;null!=d[x];x++)d[x]&&1===d[x].nodeType&&o.push(c[x]);else o.push.apply(o,d);else p(d,o);return g&&(l(g,a,o,i),l.uniqueSort(o)),o};l.uniqueSort=function(e){if(m&&(i=a,e.sort(m),i))for(var t=1;t<e.length;t++)e[t]===e[t-1]&&e.splice(t--,1);return e},l.matches=function(e,t){return l(e,null,null,t)},l.matchesSelector=function(e,t){return l(t,null,null,[e]).length>0},l.find=function(e,t,n){var o;if(!e)return[];for(var r=0,i=u.order.length;i>r;r++){var a,c=u.order[r];if(a=u.leftMatch[c].exec(e)){var l=a[1];if(a.splice(1,1),"\\"!==l.substr(l.length-1)&&(a[1]=(a[1]||"").replace(s,""),o=u.find[c](a,t,n),null!=o)){e=e.replace(u.match[c],"");break}}}return o||(o="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName("*"):[]),{set:o,expr:e}},l.filter=function(e,t,n,o){for(var r,i,a=e,s=[],c=t,f=t&&t[0]&&l.isXML(t[0]);e&&t.length;){for(var d in u.filter)if(null!=(r=u.leftMatch[d].exec(e))&&r[2]){var g,p,h=u.filter[d],m=r[1];if(i=!1,r.splice(1,1),"\\"===m.substr(m.length-1))continue;if(c===s&&(s=[]),u.preFilter[d])if(r=u.preFilter[d](r,c,n,s,o,f)){if(r===!0)continue}else i=g=!0;if(r)for(var b=0;null!=(p=c[b]);b++)if(p){g=h(p,r,b,c);var v=o^!!g;n&&null!=g?v?i=!0:c[b]=!1:v&&(s.push(p),i=!0)}if(void 0!==g){if(n||(c=s),e=e.replace(u.match[d],""),!i)return[];break}}if(e===a){if(null!=i)break;l.error(e)}a=e}return c},l.error=function(e){throw"Syntax error, unrecognized expression: "+e};var u=l.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(e,t){var n="string"==typeof t,o=n&&!c.test(t),r=n&&!o;o&&(t=t.toLowerCase());for(var i,a=0,s=e.length;s>a;a++)if(i=e[a]){for(;(i=i.previousSibling)&&1!==i.nodeType;);e[a]=r||i&&i.nodeName.toLowerCase()===t?i||!1:i===t}r&&l.filter(t,e,!0)},">":function(e,t){var n,o="string"==typeof t,r=0,i=e.length;if(o&&!c.test(t)){for(t=t.toLowerCase();i>r;r++)if(n=e[r]){var a=n.parentNode;e[r]=a.nodeName.toLowerCase()===t?a:!1}}else{for(;i>r;r++)n=e[r],n&&(e[r]=o?n.parentNode:n.parentNode===t);o&&l.filter(t,e,!0)}},"":function(n,r,i){var a,s=o++,l=t;"string"!=typeof r||c.test(r)||(r=r.toLowerCase(),a=r,l=e),l("parentNode",r,s,n,a,i)},"~":function(n,r,i){var a,s=o++,l=t;"string"!=typeof r||c.test(r)||(r=r.toLowerCase(),a=r,l=e),l("previousSibling",r,s,n,a,i)}},find:{ID:function(e,t,n){if("undefined"!=typeof t.getElementById&&!n){var o=t.getElementById(e[1]);return o&&o.parentNode?[o]:[]}},NAME:function(e,t){if("undefined"!=typeof t.getElementsByName){for(var n=[],o=t.getElementsByName(e[1]),r=0,i=o.length;i>r;r++)o[r].getAttribute("name")===e[1]&&n.push(o[r]);return 0===n.length?null:n}},TAG:function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e[1]):void 0}},preFilter:{CLASS:function(e,t,n,o,r,i){if(e=" "+e[1].replace(s,"")+" ",i)return e;for(var a,c=0;null!=(a=t[c]);c++)a&&(r^(a.className&&(" "+a.className+" ").replace(/[\t\n\r]/g," ").indexOf(e)>=0)?n||o.push(a):n&&(t[c]=!1));return!1},ID:function(e){return e[1].replace(s,"")},TAG:function(e,t){return e[1].replace(s,"").toLowerCase()},CHILD:function(e){if("nth"===e[1]){e[2]||l.error(e[0]),e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===e[2]&&"2n"||"odd"===e[2]&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0,e[3]=t[3]-0}else e[2]&&l.error(e[0]);return e[0]=o++,e},ATTR:function(e,t,n,o,r,i){var a=e[1]=e[1].replace(s,"");return!i&&u.attrMap[a]&&(e[1]=u.attrMap[a]),e[4]=(e[4]||e[5]||"").replace(s,""),"~="===e[2]&&(e[4]=" "+e[4]+" "),e},PSEUDO:function(e,t,o,r,i){if("not"===e[1]){if(!((n.exec(e[3])||"").length>1||/^\w/.test(e[3]))){var a=l.filter(e[3],t,o,!0^i);return o||r.push.apply(r,a),!1}e[3]=l(e[3],null,null,t)}else if(u.match.POS.test(e[0])||u.match.CHILD.test(e[0]))return!0;return e},POS:function(e){return e.unshift(!0),e}},filters:{enabled:function(e){return e.disabled===!1&&"hidden"!==e.type},disabled:function(e){return e.disabled===!0},checked:function(e){return e.checked===!0},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!l(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return"input"===e.nodeName.toLowerCase()&&"text"===n&&(t===n||null===t)},radio:function(e){return"input"===e.nodeName.toLowerCase()&&"radio"===e.type},checkbox:function(e){return"input"===e.nodeName.toLowerCase()&&"checkbox"===e.type},file:function(e){return"input"===e.nodeName.toLowerCase()&&"file"===e.type},password:function(e){
return"input"===e.nodeName.toLowerCase()&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&"submit"===e.type},image:function(e){return"input"===e.nodeName.toLowerCase()&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return 0===t},last:function(e,t,n,o){return t===o.length-1},even:function(e,t){return t%2===0},odd:function(e,t){return t%2===1},lt:function(e,t,n){return t<n[3]-0},gt:function(e,t,n){return t>n[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,o){var r=t[1],i=u.filters[r];if(i)return i(e,n,t,o);if("contains"===r)return(e.textContent||e.innerText||l.getText([e])||"").indexOf(t[3])>=0;if("not"===r){for(var a=t[3],s=0,c=a.length;c>s;s++)if(a[s]===e)return!1;return!0}l.error(r)},CHILD:function(e,t){var n=t[1],o=e;switch(n){case"only":case"first":for(;o=o.previousSibling;)if(1===o.nodeType)return!1;if("first"===n)return!0;o=e;case"last":for(;o=o.nextSibling;)if(1===o.nodeType)return!1;return!0;case"nth":var r=t[2],i=t[3];if(1===r&&0===i)return!0;var a=t[0],s=e.parentNode;if(s&&(s.sizcache!==a||!e.nodeIndex)){var c=0;for(o=s.firstChild;o;o=o.nextSibling)1===o.nodeType&&(o.nodeIndex=++c);s.sizcache=a}var l=e.nodeIndex-i;return 0===r?0===l:l%r===0&&l/r>=0}},ID:function(e,t){return 1===e.nodeType&&e.getAttribute("id")===t},TAG:function(e,t){return"*"===t&&1===e.nodeType||e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],o=u.attrHandle[n]?u.attrHandle[n](e):null!=e[n]?e[n]:e.getAttribute(n),r=o+"",i=t[2],a=t[4];return null==o?"!="===i:"="===i?r===a:"*="===i?r.indexOf(a)>=0:"~="===i?(" "+r+" ").indexOf(a)>=0:a?"!="===i?r!==a:"^="===i?0===r.indexOf(a):"$="===i?r.substr(r.length-a.length)===a:"|="===i?r===a||r.substr(0,a.length+1)===a+"-":!1:r&&o!==!1},POS:function(e,t,n,o){var r=t[2],i=u.setFilters[r];return i?i(e,n,t,o):void 0}}},f=u.match.POS,d=function(e,t){return"\\"+(t-0+1)};for(var g in u.match)u.match[g]=new RegExp(u.match[g].source+/(?![^\[]*\])(?![^\(]*\))/.source),u.leftMatch[g]=new RegExp(/(^(?:.|\r|\n)*?)/.source+u.match[g].source.replace(/\\(\d+)/g,d));var p=function(e,t){return e=Array.prototype.slice.call(e,0),t?(t.push.apply(t,e),t):e};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(h){p=function(e,t){var n=0,o=t||[];if("[object Array]"===r.call(e))Array.prototype.push.apply(o,e);else if("number"==typeof e.length)for(var i=e.length;i>n;n++)o.push(e[n]);else for(;e[n];n++)o.push(e[n]);return o}}var m,b;document.documentElement.compareDocumentPosition?m=function(e,t){return e===t?(i=!0,0):e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t)?-1:1:e.compareDocumentPosition?-1:1}:(m=function(e,t){if(e===t)return i=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,o,r=[],a=[],s=e.parentNode,c=t.parentNode,l=s;if(s===c)return b(e,t);if(!s)return-1;if(!c)return 1;for(;l;)r.unshift(l),l=l.parentNode;for(l=c;l;)a.unshift(l),l=l.parentNode;n=r.length,o=a.length;for(var u=0;n>u&&o>u;u++)if(r[u]!==a[u])return b(r[u],a[u]);return u===n?b(e,a[u],-1):b(r[u],t,1)},b=function(e,t,n){if(e===t)return n;for(var o=e.nextSibling;o;){if(o===t)return-1;o=o.nextSibling}return 1}),l.getText=function(e){for(var t,n="",o=0;e[o];o++)t=e[o],3===t.nodeType||4===t.nodeType?n+=t.nodeValue:8!==t.nodeType&&(n+=l.getText(t.childNodes));return n},function(){var e=document.createElement("div"),t="script"+(new Date).getTime(),n=document.documentElement;e.innerHTML="<a name='"+t+"'/>",n.insertBefore(e,n.firstChild),document.getElementById(t)&&(u.find.ID=function(e,t,n){if("undefined"!=typeof t.getElementById&&!n){var o=t.getElementById(e[1]);return o?o.id===e[1]||"undefined"!=typeof o.getAttributeNode&&o.getAttributeNode("id").nodeValue===e[1]?[o]:void 0:[]}},u.filter.ID=function(e,t){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return 1===e.nodeType&&n&&n.nodeValue===t}),n.removeChild(e),n=e=null}(),function(){var e=document.createElement("div");e.appendChild(document.createComment("")),e.getElementsByTagName("*").length>0&&(u.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if("*"===e[1]){for(var o=[],r=0;n[r];r++)1===n[r].nodeType&&o.push(n[r]);n=o}return n}),e.innerHTML="<a href='#'></a>",e.firstChild&&"undefined"!=typeof e.firstChild.getAttribute&&"#"!==e.firstChild.getAttribute("href")&&(u.attrHandle.href=function(e){return e.getAttribute("href",2)}),e=null}(),document.querySelectorAll&&!function(){var e=l,t=document.createElement("div"),n="__sizzle__";if(t.innerHTML="<p class='TEST'></p>",!t.querySelectorAll||0!==t.querySelectorAll(".TEST").length){l=function(t,o,r,i){if(o=o||document,!i&&!l.isXML(o)){var a=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(a&&(1===o.nodeType||9===o.nodeType)){if(a[1])return p(o.getElementsByTagName(t),r);if(a[2]&&u.find.CLASS&&o.getElementsByClassName)return p(o.getElementsByClassName(a[2]),r)}if(9===o.nodeType){if("body"===t&&o.body)return p([o.body],r);if(a&&a[3]){var s=o.getElementById(a[3]);if(!s||!s.parentNode)return p([],r);if(s.id===a[3])return p([s],r)}try{return p(o.querySelectorAll(t),r)}catch(c){}}else if(1===o.nodeType&&"object"!==o.nodeName.toLowerCase()){var f=o,d=o.getAttribute("id"),g=d||n,h=o.parentNode,m=/^\s*[+~]/.test(t);d?g=g.replace(/'/g,"\\$&"):o.setAttribute("id",g),m&&h&&(o=o.parentNode);try{if(!m||h)return p(o.querySelectorAll("[id='"+g+"'] "+t),r)}catch(b){}finally{d||f.removeAttribute("id")}}}return e(t,o,r,i)};for(var o in e)l[o]=e[o];t=null}}(),function(){var e=document.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var n=!t.call(document.createElement("div"),"div"),o=!1;try{t.call(document.documentElement,"[test!='']:sizzle")}catch(r){o=!0}l.matchesSelector=function(e,r){if(r=r.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!l.isXML(e))try{if(o||!u.match.PSEUDO.test(r)&&!/!=/.test(r)){var i=t.call(e,r);if(i||!n||e.document&&11!==e.document.nodeType)return i}}catch(a){}return l(r,null,null,[e]).length>0}}}(),function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>",e.getElementsByClassName&&0!==e.getElementsByClassName("e").length&&(e.lastChild.className="e",1!==e.getElementsByClassName("e").length&&(u.order.splice(1,0,"CLASS"),u.find.CLASS=function(e,t,n){return"undefined"==typeof t.getElementsByClassName||n?void 0:t.getElementsByClassName(e[1])},e=null))}(),document.documentElement.contains?l.contains=function(e,t){return e!==t&&(e.contains?e.contains(t):!0)}:document.documentElement.compareDocumentPosition?l.contains=function(e,t){return!!(16&e.compareDocumentPosition(t))}:l.contains=function(){return!1},l.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?"HTML"!==t.nodeName:!1};var v=function(e,t){for(var n,o=[],r="",i=t.nodeType?[t]:t;n=u.match.PSEUDO.exec(e);)r+=n[0],e=e.replace(u.match.PSEUDO,"");e=u.relative[e]?e+"*":e;for(var a=0,s=i.length;s>a;a++)l(e,i[a],o);return l.filter(r,o)};window.Sizzle=l}();