deviantART Common Tasks Icons

By DavidJCobb Last update Aug 21, 2008 — Installed 166 times. Daily Installs: 0, 2, 1, 2, 1, 1, 3, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0

Add Syntax Highlighting (this will take a few seconds, probably freezing your browser while it works)

// ==UserScript==
// @name           deviantART Common Tasks Icons
// @namespace      http://davidjcobb.deviantart.com/
// @description    Adds icon-links for custom tasks to the userbar, next to your message count.
// @include        http://deviantart.com/*
// @include        http://*.deviantart.com/*
// ==/UserScript==

unsafeWindow.FFGM_findPosX=window.FFGM_findPosX=function(obj) // credit for this function goes to Peter-Paul Koch & Alex Tingle. (http://www.quirksmode.org/js/findpos.html   and   http://blog.firetree.net/2005/07/04/javascript-find-position/)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

unsafeWindow.FFGM_findPosY=window.FFGM_findPosY=function(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }


unsafeWindow.FFGM_DJC_DA_GetUserAvatar=window.FFGM_DJC_DA_GetUserAvatar=
function(username){
   if (document.getElementById("deviant")&&document.getElementById("deviant").getElementsByTagName("img").length>0) {
      if (document.getElementById("deviant").getElementsByTagName("img")[0].src.indexOf("http://a.deviantart.com/avatars/"+username.toLowerCase())!=-1) {
         var b=GM_getValue("DJC_DA_Avatars",false);
         if (b) {
            if (b.indexOf(username.toLowerCase())!=-1) {
               b=b.split("|");
               for(var c=0;i<b.length;c++){
                  if (b[c].indexOf(username.toLowerCase())!=-1) {
                     b[c]=a[i].content.substring(a[i].content.indexOf("http://a.deviantart.com/avatars/"),a[i].content.indexOf("'",a[i].content.indexOf("http://a.deviantart.com/avatars/d/a/")));
                     break;
                  }
               }
               if (c==b.length) b+="|"+a[i].content.substring(a[i].content.indexOf("http://a.deviantart.com/avatars/"),a[i].content.indexOf("'",a[i].content.indexOf("http://a.deviantart.com/avatars/d/a/")));
            }
         }
         return document.getElementById("deviant").getElementsByTagName("img")[0].src;
      }
   }
   a=document.getElementsByTagName("img");
   for(var i=0;i<a.length;i++){
      if(a[i].src.indexOf("http://a.deviantart.com/avatars/"+username.toLowerCase().charAt(0)+"/"+username.toLowerCase().charAt(1)+"/"+username.toLowerCase()+".")==0) {
         var b=GM_getValue("DJC_DA_Avatars",false);
         if (b) {
            if (b.indexOf(username.toLowerCase())!=-1) {
               b=b.split("|");
               for(var c=0;i<b.length;c++){
                  if (b[c].indexOf(username.toLowerCase())!=-1) {
                     b[c]=a[i].content.substring(a[i].content.indexOf("http://a.deviantart.com/avatars/"),a[i].content.indexOf("'",a[i].content.indexOf("http://a.deviantart.com/avatars/d/a/")));
                     break;
                  }
               }
               if (c==b.length) b+="|"+a[i].content.substring(a[i].content.indexOf("http://a.deviantart.com/avatars/"),a[i].content.indexOf("'",a[i].content.indexOf("http://a.deviantart.com/avatars/d/a/")));
            }
         }
         return a[i].src;
      }
   }
   a=document.getElementsByTagName("meta");
   for(var i=0;i<a.length;i++){
      if(a[i].name=="deviantMETA"){
         var b=GM_getValue("DJC_DA_Avatars",false);
         if (b) {
            if (b.indexOf(username.toLowerCase())!=-1) {
               b=b.split("|");
               for(var c=0;i<b.length;c++){
                  if (b[c].indexOf(username.toLowerCase())!=-1) {
                     b[c]=a[i].content.substring(a[i].content.indexOf("http://a.deviantart.com/avatars/"),a[i].content.indexOf("'",a[i].content.indexOf("http://a.deviantart.com/avatars/d/a/")));
                     break;
                  }
               }
               if (c==b.length) b+="|"+a[i].content.substring(a[i].content.indexOf("http://a.deviantart.com/avatars/"),a[i].content.indexOf("'",a[i].content.indexOf("http://a.deviantart.com/avatars/d/a/")));
            }
         }
         return a[i].content.substring(a[i].content.indexOf("http://a.deviantart.com/avatars/"),a[i].content.indexOf("'",a[i].content.indexOf("http://a.deviantart.com/avatars/d/a/")));
      }
   }
   if (GM_getValue("DJC_DA_Avatars",false)) {
      var a=GM_getValue("DJC_DA_Avatars",false);
      if (a.indexOf(username.toLowerCase())!=-1) {
         a=a.split("|");
         for(var i=0;i<a.length;i++){
            if (a[i].indexOf(username.toLowerCase())!=-1) {
               return a[i];
            }
         }
      }
   }
   return "http://a.deviantart.com/avatars/default.gif"; // use default avatar as a fallback
};

