var interupt=true;function findPos(a){var b=curtop=0;if(a.offsetParent){do{b+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent)}return[b,curtop]}function applyEvent(a,c,b){if(window.addEventListener){a.addEventListener(c,b,false)}else{a.attachEvent("on"+c,b)}}function closeIt(){try{var b=document.getElementById("curropenhl2l")}catch(a){}if(b){b.parentNode.removeChild(b)}interupt=true}function useHTML(d){var c=document.getElementById("hl2lta");c.value=d;var b=document.getElementById("hl2lr1");b.style.backgroundColor="#ffffff";var a=document.getElementById("hl2lr2");a.style.backgroundColor="#aaaaba";c.select();return true}function useBBCODE(d){var c=document.getElementById("hl2lta");c.value=d;var a=document.getElementById("hl2lr2");a.style.backgroundColor="#ffffff";var b=document.getElementById("hl2lr1");b.style.backgroundColor="#aaaaba";c.select();return true}function hl2l(t){var r;if(!t){var t=window.event}if(t.which){r=(t.which==3)}else{if(t.button){r=(t.button==2)}}if(!r){return true}closeIt();var u=360;var d=250;var l;if(!(typeof event=="undefined")){l=event.srcElement;d=d-10}else{if(this){l=t.currentTarget}}var s=document.location.href;var k=l.getAttribute("src");if(k.substr(0,4).toLowerCase()!="http"){var c;if(s.substr(s.length-1,1)=="/"){c=s}else{if(s.indexOf("/",9)==-1){c=s+"/"}else{c=s.substr(0,s.lastIndexOf("/")+1)}}var n=c.substr(0,c.indexOf("/",9));if(k.substr(0,1)!="/"){k=c+k}else{k=n+k}}var b=l.getAttribute("alt");if(b){b=b.replace("'","")}else{b=""}thtml="<a href='"+s+"'><img src='"+k+"' alt='"+b+"'></a>";tbbcode="[url="+s+"][img]"+k+"[/img][/url]";var h=document.createElement("div");h.style.width=u+"px";h.style.height=d+"px";h.style.border="1px solid #000000";h.style.position="absolute";h.style.fontSize="12px";h.style.fontFamily="Arial";texy=findPos(l);h.style.left=((texy[0]+(l.offsetWidth/2))-(u/2))+"px";h.style.top=((texy[1]+(l.offsetHeight/2))-(d/2))+"px";h.style.backgroundColor="#ffe9e7";h.setAttribute("id","curropenhl2l");var i=document.createElement("div");var q=document.createElement("div");q.style.cssFloat="right";q.style.styleFloat="right";q.style.border="1px solid #444444";q.style.backgroundColor="#aaaaba";q.style.width=35+"px";q.style.cursor="pointer";q.innerHTML="Close";i.appendChild(q);applyEvent(q,"click",closeIt);var m=document.createElement("div");m.style.width=(u-50)+"px";m.style.padding="3px";m.innerHTML="If you wish to use this image elsewhere, please select either HTML <strong>(for webpages)</strong> or BBCODE <strong>(for forums)</strong> and use the code provided.<br><br>To <strong>send the picture to friends</strong> or put it on <strong>facebook</strong> please use the direct image link below or webpage URL.";i.appendChild(m);h.appendChild(i);var p=document.createElement("span");p.style.width=35+"px";p.style.border="1px solid black";p.style.padding="1px";p.style.backgroundColor="#ffffff";p.style.cursor="pointer";p.style.marginLeft="3px";p.innerHTML="HTML";p.setAttribute("id","hl2lr1");applyEvent(p,"click",function(){useHTML(thtml)});var a=document.createElement("span");a.innerHTML="&nbsp;";a.style.width=10+"px";var g=document.createElement("br");var f=document.createElement("br");var o=document.createElement("span");o.style.width=35+"px";o.style.border="1px solid black";o.style.padding="1px";o.style.backgroundColor="#aaaaba";o.style.cursor="pointer";o.innerHTML="BBCODE";o.setAttribute("id","hl2lr2");applyEvent(o,"click",function(){useBBCODE(tbbcode)});h.appendChild(p);h.appendChild(a);h.appendChild(o);h.appendChild(f);var j=document.createElement("textarea");j.setAttribute("cols","47");j.setAttribute("rows","5");j.setAttribute("wrap","soft");j.setAttribute("id","hl2lta");j.style.margin="2px";applyEvent(j,"mousemove",function(){document.getElementById("hl2lta").select()});h.appendChild(j);document.body.appendChild(h);p.checked=true;useHTML(thtml);l.oncontextmenu=function(){if(interupt){interupt=false;return false}};h.oncontextmenu=function(){if(interupt){interupt=false;return false}}};