if(document.createElement&&document.getElementById&&document.getElementsByTagName){var mons={headers:document.getElementsByTagName('h2'),togglers:document.getElementById('menu').getElementsByTagName('span'),theIntro:document.getElementById('intro'),otherHeadName:null,otherListName:null,theBody:document.getElementById('pagecontent'),monslist:document.getElementById('monslist'),convtable:document.getElementById('mc'),monsTlist:document.getElementById('monstable'),imgControls:document.createElement('div'),darkerBox:document.createElement('div'),lighterBox:document.createElement('div'),init:function(){this.emailTagLine();this.util.configEvents();for(var i=0;i<mons.togglers.length;i++){var a=document.createElement('img');this.togglers[i].appendChild(a);var b=mons.togglers[i].parentNode;var c=b.id;var d='menu'+c.substr(4);var e=document.getElementById(d);if(e.className==='nodisp'){a.src='images/expand.gif';a.alt=a.title='Click here to expand menu'}else{a.src='images/collapse.gif';a.alt=a.title='Click here to collapse menu'}};for(var i=0;i<mons.headers.length;i++){this.util.addEvent(this.headers[i],'click',this.toggle,false)};this.setupLightbox()},emailTagLine:function(){if(mons.theIntro){var a='If you have any additional information that you feel belongs in this guide, please submit it via email to ';var b='monsterinfo@grnrngr.com';var c=document.createElement('p');var d=document.createTextNode(a);var e=document.createElement('a');e.href='mailto:'+b;var f=document.createTextNode(b);c.appendChild(d);c.appendChild(e);e.appendChild(f);mons.theIntro.appendChild(c)}},toggle:function(a){mons.util.stopDefault(a);var b=this.id;var c='menu'+b.substr(4);var d=document.getElementById(c);if(d.className==='nodisp'){d.className='';this.firstChild.firstChild.src='images/collapse.gif';this.firstChild.firstChild.alt=this.firstChild.firstChild.title='Click here to collapse series'}else{d.className='nodisp';this.firstChild.firstChild.src='images/expand.gif';this.firstChild.firstChild.alt=this.firstChild.firstChild.title='Click here to expand series'}},setupLightbox:function(){if((window.innerWidth>0)&&(window.innerHeight>0)){var a=300;var b=350;var c=((window.innerHeight-a)/2)+"px";var d=((window.innerWidth-b)/2)+"px";mons.imgControls.id='imgctrls';mons.darkerBox.id='darkbox';mons.lighterBox.id='lightbox';mons.lighterBox.style.top=c;mons.lighterBox.style.left=d;mons.imgControls.appendChild(mons.darkerBox);mons.imgControls.appendChild(mons.lighterBox);this.theBody.appendChild(mons.imgControls);if(mons.monslist){mons.util.addEvent(this.monslist,'click',this.loadImgLB,false)}if(mons.monsTlist){mons.util.addEvent(this.monsTlist,'click',this.loadImgLB,false)}if(mons.convtable){mons.util.addEvent(this.convtable,'click',this.loadImgLB,false)}mons.util.addEvent(this.imgControls,'click',this.killImgLB,false)}},loadImgLB:function(a){var b=mons.util.findTarget(a,'a',this);if(!b){return}if(b.className=='smallnote'){return}mons.util.stopDefault(a);var c=b.href;var d=b.firstChild.nodeValue;var e=document.getElementById('darkbox');e.style.display='block';var f=document.getElementById('lightbox');f.style.display='table-cell';var g=document.createElement('img');g.src=c;g.alt=d;g.style.maxWidth='320px';g.style.maxHeight='240px';f.appendChild(g);var h=document.createElement('p');var i=document.createTextNode(d);f.appendChild(h).appendChild(i)},killImgLB:function(a){mons.darkerBox.style.display='none';mons.lighterBox.style.display='none';var b=mons.lighterBox.getElementsByTagName('img')[0];b.parentNode.removeChild(b);var c=mons.lighterBox.getElementsByTagName('p')[0];c.parentNode.removeChild(c)},util:{configEvents:function(){if(document.addEventListener){this.addEvent=function(a,b,c,d){a.addEventListener(b,c,d)};this.stopBubble=function(a){a.stopPropagation()};this.stopDefault=function(a){a.preventDefault()};this.findTarget=function(a,b,c){var d=a.target;while(d&&d!==c){if(d.nodeName.toLowerCase()===b){return d;break}else{d=d.parentNode}}return false}}else if(document.attachEvent){this.addEvent=function(a,b,c){a["e"+b+c]=c;a[b+c]=function(){a["e"+b+c](window.event)};a.attachEvent("on"+b,a[b+c])};this.stopBubble=function(a){a.cancelBubble=true};this.stopDefault=function(a){a.returnValue=false};this.findTarget=function(a,b,c){var d=a.srcElement;while(d&&d!==c){if(d.nodeName.toLowerCase()===b){return d;break}else{d=d.parentNode}}return false}}},}};mons.init()};