unsafeWindow.FFGM_DJC_DA_CTICloseMenues=window.FFGM_DJC_DA_CTICloseMenues=
function(){
   // User menu
   document.getElementById("DJCCTI_User").childNodes[0].style.backgroundColor="#2A3737";document.getElementById("DJCCTI_User_Menu").style.display="none";FFGM_DJC_DA_CTI_UserMenuOpen=false;
   // Edit menu
   document.getElementById("DJCCTI_Edit").childNodes[0].style.backgroundColor="#2A3737";document.getElementById("DJCCTI_Edit_Menu").style.display="none";FFGM_DJC_DA_CTI_EditMenuOpen=false;
   // CTxt menu
   document.getElementById("DJCCTI_CTxt").childNodes[0].style.backgroundColor="#2A3737";document.getElementById("DJCCTI_CTxt_Menu").style.display="none";FFGM_DJC_DA_CTI_CTxtMenuOpen=false;
   // Site menu
   document.getElementById("DJCCTI_Site").childNodes[0].style.backgroundColor="#2A3737";document.getElementById("DJCCTI_Site_Menu").style.display="none";FFGM_DJC_DA_CTI_SiteMenuOpen=false;
   // Abot menu
   document.getElementById("DJCCTI_Abot").childNodes[0].style.backgroundColor="#2A3737";document.getElementById("DJCCTI_Abot_Menu").style.display="none";FFGM_DJC_DA_CTI_AbotMenuOpen=false;
   // RVRT menu
   document.getElementById("DJCCTI_RVRT").childNodes[0].style.backgroundColor="#2A3737";document.getElementById("DJCCTI_RVRT_Menu").style.display="none";FFGM_DJC_DA_CTI_RVRTMenuOpen=false;
};

unsafeWindow.FFGM_DJC_DA_CTICloseMenu=window.FFGM_DJC_DA_CTICloseMenu=
function(which){
   document.getElementById("DJCCTI_"+which).childNodes[0].style.backgroundColor="#2A3737";document.getElementById("DJCCTI_"+which+"_Menu").style.display="none";eval("FFGM_DJC_DA_CTI_"+which+"MenuOpen=false;");
};

unsafeWindow.FFGM_DJC_DA_CTIOpenMenu=window.FFGM_DJC_DA_CTIOpenMenu=
function(which){
   document.getElementById("DJCCTI_"+which).childNodes[0].style.backgroundColor="#AFC81C";document.getElementById("DJCCTI_"+which+"_Menu").style.display="block";eval("FFGM_DJC_DA_CTI_"+which+"MenuOpen=true;");
   document.getElementById("DJCCTI_"+which+"_Menu").style.left=FFGM_findPosX(document.getElementById("DJCCTI_"+which))+"px";document.getElementById("DJCCTI_"+which+"_Menu").style.top=(FFGM_findPosY(document.getElementById("DJCCTI_"+which))+document.getElementById("DJCCTI_"+which).offsetHeight)+"px";
};

