/*
 *  © 2000-2010 deviantART, Inc. All rights reserved.
 */
if(!window.AutoExec){AutoExec=[]}window.Gruser=GMIBase.extend({});if(!window.GMFrame_BluesBar){window.GMFrame_BluesBar=GMIBase.extend({})}if(window.DWait){DWait.run("jms/pages/gruzecontrol/gruser.js")}DWait.ready(["jms/lib/gmi.js","jms/lib/browser.js","jms/lib/popup.js","jms/lib/ruler.js","jms/lib/station.js"],function(){if(!window.GPage){window.GPage=GMIBase.extend({gmiConstructor:function(){}})}window.BluesBar={hiddenMenu:function(E,C,H){var A,D,F,G,I,B;if(window.event){event.cancelBubble=true}if(this.menu_on||!C&&this.treshold&&this.treshold>(new Date).valueOf()){return false}this.ieFix(E);if(!this.gmi_called){this.gmi_called=true;DWait.ready(["jms/lib/gmi.js","jms/pages/gruzecontrol/gmframe_bluesbar.js"],bind(this,this.frameReady))}D=E.getAttribute("href").split("#").pop();B=D.split("-").pop();if(B!="give"){E.className+=" active"}this.menu_on=E;A=Popup.create({className:"gruser-"+B,callback:bind(this,this.hiddenMenuDone),no_screen_adjust:"y",no_shadow:Browser.isIE});A.node.className+=" popup2-gruser";A.node.appendChild(document.getElementById(D).cloneNode(true));A.node.firstChild.style.display="block";if(E.offsetWidth>257||H){A.node.style.width=(E.offsetWidth+3)+"px"}if(B in {stats:1,stats2:1,activity:1}){this.verify(B,A.node.firstChild,E)}F=Ruler.screen.node(E);G=(Ruler.screen.node(E.parentNode.parentNode).y2-F.y2)-2;if(G>10||B in {give:1,stats2:1}){}else{this.zNodes(E,240);if(!Browser.isIE){}}if((B in {stats:1,stats2:1})&&!GMI.query("GMFrame_BluesBar")[0]){F.x=190;F.x2=191}if(B=="buttons"){F.x-=192;F.x2-=192}setTimeout(bind(Popup,Popup.show,A,F,false),1);this.callFrame(A);return false},verify:function(C,E,D){var B,F,A;if(B=(E.getElementsByTagName("difi")||[])[0]){if(!this[C+"_node"]){if(C in {stats:1,stats2:1}){F=document.createElement("span");F.className="bars"}else{F=document.createElement("div");F.className="ploading";F.style.paddingTop="16px";F.innerHTML="Loading..."}this[C+"_node"]=F;if(F=GMI.query("GMFrame_BluesBar")[0]){A=F.gmi_args.id}else{A=GMI.up(D,"GMFrame_Gruser").gmi_args.id}switch(C){case"activity":DiFi.pushPrivateGet("GrusersUserpageinfoModule","getActivityDetails",[GMI.query("Gruser")[0].gmi_args.id,A],bind(this,this.difiReady,C));break;case"stats":case"stats2":DiFi.pushPrivateGet("GrusersModules","displayModule",[GMI.query("Gruser")[0].gmi_args.id,A,"stats_pageviews",{}],bind(this,this.difiReady,C));break;default:throw new Error("?? "+C)}DiFi.timer(1)}B.parentNode.replaceChild(this[C+"_node"],B)}},difiReady:function(A,C,B){if(A=="activity"){this[A+"_node"].className=""}this[A+"_node"].innerHTML=C?B.response.content.html:"[error: "+B.response.content+"]";if(A in {stats:1,stats2:1}){this.animateGraph(this[A+"_node"])}},animateGraph:function(B){var A;A=B.getElementsByTagName("span");for(i=0;i!=A.length;i++){if(A[i].className=="bar"){Station.push(A[i],"top",{from:44,to:44,time:(A.length-i)*25},{from:44,to:0,time:150,f:Interpolators.pulse})}}},hiddenMenuMouse:function(C,B){var A;if(BluesBar.mouseover_timer){clearTimeout(BluesBar.mouseover_timer);BluesBar.mouseover_timer=null}A=(C.getElementsByTagName("span")||[])[0];this.ieFix(C);if(!this.menu_on&&A&&A.className=="bluestip"&&A!=BluesBar.last_mouseover){BluesBar.last_mouseover=A;Station.run(A,"opacity",{from:0,to:1,time:155,f:Interpolators.sineCurve});C.onmouseout=this.hiddenMenuOut}if(this.menu_on&&this.menu_on!=C){if(Popup.completeAll()){this.hiddenMenu(C,true)}}},ieFix:function(B){var A;if(Browser.isIE){A=(B.getElementsByTagName("span")||[])[0];if(A&&!A.style.width){A.style.width=A.parentNode.offsetWidth+"px"}}},hiddenMenuOut:function(){BluesBar.mouseover_timer=setTimeout("BluesBar.last_mouseover = null",10)},hiddenMenuDone:function(A){this.menu_on.className=this.menu_on.className.replace(/\bactive\b/g,"");this.zNodes(this.menu_on,20);this.treshold=(new Date).valueOf()+200;this.menu_on=false;this.callFrame(null);delete A.node},zNodes:function(B,E){var A,D,C;if(Browser.isIE){return }if(GMI.up(B,"GPage")){A=[B.parentNode.parentNode]}else{D=GMI.up(B,"Gruser").gmi_node;A=[D.getElementsByTagName("div")[1]];A.push((document.getElementById("top")||document.getElementById("overhead")).lastChild);C=GMI.query(D,"GPage")[0];if(C.findBluesBar){A.push(C.findBluesBar("gmbutton2admin"))}}for(i=0;i!=A.length;i++){if(A[i]&&A[i].nodeType==1){A[i].style.zIndex=E+i}}},frameReady:function(){if(!this.linked_frame){this.linked_frame=GMI.query("GMFrame_BluesBar")[0]}},callFrame:function(A){if(this.linked_frame&&this.linked_frame.currentPopupIs){this.linked_frame.currentPopupIs(A)}},graphHover:function(D,E){var C,A,B;C=E.target||E.srcElement;if(C&&C.nodeType==1){A=D.getElementsByTagName("span")[0];A.innerHTML=(C.getAttribute("title")||"").split(":").join(":<strong>")+"</strong>";for(B=-15;C=C.nextSibling;B++){}A.style.left=Math.min(80,Math.max(-20,B*7))+"px"}},graphOut:function(A){A.getElementsByTagName("span")[0].innerHTML=""}};if(window.DWait){DWait.run("jms/pages/gruzecontrol/bluesbar.js")}});window.GUserPoll=GMIBase.extend({});if(window.DWait){DWait.run("jms/pages/gruzecontrol/guserpoll.js")}window.GBadge=GMIBase.extend({});if(window.DWait){DWait.run("jms/pages/gruzecontrol/gbadge.js")}TextBoxPreviewStream=PreviewStream.extend({gmiConstructor:function(){var A;this.stream_hijack_immediate=1;this.backup_nodes=[];for(A=0;this.backup_nodes[A]=this.gmi_node.childNodes[A];A++){}this.backup_class=this.gmi_node.className;this.gmi_node.onclick=bind(this,this.previewClick);this.override_selector_click=1;this.base()},domReadState:function(){var A,B,C;B=this.textboxFindVisible();for(A in B){if(B.constructor.prototype[A]){continue}this.contents[A]=this.domReadOne(B[A])}this.gs_total=this.contents.length},textboxFindVisible:function(D){var C,E,F,A,B;E={};c=0;B=this.gmi_node.getElementsByTagName("span");for(C=0;F=B[C];C++){if((F.className||"").indexOf("shadow-holder")>=0){A=document.createElement("div");A.className="tt-a";A.appendChild(document.createElement("span"));A.firstChild.className="tt-w";A.firstChild.appendChild(F.getElementsByTagName("*")[0].cloneNode(true));F.setAttribute("ps_offset_hint",c);E[c++]=A||F}}return E},previewClick:function(C){var B,A;C=C||event;if(C.ctrlKey||C.metaKey||C.altKey||C.shiftKey){return true}B=C.target||C.srcElement;while((B=B.parentNode)&&B.tagName!="A"){}if(!B){return true}if((B.href||"").match(/^http...www.deviantart.com.print.*$/)){return true}while((B=B.parentNode)&&(B.className||"")!="shadow-holder"){}if(!B){return true}A=Number(B.getAttribute("ps_offset_hint"));B=B.getElementsByTagName("*")[0];this.previewEnsure();this.preview_selector.setSelection(this.preview_selector.getAllSelectable()[A-this.gs_offset],"click");C.cancelBubble=true;return false},beforeHijackStream:function(){this.hijacked=1;while(this.gmi_node.firstChild){this.gmi_node.removeChild(this.gmi_node.firstChild)}this.gmi_node.className="stream";this.gs_offset=0;this.gs_count_per_page=this.gs_total;this.domDrawRange(0,this.gs_total)},afterRestoreStream:function(){while(this.gmi_node.firstChild){this.gmi_node.removeChild(this.gmi_node.firstChild)}for(i=0;this.backup_nodes[i];i++){this.gmi_node.appendChild(this.backup_nodes[i])}this.gmi_node.className=this.backup_class;this.hijacked=false},dataFetch:function(){},domDrawRange:function(B,A){if(this.gmi_node.className=="stream"){this.base(B,A)}}});if(window.DWait){DWait.run("jms/pages/superbrowse/types/textbox_preview_stream.js")}DWait.count();