unsafeWindow.FFGM_DJC_DA_AddTasks=window.FFGM_DJC_DA_AddTasks=
function(){
   try{if(FFGM_DJC_DA_CTI_RunOnce)return;}catch(E){}
   FFGM_DJC_DA_CTI_RunOnce=true;

   FFGM_DJC_DA_CTI_UserMenuOpen=false;
   FFGM_DJC_DA_CTI_EditMenuOpen=false;
   FFGM_DJC_DA_CTI_CTxtMenuOpen=false;
   FFGM_DJC_DA_CTI_SiteMenuOpen=false;
   FFGM_DJC_DA_CTI_AbotMenuOpen=false;
   FFGM_DJC_DA_CTI_RVRTMenuOpen=false;

   var TaskBar=document.createElement("div"); // create holder DIV
   TaskBar.id="DJCCTI_TaskBar";TaskBar.style.position="absolute";TaskBar.style.top="-9px";TaskBar.style.zIndex="202";
   TaskBar.style.padding="2px";TaskBar.style.border="1px";TaskBar.style.MozBorderRadius="6px";TaskBar.style.backgroundColor="#2A3737";

   // create and set up click-menu for USER
   var mnu_User=document.createElement("div");mnu_User.id="DJCCTI_User_Menu";mnu_User.style.position="absolute";mnu_User.style.display="none";mnu_User.className="floater menufloater floater-fixed";
   mnu_User.innerHTML='<div class="popup"><div class="pager slider"><div style="left: 0pt;" class="page switcher"><dl class="f hat"><dd style="height: 322px;" class="f flex-fill"><ul class="f menu iconmenu iconset-deviate menu-deviate"></ul></dd></dl></div></div></div>';
   // create and set up menu items for USER
   var itm_User_Userpage=document.createElement("li");itm_User_Userpage.className="f";itm_User_Userpage.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/"><!--<i class="icon l" style="background-image:url('+FFGM_DJC_DA_GetUserAvatar(unsafeWindow.deviantART.deviant.username)+');"></i>--><img src="'+FFGM_DJC_DA_GetUserAvatar(unsafeWindow.deviantART.deviant.username)+'" width="19" height="19" style="margin:2px 6px -4px -25px;">View Userpage</a>';mnu_User.getElementsByTagName("ul")[0].appendChild(itm_User_Userpage);
   var itm_User_Gallery=document.createElement("li");itm_User_Gallery.className="f";itm_User_Gallery.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/gallery/"><img src="http://i.deviantart.com/icons/activity/deviation.gif" style="margin:2px 7px -4px -25px;">View Gallery</a>';mnu_User.getElementsByTagName("ul")[0].appendChild(itm_User_Gallery);
   var itm_User_Favorites=document.createElement("li");itm_User_Favorites.className="f";itm_User_Favorites.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/favourites/"><img src="http://e.deviantart.com/emoticons/p/plusfav.gif" style="margin:2px 10px -2px -25px;">View Favourites</a>';mnu_User.getElementsByTagName("ul")[0].appendChild(itm_User_Favorites);
   var itm_User_Journal=document.createElement("li");itm_User_Journal.className="f";itm_User_Journal.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/journal/"><img src="http://i.deviantart.com/icons/activity/journal.gif" style="margin:2px 7px -4px -25px;">View Journal</a>';mnu_User.getElementsByTagName("ul")[0].appendChild(itm_User_Journal);
   var itm_User_Activity=document.createElement("li");itm_User_Activity.className="f";itm_User_Activity.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/activity/"><img src="http://e.deviantart.com/emoticons/m/magnify.gif" style="margin:2px 10px -2px -25px;">View Activity</a>';mnu_User.getElementsByTagName("ul")[0].appendChild(itm_User_Activity);
   var itm_User_GalleryStats=document.createElement("li");itm_User_GalleryStats.className="f";itm_User_GalleryStats.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/stats/gallery/"><img src="http://e.deviantart.com/emoticons/m/magnify.gif" style="margin:2px 10px -2px -25px;">View Gallery Stats</a>';mnu_User.getElementsByTagName("ul")[0].appendChild(itm_User_GalleryStats);
   var itm_User_Wishlist=document.createElement("li");itm_User_Wishlist.className="f";itm_User_Wishlist.innerHTML='<a menuri="" href="http://my.deviantart.com/wishlist/"><i class="icon l i10"></i>View Wishlist</a>';mnu_User.getElementsByTagName("ul")[0].appendChild(itm_User_Wishlist);

   // create and set up menu icons for USER
   var lnk_User=document.createElement("a");lnk_User.id="DJCCTI_User";
   var ico_User=document.createElement("img");ico_User.src=FFGM_DJC_DA_GetUserAvatar(unsafeWindow.deviantART.deviant.username);ico_User.width=ico_User.height="25";ico_User.title="Go to...";
   lnk_User.appendChild(ico_User);TaskBar.appendChild(lnk_User); // put IMG in A
   ico_User.style.padding="2px;";ico_User.style.backgroundColor="#2A3737";
   lnk_User.addEventListener("mouseover",(function(){if(!FFGM_DJC_DA_CTI_UserMenuOpen){document.getElementById("DJCCTI_User").childNodes[0].style.backgroundColor="#1F292A";}}),true); // set up mouse events
   lnk_User.addEventListener("mouseout",(function(){if(!FFGM_DJC_DA_CTI_UserMenuOpen){document.getElementById("DJCCTI_User").childNodes[0].style.backgroundColor="#2A3737";}}),true);
   lnk_User.addEventListener("click",(function(){if(!FFGM_DJC_DA_CTI_UserMenuOpen){FFGM_DJC_DA_CTICloseMenues();FFGM_DJC_DA_CTIOpenMenu("User");return;}else{FFGM_DJC_DA_CTICloseMenu("User");return;}}),true);

   // create and set up click-menu for EDIT
   var mnu_Edit=document.createElement("div");mnu_Edit.id="DJCCTI_Edit_Menu";mnu_Edit.style.position="absolute";mnu_Edit.style.display="none";mnu_Edit.className="floater menufloater floater-fixed";
   mnu_Edit.innerHTML='<div class="popup"><div class="pager slider"><div style="left: 0pt;" class="page switcher"><dl class="f hat"><dd style="height: 322px;" class="f flex-fill"><ul class="f menu iconmenu iconset-deviate menu-deviate"></ul></dd></dl></div></div></div>';
   // create and set up menu items for EDIT
   var itm_Edit_NewDev=document.createElement("li");itm_Edit_NewDev.className="f";itm_Edit_NewDev.innerHTML='<a menuri="" href="http://www.deviantart.com/submit/"><i class="icon l i2"></i>Submit Deviation</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_NewDev);
   var itm_Edit_Journal=document.createElement("li");itm_Edit_Journal.className="f";itm_Edit_Journal.innerHTML='<a menuri="" href="http://my.deviantart.com/journal/"><i class="icon l i3"></i>Update Journal</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_Journal);
   var itm_Edit_News=document.createElement("li");itm_Edit_News.className="f";itm_Edit_News.innerHTML='<a menuri="" href="http://news.deviantart.com/submit/"><img src="http://i.deviantart.com/icons/activity/news.gif" style="margin:2px 7px -4px -25px;"></i>Submit News</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_News);
   var itm_Edit_SendNote=document.createElement("li");itm_Edit_SendNote.className="f new";itm_Edit_SendNote.innerHTML='<a menuri="" href="http://my.deviantart.com/notes/"><img src="http://i.deviantart.com/icons/notes/note-read.gif" style="margin:2px 7px -4px -25px;">Send Note</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_SendNote);
   var itm_Edit_Gallery=document.createElement("li");itm_Edit_Gallery.className="f new";itm_Edit_Gallery.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/gallery/#_edit_"><i class="icon l i8"></i>Edit Gallery</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_Gallery);
   var itm_Edit_Favourites=document.createElement("li");itm_Edit_Favourites.className="f";itm_Edit_Favourites.innerHTML='<a menuri="" href="http://'+unsafeWindow.deviantART.deviant.username.toLowerCase()+'.deviantart.com/favourites/#_edit_"><img src="http://i.deviantart.com/icons/deviation/mousefav.gif" style="margin:3px 9px -3px -24px;">Edit Favourites</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_Favourites);
   var itm_Edit_Profile=document.createElement("li");itm_Edit_Profile.className="f new";itm_Edit_Profile.innerHTML='<a menuri="" href="http://my.deviantart.com/settings/"><i class="icon l i11"></i>Edit Profile</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_Profile);
   var itm_Edit_Friends=document.createElement("li");itm_Edit_Friends.className="f";itm_Edit_Friends.innerHTML='<a menuri="" href="http://my.deviantart.com/deviants/"><img src="http://i.deviantart.com/icons/activity/user.gif" style="margin:2px 7px -4px -25px;">Edit Watchlist</a>';mnu_Edit.getElementsByTagName("ul")[0].appendChild(itm_Edit_Friends);

   // create and set up menu icons for EDIT
   var lnk_Edit=document.createElement("a");lnk_Edit.id="DJCCTI_Edit";
   var ico_Edit=document.createElement("img");ico_Edit.src="http://e.deviantart.com/emoticons/p/pencil.gif";ico_Edit.title="Edit...";
   lnk_Edit.appendChild(ico_Edit);TaskBar.appendChild(lnk_Edit); // put IMG in A
   ico_Edit.style.padding="7px;";ico_Edit.style.backgroundColor="#2A3737";
   lnk_Edit.addEventListener("mouseover",(function(){if(!FFGM_DJC_DA_CTI_EditMenuOpen){document.getElementById("DJCCTI_Edit").childNodes[0].style.backgroundColor="#1F292A";}}),true); // set up mouse events
   lnk_Edit.addEventListener("mouseout",(function(){if(!FFGM_DJC_DA_CTI_EditMenuOpen){document.getElementById("DJCCTI_Edit").childNodes[0].style.backgroundColor="#2A3737";}}),true);
   lnk_Edit.addEventListener("click",(function(){if(!FFGM_DJC_DA_CTI_EditMenuOpen){FFGM_DJC_DA_CTICloseMenues();FFGM_DJC_DA_CTIOpenMenu("Edit");return;}else{FFGM_DJC_DA_CTICloseMenu("Edit");return;}}),true);

   // begin CONTEXT

   NotUserpageNames="a|about|adcast|backend|browse|chat|comments|e|fc00|fc01|fc02|fc03|fc04|fc05|fc06|fc07|fc08|forum|help|i|my|news|prints|s|services|shop|stinkbutt|store|tn1-1|tn1-2|tn1-3|tn1-4|tn1-5|tn3-1|today|www|";
   ContextState=((window.location.pathname.indexOf("/notes")===0)?"NOTES":(
                ( NotUserpageNames.indexOf("|"+window.location.hostname.substring(0,window.location.hostname.indexOf("."))+"|")===-1 )?"USRPG":(
                null)
                )
                );

   // create and set up click-menu for CTxt
   var mnu_CTxt=document.createElement("div");mnu_CTxt.id="DJCCTI_CTxt_Menu";mnu_CTxt.style.position="absolute";mnu_CTxt.style.display="none";mnu_CTxt.className="floater menufloater floater-fixed";
   mnu_CTxt.innerHTML='<div class="popup"><div class="pager slider"><div style="left: 0pt;" class="page switcher"><dl class="f hat"><dd style="height: 322px;" class="f flex-fill"><ul class="f menu iconmenu iconset-deviate menu-deviate"></ul></dd></dl></div></div></div>';
   // create and set up menu items for CTxt
   
   if(ContextState=="NOTES"){ // notes
      var itm_CTxt_WriteNote=document.createElement("li");itm_CTxt_WriteNote.className="f";itm_CTxt_WriteNote.innerHTML='<a menuri="" href="http://my.deviantart.com/notes/#send"><img src="http://e.deviantart.com/emoticons/p/pencil.gif" style="margin:2px 10px -2px -25px;">Write Note</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_WriteNote);
   }else if(ContextState=="USRPG"/*&&!(unsafeWindow.deviantART.deviant.username.toLowerCase()===window.location.hostname.substring(0,window.location.hostname.indexOf(".")).toLowerCase())*/){ // userpage
//      // set up watch link
//      for(var i=0;i<document.getElementsByTagName("a").length;i++) {
//         if(document.getElementsByTagName("a")[i].innerHTML.match(/Watch(ing|) this deviant/i)) {
//            document.getElementsByTagName("a")[i].id="$DAWATCHLINK$";break;
//         }
//      }
      var $CTXTUSER$=window.location.hostname.substring(0,window.location.hostname.indexOf("."));
      if(document.getElementById("deviant-nav")&&document.getElementById("deviant-nav").parentNode.getElementsByTagName("h1")[0].childNodes[1].childNodes[0].nodeValue){
         if(document.getElementById("deviant-nav").parentNode.getElementsByTagName("h1")[0].childNodes[1].childNodes[0].nodeValue.toLowerCase()==$CTXTUSER$){
            $CTXTUSER$=document.getElementById("deviant-nav").parentNode.getElementsByTagName("h1")[0].childNodes[1].childNodes[0].nodeValue;
         }
      }
//      var itm_CTxt_WatchUser=document.createElement("li");itm_CTxt_WatchUser.className="f";
//          itm_CTxt_WatchUser.innerHTML='<a id=\'DJCCTI_WatchUser\' menuri="" href="javascript:(function(){$DAWATCHLINK$=document.getElementById(\'$DAWATCHLINK$\');if($DAWATCHLINK$.innerHTML==\'Watching this deviant\'){return}DiFi.pushPost(\'Friends\',\'addFriend\',[window.location.hostname.substring(0,window.location.hostname.indexOf(\'.\')),0],function(success){if(!success){alert(\'Unable to connect to deviantART to +deviantWATCH.nnPlease try again.\');$DAWATCHLINK$.innerHTML=\'Watch this deviant\';return;}$DAWATCHLINK$.innerHTML=\'Watching this deviant\';$DAWATCHLINK$.href=\'http://my.deviantart.com/deviants\';document.getElementById(\'DJCCTI_WatchUser\').childNodes[1].nodeValue=\'devWATCHing User...\'});$DAWATCHLINK$.innerHTML=\'Adding...\';})();"><img src="http://e.deviantart.com/emoticons/m/magnify.gif" style="margin:2px 10px -2px -25px;">'+
//              ((document.getElementById("$DAWATCHLINK$").innerHTML=='Watching this deviant')?'':'+')+'devWATCH'+((document.getElementById("$DAWATCHLINK$").innerHTML=='Watching this deviant')?'ing':'')+' '+$CTXTUSER$+'</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_WatchUser);
      var itm_CTxt_Userpage=document.createElement("li");itm_CTxt_Userpage.className="f new";itm_CTxt_Userpage.innerHTML='<a menuri="" href="http://'+$CTXTUSER$.toLowerCase()+'.deviantart.com/"><img src="'+FFGM_DJC_DA_GetUserAvatar($CTXTUSER$)+'" width="19" height="19" style="margin:2px 6px -4px -25px;">'+$CTXTUSER$+'\'s Userpage</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_Userpage);
      var itm_CTxt_Gallery=document.createElement("li");itm_CTxt_Gallery.className="f";itm_CTxt_Gallery.innerHTML='<a menuri="" href="http://'+$CTXTUSER$.toLowerCase()+'.deviantart.com/gallery/"><img src="http://i.deviantart.com/icons/activity/deviation.gif" style="margin:2px 7px -4px -25px;">'+$CTXTUSER$+'\'s Gallery</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_Gallery);
      var itm_CTxt_Favorites=document.createElement("li");itm_CTxt_Favorites.className="f";itm_CTxt_Favorites.innerHTML='<a menuri="" href="http://'+$CTXTUSER$.toLowerCase()+'.deviantart.com/favourites/"><img src="http://e.deviantart.com/emoticons/p/plusfav.gif" style="margin:2px 10px -2px -25px;">'+$CTXTUSER$+'\'s Favourites</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_Favorites);
      var itm_CTxt_Journal=document.createElement("li");itm_CTxt_Journal.className="f";itm_CTxt_Journal.innerHTML='<a menuri="" href="http://'+$CTXTUSER$.toLowerCase()+'.deviantart.com/journal/"><img src="http://i.deviantart.com/icons/activity/journal.gif" style="margin:2px 7px -4px -25px;">'+$CTXTUSER$+'\'s Journal</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_Journal);
      var itm_CTxt_Activity=document.createElement("li");itm_CTxt_Activity.className="f";itm_CTxt_Activity.innerHTML='<a menuri="" href="http://'+$CTXTUSER$.toLowerCase()+'.deviantart.com/activity/"><img src="http://e.deviantart.com/emoticons/m/magnify.gif" style="margin:2px 10px -2px -25px;">'+$CTXTUSER$+'\'s Activity</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_Activity);
      var itm_CTxt_GalleryStats=document.createElement("li");itm_CTxt_GalleryStats.className="f";itm_CTxt_GalleryStats.innerHTML='<a menuri="" href="http://'+$CTXTUSER$.toLowerCase()+'.deviantart.com/stats/gallery/"><img src="http://e.deviantart.com/emoticons/m/magnify.gif" style="margin:2px 10px -2px -25px;">'+$CTXTUSER$+'\'s Gallery Stats</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_GalleryStats);

   }/*else if(ContextState=="USRPG"){ // own userpage
      //var itm_CTxt_WatchUser=document.createElement("li");itm_CTxt_WatchUser.className="f";itm_CTxt_WatchUser.innerHTML='<a menuri="" href="http://my.deviantart.com/notes/#send"><img src="http://e.deviantart.com/emoticons/p/pencil.gif" style="margin:2px 10px -2px -25px;">Write Note</a>';mnu_CTxt.getElementsByTagName("ul")[0].appendChild(itm_CTxt_WatchUser);
   }*/

   // create and set up menu icons for CTxt
   var lnk_CTxt=document.createElement("a");lnk_CTxt.id="DJCCTI_CTxt";
   var ico_CTxt=document.createElement("img");ico_CTxt.title=(ContextState)?"For this page...":"There are no special actions for this page.";

   ico_CTxt.src=((ContextState=="NOTES")?"http://i.deviantart.com/icons/notes/note-read.gif":(
                (ContextState=="USRPG")&&NotUserpageNames.indexOf("|"+window.location.hostname.substring(0,window.location.hostname.indexOf("."))+"|")===-1/*&&!(unsafeWindow.deviantART.deviant.username.toLowerCase()===window.location.hostname.substring(0,window.location.hostname.indexOf(".")).toLowerCase())*/)?FFGM_DJC_DA_GetUserAvatar(window.location.hostname.substring(0,window.location.hostname.indexOf("."))):(
                "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAABnRSTlMA/wDnANpuaT3yAAAAyUlEQVR42pWSsQmFQBBE18MaBGPB5ArYQAxswDIsyjJswEAMLOASwViwif+DgXFdDP6/yGNnd964l33OXX4+uYi0ZY3L8tZpqwFfTVU0VcGClaKEa7C1oe9sQ1vWQ99ZQYDFelwxRttAaYxxPS5ABjKN0ywiqoqGoe9UVUTGaWaenC7LuWOqqkK3bZuVem464DipV7tYLvSDhKwAIHdb1p6bU8nKqXC4/wlWkFKyrMyQUuLicovlYsGBi7zV63G9vhOLJCLZX2/wC9Rae0pYmE++AAAAAElFTkSuQmCC") /* fallback */
                );

   lnk_CTxt.appendChild(ico_CTxt);TaskBar.appendChild(lnk_CTxt); // put IMG in A
   ico_CTxt.style.padding="7px;";ico_CTxt.style.backgroundColor="#2A3737";
   if(ContextState!=null)lnk_CTxt.addEventListener("mouseover",(function(){if(!FFGM_DJC_DA_CTI_CTxtMenuOpen){document.getElementById("DJCCTI_CTxt").childNodes[0].style.backgroundColor="#1F292A";}}),true); // set up mouse events
   if(ContextState!=null)lnk_CTxt.addEventListener("mouseout",(function(){if(!FFGM_DJC_DA_CTI_CTxtMenuOpen){document.getElementById("DJCCTI_CTxt").childNodes[0].style.backgroundColor="#2A3737";}}),true);
   if(ContextState!=null)lnk_CTxt.addEventListener("click",(function(){if(!FFGM_DJC_DA_CTI_CTxtMenuOpen){FFGM_DJC_DA_CTICloseMenues();FFGM_DJC_DA_CTIOpenMenu("CTxt");return;}else{FFGM_DJC_DA_CTICloseMenu("CTxt");return;}}),true);
   if(ContextState=="USRPG"/*&&!(unsafeWindow.deviantART.deviant.username.toLowerCase()===window.location.hostname.substring(0,window.location.hostname.indexOf(".")).toLowerCase())*/){
      ico_CTxt.style.width="25px";
      ico_CTxt.style.height="25px";
      ico_CTxt.style.padding="2px";
   }

   // end   CONTEXT

   // create and set up click-menu for SITE
   var mnu_Site=document.createElement("div");mnu_Site.id="DJCCTI_Site_Menu";mnu_Site.style.position="absolute";mnu_Site.style.display="none";mnu_Site.className="floater menufloater floater-fixed";
   mnu_Site.innerHTML='<div class="popup"><div class="pager slider"><div style="left: 0pt;" class="page switcher"><dl class="f hat"><dd style="height: 322px;" class="f flex-fill"><ul class="f menu iconmenu iconset-deviate menu-deviate"></ul></dd></dl></div></div></div>';
   // create and set up menu items for Site
   var itm_Site_Chnl=document.createElement("li");itm_Site_Chnl.className="f";itm_Site_Chnl.innerHTML='<a menuri="" href="http://www.deviantart.com/channels/"><img src="http://e.deviantart.com/emoticons/f/fella.gif" style="margin:2px 7px -4px -25px;">Channels</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Chnl);
   var itm_Site_Brws=document.createElement("li");itm_Site_Brws.className="f";itm_Site_Brws.innerHTML='<a menuri="" href="http://browse.deviantart.com/"><img src="http://i.deviantart.com/icons/activity/deviation.gif" style="margin:2px 7px -4px -25px;">Browse</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Brws);
   var itm_Site_Chat=document.createElement("li");itm_Site_Chat.className="f new";itm_Site_Chat.innerHTML='<a menuri="" href="http://chat.deviantart.com/"><img src="http://e.deviantart.com/emoticons/b/biggrin.gif" style="margin:2px 8px -4px -23px;">Chat</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Chat);
   var itm_Site_Frum=document.createElement("li");itm_Site_Frum.className="f";itm_Site_Frum.innerHTML='<a menuri="" href="http://forum.deviantart.com/"><img src="http://i.deviantart.com/icons/activity/forum.gif" style="margin:2px 7px -4px -25px;">Forum</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Frum);
   var itm_Site_MCtr=document.createElement("li");itm_Site_MCtr.className="f";itm_Site_MCtr.innerHTML='<a menuri="" href="http://my.deviantart.com/messages/"><img src="http://i.deviantart.com/icons/notes/note-read.gif" style="margin:2px 7px -4px -25px;">Message Center</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_MCtr);
   var itm_Site_News=document.createElement("li");itm_Site_News.className="f";itm_Site_News.innerHTML='<a menuri="" href="http://news.deviantart.com/"><img src="http://i.deviantart.com/icons/activity/news.gif" style="margin:2px 7px -4px -25px;">News</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_News);
   var itm_Site_Prts=document.createElement("li");itm_Site_Prts.className="f";itm_Site_Prts.innerHTML='<a menuri="" href="http://news.deviantart.com/"><i class="icon l i4"></i>Prints</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Prts);
   var itm_Site_Shop=document.createElement("li");itm_Site_Shop.className="f";itm_Site_Shop.innerHTML='<a menuri="" href="http://shop.deviantart.com/"><i class="icon l i4"></i>Shop</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Shop);
   var itm_Site_Help=document.createElement("li");itm_Site_Help.className="f";itm_Site_Help.innerHTML='<a menuri="" href="http://help.deviantart.com/"><i class="icon l i12"></i>Help & FAQ</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Help);
   if (unsafeWindow.deviantART.deviant.symbol=="~") { var itm_Site_Subs=document.createElement("li");itm_Site_Subs.className="f new";itm_Site_Subs.innerHTML='<a menuri="" href="https://www.deviantart.com/store/subscribe"><i class="icon l i5"></i>Subscribe</a>';mnu_Site.getElementsByTagName("ul")[0].appendChild(itm_Site_Subs); }

   // create and set up menu icons for SITE
   var lnk_Site=document.createElement("a");lnk_Site.id="DJCCTI_Site";
   var ico_Site=document.createElement("img");ico_Site.src="http://e.deviantart.com/emoticons/f/fella.gif";ico_Site.title="Site...";
   lnk_Site.appendChild(ico_Site);TaskBar.appendChild(lnk_Site); // put IMG in A
   ico_Site.style.padding="7px;";ico_Site.style.backgroundColor="#2A3737";
   lnk_Site.addEventListener("mouseover",(function(){if(!FFGM_DJC_DA_CTI_SiteMenuOpen){document.getElementById("DJCCTI_Site").childNodes[0].style.backgroundColor="#1F292A";}}),true); // set up mouse events
   lnk_Site.addEventListener("mouseout",(function(){if(!FFGM_DJC_DA_CTI_SiteMenuOpen){document.getElementById("DJCCTI_Site").childNodes[0].style.backgroundColor="#2A3737";}}),true);
   lnk_Site.addEventListener("click",(function(){if(!FFGM_DJC_DA_CTI_SiteMenuOpen){FFGM_DJC_DA_CTICloseMenues();FFGM_DJC_DA_CTIOpenMenu("Site");return;}else{FFGM_DJC_DA_CTICloseMenu("Site");return;}}),true);

   // create and set up click-menu for ABOT
   var mnu_Abot=document.createElement("div");mnu_Abot.id="DJCCTI_Abot_Menu";mnu_Abot.style.position="absolute";mnu_Abot.style.display="none";mnu_Abot.className="floater menufloater floater-fixed";
   mnu_Abot.innerHTML='<div class="popup"><div class="pager slider"><div style="left: 0pt;" class="page switcher"><dl class="f hat"><dd style="height: 322px;" class="f flex-fill"><ul class="f menu iconmenu iconset-deviate menu-deviate"></ul></dd></dl></div></div></div>';
   // create and set up menu items for ABOT
   var itm_Abot_This=document.createElement("li");itm_Abot_This.className="f";itm_Abot_This.innerHTML='<a menuri="" href="http://www.deviantart.com/deviation/87265458"><img src="http://e.deviantart.com/emoticons/f/fella.gif" style="margin:2px 7px -4px -25px;">About this Userscript</a>';mnu_Abot.getElementsByTagName("ul")[0].appendChild(itm_Abot_This);
   var itm_Abot_DJCl=document.createElement("li");itm_Abot_DJCl.className="f";itm_Abot_DJCl.innerHTML='<a menuri="" href="http://davidjcobb.deviantart.com/"><img src="http://a.deviantart.com/avatars/d/a/davidjcobb.png" width="15" height="15" style="margin:2px 7px -3px -25px;">About the Author</a>';mnu_Abot.getElementsByTagName("ul")[0].appendChild(itm_Abot_DJCl);
   var itm_Abot_MOAR=document.createElement("li");itm_Abot_MOAR.className="f new";itm_Abot_MOAR.innerHTML='<a menuri="" href="http://davidjcobb.deviantart.com/gallery/#Greasemonkey-Userscripts"><img src="http://e.deviantart.com/emoticons/f/favheart.gif" style="margin:2px 7px -3px -25px;">More Userscripts</a>';mnu_Abot.getElementsByTagName("ul")[0].appendChild(itm_Abot_MOAR);
  
   // create and set up menu icons for ABOT
   var lnk_Abot=document.createElement("a");lnk_Abot.id="DJCCTI_Abot";
   var ico_Abot=document.createElement("img");ico_Abot.src="http://e.deviantart.com/emoticons/n/nod.gif";ico_Abot.title="About...";
   lnk_Abot.appendChild(ico_Abot);TaskBar.appendChild(lnk_Abot); // put IMG in A
   ico_Abot.style.padding="7px;";ico_Abot.style.backgroundColor="#2A3737";
   lnk_Abot.addEventListener("mouseover",(function(){if(!FFGM_DJC_DA_CTI_AbotMenuOpen){document.getElementById("DJCCTI_Abot").childNodes[0].style.backgroundColor="#1F292A";}}),true); // set up mouse events
   lnk_Abot.addEventListener("mouseout",(function(){if(!FFGM_DJC_DA_CTI_AbotMenuOpen){document.getElementById("DJCCTI_Abot").childNodes[0].style.backgroundColor="#2A3737";}}),true);
   lnk_Abot.addEventListener("click",(function(){if(!FFGM_DJC_DA_CTI_AbotMenuOpen){FFGM_DJC_DA_CTICloseMenues();FFGM_DJC_DA_CTIOpenMenu("Abot");return;}else{FFGM_DJC_DA_CTICloseMenu("Abot");return;}}),true);

   // create and set up click-menu for RVRT
   var mnu_RVRT=document.createElement("div");mnu_RVRT.id="DJCCTI_RVRT_Menu";mnu_RVRT.style.position="absolute";mnu_RVRT.style.display="none";mnu_RVRT.className="floater menufloater floater-fixed";
   mnu_RVRT.innerHTML='<div class="popup"><div class="pager slider"><div style="left: 0pt;" class="page switcher"><dl class="f hat"><dd style="height: 322px;" class="f flex-fill"><ul class="f menu iconmenu iconset-deviate menu-deviate"></ul></dd></dl></div></div></div>';
   // create and set up menu items for RVRT
   var itm_RVRT_RVRT=document.createElement("li");itm_RVRT_RVRT.className="f";itm_RVRT_RVRT.innerHTML='<a menuri="" href="javascript:(function(){document.getElementById(\'DJCCTI_TaskBar\').style.display=\'none\';document.getElementById(\'appBar\').style.display=\'block\';document.getElementById(\'appFolderButton\').style.display=\'block\';FFGM_DJC_DA_CTICloseMenues();if(GM_setValue){GM_setValue(\'show\',false)}})();"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAABnRSTlMA/wDnANpuaT3yAAAAi0lEQVR42mP8//wWA9GABY1vK6mGzD2MahYj3Gw0dVj1MBFUiizLxEAKYMJlcJqf49zWijQ/R2TjWXAZY25unlzdYa0shm42HMxtrYCTEIa2tjZO1QwMDMiGJVd3mJub41R98uTJpKSkkydPQthzWysgbPTwxh+C8CAnPQQxYxhXXDKipSpi0wkxAABeODrTcei7jwAAAABJRU5ErkJggg==" style="margin:2px 7px -4px -25px;">Switch to v6 AppBar</a>';mnu_RVRT.getElementsByTagName("ul")[0].appendChild(itm_RVRT_RVRT);

   // create and set up menu icons for RVRT
   var lnk_RVRT=document.createElement("a");lnk_RVRT.id="DJCCTI_RVRT";
   var ico_RVRT=document.createElement("img");ico_RVRT.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAABnRSTlMA/wDnANpuaT3yAAAAi0lEQVR42mP8//wWA9GABY1vK6mGzD2MahYj3Gw0dVj1MBFUiizLxEAKYMJlcJqf49zWijQ/R2TjWXAZY25unlzdYa0shm42HMxtrYCTEIa2tjZO1QwMDMiGJVd3mJub41R98uTJpKSkkydPQthzWysgbPTwxh+C8CAnPQQxYxhXXDKipSpi0wkxAABeODrTcei7jwAAAABJRU5ErkJggg==";ico_RVRT.title="Revert to v6 AppBar...";
   lnk_RVRT.appendChild(ico_RVRT);TaskBar.appendChild(lnk_RVRT); // put IMG in A
   ico_RVRT.style.padding="7px;";ico_RVRT.style.backgroundColor="#2A3737";
   lnk_RVRT.addEventListener("mouseover",(function(){if(!FFGM_DJC_DA_CTI_RVRTMenuOpen){document.getElementById("DJCCTI_RVRT").childNodes[0].style.backgroundColor="#1F292A";}}),true); // set up mouse events
   lnk_RVRT.addEventListener("mouseout",(function(){if(!FFGM_DJC_DA_CTI_RVRTMenuOpen){document.getElementById("DJCCTI_RVRT").childNodes[0].style.backgroundColor="#2A3737";}}),true);
   lnk_RVRT.addEventListener("click",(function(){if(!FFGM_DJC_DA_CTI_RVRTMenuOpen){FFGM_DJC_DA_CTICloseMenues();FFGM_DJC_DA_CTIOpenMenu("RVRT");return;}else{FFGM_DJC_DA_CTICloseMenu("RVRT");return;}}),true);


   // start appendin' the menues.
   document.body.appendChild(mnu_User);
   document.body.appendChild(mnu_Edit);
   document.body.appendChild(mnu_CTxt);
   document.body.appendChild(mnu_Site);
   document.body.appendChild(mnu_Abot);
   document.body.appendChild(mnu_RVRT);

   //document.getElementById("top-deviant").insertBefore(TaskBar,document.getElementById("top-friends")); // v5
   //document.getElementById("appBar").parentNode.replaceChild(TaskBar,document.getElementById("appBar")); // v6
   //document.getElementById("viewPort").removeChild(document.getElementById("appFolderButton")); // v6
   document.getElementById("appBar").parentNode.insertBefore(TaskBar,document.getElementById("appBar")); // v6
   document.getElementById("appBar").style.display="none";document.getElementById("appFolderButton").style.display="none"; // v6
   //sleekApp=null;sleekMenu=null; // v6

   document.addEventListener("click",
   (function(e){
      if (document.getElementById("DJCCTI_User_Menu").innerHTML.indexOf(e.target.innerHTML)==-1 && document.getElementById("DJCCTI_Edit_Menu").innerHTML.indexOf(e.target.innerHTML)==-1 && document.getElementById("DJCCTI_Site_Menu").innerHTML.indexOf(e.target.innerHTML)==-1 && document.getElementById("DJCCTI_Abot_Menu").innerHTML.indexOf(e.target.innerHTML)==-1) {
         FFGM_DJC_DA_CTICloseMenues();
         return false;
      }
   }),true);
   if(!GM_getValue('show',true))(function(){document.getElementById("DJCCTI_TaskBar").style.display="";document.getElementById("appBar").style.display="none";document.getElementById("appFolderButton").style.display="none";})();

   // add ability to switch from appbar to CTI
   a=document.createElement("div");a.id="appGroupDJCCTI";a.className="appFolderGroup";
   a.innerHTML="&nbsp;&nbsp;Common Tasks";
   document.getElementById("appFolderMenu").appendChild(a);
   a.addEventListener("click",function(){document.getElementById("DJCCTI_TaskBar").style.display="";document.getElementById("appBar").style.display="none";document.getElementById("appFolderButton").style.display="none";unsafeWindow.sleekMenu.folderClose();if(GM_setValue){GM_setValue('show',false)}},true);

};
document.addEventListener("DOMContentLoaded",FFGM_DJC_DA_AddTasks,true);
unsafeWindow.addEventListener("load",FFGM_DJC_DA_AddTasks,true); // catch-all