Guest User

Untitled

a guest
Jun 3rd, 2018
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 445.73 KB | None | 0 0
  1. // ==UserScript==
  2. // @name GaiaUpgrade
  3. // @author Unheard
  4. // @version 2.36
  5. // @namespace https://greasyfork.org/en/users/9948
  6. // @description A lot of useful upgrade for Gaia Online.
  7. // @include https://www.gaiaonline.com/*
  8. // @resource gucss https://gaiatools.com/assets/css/v2.25.css
  9. // @grant GM_addStyle
  10. // @grant GM_getResourceText
  11. // @grant GM_getValue
  12. // @grant GM_setValue
  13. // @grant GM_deleteValue
  14. // @grant GM_listValues
  15. // @grant GM_xmlhttpRequest
  16. // @run-at document-start
  17. // @connect gaiaonline.com
  18. // ==/UserScript==
  19.  
  20. /*!
  21. * jQuery JavaScript Library v1.10.2
  22. * http://jquery.com/
  23. *
  24. * Includes Sizzle.js
  25. * http://sizzlejs.com/
  26. *
  27. * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
  28. * Released under the MIT license
  29. * http://jquery.org/license
  30. *
  31. * Date: 2013-07-03T13:48Z
  32. */
  33.  
  34.  
  35. (function(window,undefined){var readyList,rootjQuery,core_strundefined=typeof undefined,location=window.location,document=window.document,docElem=document.documentElement,_jQuery=window.jQuery,_$=window.$,class2type={},core_deletedIds=[],core_version="1.10.2",core_concat=core_deletedIds.concat,core_push=core_deletedIds.push,core_slice=core_deletedIds.slice,core_indexOf=core_deletedIds.indexOf,core_toString=class2type.toString,core_hasOwn=class2type.hasOwnProperty,core_trim=core_version.trim,jQuery=function(selector,context){return new jQuery.fn.init(selector,context,rootjQuery)},core_pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,core_rnotwhite=/\S+/g,rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rvalidchars=/^[\],:{}\s]*$/,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rvalidescape=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rvalidtokens=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase()},completed=function(event){if(document.addEventListener||event.type==="load"||document.readyState==="complete"){detach();jQuery.ready()}},detach=function(){if(document.addEventListener){document.removeEventListener("DOMContentLoaded",completed,false);window.removeEventListener("load",completed,false)}else{document.detachEvent("onreadystatechange",completed);window.detachEvent("onload",completed)}};jQuery.fn=jQuery.prototype={jquery:core_version,constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem;if(!selector){return this}if(typeof selector==="string"){if(selector.charAt(0)==="<"&&selector.charAt(selector.length-1)===">"&&selector.length>=3){match=[null,selector,null]}else{match=rquickExpr.exec(selector)}if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match])}else{this.attr(match,context[match])}}}return this}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){if(elem.id!==match[2]){return rootjQuery.find(selector)}this.length=1;this[0]=elem}this.context=document;this.selector=selector;return this}}else if(!context||context.jquery){return(context||rootjQuery).find(selector)}else{return this.constructor(context).find(selector)}}else if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector)}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}return jQuery.makeArray(selector,this)},selector:"",length:0,toArray:function(){return core_slice.call(this)},get:function(num){return num==null?this.toArray():(num<0?this[this.length+num]:this[num])},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;ret.context=this.context;return ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){jQuery.ready.promise().done(fn);return this},slice:function(){return this.pushStack(core_slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[])},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},end:function(){return this.prevObject||this.constructor(null)},push:core_push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var src,copyIsArray,copy,name,options,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}}if(length===i){target=this;--i}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&jQuery.isArray(src)?src:[]}else{clone=src&&jQuery.isPlainObject(src)?src:{}}target[name]=jQuery.extend(deep,clone,copy)}else if(copy!==undefined){target[name]=copy}}}}return target};jQuery.extend({expando:"jQuery"+(core_version+Math.random()).replace(/\D/g,""),noConflict:function(deep){if(window.$===jQuery){window.$=_$}if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery}return jQuery},isReady:false,readyWait:1,holdReady:function(hold){if(hold){jQuery.readyWait++}else{jQuery.ready(true)}},ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return}if(!document.body){return setTimeout(jQuery.ready)}jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return}readyList.resolveWith(document,[jQuery]);if(jQuery.fn.trigger){jQuery(document).trigger("ready").off("ready")}},isFunction:function(obj){return jQuery.type(obj)==="function"},isArray:Array.isArray||function(obj){return jQuery.type(obj)==="array"},isWindow:function(obj){return obj!=null&&obj==obj.window},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj)},type:function(obj){if(obj==null){return String(obj)}return typeof obj==="object"||typeof obj==="function"?class2type[core_toString.call(obj)]||"object":typeof obj},isPlainObject:function(obj){var key;if(!obj||jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false}try{if(obj.constructor&&!core_hasOwn.call(obj,"constructor")&&!core_hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false}}catch(e){return false}if(jQuery.support.ownLast){for(key in obj){return core_hasOwn.call(obj,key)}}for(key in obj){}return key===undefined||core_hasOwn.call(obj,key)},isEmptyObject:function(obj){var name;for(name in obj){return false}return true},error:function(msg){throw new Error(msg)},parseHTML:function(data,context,keepScripts){if(!data||typeof data!=="string"){return null}if(typeof context==="boolean"){keepScripts=context;context=false}context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])]}parsed=jQuery.buildFragment([data],context,scripts);if(scripts){jQuery(scripts).remove()}return jQuery.merge([],parsed.childNodes)},parseJSON:function(data){if(window.JSON&&window.JSON.parse){return window.JSON.parse(data)}if(data===null){return data}if(typeof data==="string"){data=jQuery.trim(data);if(data){if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return(new Function("return "+data))()}}}jQuery.error("Invalid JSON: "+data)},parseXML:function(data){var xml,tmp;if(!data||typeof data!=="string"){return null}try{if(window.DOMParser){tmp=new DOMParser();xml=tmp.parseFromString(data,"text/xml")}else{xml=new ActiveXObject("Microsoft.XMLDOM");xml.async="false";xml.loadXML(data)}}catch(e){xml=undefined}if(!xml||!xml.documentElement||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data)}return xml},noop:function(){},globalEval:function(data){if(data&&jQuery.trim(data)){(window.execScript||function(data){window["eval"].call(window,data)})(data)}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray){for(;i<length;i++){value=callback.apply(obj[i],args);if(value===false){break}}}else{for(i in obj){value=callback.apply(obj[i],args);if(value===false){break}}}}else{if(isArray){for(;i<length;i++){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}else{for(i in obj){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}}return obj},trim:core_trim&&!core_trim.call("\uFEFF\xA0")?function(text){return text==null?"":core_trim.call(text)}:function(text){return text==null?"":(text+"").replace(rtrim,"")},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArraylike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr)}else{core_push.call(ret,arr)}}return ret},inArray:function(elem,arr,i){var len;if(arr){if(core_indexOf){return core_indexOf.call(arr,elem,i)}len=arr.length;i=i?i<0?Math.max(0,len+i):i:0;for(;i<len;i++){if(i in arr&&arr[i]===elem){return i}}}return-1},merge:function(first,second){var l=second.length,i=first.length,j=0;if(typeof l==="number"){for(;j<l;j++){first[i++]=second[j]}}else{while(second[j]!==undefined){first[i++]=second[j++]}}first.length=i;return first},grep:function(elems,callback,inv){var retVal,ret=[],i=0,length=elems.length;inv=!!inv;for(;i<length;i++){retVal=!!callback(elems[i],i);if(inv!==retVal){ret.push(elems[i])}}return ret},map:function(elems,callback,arg){var value,i=0,length=elems.length,isArray=isArraylike(elems),ret=[];if(isArray){for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value}}}return core_concat.apply([],ret)},guid:1,proxy:function(fn,context){var args,proxy,tmp;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp}if(!jQuery.isFunction(fn)){return undefined}args=core_slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(core_slice.call(arguments)))};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy},access:function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,length=elems.length,bulk=key==null;if(jQuery.type(key)==="object"){chainable=true;for(i in key){jQuery.access(elems,fn,i,key[i],true,emptyGet,raw)}}else if(value!==undefined){chainable=true;if(!jQuery.isFunction(value)){raw=true}if(bulk){if(raw){fn.call(elems,value);fn=null}else{bulk=fn;fn=function(elem,key,value){return bulk.call(jQuery(elem),value)}}}if(fn){for(;i<length;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)))}}}return chainable?elems:bulk?fn.call(elems):length?fn(elems[0],key):emptyGet},now:function(){return(new Date()).getTime()},swap:function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name]}ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name]}return ret}});jQuery.ready.promise=function(obj){if(!readyList){readyList=jQuery.Deferred();if(document.readyState==="complete"){setTimeout(jQuery.ready)}else if(document.addEventListener){document.addEventListener("DOMContentLoaded",completed,false);window.addEventListener("load",completed,false)}else{document.attachEvent("onreadystatechange",completed);window.attachEvent("onload",completed);var top=false;try{top=window.frameElement==null&&document.documentElement}catch(e){}if(top&&top.doScroll){(function doScrollCheck(){if(!jQuery.isReady){try{top.doScroll("left")}catch(e){return setTimeout(doScrollCheck,50)}detach();jQuery.ready()}})()}}}return readyList.promise(obj)};jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()});function isArraylike(obj){var length=obj.length,type=jQuery.type(obj);if(jQuery.isWindow(obj)){return false}if(obj.nodeType===1&&length){return true}return type==="array"||type!=="function"&&(length===0||typeof length==="number"&&length>0&&(length-1)in obj)}rootjQuery=jQuery(document);(function(window,undefined){var i,support,cachedruns,Expr,getText,isXML,compile,outermostContext,sortInput,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+ -(new Date()),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),hasDuplicate=false,sortOrder=function(a,b){if(a===b){hasDuplicate=true;return 0}return 0},strundefined=typeof undefined,MAX_NEGATIVE=1<<31,hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){var i=0,len=this.length;for(;i<len;i++){if(this[i]===elem){return i}}return-1},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",characterEncoding="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",identifier=characterEncoding.replace("w","w#"),attributes="\\["+whitespace+"*("+characterEncoding+")"+whitespace+"*(?:([*^$|!~]?=)"+whitespace+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+identifier+")|)|)"+whitespace+"*\\]",pseudos=":("+characterEncoding+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+attributes.replace(3,8)+")*)|.*)\\)|)",rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rsibling=new RegExp(whitespace+"*[+~]"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+characterEncoding+")"),"CLASS":new RegExp("^\\.("+characterEncoding+")"),"TAG":new RegExp("^("+characterEncoding.replace("w","w*")+")"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-0x10000;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00)};try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){}target.length=j-1}}}function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context)}context=context||document;results=results||[];if(!selector||typeof selector!=="string"){return results}if((nodeType=context.nodeType)!==1&&nodeType!==9){return[]}if(documentIsHTML&&!seed){if((match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){elem=context.getElementById(m);if(elem&&elem.parentNode){if(elem.id===m){results.push(elem);return results}}else{return results}}else{if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results}}if(support.qsa&&(!rbuggyQSA||!rbuggyQSA.test(selector))){nid=old=expando;newContext=context;newSelector=nodeType===9&&selector;if(nodeType===1&&context.nodeName.toLowerCase()!=="object"){groups=tokenize(selector);if((old=context.getAttribute("id"))){nid=old.replace(rescape,"\\$&")}else{context.setAttribute("id",nid)}nid="[id='"+nid+"'] ";i=groups.length;while(i--){groups[i]=nid+toSelector(groups[i])}newContext=rsibling.test(selector)&&context.parentNode||context;newSelector=groups.join(",")}if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results}catch(qsaError){}finally{if(!old){context.removeAttribute("id")}}}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){var keys=[];function cache(key,value){if(keys.push(key+=" ")>Expr.cacheLength){delete cache[keys.shift()]}return(cache[key]=value)}return cache}function markFunction(fn){fn[expando]=true;return fn}function assert(fn){var div=document.createElement("div");try{return!!fn(div)}catch(e){return false}finally{if(div.parentNode){div.parentNode.removeChild(div)}div=null}}function addHandle(attrs,handler){var arr=attrs.split("|"),i=attrs.length;while(i--){Expr.attrHandle[arr[i]]=handler}}function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff){return diff}if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1}}}return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j])}}})})}isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};support=Sizzle.support={};setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc,parent=doc.defaultView;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document}document=doc;docElem=doc.documentElement;documentIsHTML=!isXML(doc);if(parent&&parent.attachEvent&&parent!==parent.top){parent.attachEvent("onbeforeunload",function(){setDocument()})}support.attributes=assert(function(div){div.className="i";return!div.getAttribute("className")});support.getElementsByTagName=assert(function(div){div.appendChild(doc.createComment(""));return!div.getElementsByTagName("*").length});support.getElementsByClassName=assert(function(div){div.innerHTML="<div class='a'></div><div class='a i'></div>";div.firstChild.className="i";return div.getElementsByClassName("i").length===2});support.getById=assert(function(div){docElem.appendChild(div).id=expando;return!doc.getElementsByName||!doc.getElementsByName(expando).length});if(support.getById){Expr.find["ID"]=function(id,context){if(typeof context.getElementById!==strundefined&&documentIsHTML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}};Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}}else{delete Expr.find["ID"];Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId}}}Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!==strundefined){return context.getElementsByTagName(tag)}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem)}}return tmp}return results};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&documentIsHTML){return context.getElementsByClassName(className)}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(doc.querySelectorAll))){assert(function(div){div.innerHTML="<select><option selected=''></option></select>";if(!div.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")")}if(!div.querySelectorAll(":checked").length){rbuggyQSA.push(":checked")}});assert(function(div){var input=doc.createElement("input");input.setAttribute("type","hidden");div.appendChild(input).setAttribute("t","");if(div.querySelectorAll("[t^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")")}if(!div.querySelectorAll(":enabled").length){rbuggyQSA.push(":enabled",":disabled")}div.querySelectorAll("*,:x");rbuggyQSA.push(",.*:")})}if((support.matchesSelector=rnative.test((matches=docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(div){support.disconnectedMatch=matches.call(div,"div");matches.call(div,"[s!='']:x");rbuggyMatches.push("!=",pseudos)})}rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));contains=rnative.test(docElem.contains)||docElem.compareDocumentPosition?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16))}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true}}}return false};sortOrder=docElem.compareDocumentPosition?function(a,b){if(a===b){hasDuplicate=true;return 0}var compare=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b);if(compare){if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===doc||contains(preferredDoc,a)){return-1}if(b===doc||contains(preferredDoc,b)){return 1}return sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0}return compare&4?-1:1}return a.compareDocumentPosition?-1:1}:function(a,b){var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(a===b){hasDuplicate=true;return 0}else if(!aup||!bup){return a===doc?-1:b===doc?1:aup?-1:bup?1:sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0}else if(aup===bup){return siblingCheck(a,b)}cur=a;while((cur=cur.parentNode)){ap.unshift(cur)}cur=b;while((cur=cur.parentNode)){bp.unshift(cur)}while(ap[i]===bp[i]){i++}return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0};return doc};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem)}expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret}}catch(e){}}return Sizzle(expr,document,null,[elem]).length>0};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context)}return contains(context,elem)};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem)}var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val===undefined?support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null:val};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i)}}while(j--){results.splice(duplicates[j],1)}}return results};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){for(;(node=elem[i]);i++){ret+=getText(node)}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem)}}}else if(nodeType===3||nodeType===4){return elem.nodeValue}return ret};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" "}return match.slice(0,4)},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0])}match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd")}else if(match[3]){Sizzle.error(match[0])}return match},"PSEUDO":function(match){var excess,unquoted=!match[5]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null}if(match[3]&&match[4]!==undefined){match[2]=match[4]}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess)}return match.slice(0,3)}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"")})},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!="}if(!operator){return true}result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false}},"CHILD":function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false}}start=dir=type==="only"&&!start&&"nextSibling"}return true}start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){outerCache=parent[expando]||(parent[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=cache[0]===dirruns&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns){diff=cache[1]}else{while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){(node[expando]||(node[expando]={}))[type]=[dirruns,diff]}if(node===elem){break}}}}diff-=last;return diff===first||(diff%first===0&&diff/first>=0)}}},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument)}if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf.call(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i])}}):function(elem){return fn(elem,0,args)}}return fn}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem)}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);return!results.pop()}}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),"contains":markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang)}lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0}}while((elem=elem.parentNode)&&elem.nodeType===1);return false}}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},"root":function(elem){return elem===docElem},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},"enabled":function(elem){return elem.disabled===false},"disabled":function(elem){return elem.disabled===true},"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected)},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex}return elem.selected===true},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeName>"@"||elem.nodeType===3||elem.nodeType===4){return false}}return true},"parent":function(elem){return!Expr.pseudos["empty"](elem)},"header":function(elem){return rheader.test(elem.nodeName)},"input":function(elem){return rinputs.test(elem.nodeName)},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button"},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()===elem.type)},"first":createPositionalPseudo(function(){return[0]}),"last":createPositionalPseudo(function(matchIndexes,length){return[length-1]}),"eq":createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i)}return matchIndexes}),"odd":createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i)}return matchIndexes}),"lt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;--i>=0;){matchIndexes.push(i)}return matchIndexes}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i)}return matchIndexes})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i)}for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i)}function setFilters(){}setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0)}soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar}groups.push(tokens=[])}matched=false;if((match=rcombinators.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length)}for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length)}}if(!matched){break}}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)}function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value}return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,checkNonElements=base&&dir==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml)}}}:function(elem,context,xml){var data,cache,outerCache,dirkey=dirruns+" "+doneName;if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});if((cache=outerCache[dir])&&cache[0]===dirkey){if((data=cache[1])===true||data===cachedruns){return data===true}}else{cache=outerCache[dir]=[dirkey];cache[1]=matcher(elem,context,xml)||cachedruns;if(cache[1]===true){return true}}}}}}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false}}return true}:matchers[0]}function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if((elem=unmatched[i])){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i)}}}}return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter)}if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector)}return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml)}if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if((elem=temp[i])){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem)}}}if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem))}}postFinder(null,(matcherOut=[]),temp,xml)}i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf.call(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem)}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml)}else{push.apply(results,matcherOut)}}})}function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,true),matchers=[function(elem,context,xml){return(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml))}];for(;i<len;i++){if((matcher=Expr.relative[tokens[i].type])){matchers=[addCombinator(elementMatcher(matchers),matcher)]}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break}}return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens))}matchers.push(matcher)}}return elementMatcher(matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){var matcherCachedRuns=0,bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,expandContext){var elem,j,matcher,setMatched=[],matchedCount=0,i="0",unmatched=seed&&[],outermost=expandContext!=null,contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",expandContext&&context.parentNode||context),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1);if(outermost){outermostContext=context!==document&&context;cachedruns=matcherCachedRuns}for(;(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;while((matcher=elementMatchers[j++])){if(matcher(elem,context,xml)){results.push(elem);break}}if(outermost){dirruns=dirrunsUnique;cachedruns=++matcherCachedRuns}}if(bySet){if((elem=!matcher&&elem)){matchedCount--}if(seed){unmatched.push(elem)}}}matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml)}if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results)}}}setMatched=condense(setMatched)}push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results)}}if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup}return unmatched};return bySet?markFunction(superMatcher):superMatcher}compile=Sizzle.compile=function(selector,group){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!group){group=tokenize(selector)}i=group.length;while(i--){cached=matcherFromTokens(group[i]);if(cached[expando]){setMatchers.push(cached)}else{elementMatchers.push(cached)}}cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers))}return cached};function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results)}return results}function select(selector,context,results,seed){var i,tokens,token,type,find,match=tokenize(selector);if(!seed){if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&support.getById&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results}selector=selector.slice(tokens.shift().value.length)}i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break}if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&context.parentNode||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results}break}}}}}compile(selector,match)(seed,context,!documentIsHTML,results,rsibling.test(selector));return results}support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=hasDuplicate;setDocument();support.sortDetached=assert(function(div1){return div1.compareDocumentPosition(document.createElement("div"))&1});if(!assert(function(div){div.innerHTML="<a href='#'></a>";return div.firstChild.getAttribute("href")==="#"})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2)}})}if(!support.attributes||!assert(function(div){div.innerHTML="<input/>";div.firstChild.setAttribute("value","");return div.firstChild.getAttribute("value")===""})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue}})}if(!assert(function(div){return div.getAttribute("disabled")==null})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return(val=elem.getAttributeNode(name))&&val.specified?val.value:elem[name]===true?name.toLowerCase():null}})}jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains})(window);var optionsCache={};function createOptions(options){var object=optionsCache[options]={};jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=true});return object}jQuery.Callbacks=function(options){options=typeof options==="string"?(optionsCache[options]||createOptions(options)):jQuery.extend({},options);var firing,memory,fired,firingLength,firingIndex,firingStart,list=[],stack=!options.once&&[],fire=function(data){memory=options.memory&&data;fired=true;firingIndex=firingStart||0;firingStart=0;firingLength=list.length;firing=true;for(;list&&firingIndex<firingLength;firingIndex++){if(list[firingIndex].apply(data[0],data[1])===false&&options.stopOnFalse){memory=false;break}}firing=false;if(list){if(stack){if(stack.length){fire(stack.shift())}}else if(memory){list=[]}else{self.disable()}}},self={add:function(){if(list){var start=list.length;(function add(args){jQuery.each(args,function(_,arg){var type=jQuery.type(arg);if(type==="function"){if(!options.unique||!self.has(arg)){list.push(arg)}}else if(arg&&arg.length&&type!=="string"){add(arg)}})})(arguments);if(firing){firingLength=list.length}else if(memory){firingStart=start;fire(memory)}}return this},remove:function(){if(list){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(firing){if(index<=firingLength){firingLength--}if(index<=firingIndex){firingIndex--}}}})}return this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!!(list&&list.length)},empty:function(){list=[];firingLength=0;return this},disable:function(){list=stack=memory=undefined;return this},disabled:function(){return!list},lock:function(){stack=undefined;if(!memory){self.disable()}return this},locked:function(){return!stack},fireWith:function(context,args){if(list&&(!fired||stack)){args=args||[];args=[context,args.slice?args.slice():args];if(firing){stack.push(args)}else{fire(args)}}return this},fire:function(){self.fireWith(this,arguments);return this},fired:function(){return!!fired}};return self};jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state},always:function(){deferred.done(arguments).fail(arguments);return this},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var action=tuple[0],fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify)}else{newDefer[action+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments)}})});fns=null}).promise()},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise}},deferred={};promise.pipe=promise.then;jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString},tuples[i^1][2].disable,tuples[2][2].lock)}deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?promise:this,arguments);return this};deferred[tuple[0]+"With"]=list.fireWith});promise.promise(deferred);if(func){func.call(deferred,deferred)}return deferred},when:function(subordinate){var i=0,resolveValues=core_slice.call(arguments),length=resolveValues.length,remaining=length!==1||(subordinate&&jQuery.isFunction(subordinate.promise))?length:0,deferred=remaining===1?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this;values[i]=arguments.length>1?core_slice.call(arguments):value;if(values===progressValues){deferred.notifyWith(contexts,values)}else if(!(--remaining)){deferred.resolveWith(contexts,values)}}},progressValues,progressContexts,resolveContexts;if(length>1){progressValues=new Array(length);progressContexts=new Array(length);resolveContexts=new Array(length);for(;i<length;i++){if(resolveValues[i]&&jQuery.isFunction(resolveValues[i].promise)){resolveValues[i].promise().done(updateFunc(i,resolveContexts,resolveValues)).fail(deferred.reject).progress(updateFunc(i,progressContexts,progressValues))}else{--remaining}}}if(!remaining){deferred.resolveWith(resolveContexts,resolveValues)}return deferred.promise()}});jQuery.support=(function(support){var all,a,input,select,fragment,opt,eventName,isSupported,i,div=document.createElement("div");div.setAttribute("className","t");div.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";all=div.getElementsByTagName("*")||[];a=div.getElementsByTagName("a")[0];if(!a||!a.style||!all.length){return support}select=document.createElement("select");opt=select.appendChild(document.createElement("option"));input=div.getElementsByTagName("input")[0];a.style.cssText="top:1px;float:left;opacity:.5";support.getSetAttribute=div.className!=="t";support.leadingWhitespace=div.firstChild.nodeType===3;support.tbody=!div.getElementsByTagName("tbody").length;support.htmlSerialize=!!div.getElementsByTagName("link").length;support.style=/top/.test(a.getAttribute("style"));support.hrefNormalized=a.getAttribute("href")==="/a";support.opacity=/^0.5/.test(a.style.opacity);support.cssFloat=!!a.style.cssFloat;support.checkOn=!!input.value;support.optSelected=opt.selected;support.enctype=!!document.createElement("form").enctype;support.html5Clone=document.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>";support.inlineBlockNeedsLayout=false;support.shrinkWrapBlocks=false;support.pixelPosition=false;support.deleteExpando=true;support.noCloneEvent=true;support.reliableMarginRight=true;support.boxSizingReliable=true;input.checked=true;support.noCloneChecked=input.cloneNode(true).checked;select.disabled=true;support.optDisabled=!opt.disabled;try{delete div.test}catch(e){support.deleteExpando=false}input=document.createElement("input");input.setAttribute("value","");support.input=input.getAttribute("value")==="";input.value="t";input.setAttribute("type","radio");support.radioValue=input.value==="t";input.setAttribute("checked","t");input.setAttribute("name","t");fragment=document.createDocumentFragment();fragment.appendChild(input);support.appendChecked=input.checked;support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;if(div.attachEvent){div.attachEvent("onclick",function(){support.noCloneEvent=false});div.cloneNode(true).click()}for(i in{submit:true,change:true,focusin:true}){div.setAttribute(eventName="on"+i,"t");support[i+"Bubbles"]=eventName in window||div.attributes[eventName].expando===false}div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";for(i in jQuery(support)){break}support.ownLast=i!=="0";jQuery(function(){var container,marginDiv,tds,divReset="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",body=document.getElementsByTagName("body")[0];if(!body){return}container=document.createElement("div");container.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";body.appendChild(container).appendChild(div);div.innerHTML="<table><tr><td></td><td>t</td></tr></table>";tds=div.getElementsByTagName("td");tds[0].style.cssText="padding:0;margin:0;border:0;display:none";isSupported=(tds[0].offsetHeight===0);tds[0].style.display="";tds[1].style.display="none";support.reliableHiddenOffsets=isSupported&&(tds[0].offsetHeight===0);div.innerHTML="";div.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";jQuery.swap(body,body.style.zoom!=null?{zoom:1}:{},function(){support.boxSizing=div.offsetWidth===4});if(window.getComputedStyle){support.pixelPosition=(window.getComputedStyle(div,null)||{}).top!=="1%";support.boxSizingReliable=(window.getComputedStyle(div,null)||{width:"4px"}).width==="4px";marginDiv=div.appendChild(document.createElement("div"));marginDiv.style.cssText=div.style.cssText=divReset;marginDiv.style.marginRight=marginDiv.style.width="0";div.style.width="1px";support.reliableMarginRight=!parseFloat((window.getComputedStyle(marginDiv,null)||{}).marginRight)}if(typeof div.style.zoom!==core_strundefined){div.innerHTML="";div.style.cssText=divReset+"width:1px;padding:1px;display:inline;zoom:1";support.inlineBlockNeedsLayout=(div.offsetWidth===3);div.style.display="block";div.innerHTML="<div></div>";div.firstChild.style.width="5px";support.shrinkWrapBlocks=(div.offsetWidth!==3);if(support.inlineBlockNeedsLayout){body.style.zoom=1}}body.removeChild(container);container=div=tds=marginDiv=null});all=select=fragment=opt=a=input=null;return support})({});var rbrace=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,rmultiDash=/([A-Z])/g;function internalData(elem,name,data,pvt){if(!jQuery.acceptData(elem)){return}var ret,thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if((!id||!cache[id]||(!pvt&&!cache[id].data))&&data===undefined&&typeof name==="string"){return}if(!id){if(isNode){id=elem[internalKey]=core_deletedIds.pop()||jQuery.guid++}else{id=internalKey}}if(!cache[id]){cache[id]=isNode?{}:{toJSON:jQuery.noop}}if(typeof name==="object"||typeof name==="function"){if(pvt){cache[id]=jQuery.extend(cache[id],name)}else{cache[id].data=jQuery.extend(cache[id].data,name)}}thisCache=cache[id];if(!pvt){if(!thisCache.data){thisCache.data={}}thisCache=thisCache.data}if(data!==undefined){thisCache[jQuery.camelCase(name)]=data}if(typeof name==="string"){ret=thisCache[name];if(ret==null){ret=thisCache[jQuery.camelCase(name)]}}else{ret=thisCache}return ret}function internalRemoveData(elem,name,pvt){if(!jQuery.acceptData(elem)){return}var thisCache,i,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(!cache[id]){return}if(name){thisCache=pvt?cache[id]:cache[id].data;if(thisCache){if(!jQuery.isArray(name)){if(name in thisCache){name=[name]}else{name=jQuery.camelCase(name);if(name in thisCache){name=[name]}else{name=name.split(" ")}}}else{name=name.concat(jQuery.map(name,jQuery.camelCase))}i=name.length;while(i--){delete thisCache[name[i]]}if(pvt?!isEmptyDataObject(thisCache):!jQuery.isEmptyObject(thisCache)){return}}}if(!pvt){delete cache[id].data;if(!isEmptyDataObject(cache[id])){return}}if(isNode){jQuery.cleanData([elem],true)}else if(jQuery.support.deleteExpando||cache!=cache.window){delete cache[id]}else{cache[id]=null}}jQuery.extend({cache:{},noData:{"applet":true,"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(elem){elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando];return!!elem&&!isEmptyDataObject(elem)},data:function(elem,name,data){return internalData(elem,name,data)},removeData:function(elem,name){return internalRemoveData(elem,name)},_data:function(elem,name,data){return internalData(elem,name,data,true)},_removeData:function(elem,name){return internalRemoveData(elem,name,true)},acceptData:function(elem){if(elem.nodeType&&elem.nodeType!==1&&elem.nodeType!==9){return false}var noData=elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()];return!noData||noData!==true&&elem.getAttribute("classid")===noData}});jQuery.fn.extend({data:function(key,value){var attrs,name,data=null,i=0,elem=this[0];if(key===undefined){if(this.length){data=jQuery.data(elem);if(elem.nodeType===1&&!jQuery._data(elem,"parsedAttrs")){attrs=elem.attributes;for(;i<attrs.length;i++){name=attrs[i].name;if(name.indexOf("data-")===0){name=jQuery.camelCase(name.slice(5));dataAttr(elem,name,data[name])}}jQuery._data(elem,"parsedAttrs",true)}}return data}if(typeof key==="object"){return this.each(function(){jQuery.data(this,key)})}return arguments.length>1?this.each(function(){jQuery.data(this,key,value)}):elem?dataAttr(elem,key,jQuery.data(elem,key)):null},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}});function dataAttr(elem,key,data){if(data===undefined&&elem.nodeType===1){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}jQuery.data(elem,key,data)}else{data=undefined}}return data}function isEmptyDataObject(obj){var name;for(name in obj){if(name==="data"&&jQuery.isEmptyObject(obj[name])){continue}if(name!=="toJSON"){return false}}return true}jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=jQuery._data(elem,type);if(data){if(!queue||jQuery.isArray(data)){queue=jQuery._data(elem,type,jQuery.makeArray(data))}else{queue.push(data)}}return queue||[]}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};if(fn==="inprogress"){fn=queue.shift();startLength--}if(fn){if(type==="fx"){queue.unshift("inprogress")}delete hooks.stop;fn.call(elem,next,hooks)}if(!startLength&&hooks){hooks.empty.fire()}},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue");jQuery._removeData(elem,key)})})}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--}if(arguments.length<setter){return jQuery.queue(this[0],type)}return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=setTimeout(next,time);hooks.stop=function(){clearTimeout(timeout)}})},clearQueue:function(type){return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements])}};if(typeof type!=="string"){obj=type;type=undefined}type=type||"fx";while(i--){tmp=jQuery._data(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve)}}resolve();return defer.promise(obj)}});var nodeHook,boolHook,rclass=/[\t\r\n\f]/g,rreturn=/\r/g,rfocusable=/^(?:input|select|textarea|button|object)$/i,rclickable=/^(?:a|area)$/i,ruseDefault=/^(?:checked|selected)$/i,getSetAttribute=jQuery.support.getSetAttribute,getSetInput=jQuery.support.input;jQuery.fn.extend({attr:function(name,value){return jQuery.access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})},prop:function(name,value){return jQuery.access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){name=jQuery.propFix[name]||name;return this.each(function(){try{this[name]=undefined;delete this[name]}catch(e){}})},addClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed=typeof value==="string"&&value;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))})}if(proceed){classes=(value||"").match(core_rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):" ");if(cur){j=0;while((clazz=classes[j++])){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" "}}elem.className=jQuery.trim(cur)}}}return this},removeClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed=arguments.length===0||typeof value==="string"&&value;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,this.className))})}if(proceed){classes=(value||"").match(core_rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):"");if(cur){j=0;while((clazz=classes[j++])){while(cur.indexOf(" "+clazz+" ")>=0){cur=cur.replace(" "+clazz+" "," ")}}elem.className=value?jQuery.trim(cur):""}}}return this},toggleClass:function(value,stateVal){var type=typeof value;if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value)}if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)})}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),classNames=value.match(core_rnotwhite)||[];while((className=classNames[i++])){if(self.hasClass(className)){self.removeClass(className)}else{self.addClass(className)}}}else if(type===core_strundefined||type==="boolean"){if(this.className){jQuery._data(this,"__className__",this.className)}this.className=this.className||value===false?"":jQuery._data(this,"__className__")||""}})},hasClass:function(selector){var className=" "+selector+" ",i=0,l=this.length;for(;i<l;i++){if(this[i].nodeType===1&&(" "+this[i].className+" ").replace(rclass," ").indexOf(className)>=0){return true}}return false},val:function(value){var ret,hooks,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret}ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret}return}isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return}if(isFunction){val=value.call(this,i,jQuery(this).val())}else{val=value}if(val==null){val=""}else if(typeof val==="number"){val+=""}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+""})}hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val}})}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:elem.text}},select:{get:function(elem){var value,option,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one"||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;for(;i<max;i++){option=options[i];if((option.selected||i===index)&&(jQuery.support.optDisabled?!option.disabled:option.getAttribute("disabled")===null)&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value}values.push(value)}}return values},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if((option.selected=jQuery.inArray(jQuery(option).val(),values)>=0)){optionSet=true}}if(!optionSet){elem.selectedIndex=-1}return values}}},attr:function(elem,name,value){var hooks,ret,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return}if(typeof elem.getAttribute===core_strundefined){return jQuery.prop(elem,name,value)}if(nType!==1||!jQuery.isXMLDoc(elem)){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:nodeHook)}if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name)}else if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret}else{elem.setAttribute(name,value+"");return value}}else if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret}else{ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret}},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){propName=jQuery.propFix[name]||name;if(jQuery.expr.match.bool.test(name)){if(getSetInput&&getSetAttribute||!ruseDefault.test(name)){elem[propName]=false}else{elem[jQuery.camelCase("default-"+name)]=elem[propName]=false}}else{jQuery.attr(elem,name,"")}elem.removeAttribute(getSetAttribute?name:propName)}}},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val}return value}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return}notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name]}if(value!==undefined){return hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem[name]=value)}else{return hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null?ret:elem[name]}},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name)}else if(getSetInput&&getSetAttribute||!ruseDefault.test(name)){elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name)}else{elem[jQuery.camelCase("default-"+name)]=elem[name]=true}return name}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=jQuery.expr.attrHandle[name]||jQuery.find.attr;jQuery.expr.attrHandle[name]=getSetInput&&getSetAttribute||!ruseDefault.test(name)?function(elem,name,isXML){var fn=jQuery.expr.attrHandle[name],ret=isXML?undefined:(jQuery.expr.attrHandle[name]=undefined)!=getter(elem,name,isXML)?name.toLowerCase():null;jQuery.expr.attrHandle[name]=fn;return ret}:function(elem,name,isXML){return isXML?undefined:elem[jQuery.camelCase("default-"+name)]?name.toLowerCase():null}});if(!getSetInput||!getSetAttribute){jQuery.attrHooks.value={set:function(elem,value,name){if(jQuery.nodeName(elem,"input")){elem.defaultValue=value}else{return nodeHook&&nodeHook.set(elem,value,name)}}}}if(!getSetAttribute){nodeHook={set:function(elem,value,name){var ret=elem.getAttributeNode(name);if(!ret){elem.setAttributeNode((ret=elem.ownerDocument.createAttribute(name)))}ret.value=value+="";return name==="value"||value===elem.getAttribute(name)?value:undefined}};jQuery.expr.attrHandle.id=jQuery.expr.attrHandle.name=jQuery.expr.attrHandle.coords=function(elem,name,isXML){var ret;return isXML?undefined:(ret=elem.getAttributeNode(name))&&ret.value!==""?ret.value:null};jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&ret.specified?ret.value:undefined},set:nodeHook.set};jQuery.attrHooks.contenteditable={set:function(elem,value,name){nodeHook.set(elem,value===""?false:value,name)}};jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]={set:function(elem,value){if(value===""){elem.setAttribute(name,"auto");return value}}}})}if(!jQuery.support.hrefNormalized){jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4)}}})}if(!jQuery.support.style){jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||undefined},set:function(elem,value){return(elem.style.cssText=value+"")}}}if(!jQuery.support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex}}return null}}}jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});if(!jQuery.support.enctype){jQuery.propFix.enctype="encoding"}jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0)}}};if(!jQuery.support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value}}});var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;function returnTrue(){return true}function returnFalse(){return false}function safeActiveElement(){try{return document.activeElement}catch(err){}}jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(!elemData){return}if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector}if(!handler.guid){handler.guid=jQuery.guid++}if(!(events=elemData.events)){events=elemData.events={}}if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!==core_strundefined&&(!e||jQuery.event.triggered!==e.type)?jQuery.event.dispatch.apply(eventHandle.elem,arguments):undefined};eventHandle.elem=elem}types=(types||"").match(core_rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue}special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false)}else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle)}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}if(selector){handlers.splice(handlers.delegateCount++,0,handleObj)}else{handlers.push(handleObj)}jQuery.event.global[type]=true}elem=null},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(!elemData||!(events=elemData.events)){return}types=(types||"").match(core_rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true)}continue}special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--}if(special.remove){special.remove.call(elem,handleObj)}}}if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle)}delete events[type]}}if(jQuery.isEmptyObject(events)){delete elemData.handle;jQuery._removeData(elem,"events")}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=core_hasOwn.call(event,"type")?event.type:event,namespaces=core_hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return}if(rfocusMorph.test(type+jQuery.event.triggered)){return}if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();namespaces.sort()}ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem}data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return}if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode}for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur}if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window)}}i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle");if(handle){handle.apply(cur,data)}handle=ontype&&cur[ontype];if(handle&&jQuery.acceptData(cur)&&handle.apply&&handle.apply(cur,data)===false){event.preventDefault()}}event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&jQuery.acceptData(elem)){if(ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null}jQuery.event.triggered=type;try{elem[type]()}catch(e){}jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp}}}}return event.result},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=core_slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return}handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation()}}}}}if(special.postDispatch){special.postDispatch.call(this,event)}return event.result},handlers:function(event,handlers){var sel,handleObj,matches,i,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||event.type!=="click")){for(;cur!=this;cur=cur.parentNode||this){if(cur.nodeType===1&&(cur.disabled!==true||event.type!=="click")){matches=[];for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matches[sel]===undefined){matches[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>=0:jQuery.find(sel,this,null,[cur]).length}if(matches[sel]){matches.push(handleObj)}}if(matches.length){handlerQueue.push({elem:cur,handlers:matches})}}}}if(delegateCount<handlers.length){handlerQueue.push({elem:this,handlers:handlers.slice(delegateCount)})}return handlerQueue},fix:function(event){if(event[jQuery.expando]){return event}var i,prop,copy,type=event.type,originalEvent=event,fixHook=this.fixHooks[type];if(!fixHook){this.fixHooks[type]=fixHook=rmouseEvent.test(type)?this.mouseHooks:rkeyEvent.test(type)?this.keyHooks:{}}copy=fixHook.props?this.props.concat(fixHook.props):this.props;event=new jQuery.Event(originalEvent);i=copy.length;while(i--){prop=copy[i];event[prop]=originalEvent[prop]}if(!event.target){event.target=originalEvent.srcElement||document}if(event.target.nodeType===3){event.target=event.target.parentNode}event.metaKey=!!event.metaKey;return fixHook.filter?fixHook.filter(event,originalEvent):event},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(event,original){if(event.which==null){event.which=original.charCode!=null?original.charCode:original.keyCode}return event}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(event,original){var body,eventDoc,doc,button=original.button,fromElement=original.fromElement;if(event.pageX==null&&original.clientX!=null){eventDoc=event.target.ownerDocument||document;doc=eventDoc.documentElement;body=eventDoc.body;event.pageX=original.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=original.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}if(!event.relatedTarget&&fromElement){event.relatedTarget=fromElement===event.target?original.toElement:fromElement}if(!event.which&&button!==undefined){event.which=(button&1?1:(button&2?3:(button&4?2:0)))}return event}},special:{load:{noBubble:true},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus){try{this.focus();return false}catch(e){}}},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur){this.blur();return false}},delegateType:"focusout"},click:{trigger:function(){if(jQuery.nodeName(this,"input")&&this.type==="checkbox"&&this.click){this.click();return false}},_default:function(event){return jQuery.nodeName(event.target,"a")}},beforeunload:{postDispatch:function(event){if(event.result!==undefined){event.originalEvent.returnValue=event.result}}}},simulate:function(type,elem,event,bubble){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true,originalEvent:{}});if(bubble){jQuery.event.trigger(e,null,elem)}else{jQuery.event.dispatch.call(elem,e)}if(e.isDefaultPrevented()){event.preventDefault()}}};jQuery.removeEvent=document.removeEventListener?function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle,false)}}:function(elem,type,handle){var name="on"+type;if(elem.detachEvent){if(typeof elem[name]===core_strundefined){elem[name]=null}elem.detachEvent(name,handle)}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props)}if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=(src.defaultPrevented||src.returnValue===false||src.getPreventDefault&&src.getPreventDefault())?returnTrue:returnFalse}else{this.type=src}if(props){jQuery.extend(this,props)}this.timeStamp=src&&src.timeStamp||jQuery.now();this[jQuery.expando]=true};jQuery.Event.prototype={isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(!e){return}if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(!e){return}if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation()}};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix}return ret}}});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(){if(jQuery.nodeName(this,"form")){return false}jQuery.event.add(this,"click._submit keypress._submit",function(e){var elem=e.target,form=jQuery.nodeName(elem,"input")||jQuery.nodeName(elem,"button")?elem.form:undefined;if(form&&!jQuery._data(form,"submitBubbles")){jQuery.event.add(form,"submit._submit",function(event){event._submit_bubble=true});jQuery._data(form,"submitBubbles",true)}})},postDispatch:function(event){if(event._submit_bubble){delete event._submit_bubble;if(this.parentNode&&!event.isTrigger){jQuery.event.simulate("submit",this.parentNode,event,true)}}},teardown:function(){if(jQuery.nodeName(this,"form")){return false}jQuery.event.remove(this,"._submit")}}}if(!jQuery.support.changeBubbles){jQuery.event.special.change={setup:function(){if(rformElems.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){jQuery.event.add(this,"propertychange._change",function(event){if(event.originalEvent.propertyName==="checked"){this._just_changed=true}});jQuery.event.add(this,"click._change",function(event){if(this._just_changed&&!event.isTrigger){this._just_changed=false}jQuery.event.simulate("change",this,event,true)})}return false}jQuery.event.add(this,"beforeactivate._change",function(e){var elem=e.target;if(rformElems.test(elem.nodeName)&&!jQuery._data(elem,"changeBubbles")){jQuery.event.add(elem,"change._change",function(event){if(this.parentNode&&!event.isSimulated&&!event.isTrigger){jQuery.event.simulate("change",this.parentNode,event,true)}});jQuery._data(elem,"changeBubbles",true)}})},handle:function(event){var elem=event.target;if(this!==elem||event.isSimulated||event.isTrigger||(elem.type!=="radio"&&elem.type!=="checkbox")){return event.handleObj.handler.apply(this,arguments)}},teardown:function(){jQuery.event.remove(this,"._change");return!rformElems.test(this.nodeName)}}}if(!jQuery.support.focusinBubbles){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var attaches=0,handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event),true)};jQuery.event.special[fix]={setup:function(){if(attaches++===0){document.addEventListener(orig,handler,true)}},teardown:function(){if(--attaches===0){document.removeEventListener(orig,handler,true)}}}})}jQuery.fn.extend({on:function(types,selector,data,fn,one){var type,origFn;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined}for(type in types){this.on(type,selector,data,types[type],one)}return this}if(data==null&&fn==null){fn=selector;data=selector=undefined}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined}else{fn=data;data=selector;selector=undefined}}if(fn===false){fn=returnFalse}else if(!fn){return this}if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments)};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)}return this.each(function(){jQuery.event.add(this,types,fn,data,selector)})},one:function(types,selector,data,fn){return this.on(types,selector,data,fn,1)},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this}if(typeof types==="object"){for(type in types){this.off(type,selector,types[type])}return this}if(selector===false||typeof selector==="function"){fn=selector;selector=undefined}if(fn===false){fn=returnFalse}return this.each(function(){jQuery.event.remove(this,types,fn,selector)})},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true)}}});var isSimple=/^.[^:#\[\.,]*$/,rparentsprev=/^(?:parents|prev(?:Until|All))/,rneedsContext=jQuery.expr.match.needsContext,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({find:function(selector){var i,ret=[],self=this,len=self.length;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true}}}))}for(i=0;i<len;i++){jQuery.find(selector,self[i],ret)}ret=this.pushStack(len>1?jQuery.unique(ret):ret);ret.selector=this.selector?this.selector+" "+selector:selector;return ret},has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;i<len;i++){if(jQuery.contains(this,targets[i])){return true}}})},not:function(selector){return this.pushStack(winnow(this,selector||[],true))},filter:function(selector){return this.pushStack(winnow(this,selector||[],false))},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length},closest:function(selectors,context){var cur,i=0,l=this.length,ret=[],pos=rneedsContext.test(selectors)||typeof selectors!=="string"?jQuery(selectors,context||this.context):0;for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(pos?pos.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){cur=ret.push(cur);break}}}return this.pushStack(ret.length>1?jQuery.unique(ret):ret)},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1}if(typeof elem==="string"){return jQuery.inArray(this[0],jQuery(elem))}return jQuery.inArray(elem.jquery?elem[0]:elem,this)},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(jQuery.unique(all))},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector))}});function sibling(cur,dir){do{cur=cur[dir]}while(cur&&cur.nodeType!==1);return cur}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret)}if(this.length>1){if(!guaranteedUnique[name]){ret=jQuery.unique(ret)}if(rparentsprev.test(name)){ret=ret.reverse()}}return this.pushStack(ret)}});jQuery.extend({filter:function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")"}return elems.length===1&&elem.nodeType===1?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1}))},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur)}cur=cur[dir]}return matched},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n)}}return r}});function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not})}if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not})}if(typeof qualifier==="string"){if(isSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not)}qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return(jQuery.inArray(elem,qualifier)>=0)!==not})}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement){while(list.length){safeFrag.createElement(list.pop())}}return safeFrag}var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnoInnerhtml=/<(?:script|style|link)/i,manipulation_rcheckableType=/^(?:checkbox|radio)$/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/^$|\/(?:java|ecma)script/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:jQuery.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;jQuery.fn.extend({text:function(value){return jQuery.access(this,function(value){return value===undefined?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value))},null,value,arguments.length)},append:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this)}})},after:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling)}})},remove:function(selector,keepData){var elem,elems=selector?jQuery.filter(selector,this):this,i=0;for(;(elem=elems[i])!=null;i++){if(!keepData&&elem.nodeType===1){jQuery.cleanData(getAll(elem))}if(elem.parentNode){if(keepData&&jQuery.contains(elem.ownerDocument,elem)){setGlobalEval(getAll(elem,"script"))}elem.parentNode.removeChild(elem)}}return this},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false))}while(elem.firstChild){elem.removeChild(elem.firstChild)}if(elem.options&&jQuery.nodeName(elem,"select")){elem.options.length=0}}return this},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return jQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined){return elem.nodeType===1?elem.innerHTML.replace(rinlinejQuery,""):undefined}if(typeof value==="string"&&!rnoInnerhtml.test(value)&&(jQuery.support.htmlSerialize||!rnoshimcache.test(value))&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1></$2>");try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value}}elem=0}catch(e){}}if(elem){this.empty().append(value)}},null,value,arguments.length)},replaceWith:function(){var args=jQuery.map(this,function(elem){return[elem.nextSibling,elem.parentNode]}),i=0;this.domManip(arguments,function(elem){var next=args[i++],parent=args[i++];if(parent){if(next&&next.parentNode!==parent){next=this.nextSibling}jQuery(this).remove();parent.insertBefore(elem,next)}},true);return i?this:this.remove()},detach:function(selector){return this.remove(selector,true)},domManip:function(args,callback,allowIntersection){args=core_concat.apply([],args);var first,node,hasScripts,scripts,doc,fragment,i=0,l=this.length,set=this,iNoClone=l-1,value=args[0],isFunction=jQuery.isFunction(value);if(isFunction||!(l<=1||typeof value!=="string"||jQuery.support.checkClone||!rchecked.test(value))){return this.each(function(index){var self=set.eq(index);if(isFunction){args[0]=value.call(this,index,self.html())}self.domManip(args,callback,allowIntersection)})}if(l){fragment=jQuery.buildFragment(args,this[0].ownerDocument,false,!allowIntersection&&this);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first}if(first){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"))}}callback.call(this[i],node,i)}if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!jQuery._data(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src){jQuery._evalUrl(node.src)}else{jQuery.globalEval((node.text||node.textContent||node.innerHTML||"").replace(rcleanScript,""))}}}}fragment=first=null}}return this}});function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(content.nodeType===1?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){elem.type=(jQuery.find.attr(elem,"type")!==null)+"/"+elem.type;return elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);if(match){elem.type=match[1]}else{elem.removeAttribute("type")}return elem}function setGlobalEval(elems,refElements){var elem,i=0;for(;(elem=elems[i])!=null;i++){jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}}function cloneCopyEvent(src,dest){if(dest.nodeType!==1||!jQuery.hasData(src)){return}var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle;curData.events={};for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i])}}}if(curData.data){curData.data=jQuery.extend({},curData.data)}}function fixCloneNodeIssues(src,dest){var nodeName,e,data;if(dest.nodeType!==1){return}nodeName=dest.nodeName.toLowerCase();if(!jQuery.support.noCloneEvent&&dest[jQuery.expando]){data=jQuery._data(dest);for(e in data.events){jQuery.removeEvent(dest,e,data.handle)}dest.removeAttribute(jQuery.expando)}if(nodeName==="script"&&dest.text!==src.text){disableScript(dest).text=src.text;restoreScript(dest)}else if(nodeName==="object"){if(dest.parentNode){dest.outerHTML=src.outerHTML}if(jQuery.support.html5Clone&&(src.innerHTML&&!jQuery.trim(dest.innerHTML))){dest.innerHTML=src.innerHTML}}else if(nodeName==="input"&&manipulation_rcheckableType.test(src.type)){dest.defaultChecked=dest.checked=src.checked;if(dest.value!==src.value){dest.value=src.value}}else if(nodeName==="option"){dest.defaultSelected=dest.selected=src.defaultSelected}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue}}jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,i=0,ret=[],insert=jQuery(selector),last=insert.length-1;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);core_push.apply(ret,elems.get())}return this.pushStack(ret)}});function getAll(context,tag){var elems,elem,i=0,found=typeof context.getElementsByTagName!==core_strundefined?context.getElementsByTagName(tag||"*"):typeof context.querySelectorAll!==core_strundefined?context.querySelectorAll(tag||"*"):undefined;if(!found){for(found=[],elems=context.childNodes||context;(elem=elems[i])!=null;i++){if(!tag||jQuery.nodeName(elem,tag)){found.push(elem)}else{jQuery.merge(found,getAll(elem,tag))}}}return tag===undefined||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],found):found}function fixDefaultChecked(elem){if(manipulation_rcheckableType.test(elem.type)){elem.defaultChecked=elem.checked}}jQuery.extend({clone:function(elem,dataAndEvents,deepDataAndEvents){var destElements,node,clone,i,srcElements,inPage=jQuery.contains(elem.ownerDocument,elem);if(jQuery.support.html5Clone||jQuery.isXMLDoc(elem)||!rnoshimcache.test("<"+elem.nodeName+">")){clone=elem.cloneNode(true)}else{fragmentDiv.innerHTML=elem.outerHTML;fragmentDiv.removeChild(clone=fragmentDiv.firstChild)}if((!jQuery.support.noCloneEvent||!jQuery.support.noCloneChecked)&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0;(node=srcElements[i])!=null;++i){if(destElements[i]){fixCloneNodeIssues(node,destElements[i])}}}if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0;(node=srcElements[i])!=null;i++){cloneCopyEvent(node,destElements[i])}}else{cloneCopyEvent(elem,clone)}}destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"))}destElements=srcElements=node=null;return clone},buildFragment:function(elems,context,scripts,selection){var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(jQuery.type(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem)}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem))}else{tmp=tmp||safe.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+elem.replace(rxhtmlTag,"<$1></$2>")+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0]))}if(!jQuery.support.tbody){elem=tag==="table"&&!rtbody.test(elem)?tmp.firstChild:wrap[1]==="<table>"&&!rtbody.test(elem)?tmp:0;j=elem&&elem.childNodes.length;while(j--){if(jQuery.nodeName((tbody=elem.childNodes[j]),"tbody")&&!tbody.childNodes.length){elem.removeChild(tbody)}}}jQuery.merge(nodes,tmp.childNodes);tmp.textContent="";while(tmp.firstChild){tmp.removeChild(tmp.firstChild)}tmp=safe.lastChild}}}if(tmp){safe.removeChild(tmp)}if(!jQuery.support.appendChecked){jQuery.grep(getAll(nodes,"input"),fixDefaultChecked)}i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)!==-1){continue}contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(safe.appendChild(elem),"script");if(contains){setGlobalEval(tmp)}if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem)}}}}tmp=null;return safe},cleanData:function(elems,acceptData){var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=jQuery.support.deleteExpando,special=jQuery.event.special;for(;(elem=elems[i])!=null;i++){if(acceptData||jQuery.acceptData(elem)){id=elem[internalKey];data=id&&cache[id];if(data){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type)}else{jQuery.removeEvent(elem,type,data.handle)}}}if(cache[id]){delete cache[id];if(deleteExpando){delete elem[internalKey]}else if(typeof elem.removeAttribute!==core_strundefined){elem.removeAttribute(internalKey)}else{elem[internalKey]=null}core_deletedIds.push(id)}}}}},_evalUrl:function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:false,global:false,"throws":true})}});jQuery.fn.extend({wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))})}if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i))})}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes)}}).end()}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];function vendorPropName(style,name){if(name in style){return name}var capName=name.charAt(0).toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in style){return name}}return origName}function isHidden(elem,el){elem=el||elem;return jQuery.css(elem,"display")==="none"||!jQuery.contains(elem.ownerDocument,elem)}function showHide(elements,show){var display,elem,hidden,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue}values[index]=jQuery._data(elem,"olddisplay");display=elem.style.display;if(show){if(!values[index]&&display==="none"){elem.style.display=""}if(elem.style.display===""&&isHidden(elem)){values[index]=jQuery._data(elem,"olddisplay",css_defaultDisplay(elem.nodeName))}}else{if(!values[index]){hidden=isHidden(elem);if(display&&display!=="none"||!hidden){jQuery._data(elem,"olddisplay",hidden?display:jQuery.css(elem,"display"))}}}}for(index=0;index<length;index++){elem=elements[index];if(!elem.style){continue}if(!show||elem.style.display==="none"||elem.style.display===""){elem.style.display=show?values[index]||"":"none"}}return elements}jQuery.fn.extend({css:function(name,value){return jQuery.access(this,function(elem,name,value){var len,styles,map={},i=0;if(jQuery.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles)}return map}return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)},show:function(){return showHide(this,true)},hide:function(){return showHide(this)},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide()}return this.each(function(){if(isHidden(this)){jQuery(this).show()}else{jQuery(this).hide()}})}});jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret}}}},cssNumber:{"columnCount":true,"fillOpacity":true,"fontWeight":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return}var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rrelNum.exec(value))){value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name));type="number"}if(value==null||type==="number"&&isNaN(value)){return}if(type==="number"&&!jQuery.cssNumber[origName]){value+="px"}if(!jQuery.support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit"}if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){try{style[name]=value}catch(e){}}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret}return style[name]}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra)}if(val===undefined){val=curCSS(elem,name,styles)}if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name]}if(extra===""||extra){num=parseFloat(val);return extra===true||jQuery.isNumeric(num)?num||0:val}return val}});if(window.getComputedStyle){getStyles=function(elem){return window.getComputedStyle(elem,null)};curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;if(computed){if(ret===""&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name)}if(rnumnonpx.test(ret)&&rmargin.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth}}return ret}}else if(document.documentElement.currentStyle){getStyles=function(elem){return elem.currentStyle};curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;if(ret==null&&style&&style[name]){ret=style[name]}if(rnumnonpx.test(ret)&&!rposition.test(name)){left=style.left;rs=elem.runtimeStyle;rsLeft=rs&&rs.left;if(rsLeft){rs.left=elem.currentStyle.left}style.left=name==="fontSize"?"1em":ret;ret=style.pixelLeft+"px";style.left=left;if(rsLeft){rs.left=rsLeft}}return ret===""?"auto":ret}}function setPositiveNumber(elem,value,subtract){var matches=rnumsplit.exec(value);return matches?Math.max(0,matches[1]-(subtract||0))+(matches[2]||"px"):value}function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){var i=extra===(isBorderBox?"border":"content")?4:name==="width"?1:0,val=0;for(;i<4;i+=2){if(extra==="margin"){val+=jQuery.css(elem,extra+cssExpand[i],true,styles)}if(isBorderBox){if(extra==="content"){val-=jQuery.css(elem,"padding"+cssExpand[i],true,styles)}if(extra!=="margin"){val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles)}}else{val+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(extra!=="padding"){val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles)}}}return val}function getWidthOrHeight(elem,name,extra){var valueIsBorderBox=true,val=name==="width"?elem.offsetWidth:elem.offsetHeight,styles=getStyles(elem),isBorderBox=jQuery.support.boxSizing&&jQuery.css(elem,"boxSizing",false,styles)==="border-box";if(val<=0||val==null){val=curCSS(elem,name,styles);if(val<0||val==null){val=elem.style[name]}if(rnumnonpx.test(val)){return val}valueIsBorderBox=isBorderBox&&(jQuery.support.boxSizingReliable||val===elem.style[name]);val=parseFloat(val)||0}return(val+augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles))+"px"}function css_defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];if(!display){display=actualDisplay(nodeName,doc);if(display==="none"||!display){iframe=(iframe||jQuery("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(doc.documentElement);doc=(iframe[0].contentWindow||iframe[0].contentDocument).document;doc.write("<!doctype html><html><body>");doc.close();display=actualDisplay(nodeName,doc);iframe.detach()}elemdisplay[nodeName]=display}return display}function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");elem.remove();return display}jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed){return elem.offsetWidth===0&&rdisplayswap.test(jQuery.css(elem,"display"))?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra)}},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.support.boxSizing&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",styles):0)}}});if(!jQuery.support.opacity){jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?(0.01*parseFloat(RegExp.$1))+"":computed?"1":""},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+value*100+")":"",filter=currentStyle&&currentStyle.filter||style.filter||"";style.zoom=1;if((value>=1||value==="")&&jQuery.trim(filter.replace(ralpha,""))===""&&style.removeAttribute){style.removeAttribute("filter");if(value===""||currentStyle&&!currentStyle.filter){return}}style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity}}}jQuery(function(){if(!jQuery.support.reliableMarginRight){jQuery.cssHooks.marginRight={get:function(elem,computed){if(computed){return jQuery.swap(elem,{"display":"inline-block"},curCSS,[elem,"marginRight"])}}}}if(!jQuery.support.pixelPosition&&jQuery.fn.position){jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]={get:function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}}}})}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||(!jQuery.support.reliableHiddenOffsets&&((elem.style&&elem.style.display)||jQuery.css(elem,"display"))==="none")};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)}}jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0]}return expanded}};if(!rmargin.test(prefix)){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber}});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!manipulation_rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}});jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():(value==null?"":value);s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined){traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional}if(jQuery.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value)})}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add)}}return s.join("&").replace(r20,"+")};function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v)}else{buildParams(prefix+"["+(typeof v==="object"?i:"")+"]",v,traditional,add)}})}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add)}}else{add(prefix,obj)}}jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)},bind:function(types,data,fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn)}});var ajaxLocParts,ajaxLocation,ajax_nonce=jQuery.now(),ajax_rquery=/\?/,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,_load=jQuery.fn.load,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*"}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(core_rnotwhite)||[];if(jQuery.isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func)}else{(structure[dataType]=structure[dataType]||[]).push(func)}}}}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false}else if(seekingTransport){return!(selected=dataTypeOrTransport)}});return selected}return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key]}}if(deep){jQuery.extend(true,target,deep)}return target}jQuery.fn.load=function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments)}var selector,response,type,self=this,off=url.indexOf(" ");if(off>=0){selector=url.slice(off,url.length);url=url.slice(0,off)}if(jQuery.isFunction(params)){callback=params;params=undefined}else if(params&&typeof params==="object"){type="POST"}if(self.length>0){jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])})}return this};jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}});jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined}options=options||{};var parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2]}}match=responseHeaders[key.toLowerCase()]}return match==null?null:match},getAllResponseHeaders:function(){return state===2?responseHeadersString:null},setRequestHeader:function(name,value){var lname=name.toLowerCase();if(!state){name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value}return this},overrideMimeType:function(type){if(!state){s.mimeType=type}return this},statusCode:function(map){var code;if(map){if(state<2){for(code in map){statusCode[code]=[statusCode[code],map[code]]}}else{jqXHR.always(map[jqXHR.status])}}return this},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText)}done(0,finalText);return this}};deferred.promise(jqXHR).complete=completeDeferred.add;jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(core_rnotwhite)||[""];if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!==ajaxLocParts[1]||parts[2]!==ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?"80":"443"))!==(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?"80":"443"))))}if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return jqXHR}fireGlobals=s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart")}s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url;if(!s.hasContent){if(s.data){cacheURL=(s.url+=(ajax_rquery.test(cacheURL)?"&":"?")+s.data);delete s.data}if(s.cache===false){s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+ajax_nonce++):cacheURL+(ajax_rquery.test(cacheURL)?"&":"?")+"_="+ajax_nonce++}}if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL])}if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])}}if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType)}jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i])}if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){return jqXHR.abort()}strAbort="abort";for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i])}transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport")}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s])}if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout)}try{state=1;transport.send(requestHeaders,done)}catch(e){if(state<2){done(-1,e)}else{throw e}}}function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(state===2){return}state=2;if(timeoutTimer){clearTimeout(timeoutTimer)}transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses)}response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified}modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified}}if(status===204||s.type==="HEAD"){statusText="nocontent"}else if(status===304){statusText="notmodified"}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0}}}jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR])}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error])}jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error])}completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop")}}}return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script")}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined}return jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}});function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type")}}if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}}}if(dataTypes[0]in responses){finalDataType=dataTypes[0]}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}if(!firstDataType){firstDataType=type}}finalDataType=finalDataType||firstDataType}if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType)}return responses[finalDataType]}}function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv]}}current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response}if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType)}prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2]}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1])}break}}}}if(conv!==true){if(conv&&s["throws"]){response=conv(response)}else{try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}}}}}return{state:"success",data:response}}jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){jQuery.globalEval(text);return text}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false}if(s.crossDomain){s.type="GET";s.global=false}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script");script.async=true;if(s.scriptCharset){script.charset=s.scriptCharset}script.src=s.url;script.onload=script.onreadystatechange=function(_,isAbort){if(isAbort||!script.readyState||/loaded|complete/.test(script.readyState)){script.onload=script.onreadystatechange=null;if(script.parentNode){script.parentNode.removeChild(script)}script=null;if(!isAbort){callback(200,"success")}}};head.insertBefore(script,head.firstChild)},abort:function(){if(script){script.onload(undefined,true)}}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(ajax_nonce++));this[callback]=true;return callback}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName)}else if(s.jsonp!==false){s.url+=(ajax_rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName}s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called")}return responseContainer[0]};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments};jqXHR.always(function(){window[callbackName]=overwritten;if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName)}if(responseContainer&&jQuery.isFunction(overwritten)){overwritten(responseContainer[0])}responseContainer=overwritten=undefined});return"script"}});var xhrCallbacks,xhrSupported,xhrId=0,xhrOnUnloadAbort=window.ActiveXObject&&function(){var key;for(key in xhrCallbacks){xhrCallbacks[key](undefined,true)}};function createStandardXHR(){try{return new window.XMLHttpRequest()}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}jQuery.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&createStandardXHR()||createActiveXHR()}:createStandardXHR;xhrSupported=jQuery.ajaxSettings.xhr();jQuery.support.cors=!!xhrSupported&&("withCredentials"in xhrSupported);xhrSupported=jQuery.support.ajax=!!xhrSupported;if(xhrSupported){jQuery.ajaxTransport(function(s){if(!s.crossDomain||jQuery.support.cors){var callback;return{send:function(headers,complete){var handle,i,xhr=s.xhr();if(s.username){xhr.open(s.type,s.url,s.async,s.username,s.password)}else{xhr.open(s.type,s.url,s.async)}if(s.xhrFields){for(i in s.xhrFields){xhr[i]=s.xhrFields[i]}}if(s.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(s.mimeType)}if(!s.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest"}try{for(i in headers){xhr.setRequestHeader(i,headers[i])}}catch(err){}xhr.send((s.hasContent&&s.data)||null);callback=function(_,isAbort){var status,responseHeaders,statusText,responses;try{if(callback&&(isAbort||xhr.readyState===4)){callback=undefined;if(handle){xhr.onreadystatechange=jQuery.noop;if(xhrOnUnloadAbort){delete xhrCallbacks[handle]}}if(isAbort){if(xhr.readyState!==4){xhr.abort()}}else{responses={};status=xhr.status;responseHeaders=xhr.getAllResponseHeaders();if(typeof xhr.responseText==="string"){responses.text=xhr.responseText}try{statusText=xhr.statusText}catch(e){statusText=""}if(!status&&s.isLocal&&!s.crossDomain){status=responses.text?200:404}else if(status===1223){status=204}}}}catch(firefoxAccessException){if(!isAbort){complete(-1,firefoxAccessException)}}if(responses){complete(status,statusText,responses,responseHeaders)}};if(!s.async){callback()}else if(xhr.readyState===4){setTimeout(callback)}else{handle=++xhrId;if(xhrOnUnloadAbort){if(!xhrCallbacks){xhrCallbacks={};jQuery(window).unload(xhrOnUnloadAbort)}xhrCallbacks[handle]=callback}xhr.onreadystatechange=callback}},abort:function(){if(callback){callback(undefined,true)}}}}})}var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+core_pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var tween=this.createTween(prop,value),target=tween.cur(),parts=rfxnum.exec(value),unit=parts&&parts[3]||(jQuery.cssNumber[prop]?"":"px"),start=(jQuery.cssNumber[prop]||unit!=="px"&&+target)&&rfxnum.exec(jQuery.css(tween.elem,prop)),scale=1,maxIterations=20;if(start&&start[3]!==unit){unit=unit||start[3];parts=parts||[];start=+target||1;do{scale=scale||".5";start=start/scale;jQuery.style(tween.elem,prop,start+unit)}while(scale!==(scale=tween.cur()/target)&&scale!==1&&--maxIterations)}if(parts){start=tween.start=+start||+target||0;tween.unit=unit;tween.end=parts[1]?start+(parts[1]+1)*parts[2]:+parts[2]}return tween}]};function createFxNow(){setTimeout(function(){fxNow=undefined});return(fxNow=jQuery.now())}function createTween(value,prop,animation){var tween,collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if((tween=collection[index].call(animation,prop,value))){return tween}}}function Animation(elem,properties,options){var result,stopped,index=0,length=animationPrefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),tick=function(){if(stopped){return false}var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent)}deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining}else{deferred.resolveWith(elem,[animation]);return false}},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{}},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this}stopped=true;for(;index<length;index++){animation.tweens[index].run(1)}if(gotoEnd){deferred.resolveWith(elem,[animation,gotoEnd])}else{deferred.rejectWith(elem,[animation,gotoEnd])}return this}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=animationPrefilters[index].call(animation,elem,props,animation.opts);if(result){return result}}jQuery.map(props,createTween,animation);if(jQuery.isFunction(animation.opts.start)){animation.opts.start.call(elem,animation)}jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always)}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=jQuery.camelCase(index);easing=specialEasing[name];value=props[index];if(jQuery.isArray(value)){easing=value[1];value=props[index]=value[0]}if(index!==name){props[name]=value;delete props[index]}hooks=jQuery.cssHooks[name];if(hooks&&"expand"in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing}}}else{specialEasing[name]=easing}}}jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){if(jQuery.isFunction(props)){callback=props;props=["*"]}else{props=props.split(" ")}var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];tweeners[prop]=tweeners[prop]||[];tweeners[prop].unshift(callback)}},prefilter:function(callback,prepend){if(prepend){animationPrefilters.unshift(callback)}else{animationPrefilters.push(callback)}}});function defaultPrefilter(elem,props,opts){var prop,value,toggle,tween,hooks,oldfire,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHidden(elem),dataShow=jQuery._data(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire()}}}hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire()}})})}if(elem.nodeType===1&&("height"in props||"width"in props)){opts.overflow=[style.overflow,style.overflowX,style.overflowY];if(jQuery.css(elem,"display")==="inline"&&jQuery.css(elem,"float")==="none"){if(!jQuery.support.inlineBlockNeedsLayout||css_defaultDisplay(elem.nodeName)==="inline"){style.display="inline-block"}else{style.zoom=1}}}if(opts.overflow){style.overflow="hidden";if(!jQuery.support.shrinkWrapBlocks){anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2]})}}for(prop in props){value=props[prop];if(rfxtypes.exec(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){continue}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}}if(!jQuery.isEmptyObject(orig)){if(dataShow){if("hidden"in dataShow){hidden=dataShow.hidden}}else{dataShow=jQuery._data(elem,"fxshow",{})}if(toggle){dataShow.hidden=!hidden}if(hidden){jQuery(elem).show()}else{anim.done(function(){jQuery(elem).hide()})}anim.done(function(){var prop;jQuery._removeData(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop])}});for(prop in orig){tween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=tween.start;if(hidden){tween.end=tween.start;tween.start=prop==="width"||prop==="height"?1:0}}}}}function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||"swing";this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration)}else{this.pos=eased=percent}this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(hooks&&hooks.set){hooks.set(this)}else{Tween.propHooks._default.set(this)}return this}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem[tween.prop]!=null&&(!tween.elem.style||tween.elem.style[tween.prop]==null)){return tween.elem[tween.prop]}result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween)}else if(tween.elem.style&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}else{tween.elem[tween.prop]=tween.now}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now}}};jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback)}});jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHidden).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||jQuery._data(this,"finish")){anim.stop(true)}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd)};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined}if(clearQueue&&type!==false){this.queue(type||"fx",[])}return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=jQuery._data(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index])}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index])}}}for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1)}}if(dequeue||!gotoEnd){jQuery.dequeue(this,type)}})},finish:function(type){if(type!==false){type=type||"fx"}return this.each(function(){var index,data=jQuery._data(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true)}for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1)}}for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this)}}delete data.finish})}});function genFx(type,includeWidth){var which,attrs={height:type},i=0;includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type}if(includeWidth){attrs.opacity=attrs.width=type}return attrs}jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default;if(opt.queue==null||opt.queue===true){opt.queue="fx"}opt.old=opt.complete;opt.complete=function(){if(jQuery.isFunction(opt.old)){opt.old.call(this)}if(opt.queue){jQuery.dequeue(this,opt.queue)}};return opt};jQuery.easing={linear:function(p){return p},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2}};jQuery.timers=[];jQuery.fx=Tween.prototype.init;jQuery.fx.tick=function(){var timer,timers=jQuery.timers,i=0;fxNow=jQuery.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1)}}if(!timers.length){jQuery.fx.stop()}fxNow=undefined};jQuery.fx.timer=function(timer){if(timer()&&jQuery.timers.push(timer)){jQuery.fx.start()}};jQuery.fx.interval=13;jQuery.fx.start=function(){if(!timerId){timerId=setInterval(jQuery.fx.tick,jQuery.fx.interval)}};jQuery.fx.stop=function(){clearInterval(timerId);timerId=null};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fx.step={};if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length}}jQuery.fn.offset=function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)})}var docElem,win,box={top:0,left:0},elem=this[0],doc=elem&&elem.ownerDocument;if(!doc){return}docElem=doc.documentElement;if(!jQuery.contains(docElem,elem)){return box}if(typeof elem.getBoundingClientRect!==core_strundefined){box=elem.getBoundingClientRect()}win=getWindow(doc);return{top:box.top+(win.pageYOffset||docElem.scrollTop)-(docElem.clientTop||0),left:box.left+(win.pageXOffset||docElem.scrollLeft)-(docElem.clientLeft||0)}};jQuery.offset={setOffset:function(elem,options,i){var position=jQuery.css(elem,"position");if(position==="static"){elem.style.position="relative"}var curElem=jQuery(elem),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),calculatePosition=(position==="absolute"||position==="fixed")&&jQuery.inArray("auto",[curCSSTop,curCSSLeft])>-1,props={},curPosition={},curTop,curLeft;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0}if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset)}if(options.top!=null){props.top=(options.top-curOffset.top)+curTop}if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft}if("using"in options){options.using.call(elem,props)}else{curElem.css(props)}}};jQuery.fn.extend({position:function(){if(!this[0]){return}var offsetParent,offset,parentOffset={top:0,left:0},elem=this[0];if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect()}else{offsetParent=this.offsetParent();offset=this.offset();if(!jQuery.nodeName(offsetParent[0],"html")){parentOffset=offsetParent.offset()}parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",true)}return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||docElem;while(offsetParent&&(!jQuery.nodeName(offsetParent,"html")&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent}return offsetParent||docElem})}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);jQuery.fn[method]=function(val){return jQuery.access(this,function(elem,method,val){var win=getWindow(elem);if(val===undefined){return win?(prop in win)?win[prop]:win.document.documentElement[method]:elem[method]}if(win){win.scrollTo(!top?val:jQuery(win).scrollLeft(),top?val:jQuery(win).scrollTop())}else{elem[method]=val}},method,val,arguments.length,null)}});function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false}jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return jQuery.access(this,function(elem,type,value){var doc;if(jQuery.isWindow(elem)){return elem.document.documentElement["client"+name]}if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])}return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable,null)}})});jQuery.fn.size=function(){return this.length};jQuery.fn.andSelf=jQuery.fn.addBack;if(typeof module==="object"&&module&&typeof module.exports==="object"){module.exports=jQuery}else{window.jQuery=window.$=jQuery;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery})}}})(window);
  36.  
  37. /*!
  38. * WaitForKeyElements
  39. * https://gist.github.com/BrockA/2625891
  40. *
  41. * A utility function, for userscripts,
  42. * that detects and handles AJAXed content.
  43. */
  44.  
  45. function waitForKeyElements(selectorTxt,actionFunction,bWaitOnce,iframeSelector){var targetNodes,btargetsFound;if(typeof iframeSelector=="undefined")targetNodes=$(selectorTxt);else targetNodes=$(iframeSelector).contents().find(selectorTxt);if(targetNodes&&targetNodes.length>0){btargetsFound=true;targetNodes.each(function(){var jThis=$(this);var alreadyFound=jThis.data('alreadyFound')||false;if(!alreadyFound){var cancelFound=actionFunction(jThis);if(cancelFound)btargetsFound=false;else jThis.data('alreadyFound',true)}})}else{btargetsFound=false}var controlObj=waitForKeyElements.controlObj||{};var controlKey=selectorTxt.replace(/[^\w]/g,"_");var timeControl=controlObj[controlKey];if(btargetsFound&&bWaitOnce&&timeControl){clearInterval(timeControl);delete controlObj[controlKey]}else{if(!timeControl){timeControl=setInterval(function(){waitForKeyElements(selectorTxt,actionFunction,bWaitOnce,iframeSelector)},300);controlObj[controlKey]=timeControl}}waitForKeyElements.controlObj=controlObj}
  46.  
  47. /*!
  48. * Main CSS
  49. */
  50.  
  51. var cssTxt = GM_getResourceText ("gucss");
  52. GM_addStyle (cssTxt);
  53.  
  54. /*!
  55. * Global Functions
  56. */
  57.  
  58. // Alpha
  59.  
  60. jQuery.fn.ForceAlphaNumOnly = function() {
  61. return this.each(function() {
  62. $(this).keydown(function(e) {
  63. var key = e.charCode || e.keyCode || 0;
  64. return ( key == 8 || key == 9 || key == 16 || key == 17 || key == 18 || key == 20 || key == 32 || key == 46 || key == 67 || key == 86 || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 65 && key <= 90) || (key >= 96 && key <= 105) ); }); });
  65. };
  66.  
  67. // Num
  68.  
  69. jQuery.fn.ForceNumericOnly = function() {
  70. return this.each(function() {
  71. $(this).keydown(function(e) {
  72. var key = e.charCode || e.keyCode || 0;
  73. return ( key == 8 || key == 9 || key == 13 || key == 17 || key == 46 || key == 67 || key == 86 || key == 110 || key == 188 || key == 190 || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105) ); }); });
  74. };
  75.  
  76. // Att
  77.  
  78. function setAttributes(el, attrs) {
  79. for(var key in attrs) {
  80. el.setAttribute(key, attrs[key]); }
  81. }
  82.  
  83. // Saved
  84.  
  85. function ugm_saved(e) {
  86. $(e).fadeOut(function() {
  87. $(this).text('Saved').fadeIn().delay(2000);
  88. $(e).fadeOut(function() {
  89. $(this).text('Save').fadeIn(); }); });
  90. }
  91.  
  92. // CSS
  93.  
  94. function addGlobalStyle(ags_css) {
  95. var ags_head, ags_style;
  96. ags_head = document.getElementsByTagName('head')[0];
  97. if (!ags_head) { return; }
  98. ags_style = document.createElement('style');
  99. ags_style.type = 'text/css';
  100. ags_style.innerHTML = ags_css;
  101. ags_head.appendChild(ags_style);
  102. }
  103.  
  104. // BBCode
  105.  
  106. function ugm_global_bbcodegen(set1, set2, set3, title1, title2, title3) {
  107. $('<div class="ugm_vowbackdrop"></div>' +
  108. '<div id="ugm_invo_div">' +
  109. '<button id="bbcode_close">X</button>' +
  110. '<div id="bbcode_ta1t">'+ title1 +'</div>' +
  111. '<textarea id="bbcode_ta1" type="text" readOnly="true" resize="none"></textarea>' +
  112. '<div id="bbcode_ta2t">'+ title2 +'</div>' +
  113. '<textarea id="bbcode_ta2" type="text" readOnly="true" resize="none"></textarea>' +
  114. '<div id="bbcode_ta3t">'+ title3 +'</div>' +
  115. '<textarea id="bbcode_ta3" type="text" readOnly="true" resize="none"></textarea>' +
  116. '</div>').appendTo('#content');
  117. $('#bbcode_ta1').append(set1);
  118. $('#bbcode_ta2').append(set2);
  119. $('#bbcode_ta3').append(set3);
  120. $('#bbcode_close,.ugm_vowbackdrop').click(function() { $('#ugm_invo_div,.ugm_vowbackdrop').remove(); });
  121. $('#bbcode_ta1, #bbcode_ta2, #bbcode_ta3').click(function() { $(this).select(); });
  122. }
  123.  
  124. // Wrap
  125.  
  126. function wrapText(elementID, openTag, closeTag) {
  127. var textArea = $('#' + elementID);
  128. var len = textArea.val().length;
  129. var start = textArea[0].selectionStart;
  130. var end = textArea[0].selectionEnd;
  131. var selectedText = textArea.val().substring(start, end);
  132. var replacement = openTag + selectedText + closeTag;
  133. textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
  134. }
  135.  
  136. // Comma
  137.  
  138. function addCommas(nStr) {
  139. nStr += '';
  140. x = nStr.split('.');
  141. x1 = x[0];
  142. x2 = x.length > 1 ? '.' + x[1] : '';
  143. var rgx = /(\d+)(\d{3})/;
  144. while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); }
  145. return x1 + x2;
  146. }
  147.  
  148. // Scroll
  149.  
  150. $.fn.scrollTo = function( target, options, callback ){
  151. if(typeof options == 'function' && arguments.length == 2){ callback = options; options = target; }
  152. var settings = $.extend({
  153. scrollTarget : target,
  154. offsetTop : 50,
  155. duration : 500,
  156. easing : 'swing'
  157. }, options);
  158. return this.each(function(){
  159. var scrollPane = $(this);
  160. var scrollTarget = (typeof settings.scrollTarget == "number") ? settings.scrollTarget : $(settings.scrollTarget);
  161. var scrollY = (typeof scrollTarget == "number") ? scrollTarget : scrollTarget.offset().top + scrollPane.scrollTop() - parseInt(settings.offsetTop);
  162. scrollPane.animate({scrollTop : scrollY }, parseInt(settings.duration), settings.easing, function(){
  163. if (typeof callback == 'function') { callback.call(this); } }); });
  164. }
  165.  
  166. // Decode
  167.  
  168. function decodeEntities(encodedString) {
  169. var textArea = document.createElement('textarea');
  170. textArea.innerHTML = encodedString;
  171. return textArea.value;
  172. }
  173.  
  174. /*!
  175. * Menu Colors
  176. */
  177.  
  178. if (GM_getValue('rhn_hexcp_enabled')) {
  179. var rhn_dcolor = GM_getValue('rhn_hexcol', '#333');
  180. var rhn_dcolor2 = GM_getValue('rhn_hexcol2', '#fff');
  181. } else {
  182. var rhn_dcolor = GM_getValue('rhn_col', '#333');
  183. var rhn_dcolor2 = GM_getValue('rhn_col2', '#fff'); }
  184.  
  185. addGlobalStyle('.megamenu-section-trigger {background-color: ' + rhn_dcolor + ' !important;}');
  186. addGlobalStyle('#gaia_menu_bar {background-color: ' + rhn_dcolor + ' !important;}');
  187. addGlobalStyle('.panel-title {background: ' + rhn_dcolor + ' !important; }');
  188. addGlobalStyle('.megamenu-standard-menu>a {color: ' + rhn_dcolor2 + ' !important;}');
  189. addGlobalStyle('.megamenu-no-panel>a {color: ' + rhn_dcolor2 + ' !important}');
  190. addGlobalStyle('.panel-title {color: ' + rhn_dcolor2 + ' !important; }');
  191.  
  192. /*!
  193. * Gaia Menu
  194. */
  195.  
  196. $(document).ready(function() {
  197. $('.panel-link.panel_mygaia_prefs').detach().insertAfter('.panel-link.panel_mygaia_house');
  198. $('.panel-link.panel_shops_gofusion').detach().insertAfter('.panel-link.panel_shops_mecha');
  199. $('.panel-link.panel_shops_mc').detach().insertAfter('.panel-link.panel_shops_mecha');
  200. $('.panel-link.panel_shops_trade').detach().insertBefore('.panel-link.panel_shops_marketplace');
  201. $('.panel-link.panel_shops_alchemy').detach().insertBefore('.panel-link.panel_shops_marketplace');
  202.  
  203. $('<li class="panel-link">' +
  204. '<span style="background:none;" class="panel-img"></span>' +
  205. '<div class="complex-sublist">' +
  206. '<span style="color: #9981AA;">Check Mail</span>' +
  207. '<ul class="rhn_links">' +
  208. '<li> <a href="/profile/privmsg.php?mode=post">Compose</a></li>' +
  209. '<li> <a href="/profile/privmsg.php">Inbox</a></li>' +
  210. '<li> <a href="/profile/privmsg.php?folder=outbox">Outbox</a></li>' +
  211. '<li> <a href="/profile/privmsg.php?folder=sentbox">Sent</a></li>' +
  212. '<li>&nbsp;</li>' +
  213. '</ul>' +
  214. '</div>' +
  215. '</li>').insertAfter('.panel-link.panel_mygaia_mail');
  216.  
  217. $('<li class="panel-link" id="sublist_profile">' +
  218. '<span style="background:none;" class="panel-img"></span>' +
  219. '<div class="complex-sublist">' +
  220. '<span style="color: #9981AA;">Edit Profile</span>' +
  221. '<ul class="rhn_links">' +
  222. '<li> <a href="/account/profileprefs/">Profile CSS</a></li>' +
  223. '<li> <a href="/account/about/">About Me</a></li>' +
  224. '<li>&nbsp;</li>' +
  225. '</ul>' +
  226. '</div>' +
  227. '</li>').insertAfter('.panel-link.panel_mygaia_profile');
  228.  
  229. $('<li class="panel-link">' +
  230. '<span style="background:none;" class="panel-img"></span>' +
  231. '<div class="complex-sublist">' +
  232. '<span style="color: #9981AA;">Others</span>' +
  233. '<ul class="rhn_links">' +
  234. '<li> <a href="/friends/">Friends</a></li>' +
  235. '<li> <a href="/journal/">Journals</a></li>' +
  236. '<li> <a href="/labs/">Gaia Labs</a></li>' +
  237. '<li> <a href="/marriage/">Marriage</a></li>' +
  238. '<li>&nbsp;</li>' +
  239. '</ul>' +
  240. '</div>' +
  241. '</li>').insertAfter('.panel-link.panel_mygaia_achievements');
  242.  
  243. $('<li class="panel-link">' +
  244. '<span style="background:none;" class="panel-img"></span>' +
  245. '<div class="complex-sublist">' +
  246. '<span style="color: #9981AA;">Browse Market</span>' +
  247. '<ul class="rhn_links" id="rhn_ulmarket">' +
  248. '<li> <a href="/marketplace/mystore/showinventory/">Sell Item</a></li>' +
  249. '<li> <a href="/account/wishlist/">Wish List</a></li>' +
  250. '<li> <a href="/marketplace/userstore/10640437/">Flynn\'s Plunder</a></li>' +
  251. '<li> <a href="/marketplace/userstore/23809095/">Nicolae\'s Black Market</a></li>' +
  252. '<li> <a href="/marketplace/mystore/">My Store</a></li>' +
  253. '<li> <a href="/marketplace/outfits/">Outfits</a></li>' +
  254. '<li>&nbsp;</li>' +
  255. '</ul>' +
  256. '</div>' +
  257. '</li>').insertAfter('.panel-link.panel_shops_marketplace');
  258.  
  259. $('<ul class="rhn_links" id="rhn_forums">' +
  260. '<li> <a href="/forum/gaia-community-discussion/f.139/">GCD</a></li>' +
  261. '<li> <a href="/forum/the-gd/f.2/">GD</a></li>' +
  262. '<li> <a href="/forum/chatterbox/f.23/">Chatterbox</a></li>' +
  263. '<li> <a href="/forum/the-gaia-exchange/f.22/">Exchange</a></li>' +
  264. '<li> <a href="/forum/mini-shops/f.79/">Mini Shops</a></li>' +
  265. '<li> <a href="/forum/art-shops/f.82/">Art Shops</a></li>' +
  266. '<li> <a href="/forum/barton-town-role-play/f.9/">Barton Town</a></li>' +
  267. '<li> <a href="/forum/gaia-guides-and-resources/f.92/">Resources</a></li>' +
  268. '<li> <a href="/forum/announcements/f.10/">News</a></li>' +
  269. '<li> <a href="/forum/t.63632027_recent/">Updates</a></li>' +
  270. '</ul>').insertAfter('#community_links');
  271.  
  272. $('#community_links').remove();
  273.  
  274. $('<li class="panel-link panel_community_gaiaupgrade">' +
  275. '<span class="panel-img gaiaupgrade"></span>' +
  276. '<a class="panel-link-title" href="/forum/t.96435915/">GaiaUpgrade</a>' +
  277. '<div class="panel-link-descrip">experience Gaia\'s future today</div>' +
  278. '</li>').insertBefore('.panel-link.panel_community_guilds');
  279.  
  280. $('<li class="panel-link">' +
  281. '<span style="background:none;" class="panel-img"></span>' +
  282. '<div class="complex-sublist">' +
  283. '<span style="color: #9981AA;">Learn More</span>' +
  284. '<ul class="rhn_links">' +
  285. '<li> <a href="/forum/t.99436961/">Tips</a></li>' +
  286. '<li> <a href="/forum/t.99715343_recent/">Changes</a></li>' +
  287. '<li> <a href="/forum/t.99970043/">Help</a></li>' +
  288. '<li> <a href="/forum/t.96435915_recent/">Recent</a></li>' +
  289. '<li>&nbsp;</li>' +
  290. '</ul>' +
  291. '</div>' +
  292. '</li>').insertAfter('.panel-link.panel_community_gaiaupgrade');
  293.  
  294. $('<li class="panel-link">' +
  295. '<span style="background:none;" class="panel-img"></span>' +
  296. '<div class="complex-sublist">' +
  297. '<span style="color: #9981AA;">Others</span>' +
  298. '<ul class="rhn_links">' +
  299. '<li> <a href="/guilds/">Guild</a></li>' +
  300. '<li> <a href="/clans/">Clans</a></li>' +
  301. '<li> <a onclick="window.open(\'http://www.gaiaonline.com/launch/chat/\', \'GaiaOnline Chat\', \'height=641,width=732\')" href="#">Chat</a></li>' +
  302. '<li> <a href="/guilds/?gmode=myguilds">My Guilds</a></li>' +
  303. '<li>&nbsp;</li>' +
  304. '</ul>' +
  305. '</div>' +
  306. '</li>').insertAfter('.panel-link.panel_community_arenas');
  307.  
  308. $('<li class="rhn_panel_games_lklite">' +
  309. '<span class="panel-img"></span>' +
  310. '<span class="panel-lite"></span>' +
  311. '<div class="complex-sublist">' +
  312. '<a href="/pets/lite">Lake Kindred Lite</a><div class="panel-link-descrip">Enjoy Lake Kindred with less lag!</div>' +
  313. '</div>' +
  314. '</li>').insertAfter('#games_menu_content .panel_games_pets');
  315.  
  316. $('<div class="panel-link-descrip">catch rare fishes and get rich</div>').insertAfter('#games_menu_content .panel_games_fishing a');
  317. $('<div class="panel-link-descrip">match the tiles and earn tickets</div>').insertAfter('#games_menu_content .panel_games_tiles a');
  318. $('<div class="panel-link-descrip">slap around the ol\' silverball</div>').insertAfter('#games_menu_content .panel_games_pinball a');
  319. $('<div class="panel-link-descrip">solve tons of jigsaw puzzles</div>').insertAfter('#games_menu_content .panel_games_jigsaw a');
  320. $('<div class="panel-link-descrip">enjoy a classic card game</div>').insertAfter('#games_menu_content .panel_games_blackjack a');
  321. $('<div class="panel-link-descrip">spell words as fast as you can</div>').insertAfter('#games_menu_content .panel_games_wordbump a');
  322. $('<div class="panel-link-descrip">get free items from the dumpster</div>').insertAfter('#games_menu_content .panel_games_dumpsterdive a');
  323.  
  324. $('.panel-link.panel_community_guilds').remove();
  325. $('.panel-link.panel_community_clans').remove();
  326. $('.panel-link.panel_community_chat').remove();
  327. $('#community_links').html($('#community_links').html().replace(/\-/g, ''));
  328.  
  329. /*!
  330. * Color Picker
  331. */
  332.  
  333. // Element
  334.  
  335. $('<span id="rhn_cpspan">Menu Background: <input type="color" id="rhn_colorpicker"></span>' +
  336. '<span id="rhn_cpspan2">Menu Font Color: <input type="color" id="rhn_colorpicker2"></span>' +
  337. '<span id="rhn_cphex"><input type="checkbox" id="rhn_cpcb"><label>Hex</label><a id="rhn_cpsave">Save</a>').insertAfter('.main_color_panel .single_panel');
  338. $('<input type="textbox" id="rhn_colorhex1" placeholder="#333333">').appendTo('#rhn_cpspan');
  339. $('<input type="textbox" id="rhn_colorhex2" placeholder="#ffffff">').appendTo('#rhn_cpspan2');
  340.  
  341. // Load
  342.  
  343. $('#rhn_colorpicker').val(GM_getValue('rhn_col','#333'));
  344. $('#rhn_colorpicker2').val(GM_getValue('rhn_col2','#fff'));
  345. $('#rhn_colorhex1').val(GM_getValue('rhn_hexcol','#333'));
  346. $('#rhn_colorhex2').val(GM_getValue('rhn_hexcol2','#fff'));
  347. $('#rhn_cpcb').prop('checked', GM_getValue('rhn_hexcp_enabled'));
  348.  
  349. $('#rhn_colorpicker').on('input', function() {
  350. var rhn_color = this.value;
  351. GM_setValue('rhn_col', rhn_color);
  352. var rhn_dcolor = GM_getValue('rhn_col', '#333');
  353. addGlobalStyle('.megamenu-section-trigger {background: '+rhn_dcolor+' url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAWCAYAAAABxvaqAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKElEQVQI12NgYGAIYvr//z8DKmBmYmBgYGEiyELjMuGSYGZiYGBwAgBn6QPxZz9EUQAAAABJRU5ErkJggg==) repeat-x scroll 0 -1px !important;}');
  354. addGlobalStyle('#gaia_menu_bar {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAWCAYAAAABxvaqAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKElEQVQI12NgYGAIYvr//z8DKmBmYmBgYGEiyELjMuGSYGZiYGBwAgBn6QPxZz9EUQAAAABJRU5ErkJggg==) repeat-x '+rhn_dcolor+' !important}');
  355. addGlobalStyle('.panel-title {background: '+rhn_dcolor+' !important; border-bottom: 10px solid #fff; padding: 15px 0 0 10px !important; }');
  356. });
  357.  
  358. $('#rhn_colorpicker2').on('input', function() {
  359. var rhn_color2 = this.value;
  360. GM_setValue('rhn_col2', rhn_color2);
  361. var rhn_dcolor2 = GM_getValue('rhn_col2', '#fff');
  362. addGlobalStyle('.megamenu-standard-menu>a {color: '+rhn_dcolor2+' !important;}');
  363. addGlobalStyle('.megamenu-no-panel>a {color: '+rhn_dcolor2+' !important}');
  364. addGlobalStyle('.panel-title {color: '+rhn_dcolor2+' !important; }');
  365. });
  366.  
  367. // Hex
  368.  
  369. function rhn_cptohex() {
  370. if ($('#rhn_cpcb').is(':checked')) {
  371. $('#rhn_colorpicker').hide();
  372. $('#rhn_colorpicker2').hide();
  373. $('#rhn_colorhex1').show();
  374. $('#rhn_colorhex2').show();
  375. $('#rhn_cpsave').show();
  376. } else {
  377. $('#rhn_colorpicker').show();
  378. $('#rhn_colorpicker2').show();
  379. $('#rhn_colorhex1').hide();
  380. $('#rhn_colorhex2').hide();
  381. $('#rhn_cpsave').hide();
  382. }
  383. }
  384.  
  385. $('#rhn_cpcb').change(function(){
  386. GM_setValue('rhn_hexcp_enabled', this.checked);
  387. rhn_cptohex();
  388. });
  389.  
  390. rhn_cptohex();
  391.  
  392. // Save
  393.  
  394. $('#rhn_cpsave').click(function(){
  395. var rhn_hexcolor = $('#rhn_colorhex1').val();
  396. var rhn_hexcolor2 = $('#rhn_colorhex2').val();
  397. GM_setValue('rhn_hexcol', rhn_hexcolor);
  398. GM_setValue('rhn_hexcol2', rhn_hexcolor2);
  399. ugm_saved(this);
  400. addGlobalStyle('.megamenu-section-trigger {background: '+rhn_hexcolor+' url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAWCAYAAAABxvaqAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKElEQVQI12NgYGAIYvr//z8DKmBmYmBgYGEiyELjMuGSYGZiYGBwAgBn6QPxZz9EUQAAAABJRU5ErkJggg==) repeat-x scroll 0 -1px !important;}');
  401. addGlobalStyle('#gaia_menu_bar {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAWCAYAAAABxvaqAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKElEQVQI12NgYGAIYvr//z8DKmBmYmBgYGEiyELjMuGSYGZiYGBwAgBn6QPxZz9EUQAAAABJRU5ErkJggg==) repeat-x '+rhn_hexcolor+' !important}');
  402. addGlobalStyle('.panel-title {background: '+rhn_hexcolor+' !important; border-bottom: 10px solid #fff; padding: 15px 0 0 10px !important; }');
  403. addGlobalStyle('.megamenu-standard-menu>a {color: '+rhn_hexcolor2+' !important;}');
  404. addGlobalStyle('.megamenu-no-panel>a {color: '+rhn_hexcolor2+' !important}');
  405. addGlobalStyle('.panel-title {color: '+rhn_hexcolor2+' !important; }');
  406. });
  407.  
  408. /*!
  409. * GaiaUpgrade Menu
  410. */
  411.  
  412. // Element
  413.  
  414. $('<li class="megamenu-divider" id="yui-gen8"><!-- --></li>' +
  415. '<li id="gaiaupgrade_menu" class="megamenu-no-panel megamenu-menu-gofusion">' +
  416. '<a class="megamenu-section-trigger">Menu</a>' +
  417. '</li>').insertAfter('#catch_menu');
  418.  
  419. $('<div id="main_sub" class="main_panel_container">' +
  420. '<div class="panel-title" id="main_sub_features"><a href="http://www.gaiaonline.com/forum/t.96435915/">GaiaUpgrade</a>' +
  421. '<div class="gaiaupgrade_nav">' +
  422. '<a href="http://www.gaiaonline.com/forum/t.96435915/">Main Thread</a>' +
  423. '<a href="http://www.gaiaonline.com/forum/t.99436961/">Tutorials</a>' +
  424. '<a href="http://www.gaiaonline.com/forum/t.99970043/">Troubleshoot</a>' +
  425. '<a href="http://www.gaiaonline.com/forum/t.99715343_recent/">Changes</a>' +
  426. '</div>' +
  427. '</div>' +
  428. '<div class="main_sub_versions">' +
  429. '<span>Current version: 2.36</span><br/>' +
  430. '<span>Newest version: <a id="main_sub_check">Check</a></span>' +
  431. '</div>' +
  432. '<div class="main_panel gAutoTooltip delay-0" title="Click the Menu button to keep the feature list open. Click it again to close.<br/>Hovering your cursor over a features name will display their description." id="gaiaupgrade_mainpanel">' +
  433. '<div class="main_subpanel">' +
  434. '<div class="panel-left" id="main_sub_left">' +
  435. '<ul class="panel-links" id="main_sub_set1">' +
  436. '</ul>' +
  437. '</div>' +
  438. '<div class="panel-right" id="main_sub_right">' +
  439. '<ul class="panel-links" id="main_sub_set2">' +
  440. '</ul>' +
  441. '</div>' +
  442. '</div>' +
  443. '<div class="clear"><!-- --></div>' +
  444. '</div>' +
  445. '<div class="panel_bottom"></div>' +
  446. '</div>').insertAfter('#gaiaupgrade_menu>a');
  447.  
  448. var menu_categories = [{
  449. category: "Forum Posting",
  450. description: "Post in the forums faster.",
  451. id: "main_sub_forumposting_list",
  452. column: "#main_sub_set1"
  453. }, {
  454. category: "Forum Browsing",
  455. description: "Browse the forums easily.",
  456. id: "main_sub_forumbrowsing_list",
  457. column: "#main_sub_set2"
  458. }, {
  459. category: "Inventory",
  460. description: "Enhances inventory managing.",
  461. id: "main_sub_inventory_list",
  462. column: "#main_sub_set1"
  463. }, {
  464. category: "Wishlist",
  465. description: "Better wishlist organizing.",
  466. id: "main_sub_wishlist_list",
  467. column: "#main_sub_set2"
  468. }, {
  469. category: "Market",
  470. description: "Experience a safer market.",
  471. id: "main_sub_market_list",
  472. column: "#main_sub_set1"
  473. }, {
  474. category: "Avatar Dress Up",
  475. description: "Make better avatars.",
  476. id: "main_sub_avatar_list",
  477. column: "#main_sub_set1"
  478. }, {
  479. category: "Others",
  480. description: "The best Gaia experience.",
  481. id: "main_sub_others_list",
  482. column: "#main_sub_set2"
  483. }, {
  484. category: "Guild",
  485. description: "Renews the guild system.",
  486. id: "main_sub_guild_list",
  487. column: "#main_sub_set2"
  488. }, {
  489. category: "Private Messaging",
  490. description: "Interact better with Gaians.",
  491. id: "main_sub_messaging_list",
  492. column: "#main_sub_set1"
  493. }, {
  494. category: "Notifications",
  495. description: "Manage the notifications.",
  496. id: "main_sub_notifications_list",
  497. column: "#main_sub_set2"
  498. }]
  499.  
  500. var menu_features = [ {
  501. type: "#main_sub_forumposting_list",
  502. feature: "BBCode Generator",
  503. description: "Adds buttons on different pages that will generate item BBCodes.",
  504. button: "ugm_bbcodegencb",
  505. submenu: "ugm_bbcodegen_mainbtn",
  506. save: "bbcodegen_enabled"
  507. }, {
  508. type: "#main_sub_forumposting_list",
  509. feature: "Post Format",
  510. description: "Allows you to save post formats. Select a post format from the dropdown menu to apply it automatically upon submitting a post.",
  511. button: "ugm_poststylercb",
  512. submenu: "ugm_poststyler_mainbtn",
  513. save: "poststyler_enabled"
  514. }, {
  515. type: "#main_sub_forumposting_list",
  516. feature: "Post Action Saver",
  517. description: "Allows you to save a Dice Roll or RNG.",
  518. button: "ugm_postactercb",
  519. submenu: "none",
  520. save: "postacter_enabled"
  521. }, {
  522. type: "#main_sub_forumposting_list",
  523. feature: "Instant Quote & Reply",
  524. description: "Allows you to instantly quote people by clicking the arrow next to the quote button. This also adds BBCodes and New Emoticons to quick reply.",
  525. button: "ugm_qrqqcb",
  526. submenu: "ugm_qrqq_mainbtn",
  527. save: "qrqq_enabled"
  528. }, {
  529. type: "#main_sub_forumposting_list",
  530. feature: "Instant Edit",
  531. description: "Allows you to instantly edit your post by click the arrow next to the edit button.",
  532. button: "ugm_ieditcb",
  533. submenu: "none",
  534. save: "iedit_enabled"
  535. }, {
  536. type: "#main_sub_forumposting_list",
  537. feature: "More BBCodes",
  538. description: "Adds Spoiler BBCode and Video BBCode when posting.",
  539. button: "ugm_spoilerbuttonscb",
  540. submenu: "none",
  541. save: "morebbcodes_enabled"
  542. }, {
  543. type: "#main_sub_forumposting_list",
  544. feature: "New Emoticons",
  545. description: "Adds tons of new emoticons exclusively made for GaiaUpgrade.",
  546. button: "ugm_newemoticonscb",
  547. submenu: "none",
  548. save: "newemoticons_enabled"
  549. }, {
  550. type: "#main_sub_forumposting_list",
  551. feature: "Multiquote",
  552. description: "Allows you to quote multiple post from a page. Simply click the + buttons next to quote, then do a normal Quick Reply.",
  553. button: "ugm_multiquotecb",
  554. submenu: "none",
  555. save: "multiquote_enabled"
  556. }, {
  557. type: "#main_sub_forumposting_list",
  558. feature: "Disable Topic Voting",
  559. description: "Set to always disable topic voting.",
  560. button: "ugm_disablevotingcb",
  561. submenu: "none",
  562. save: "disablevoting_enabled"
  563. }, {
  564. type: "#main_sub_forumbrowsing_list",
  565. feature: "Thread Filter",
  566. description: "Hide threads with many replies. Hide threads created by users with the same set nicknames.",
  567. button: "ugm_hidebigtopicscb",
  568. submenu: "ugm_hidemuletopics_mainbtn",
  569. save: "hidebigtopics_enabled"
  570. }, {
  571. type: "#main_sub_forumbrowsing_list",
  572. feature: "Centered Forums",
  573. description: "This will bring back the centered forums that Gaia had before.",
  574. button: "ugm_centeredforumscb",
  575. submenu: "none",
  576. save: "centeredforums_enabled"
  577. }, {
  578. type: "#main_sub_forumbrowsing_list",
  579. feature: "Tip Cooldown",
  580. description: "Displays a cooldown after tipping a post.",
  581. button: "ugm_tipcdcb",
  582. submenu: "none",
  583. save: "tipcd_enabled"
  584. }, {
  585. type: "#main_sub_forumbrowsing_list",
  586. feature: "More User Menu Options",
  587. description: "Adds more options on the dropdown menu found under avatars in the forums. This lets you view other user\'s topics and wishlist easily. The feature can also be seen in userstores.",
  588. button: "ugm_udmucb",
  589. submenu: "none",
  590. save: "udmu_enabled"
  591. }, {
  592. type: "#main_sub_forumbrowsing_list",
  593. feature: "User Tag",
  594. description: "Allows you to assign custom tags for every user. Click the title under the usernames (example: Community Member) in the forums to edit them.",
  595. button: "ugm_usertagcb",
  596. submenu: "ugm_usertag_mainbtn",
  597. save: "usertag_enabled"
  598. }, {
  599. type: "#main_sub_forumbrowsing_list",
  600. feature: "Forum Lite Upgrade",
  601. description: "Makes the forum look simpler. A mix of default forum and forum lite.",
  602. button: "ugm_forumlitecb",
  603. submenu: "ugm_forumlite_mainbtn",
  604. save: "forumlite_enabled"
  605. }, {
  606. type: "#main_sub_inventory_list",
  607. feature: "Item Marker",
  608. description: "Allows you to mark your items to avoid accidentally selling or trading them. Item marking can be done in the Sell An Item page.",
  609. button: "ugm_itemmarkercb",
  610. submenu: "none",
  611. save: "itemmarker_enabled"
  612. }, {
  613. type: "#main_sub_inventory_list",
  614. feature: "Storage Upgrade",
  615. description: "Increases the size of the inventory storage and makes it follow the screen as you scroll the page.",
  616. button: "ugm_invoupgradecb",
  617. submenu: "none",
  618. save: "invoupgrade_enabled"
  619. }, {
  620. type: "#main_sub_inventory_list",
  621. feature: "Detailed Inventory Items",
  622. description: "When viewing an item in your inventory, it will display its accurate marketplace details. Clicking on its name will direct you to its marketplace listing as well.",
  623. button: "ugm_idmlcb",
  624. submenu: "none",
  625. save: "idml_enabled"
  626. }, {
  627. type: "#main_sub_inventory_list",
  628. feature: "Inventory Sorter",
  629. description: "Allows you to sort the items in an inventory page.",
  630. button: "ugm_iparcb",
  631. submenu: "none",
  632. save: "ipar_enabled"
  633. }, {
  634. type: "#main_sub_wishlist_list",
  635. feature: "Wishlist Sorter",
  636. description: "Sorts the wishlist alphabetically. Currently in beta.",
  637. button: "ugm_wishsortercb",
  638. submenu: "none",
  639. save: "wishsorter_enabled"
  640. }, {
  641. type: "#main_sub_wishlist_list",
  642. feature: "Wishlist Notifier",
  643. description: "Be notified when a wishlist item has a listing. This will also notify you when an item has a listing below a certain price.",
  644. button: "ugm_listingalertcb",
  645. submenu: "ugm_wishnotifier_mainbtn",
  646. save: "listingalert_enabled"
  647. }, {
  648. type: "#main_sub_wishlist_list",
  649. feature: "Wishlist Arranger",
  650. description: "This will display only the icons of your wishlist items, for easier arranging. Click on the icon to display its action choices.",
  651. button: "ugm_wisharrcb",
  652. submenu: "none",
  653. save: "wisharr_enabled"
  654. }, {
  655. type: "#main_sub_wishlist_list",
  656. feature: "Wishlist Items Indicator",
  657. description: "Indicate owned items with a red background when viewing certain pages.",
  658. button: "ugm_wishlistedcb",
  659. submenu: "ugm_wishlisted_mainbtn",
  660. save: "wishlisted_enabled"
  661. }, {
  662. type: "#main_sub_wishlist_list",
  663. feature: "Wishlist Delete All",
  664. description: "Marks and unmarks all wishlist items to be deleted.",
  665. button: "ugm_wdacb",
  666. submenu: "none",
  667. save: "wda_enabled"
  668. }, {
  669. type: "#main_sub_market_list",
  670. feature: "Auto Comma",
  671. description: "Automatically adds commas as you type large numbers in the market and trade.",
  672. button: "ugm_autocommacb",
  673. submenu: "none",
  674. save: "autocomma_enabled"
  675. }, {
  676. type: "#main_sub_market_list",
  677. feature: "Easy Undercut",
  678. description: "Allows you to undercut the lbp with just a single click.",
  679. button: "ugm_undercuttercb",
  680. submenu: "ugm_undercutter_mainbtn",
  681. save: "undercutter_enabled"
  682. }, {
  683. type: "#main_sub_market_list",
  684. feature: "Easy Bid",
  685. description: "Allows you to bid the minimum amount with just a single click.",
  686. button: "ugm_easybidcb",
  687. submenu: "none",
  688. save: "easybid_enabled"
  689. }, {
  690. type: "#main_sub_market_list",
  691. feature: "Owned Listing Quantity",
  692. description: "When viewing a marketplace listing, it will show you specficially how many of the item you own.",
  693. button: "ugm_olqcb",
  694. submenu: "none",
  695. save: "olq_enabled"
  696. }, {
  697. type: "#main_sub_market_list",
  698. feature: "Owned Items Indicator",
  699. description: "Indicate owned items with a blue background when viewing certain pages.",
  700. button: "ugm_ownedcb",
  701. submenu: "ugm_owned_mainbtn",
  702. save: "owned_enabled"
  703. }, {
  704. type: "#main_sub_market_list",
  705. feature: "Easy Item Report",
  706. description: "Easily report an item with a mis-tagged issue or not released issue.",
  707. button: "ugm_mistagcb",
  708. submenu: "none",
  709. save: "mistag_enabled"
  710. }, {
  711. type: "#main_sub_market_list",
  712. feature: "Detailed Sell Page",
  713. description: "Displays more details when selling an item. This includes owned quantity, accurate lbp, number of listings, and after tax.",
  714. button: "ugm_sioqcb",
  715. submenu: "none",
  716. save: "sioq_enabled"
  717. }, {
  718. type: "#main_sub_market_list",
  719. feature: "Clickable Trade Items",
  720. description: "Items being traded to you will be clickable so you can easily check them in the market.",
  721. button: "ugm_cticb",
  722. submenu: "none",
  723. save: "cti_enabled"
  724. }, {
  725. type: "#main_sub_market_list",
  726. feature: "Game Item Qty Sorter",
  727. description: "When viewing game items, you can click Qty to sort the listings based on quantity. Highly advisable to display 50-100 results per page to make it more effective.",
  728. button: "ugm_giqs",
  729. submenu: "none",
  730. save: "giqs_enabled"
  731. }, {
  732. type: "#main_sub_market_list",
  733. feature: "Detailed Outfit Buy Page",
  734. description: "Enhances the outfit buy window and adds accurate prices and total for the outfit items.",
  735. button: "ugm_dobp",
  736. submenu: "none",
  737. save: "dobp_enabled"
  738. }, {
  739. type: "#main_sub_avatar_list",
  740. feature: "Avatar Custom Previews",
  741. description: "Allows you to preview your avatar in different backgrounds and size. Changing the mouth, pose, or outfit will reset it. Currently in beta.",
  742. button: "ugm_avatarpreviewscb",
  743. submenu: "none",
  744. save: "avatarpreviews_enabled"
  745. }, {
  746. type: "#main_sub_avatar_list",
  747. feature: "Avatar Value",
  748. description: "Displays the total cost of your current avatar.",
  749. button: "ugm_avivalcb",
  750. submenu: "none",
  751. save: "avival_enabled"
  752. }, {
  753. type: "#main_sub_avatar_list",
  754. feature: "Avatar Builder Upgrade",
  755. description: "Enhances the appearance of the Avatar Builder.",
  756. button: "ugm_nabcb",
  757. submenu: "none",
  758. save: "nab_enabled"
  759. }, {
  760. type: "#main_sub_others_list",
  761. feature: "General Fixes",
  762. description: "Fixes minor issues on Gaia.",
  763. button: "ugm_genfixcb",
  764. submenu: "ugm_genfix_mainbtn",
  765. save: "genfix_enabled"
  766. }, {
  767. type: "#main_sub_others_list",
  768. feature: "Favorite Links",
  769. description: "Allows you to save custom links. The Favorite Links will replace the Runway button, which has been moved under the World tab.",
  770. button: "ugm_rhncb",
  771. submenu: "ugm_rhn_mainbtn",
  772. save: "rhn_enabled"
  773. }, {
  774. type: "#main_sub_others_list",
  775. feature: "Custom Header BG",
  776. description: "Allows you to set a custom header background.",
  777. button: "ugm_chbcb",
  778. submenu: "ugm_chb_mainbtn",
  779. save: "chb_enabled"
  780. }, {
  781. type: "#main_sub_others_list",
  782. feature: "Daily Chance Upgrade",
  783. description: "Replaces the Daily Chance with a GaiaUpgrade Daily Chance which lets you claim all 9 rewards easily.",
  784. button: "ugm_dailychancecb",
  785. submenu: "none",
  786. save: "dailychance_enabled"
  787. }, {
  788. type: "#main_sub_others_list",
  789. feature: "Dumpster Dive Reminder",
  790. description: "Displays a countdown for when diving is available. This also lets you dive instantly from any page.",
  791. button: "ugm_dumpstercb",
  792. submenu: "none",
  793. save: "dumpster_enabled"
  794. }, {
  795. type: "#main_sub_others_list",
  796. feature: "Achievement Organizer",
  797. description: "Sorts the achievement titles alphabetically. Also adds a scroll bar to the achievement icon panel for easier achievement equipping.",
  798. button: "ugm_alphatitlecb",
  799. submenu: "none",
  800. save: "alphatitle_enabled"
  801. }, {
  802. type: "#main_sub_others_list",
  803. feature: "New Arena Layout",
  804. description: "This will display the full avatars when viewing all entries in avatar arena, instead of a cropped headshot.",
  805. button: "ugm_betteraviarenacb",
  806. submenu: "none",
  807. save: "betteraviarena_enabled"
  808. }, {
  809. type: "#main_sub_others_list",
  810. feature: "Members Online",
  811. description: "Display the detailed numbers of members online. Enabling this feature will hide the gold message.",
  812. button: "ugm_ontimecb",
  813. submenu: "none",
  814. save: "ontime_enabled"
  815. }, {
  816. type: "#main_sub_others_list",
  817. feature: "Friends List Upgrade",
  818. description: "Adds quick links for your friend list on My Gaia page. Access this by hovering your cursor on their avatar or username. This also removes unnecessary links on the Friends page.",
  819. button: "ugm_flu",
  820. submenu: "none",
  821. save: "flu_enabled"
  822. }, {
  823. type: "#main_sub_others_list",
  824. feature: "Disable Avatar Favorites",
  825. description: "Hides the heart icon for avatar favorites feature.",
  826. button: "ugm_daf",
  827. submenu: "none",
  828. save: "daf_enabled"
  829. },{
  830. type: "#main_sub_guild_list",
  831. feature: "New Forum Layout",
  832. description: "Changes the guild forum\'s layout to match the new Gaia forum layout.",
  833. button: "ugm_gfucb",
  834. submenu: "none",
  835. save: "gfu_enabled"
  836. }, {
  837. type: "#main_sub_guild_list",
  838. feature: "Quick Reply BBCodes",
  839. description: "Adds BBCodes in Quick Reply in guild forums.",
  840. button: "ugm_gqrcb",
  841. submenu: "none",
  842. save: "gqr_enabled"
  843. }, {
  844. type: "#main_sub_guild_list",
  845. feature: "Centered Guild Forums",
  846. description: "Centers the guild forums.",
  847. button: "ugm_cgfcb",
  848. submenu: "none",
  849. save: "cgf_enabled"
  850. }, {
  851. type: "#main_sub_messaging_list",
  852. feature: "PM Cooldown",
  853. description: "Replaces the send button with a cooldown, when private messaging is unavailable.",
  854. button: "ugm_pmcdcb",
  855. submenu: "none",
  856. save: "pmcd_enabled"
  857. }, {
  858. type: "#main_sub_messaging_list",
  859. feature: "Easy Gifter Reply",
  860. description: "Replaces the Reply button with PM Gifter button when recieving a gift via [NPC] Rina.",
  861. button: "ugm_pmgiftercb",
  862. submenu: "none",
  863. save: "pmgifter_enabled"
  864. }, {
  865. type: "#main_sub_messaging_list",
  866. feature: "Quick PM Reply",
  867. description: "Reply instantly to private messages.",
  868. button: "ugm_pmqrcb",
  869. submenu: "none",
  870. save: "pmqr_enabled"
  871. }, {
  872. type: "#main_sub_notifications_list",
  873. feature: "Announcement Viewer",
  874. description: "Allows you to instantly view announcement titles. This feature will not work if Announcement Remover is enabled.",
  875. button: "ugm_annviewcb",
  876. submenu: "none",
  877. save: "annview_enabled"
  878. }, {
  879. type: "#main_sub_notifications_list",
  880. feature: "Announcement Remover",
  881. description: "Automatically marks each announcement as read.",
  882. button: "ugm_annremcb",
  883. submenu: "none",
  884. save: "annrem_enabled"
  885. }, {
  886. type: "#main_sub_notifications_list",
  887. feature: "New PM Viewer",
  888. description: "Instantly see who sent you a private message.",
  889. button: "ugm_pmviewercb",
  890. submenu: "none",
  891. save: "pmviewer_enabled"
  892. }, {
  893. type: "#main_sub_notifications_list",
  894. feature: "New Notice Viewer",
  895. description: "Allows you to instantly view new notices without going to MyGaia page.",
  896. button: "ugm_inoticecb",
  897. submenu: "none",
  898. save: "inotice_enabled"
  899. } ];
  900.  
  901. for ( var i = 0 ; i < menu_categories.length ; i++ ) {
  902. $('<li class="panel-link">' +
  903. '<span class="panel-img" style="background-position:-353px -45px;"></span>' +
  904. '<a>' + menu_categories[i].category + '</a>' +
  905. '<div class="panel-link-descrip">' + menu_categories[i].description + '</div>' +
  906. '</li>'+
  907. '<li class="panel-link">' +
  908. '<span style="background:none;" class="panel-img"></span>' +
  909. '<div class="complex-sublist">' +
  910. '<span style="color: #9981AA;">Features</span>' +
  911. '<ul id="' + menu_categories[i].id + '" class="main_sub_list">' +
  912. '</ul>' +
  913. '</div>' +
  914. '</li>').appendTo(menu_categories[i].column);
  915. }
  916.  
  917. for ( var i = 0 ; i < menu_features.length ; i++ ) {
  918. if ( menu_features[i].submenu != "none" ){
  919. $('<li><div class="main_sub_cb"><input type="checkbox" id="' + menu_features[i].button + '" data-save="' + menu_features[i].save + '"><label for="' + menu_features[i].button + '"></label></div>'+
  920. '<a title="' + menu_features[i].description + '">' + menu_features[i].feature +'</a><a id="' + menu_features[i].submenu + '"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAAK/INwWK6QAAAOhJREFUeNpcULuJhUAUPbNoCUYiGghmGliCFiBYjLVYhGBkJGgDJgaCmIhgASaKKMy+M7srb9/A/cy5535Fnuf4ePLXinfwi+q+b+k4jqSN4xiUd4wcjcq2bbiuq+x1XapCFEXQdV3913WFtm0bKJZlKaAsS0VMkgSmaWIYhp/W53nKNE1xHAeapkGWZYJCnxhj5GgvhWVZVJZhGM/w9ElkjBxWFFVVPdl1XUvKXxfGXmMJjUvs+w7P89D3vdqYj77v+xjHEc/W0zShKArM8/xs3batwokFQQDxefCu69TdwjD8d/BvAQYApt6Pn+0/eeMAAAAASUVORK5CYII="/></a></li>').appendTo(menu_features[i].type);
  921. } else {
  922. $('<li><div class="main_sub_cb"><input type="checkbox" id="' + menu_features[i].button + '" data-save="' + menu_features[i].save + '"><label for="' + menu_features[i].button + '"></label></div>'+
  923. '<a title="' + menu_features[i].description + '">' + menu_features[i].feature +'</a></li>').appendTo(menu_features[i].type);
  924. }
  925. $('#' + menu_features[i].button).change(function(){ GM_setValue($(this).attr('data-save'), this.checked); });
  926. $('#' + menu_features[i].button).prop('checked', GM_getValue(menu_features[i].save));
  927. }
  928. $('.main_sub_list').each(function(){ $('<li>&nbsp;</li>').appendTo(this); });
  929.  
  930. /*!
  931. * Sub Menu - General
  932. */
  933.  
  934. // Lock
  935.  
  936. var gaiaupgrade_menu_stat = "unlocked";
  937. $('#gaiaupgrade_menu>a').click(function(){
  938. switch (gaiaupgrade_menu_stat) {
  939. case "unlocked":
  940. gaiaupgrade_menu_stat = "locked";
  941. $(this).css({'box-shadow': '0 0 0 20px rgba(255, 255, 255, 0.1) inset'});
  942. $('#main_sub').css({"display": "block"});
  943. $('#gaiaupgrade_mainpanel').removeClass('gAutoTooltip delay-0');
  944. $('#gaiaupgrade_mainpanel').removeAttr('title');
  945. break;
  946. case "locked":
  947. gaiaupgrade_menu_stat = "unlocked";
  948. $(this).css({"box-shadow": "none"});
  949. $('#main_sub').css({"display": "none"});
  950. $('#gaiaupgrade_mainpanel').addClass('gAutoTooltip delay-0');
  951. break;
  952. }
  953. });
  954.  
  955. // Version
  956.  
  957. $('#main_sub_check').click(function(){
  958. document.getElementById('main_sub_check').innerHTML = "Loading";
  959. GM_xmlhttpRequest({
  960. method: "GET",
  961. url: "http://www.gaiaonline.com/forum/t.99715343_recent/",
  962. onload: function(response) {
  963. var parser=new DOMParser();
  964. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  965. var latest = innerDoc.getElementById('thread_title').getElementsByTagName('a')[0].innerHTML.split('[');
  966. document.getElementById('main_sub_check').innerHTML = '' + latest[2].replace('v','').replace('\]','');
  967. }
  968. });
  969. });
  970.  
  971. // Sub
  972.  
  973. function ugm_menu_openclose(event) { $(event.data.div).css({"display": event.data.state}); }
  974.  
  975. /*!
  976. * Sub Menu - Post Format
  977. */
  978.  
  979. // Element Load
  980.  
  981. $('<div class="ugm_poststyler_div">' +
  982. '<div class="ugm_poststyler_close">â—„ Main Menu</div>' +
  983. '<div class="ugm_poststyler_modify">' +
  984. '<span>Modify:</span>' +
  985. '</div>' +
  986. '<span id="ugm_poststyler_span">Default Post Format: ' +
  987. '<select id="ugm_ps_seldef">' +
  988. '<option value="Default">None</option>' +
  989. '</select>' +
  990. '</span>'+
  991. '<div id="ugm_poststyler_psdiv"></div>' +
  992. '</div>').appendTo('#gaiaupgrade_mainpanel');
  993.  
  994. var pfn = ["A", "B", "C", "D", "E"];
  995.  
  996. for ( i = 0 ; i < pfn.length ; i++ ) {
  997. $('<a class="ugm_poststyler_modify_' + pfn[i].toLowerCase() + '">' + pfn[i] + '</a>').appendTo('.ugm_poststyler_modify');
  998. $('<option value="PF' + (i + 1) + '">' + pfn[i] + '</option>').appendTo('#ugm_ps_seldef');
  999. $('<div class="ugm_ps_div" id="ugm_poststyle_' + pfn[i].toLowerCase() + '">' +
  1000. '<textarea id="ugm_poststyler_tab' + (i + 1) + '_ta" placeholder="Opening Text..."></textarea>' +
  1001. '<textarea id="ugm_poststyler_tab' + (i + 1) + '_ta2" placeholder="Closing Text..."></textarea>' +
  1002. '<button id="ugm_poststyler_tab' + (i + 1) + '_save">Save</button>' +
  1003. '</div>').appendTo('#ugm_poststyler_psdiv');
  1004.  
  1005. document.getElementById('ugm_poststyler_tab' + (i + 1) + '_ta').value = GM_getValue('poststyle_' + pfn[i].toLowerCase() + '_prefix', '');
  1006. document.getElementById('ugm_poststyler_tab' + (i + 1) + '_ta2').value = GM_getValue('poststyle_' + pfn[i].toLowerCase() + '_suffix', '');
  1007.  
  1008.  
  1009. }
  1010.  
  1011. // Set
  1012.  
  1013. $('#ugm_poststyler_mainbtn').click({div: '.ugm_poststyler_div', state: 'inline-block'}, ugm_menu_openclose);
  1014. $('.ugm_poststyler_close').click({div: '.ugm_poststyler_div', state: 'none'}, ugm_menu_openclose);
  1015.  
  1016. // Save
  1017.  
  1018. function ugm_poststyler_save(event){
  1019. var ps_prefix = document.getElementById('ugm_poststyler_tab' + event.data.psn + '_ta').value;
  1020. var ps_suffix = document.getElementById('ugm_poststyler_tab' + event.data.psn + '_ta2').value;
  1021. GM_setValue('poststyle_' + event.data.psl + '_prefix', ps_prefix);
  1022. GM_setValue('poststyle_' + event.data.psl + '_suffix', ps_suffix);
  1023. ugm_saved('#ugm_poststyler_tab' + event.data.psn + '_save');
  1024. }
  1025.  
  1026. $('#ugm_poststyler_tab1_save').click({psn: '1', psl: 'a'}, ugm_poststyler_save);
  1027. $('#ugm_poststyler_tab2_save').click({psn: '2', psl: 'b'}, ugm_poststyler_save);
  1028. $('#ugm_poststyler_tab3_save').click({psn: '3', psl: 'c'}, ugm_poststyler_save);
  1029. $('#ugm_poststyler_tab4_save').click({psn: '4', psl: 'd'}, ugm_poststyler_save);
  1030. $('#ugm_poststyler_tab5_save').click({psn: '5', psl: 'e'}, ugm_poststyler_save);
  1031.  
  1032. document.getElementById('ugm_ps_seldef').addEventListener('change', function(e) { GM_setValue('ugm_postdef', this.value); });
  1033. document.getElementById('ugm_ps_seldef').value = GM_getValue('ugm_postdef');
  1034.  
  1035. // Tab
  1036.  
  1037. function ugm_poststyler_switch(event){ $('#ugm_poststyler_psdiv').scrollTo(event.data.theid,{duration: '0', offsetTop : '270'}); }
  1038.  
  1039. $('.ugm_poststyler_modify_a').click({theid: '#ugm_poststyle_a', psl: 'a'}, ugm_poststyler_switch);
  1040. $('.ugm_poststyler_modify_b').click({theid: '#ugm_poststyle_b', psl: 'a'}, ugm_poststyler_switch);
  1041. $('.ugm_poststyler_modify_c').click({theid: '#ugm_poststyle_c', psl: 'a'}, ugm_poststyler_switch);
  1042. $('.ugm_poststyler_modify_d').click({theid: '#ugm_poststyle_d', psl: 'a'}, ugm_poststyler_switch);
  1043. $('.ugm_poststyler_modify_e').click({theid: '#ugm_poststyle_e', psl: 'a'}, ugm_poststyler_switch);
  1044.  
  1045. // Click
  1046.  
  1047. $('.ugm_poststyler_modify_a').css('background', '#ccc');
  1048.  
  1049. $('.ugm_poststyler_modify a').click(function(){
  1050. $('.ugm_poststyler_modify a').css('background', '#eeeeee');
  1051. $(this).css('background', '#ccc');
  1052. });
  1053.  
  1054.  
  1055. /*!
  1056. * Sub Menu - Topic Filter
  1057. */
  1058.  
  1059. // Element
  1060.  
  1061. $('<div class="ugm_hidemuletopics_div">' +
  1062. '<div class="ugm_hidemuletopics_close">â—„ Main Menu</div>' +
  1063. '<div class="ugm_hidemuletopics_div1">' +
  1064. '<textarea id="ugm_hidemuletopics_ta" placeholder="separate, keywords, like, this"></textarea>' +
  1065. '<button id="ugm_hidemuletopics_save" style="position: 80px; z-index: 100;">Save</button>' +
  1066. '</div>' +
  1067. '<span id="ugm_hidebigtopics_customtext">Max Replies</span>' +
  1068. '<input id="ugm_hidebigtopics_customval" type="text">' +
  1069. '<label id="ugm_hidemuletopics_ha">Keywords</label>' +
  1070. '<div class="ugm_hidemuletopics_div2"><ul>' +
  1071. '<li>Threads that exceed the Max Replies will be hidden.</li>' +
  1072. '<li>All usernames that contains a matching keyword will be blacklisted.</li>' +
  1073. '<li>For example, putting "troll" will hide every users with "troll" on their name.</li>' +
  1074. '<li>Separate each keyword with a comma then space.</li>' +
  1075. '<li>Avoid putting a lot of keywords. Please use Gaia\'s block feature if possible.</li>' +
  1076. '<label id="ugm_hidemuletopics_ha2">How To Use</label>' +
  1077. '</div>' +
  1078. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1079.  
  1080. // Set
  1081.  
  1082. $('#ugm_hidemuletopics_mainbtn').click({div: '.ugm_hidemuletopics_div', state: 'inline-block'}, ugm_menu_openclose);
  1083. $('.ugm_hidemuletopics_close').click({div: '.ugm_hidemuletopics_div', state: 'none'}, ugm_menu_openclose);
  1084.  
  1085. // Save Load
  1086.  
  1087. $("#ugm_hidebigtopics_customval").ForceNumericOnly();
  1088. document.getElementById('ugm_hidebigtopics_customval').value = GM_getValue('hidebigtopics_customval', '');
  1089. document.getElementById('ugm_hidemuletopics_ta').value = GM_getValue('hmt_names', '');
  1090.  
  1091. $('#ugm_hidemuletopics_save').click(function() {
  1092. var ugm_hmt_ta = document.getElementById('ugm_hidemuletopics_ta').value;
  1093. GM_setValue('hmt_names', ugm_hmt_ta);
  1094.  
  1095. var hidebigtopics_customval = document.getElementById('ugm_hidebigtopics_customval').value;
  1096. var hidebigtopics_customval_nocomma = hidebigtopics_customval.replace(/\,/g, '');
  1097. GM_setValue('hidebigtopics_customval', hidebigtopics_customval_nocomma);
  1098. ugm_saved(this);
  1099. });
  1100.  
  1101. /*!
  1102. * Sub Menu - Easy Undercut
  1103. */
  1104.  
  1105. // Element
  1106.  
  1107. $('<div class="ugm_undercutter_div">' +
  1108. '<div class="ugm_undercutter_close">â—„ Main Menu</div>' +
  1109. '<span id="ugm_undercutter_choicetext">Undercut by:</span>' +
  1110. '<select id="ugm_undercutter_choice"><option value="Exact">Exact Value</option><option value="Percent">Percent</option></select>' +
  1111. '<span id="ugm_undercutter_exacttext">Exact Amount:</span>' +
  1112. '<input id="ugm_undercutter_customval" type="text">' +
  1113. '<span id="ugm_undercutter_percenttext">Percent:</span>' +
  1114. '<input id="ugm_undercutter_percentval" type="text">' +
  1115. '<span id="ugm_undercutter_durationtxt">Duration:</span>' +
  1116. '<select id="ugm_undercutter_durdays"></select>' +
  1117. '<select id="ugm_undercutter_durhrs"></select>' +
  1118. '<select id="ugm_undercutter_durmins"></select>' +
  1119. '<span id="ugm_undercutter_gcp">Gcash purchasable: <input type="checkbox" value="ugm_undercutter_gcpcb" id="ugm_undercutter_gcpcb"></span>' +
  1120. '<a id="ugm_undercuttersave">Save</a>' +
  1121. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1122.  
  1123. for ( i = 0 ; i < 15 ; i ++ ) { $('<option value="'+[i]+'">' + [i] + ' days</option>').appendTo('#ugm_undercutter_durdays'); }
  1124. for ( i = 0 ; i < 24 ; i ++ ) { $('<option value="'+[i]+'">' + [i] + ' hrs</option>').appendTo('#ugm_undercutter_durhrs'); }
  1125. for ( i = 0 ; i < 56 ; i ++ ) { $('<option value="'+[i]+'">' + [i] + ' mins</option>').appendTo('#ugm_undercutter_durmins'); }
  1126.  
  1127. // Set
  1128.  
  1129. $('#ugm_undercutter_mainbtn').click({div: '.ugm_undercutter_div', state: 'inline-block'}, ugm_menu_openclose);
  1130. $('.ugm_undercutter_close').click({div: '.ugm_undercutter_div', state: 'none'}, ugm_menu_openclose);
  1131. $('#ugm_undercutter_customval').ForceNumericOnly();
  1132. $('#ugm_undercutter_percentval').ForceNumericOnly();
  1133.  
  1134. // Save
  1135.  
  1136. $('#ugm_undercuttersave').click(function() {
  1137. GM_setValue('undercut_customval', document.getElementById('ugm_undercutter_customval').value);
  1138. GM_setValue('undercut_percentval', document.getElementById('ugm_undercutter_percentval').value);
  1139. GM_setValue('undercut_durdays', document.getElementById('ugm_undercutter_durdays').value);
  1140. GM_setValue('undercut_durhrs', document.getElementById('ugm_undercutter_durhrs').value);
  1141. GM_setValue('undercut_durmins', document.getElementById('ugm_undercutter_durmins').value);
  1142. GM_setValue('undercut_gcp_enabled', document.getElementById('ugm_undercutter_gcpcb').checked);
  1143. ugm_saved(this);
  1144. });
  1145.  
  1146. document.getElementById('ugm_undercutter_choice').addEventListener('change', function(e) { GM_setValue('ugm_undercutter_choice', this.value); });
  1147. document.getElementById('ugm_undercutter_choice').value = GM_getValue('ugm_undercutter_choice');
  1148. document.getElementById('ugm_undercutter_customval').value = GM_getValue('undercut_customval', '1');
  1149. document.getElementById('ugm_undercutter_percentval').value = GM_getValue('undercut_percentval', '1');
  1150. document.getElementById('ugm_undercutter_durdays').value = GM_getValue('undercut_durdays');
  1151. document.getElementById('ugm_undercutter_durhrs').value = GM_getValue('undercut_durhrs');
  1152. document.getElementById('ugm_undercutter_durmins').value = GM_getValue('undercut_durmins');
  1153. $('#ugm_undercutter_gcpcb').prop('checked', GM_getValue('undercut_gcp_enabled'));
  1154.  
  1155. /*!
  1156. * Sub Menu - Wishlist Notifier
  1157. */
  1158.  
  1159. // Element
  1160.  
  1161. $('<div class="ugm_wishnotifier_div">' +
  1162. '<div class="ugm_wishnotifier_close">â—„ Main Menu</div>' +
  1163. '<span id="ugm_wishnotifier_t1">Listing Notification:</span>' +
  1164. '<input id="ugm_wishnotifier_wishval" type="text" placeholder="#">' +
  1165. '<span id="ugm_wishnotifier_t2">Be notified if any of the top items in your wishlist has a listing. For example, if you put 5, you will be notified about the top 5 items on your wishlist. Leave it blank to disable Listing Notification.</span>' +
  1166. '<span id="ugm_wishnotifier_t3">Price Notification:</span>' +
  1167. '<input id="ugm_wishnotifier_priceval" type="text" placeholder="Put gold amount here">' +
  1168. '<span id="ugm_wishnotifier_t4">Market Item ID:</span>' +
  1169. '<input id="ugm_wishnotifier_idval" type="text" placeholder="Put item ID here">' +
  1170. '<span id="ugm_wishnotifier_t5">Be notified if an item has a listing below the set price. Using both features may result in a slower page loading, depending on your internet speed. Leave the Item ID blank to disable Price Notification.</span>' +
  1171. '<a id="ugm_wishnotifier_save">Save</a>' +
  1172. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1173.  
  1174. // Set
  1175.  
  1176. $('#ugm_wishnotifier_mainbtn').click({div: '.ugm_wishnotifier_div', state: 'inline-block'}, ugm_menu_openclose);
  1177. $('.ugm_wishnotifier_close').click({div: '.ugm_wishnotifier_div', state: 'none'}, ugm_menu_openclose);
  1178. $("#ugm_wishnotifier_wishval").ForceNumericOnly();
  1179. $("#ugm_wishnotifier_priceval").ForceNumericOnly();
  1180. $("#ugm_wishnotifier_idval").ForceNumericOnly();
  1181.  
  1182. // Save Load
  1183.  
  1184. document.getElementById('ugm_wishnotifier_wishval').value = GM_getValue('wishnotifier_wishval', '');
  1185. document.getElementById('ugm_wishnotifier_priceval').value = GM_getValue('wishnotifier_priceval', '');
  1186. document.getElementById('ugm_wishnotifier_idval').value = GM_getValue('wishnotifier_idval', '');
  1187.  
  1188. $('#ugm_wishnotifier_save').click(function() {
  1189. var wa = document.getElementById('ugm_wishnotifier_wishval').value;
  1190. var wb = document.getElementById('ugm_wishnotifier_priceval').value;
  1191. var wc = document.getElementById('ugm_wishnotifier_idval').value;
  1192. GM_setValue('wishnotifier_wishval', wa);
  1193. GM_setValue('wishnotifier_priceval', wb);
  1194. GM_setValue('wishnotifier_idval', wc);
  1195. ugm_saved(this);
  1196. });
  1197.  
  1198. /*!
  1199. * Sub Menu - Owned Items Indicator
  1200. */
  1201.  
  1202. // Element
  1203.  
  1204. $('<div class="ugm_owned_div">' +
  1205. '<div class="ugm_owned_close">â—„ Main Menu</div>' +
  1206. '<span id="ugm_owned_desc">Indicate items you own, with a blue background, when viewing:</span>' +
  1207. '<ul id="ugm_owned_list">' +
  1208. '<li><input type="checkbox" id="ugm_msoiicb"><label for="ugm_msoiicb"></label>Marketplace Search</li>' +
  1209. '<li><input type="checkbox" id="ugm_uoicb"><label for="ugm_uoicb"></label>Userstores</li>' +
  1210. '<li><input type="checkbox" id="ugm_osicb"><label for="ugm_osicb"></label>Gold and Cash Shop</li>' +
  1211. '<li><input type="checkbox" id="ugm_wishowncb"><label for="ugm_wishowncb">Wishlist</li>' +
  1212. '<li><input type="checkbox" id="ugm_owoicb"><label for="ugm_owoicb"></label>Other User\'s Wishlist (User Menu)</li>' +
  1213. '<li><input type="checkbox" id="ugm_ovscb"><label for="ugm_ovscb"></label>All Listings</li>' +
  1214. '<li><input type="checkbox" id="ugm_ogfcb"><label for="ugm_ogfcb"></label>Go Fusion</li>' +
  1215. '</ul>' +
  1216. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1217.  
  1218. // Set
  1219.  
  1220. $('#ugm_owned_mainbtn').click({div: '.ugm_owned_div', state: 'inline-block'}, ugm_menu_openclose);
  1221. $('.ugm_owned_close').click({div: '.ugm_owned_div', state: 'none'}, ugm_menu_openclose);
  1222.  
  1223. /*!
  1224. * Sub Menu - Favorite Links
  1225. */
  1226.  
  1227. // Element
  1228.  
  1229. $('<div class="ugm_rhn_div">' +
  1230. '<div class="ugm_rhn_close">â—„ Main Menu</div>' +
  1231. '<div class="ugm_rhn_div1"></div>' +
  1232. '<div class="ugm_rhn_div2"></div>' +
  1233. '<label id="ugm_rhn_tab1_ha">Links</label>' +
  1234. '<label id="ugm_rhn_tab2_ha">More Links</label>' +
  1235. '<button id="ugm_rhn_tab1_save">Save</button>' +
  1236. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1237.  
  1238. for ( i = 0 ; i < 10 ; i++ ) {
  1239. $('<span class="rhn_linkspan">Title: <input type="text" class="rhn_linktitle"> Link: <input type="text" class="rhn_linkhref"></span>').appendTo('.ugm_rhn_div1');
  1240. $('<span class="rhn_linkspan">Title: <input type="text" class="rhn_linktitle"> Link: <input type="text" class="rhn_linkhref"></span>').appendTo('.ugm_rhn_div2');
  1241. }
  1242.  
  1243. // Set
  1244.  
  1245. $('#ugm_rhn_mainbtn').click({div: '.ugm_rhn_div', state: 'inline-block'}, ugm_menu_openclose);
  1246. $('.ugm_rhn_close').click({div: '.ugm_rhn_div', state: 'none'}, ugm_menu_openclose);
  1247.  
  1248. // Load
  1249.  
  1250. var rhn_lt, rhn_ll, rhn_lt2, rhn_ll2;
  1251.  
  1252. for ( i = 0 ; i < 10 ; i++) {
  1253. rhn_lt = "gmsv_rhn_title" + [i];
  1254. rhn_ll = "gmsv_rhn_href" + [i];
  1255. rhn_lt2 = "gmsv_rhn_title2" + [i];
  1256. rhn_ll2 = "gmsv_rhn_href2" + [i];
  1257. document.getElementsByClassName('ugm_rhn_div1')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linktitle')[0].value = GM_getValue(rhn_lt, '');
  1258. document.getElementsByClassName('ugm_rhn_div1')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linkhref')[0].value = GM_getValue(rhn_ll, '');
  1259. document.getElementsByClassName('ugm_rhn_div2')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linktitle')[0].value = GM_getValue(rhn_lt2, '');
  1260. document.getElementsByClassName('ugm_rhn_div2')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linkhref')[0].value = GM_getValue(rhn_ll2, '');
  1261. }
  1262.  
  1263. // Save
  1264.  
  1265. $('#ugm_rhn_tab1_save').click(function() {
  1266.  
  1267. var rhn_title, rhn_href, rhn_st, rhn_sl, rhn_title2, rhn_href2, rhn_st2, rhn_sl2;
  1268.  
  1269. for ( i = 0 ; i < 10 ; i++) {
  1270. rhn_title = document.getElementsByClassName('ugm_rhn_div1')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linktitle')[0].value;
  1271. rhn_href = document.getElementsByClassName('ugm_rhn_div1')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linkhref')[0].value;
  1272. rhn_title2 = document.getElementsByClassName('ugm_rhn_div2')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linktitle')[0].value;
  1273. rhn_href2 = document.getElementsByClassName('ugm_rhn_div2')[0].getElementsByClassName('rhn_linkspan')[i].getElementsByClassName('rhn_linkhref')[0].value;
  1274. rhn_st = "gmsv_rhn_title" + [i];
  1275. rhn_sl = "gmsv_rhn_href" + [i];
  1276. rhn_st2 = "gmsv_rhn_title2" + [i];
  1277. rhn_sl2 = "gmsv_rhn_href2" + [i];
  1278. GM_setValue(rhn_st, rhn_title);
  1279. GM_setValue(rhn_sl, rhn_href);
  1280. GM_setValue(rhn_st2, rhn_title2);
  1281. GM_setValue(rhn_sl2, rhn_href2);
  1282. }
  1283.  
  1284. ugm_saved(this);
  1285.  
  1286. });
  1287.  
  1288. /*!
  1289. * Sub Menu - Custom Header BG
  1290. */
  1291.  
  1292. // Element
  1293.  
  1294. $('<div id="ugm_chb_div">' +
  1295. '<div id="ugm_chb_close">â—„ Main Menu</div>' +
  1296. '<span id="chb_note">This does not override CI and events BG.</span>' +
  1297. '<div id="ugm_chb_innerdiv">'+
  1298. '<div class="ugm_chb_spandiv"><span class="chb_year">2009</span>'+
  1299. '<ul class="chb_list">'+
  1300. '<li data-chb-c="f8bf94" data-chb-bg="http://i.imgur.com/XIUyNTr.jpg">Fallen Gods</li>'+
  1301. '<li data-chb-c="29799b" data-chb-bg="http://i.imgur.com/npiFJ0D.jpg">Summer</li>'+
  1302. '<li data-chb-c="347849" data-chb-bg="http://i.imgur.com/LcvkwaJ.jpg">Camp Chaos</li>'+
  1303. '<li data-chb-c="424927" data-chb-bg="http://i.imgur.com/rFxQz96.jpg">Easter</li>'+
  1304. '<li data-chb-c="3e6234" data-chb-bg="http://i.imgur.com/gnOp9I2.jpg">Earth Day</li>'+
  1305. '<li data-chb-c="201e2b" data-chb-bg="http://i.imgur.com/73oHP8i.jpg">Promageddon</li>'+
  1306. '<li data-chb-c="391e0d" data-chb-bg="http://i.imgur.com/mhcE3YI.jpg">Demon Buster</li>'+
  1307. '</ul></div>'+
  1308. '<div class="ugm_chb_spandiv"><span class="chb_year">2010</span>'+
  1309. '<ul class="chb_list">'+
  1310. '<li data-chb-c="f9e4b5" data-chb-bg="http://i.imgur.com/76NIFCw.jpg">Love Charm</li>'+
  1311. '<li data-chb-c="01122c" data-chb-bg="http://i.imgur.com/qUeW92W.jpg">Poseidon\'s Legacy</li>'+
  1312. '<li data-chb-c="172514" data-chb-bg="http://i.imgur.com/kPHO2EE.jpg">Code Alpha</li>'+
  1313. '<li data-chb-c="fae788" data-chb-bg="http://i.imgur.com/4ZrlJNh.jpg">Perfect Tragedy</li>'+
  1314. '<li data-chb-c="7a5273" data-chb-bg="http://s.cdn.gaiaonline.com/images/rig/may2010/dream_header.jpg">Luna\'s Incense</li>'+
  1315. '<li data-chb-c="27282e" data-chb-bg="http://s.cdn.gaiaonline.com/images/rig/june2010/musicheader.png">Famestar Hero</li>'+
  1316. '<li data-chb-c="7a72a3" data-chb-bg="http://i.imgur.com/tDN4f3H.jpg">Wrath of Gaia</li>'+
  1317. '<li data-chb-c="dfedee" data-chb-bg="http://s.cdn.gaiaonline.com/images/rig/august2010/August_Header.jpg">Final Reign</li>'+
  1318. '<li data-chb-c="240108" data-chb-bg="http://i.imgur.com/qqKDAPw.jpg">Cirque Du Gothique</li>'+
  1319. '<li data-chb-c="8a2228" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/october2010ci/oct2010_header.jpg">Hell Prison</li>'+
  1320. '<li data-chb-c="2d212a" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/november2010ci/nov2010_header.jpg">Neon Core</li>'+
  1321. '<li data-chb-c="05084b" data-chb-bg="http://i.imgur.com/KKel2Pe.jpg">Bitter Frost</li>'+
  1322. '<li data-chb-c="06224a" data-chb-bg="http://s.cdn.gaiaonline.com/images/gaia_global/gaia_header/new_header/il_header_bg_beach_sprite.jpg">Homepage</li>'+
  1323. '<li data-chb-c="e9f6ed" data-chb-bg="http://i.imgur.com/k0ZFFKd.jpg">Frontier Skies</li>'+
  1324. '<li data-chb-c="a0b19f" data-chb-bg="http://i.imgur.com/gjUpGSc.jpg">Spring Cleaning</li>'+
  1325. '<li data-chb-c="686613" data-chb-bg="http://i.imgur.com/70EJfgi.jpg">Easter - Diedrich</li>'+
  1326. '<li data-chb-c="848484" data-chb-bg="http://i.imgur.com/NbA0Xqw.gif">April Fools</li>'+
  1327. '<li data-chb-c="492d22" data-chb-bg="http://w.cdn.gaiaonline.com/imaging/cms/header_minievent_1a_1291681922_bkgd.jpg">Cats vs Dogs</li>'+
  1328. '<li data-chb-c="3b2314" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/halloween2010/halloween_banner.jpg">Grave Danger!</li>'+
  1329. '<li data-chb-c="c9e7f5" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_aekea.jpg">Xmas - Aekea</li>'+
  1330. '<li data-chb-c="5c6dbe" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_aekea_night.jpg">Xmas - Aekea Night</li>'+
  1331. '<li data-chb-c="cddfef" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_barton.jpg">Barton</li>'+
  1332. '<li data-chb-c="555d8a" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_barton_night.jpg">Barton Night</li>'+
  1333. '<li data-chb-c="dcf6f7" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_durem.jpg">Durem</li>'+
  1334. '<li data-chb-c="4066bd" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_durem_night.jpg">Durem Night</li>'+
  1335. '<li data-chb-c="a6d3f3" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_gambino.jpg">Gambino</li>'+
  1336. '<li data-chb-c="353991" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_gambino_night.jpg">Gambino Night</li>'+
  1337. '<li data-chb-c="b4d8f3" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_bassken.jpg">Bassken</li>'+
  1338. '<li data-chb-c="2c2b50" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2010/header/il_header_bg_bassken_night.jpg">Bassken Night</li>'+
  1339. '</ul></div>'+
  1340. '<div class="ugm_chb_spandiv"><span class="chb_year">2011</span>'+
  1341. '<ul class="chb_list">'+
  1342. '<li data-chb-c="1e0a13" data-chb-bg="http://i.imgur.com/bZz1F3T.jpg">Lost Chapter</li>'+
  1343. '<li data-chb-c="2b2b2b" data-chb-bg="http://i.imgur.com/KBwuSIB.jpg">Love Charm II</li>'+
  1344. '<li data-chb-c="484560" data-chb-bg="http://i.imgur.com/67GxAQ4.jpg">Crystal Overdrive</li>'+
  1345. '<li data-chb-c="1c000e" data-chb-bg="http://i.imgur.com/Fnk2GE0.jpg">Arcana Break</li>'+
  1346. '<li data-chb-c="3c392a" data-chb-bg="http://i.imgur.com/O2H5t7A.jpg">Eternal Rivals</li>'+
  1347. '<li data-chb-c="2c1972" data-chb-bg="http://i.imgur.com/4qxwJgS.jpg">Screen King</li>'+
  1348. '<li data-chb-c="7895f3" data-chb-bg="http://i.imgur.com/UXNLqVc.jpg">Double Rainbow</li>'+
  1349. '<li data-chb-c="18367e" data-chb-bg="http://i.imgur.com/E3Wek0I.jpg">Valefor Academy</li>'+
  1350. '<li data-chb-c="e3edee" data-chb-bg="http://i.imgur.com/SEFGefo.jpg">Neverland</li>'+
  1351. '<li data-chb-c="2c0e18" data-chb-bg="http://i.imgur.com/igOykaz.jpg">Famestar Masquerade</li>'+
  1352. '<li data-chb-c="080b14" data-chb-bg="http://i.imgur.com/CSo4lg4.jpg">Guardian Totem</li>'+
  1353. '<li data-chb-c="32426b" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/december2011ci/dec2011_underland_header.jpg">Underland</li>'+
  1354. '<li data-chb-c="9fce5e" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/easter2011/easter2011_bg.jpg">Dueling Bunnies</li>'+
  1355. '<li data-chb-c="1936d2" data-chb-bg="http://i.imgur.com/Z0WVT10.jpg">Meowbook</li>'+
  1356. '<li data-chb-c="86c1fd" data-chb-bg="http://s.cdn.gaiaonline.com/images/zomg/beachboard_header.jpg">Buccaneer Boardwalk</li>'+
  1357. '<li data-chb-c="222d29" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/mogaheader/11_05_moga_header.jpg">Monster Galaxy</li>'+
  1358. '<li data-chb-c="2c0e16" data-chb-bg="http://i.imgur.com/l21blUz.jpg">Masquerade</li>'+
  1359. '<li data-chb-c="29110f" data-chb-bg="http://i.imgur.com/0H03kf3.jpg">Moonrise</li>'+
  1360. '<li data-chb-c="fffaf7" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/piehard2011/pie_header.jpg">Pie Hard</li>'+
  1361. '<li data-chb-c="d6dded" data-chb-bg="http://i.imgur.com/x01TO1D.jpg">Carol of Old Pete</li>'+
  1362. '</ul></div>'+
  1363. '<div class="ugm_chb_spandiv"><span class="chb_year">2012</span>'+
  1364. '<ul class="chb_list">'+
  1365. '<li data-chb-c="160d22" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/january2012/radiantglxy_header.jpg">Radiant Galaxy</li>'+
  1366. '<li data-chb-c="5279a4" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/february2012/feb_luvchrm3_header.jpg">Love Charm III</li>'+
  1367. '<li data-chb-c="0e0e0e" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/march2012/clblimbo_header.jpg">Club Limbo</li>'+
  1368. '<li data-chb-c="181f11" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/april2012/gauntletsngoblins_header.jpg">Gauntlets & Goblins</li>'+
  1369. '<li data-chb-c="000000" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/may2012/radiohavok_header.jpg">Radio Havoc</li>'+
  1370. '<li data-chb-c="08000a" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/june2012/header.jpg">Digital Rainbow</li>'+
  1371. '<li data-chb-c="191718" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/july2012/header.jpg">Runic Challenge</li>'+
  1372. '<li data-chb-c="181449" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/august2012/header.jpg">Forgotten Reverie</li>'+
  1373. '<li data-chb-c="533623" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/september2012/header.jpg">Champion Halls</li>'+
  1374. '<li data-chb-c="110f10" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/october2012/header.jpg">Dark Reflection</li>'+
  1375. '<li data-chb-c="233d24" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/november2012/header.jpg">Cryptic Path</li>'+
  1376. '<li data-chb-c="0e223f" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/december2012/header.jpg">Trinket Heart</li>'+
  1377. '<li data-chb-c="1a1f21" data-chb-bg="http://s.cdn.gaiaonline.com/images/hoc/header/HOC_gaiaheader_default.jpg">Herald of Chaos</li>'+
  1378. '<li data-chb-c="1a1922" data-chb-bg="http://s.cdn.gaiaonline.com/images/hoc/header/HOC_gaiaheader_demon.jpg">HOC - Demon</li>'+
  1379. '<li data-chb-c="132023" data-chb-bg="http://s.cdn.gaiaonline.com/images/hoc/header/HOC_gaiaheader_dragon.jpg">HOC - Dragon</li>'+
  1380. '<li data-chb-c="271912" data-chb-bg="http://s.cdn.gaiaonline.com/images/hoc/header/HOC_gaiaheader_kingdom.jpg">HOC - Kingdom</li>'+
  1381. '<li data-chb-c="000000" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/olympics2012/header/2012ROsummer_header.jpg">Rejected Olympics</li>'+
  1382. '<li data-chb-c="000000" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/olympics2012/header/2012ROsummer_aekea_header.jpg">RO - Aekea</li>'+
  1383. '<li data-chb-c="000000" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/olympics2012/header/2012ROsummer_barton_header.jpg">RO - Barton</li>'+
  1384. '<li data-chb-c="000000" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/olympics2012/header/2012ROsummer_durem_header.jpg">RO - Durem</li>'+
  1385. '<li data-chb-c="000000" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/olympics2012/header/2012ROsummer_gambino_header.jpg">RO - Gambino</li>'+
  1386. '<li data-chb-c="56baff" data-chb-bg="http://s.cdn.gaiaonline.com/images/sponsorships/adventuretime/header/adtime_icekingdom_header.jpg">Adventure Time</li>'+
  1387. '<li data-chb-c="7faf3f" data-chb-bg="http://i.imgur.com/yaG2Y8D.jpg">Grunnygeddon</li>'+
  1388. '<li data-chb-c="0a0809" data-chb-bg="http://i.imgur.com/tYTHRBT.jpg">The Don</li>'+
  1389. '<li data-chb-c="20190a" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/header_1.jpg">Apocalypsmas 1</li>'+
  1390. '<li data-chb-c="20190a" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/header_2.jpg">Apocalypsmas 2</li>'+
  1391. '<li data-chb-c="cddfef" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/header_3.jpg">Apocalypsmas 3</li>'+
  1392. '<li data-chb-c="cddfef" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/header_4.jpg">Apocalypsmas 4</li>'+
  1393. '<li data-chb-c="cddfef" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/header_5.jpg">Apocalypsmas 5</li>'+
  1394. '<li data-chb-c="20190a" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/apocalypsmas_header_01ABC.jpg">Apocalypsmas 6</li>'+
  1395. '<li data-chb-c="20190a" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/apocalypsmas_header_02DCF.jpg">Apocalypsmas 7</li>'+
  1396. '<li data-chb-c="cddfef" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/apocalypsmas_header_03J8C.jpg">Apocalypsmas 8</li>'+
  1397. '<li data-chb-c="cddfef" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/apocalypsmas_header_04LXQ.jpg">Apocalypsmas 9</li>'+
  1398. '<li data-chb-c="cddfef" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2012/headers/apocalypsmas_header_05AW2.jpg">Apocalypsmas 10</li>'+
  1399. '</ul></div>'+
  1400. '<div class="ugm_chb_spandiv"><span class="chb_year">2013</span>'+
  1401. '<ul class="chb_list">'+
  1402. '<li data-chb-c="fdf1c0" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/ci/january2013/header_010913_7197.jpg">Impractical Gala</li>'+
  1403. '<li data-chb-c="262931" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/4b01ec466401.jpg">Final Line</li>'+
  1404. '<li data-chb-c="fecf6e" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/f39119b2a7ba.jpg">Culinary Coliseum</li>'+
  1405. '<li data-chb-c="6bc9e6" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/5c7e3d98a667.jpg">Seven Seas</li>'+
  1406. '<li data-chb-c="5a8ff5" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/a61815193ed1.jpg">Game On</li>'+
  1407. '<li data-chb-c="4b352a" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/0235debf9df9.jpg">Carnival du Gothique</li>'+
  1408. '<li data-chb-c="181d76" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/422675eed918.jpg">Starlight Redemption</li>'+
  1409. '<li data-chb-c="3a5a7f" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/0830c7c8f1b9.jpg">Return To Valefor</li>'+
  1410. '<li data-chb-c="18133d" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/c5fdb3c41036.png">Midnight Citadel</li>'+
  1411. '<li data-chb-c="23261a" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/82f4e66d65ef.jpg">Verdant Grove</li>'+
  1412. '<li data-chb-c="160d22" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/a4a27f51a3ac.jpg">Checkmate Tactics</li>'+
  1413. '<li data-chb-c="b3d9ff" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/easter2013/header/easter2013_bunnylament_header.jpg">A Bunny\'s Lament</li>'+
  1414. '<li data-chb-c="9edbf8" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/anniversary2013/header/luvofgaia2k13_header.jpg">For The Love Of Gaia</li>'+
  1415. '<li data-chb-c="07416f" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/summer2013/summer2k13wtfluff_header.jpg">What the Fluff?!</li>'+
  1416. '<li data-chb-c="100c2e" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/halloween2013/header/h2k13_jkveb_header.png">Vengeance</li>'+
  1417. '<li data-chb-c="55bbfe" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/91329076499c.jpg">Resolution</li>'+
  1418. '</ul></div>'+
  1419. '<div class="ugm_chb_spandiv"><span class="chb_year">2014</span>'+
  1420. '<ul class="chb_list">'+
  1421. '<li data-chb-c="2b3563" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/e6eac8682bc5.png">Nouvelle Lune</li>'+
  1422. '<li data-chb-c="affe6c" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/d6e59239864b.jpg">In Deep Ship</li>'+
  1423. '<li data-chb-c="27293e" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/aec1b0ce10ea.jpg">Underworld Descent</li>'+
  1424. '<li data-chb-c="fae0c4" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/b4062e071cbb.jpg">Budding Bistro</li>'+
  1425. '<li data-chb-c="250f2b" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/d18e5e4355e7.jpg">Vivid Harmony</li>'+
  1426. '<li data-chb-c="cddce5" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/7754274af669.jpg">Peyo\'s Fables</li>'+
  1427. '<li data-chb-c="1f1f23" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/664c599d0f88.jpg">CONtagious</li>'+
  1428. '<li data-chb-c="3e3e37" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/70d46372c8d1.jpg">Rascal Romp </li>'+
  1429. '<li data-chb-c="fffeff" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/f5e7a0861835.jpg">Tailored Star</li>'+
  1430. '<li data-chb-c="251a2c" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/b7de6f51b3f4.jpg">Enigma Institute</li>'+
  1431. '<li data-chb-c="373c9a" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/4e3d6860f46d.jpg">Luminous Void</li>'+
  1432. '<li data-chb-c="91c77c" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/489096c25c0b.jpg">Zephyr Strife</li>'+
  1433. '<li data-chb-c="262fad" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/5fde46e9edcd.jpg">Frozen Repose</li>'+
  1434. '<li data-chb-c="3b121f" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/c91fb0d9cfc5.jpg">Rising Concerto</li>'+
  1435. '<li data-chb-c="aac2c4" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/aprilfool2014/april2k14_takeover_header.jpg">April Fools</li>'+
  1436. '<li data-chb-c="76b895" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/easter2014/header/easter2k14_header.jpg">Easter</li>'+
  1437. '<li data-chb-c="47e9db" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/4d3f7d793522.jpg">Summer Sale</li>'+
  1438. '<li data-chb-c="322e42" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/summer2014/header/summer2k14event_header.jpg">Spirit of the Summer</li>'+
  1439. '<li data-chb-c="fefdfe" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/xmas2014/201412_xmasheader.jpg">Bitter Slumber</li>'+
  1440. '</ul></div>'+
  1441. '<div class="ugm_chb_spandiv"><span class="chb_year">2015</span>'+
  1442. '<ul class="chb_list">'+
  1443. '<li data-chb-c="636362" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/031863aab421.jpg">New Attitude</li>'+
  1444. '<li data-chb-c="bae1ea" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/866ee81a6367.jpg">Ships Going Down</li>'+
  1445. '<li data-chb-c="0eca9d" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/dc75a97ffef8.jpg">Tendit ad Astra</li>'+
  1446. '<li data-chb-c="c5548d" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/871de4b72f41.jpg">Arcance Chevalier</li>'+
  1447. '<li data-chb-c="574237" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/c08d4e11ac24.jpg">CONspicuous</li>'+
  1448. '<li data-chb-c="0c1c3c" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/8677a965113f.jpg">Camp Nimbus</li>'+
  1449. '<li data-chb-c="151517" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/5549ee3c7a52.jpg">Joker\'s Wild</li>'+
  1450. '<li data-chb-c="fff7ff" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/727760fbe357.jpg">Starstruck</li>'+
  1451. '<li data-chb-c="353535" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/6e8b86c5047c.jpg">Back to FashionSchool</li>'+
  1452. '<li data-chb-c="12082e" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/d58f80cf81da.jpg">Netherhood</li>'+
  1453. '<li data-chb-c="100f1d" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/9cc53b3719c5.jpg">Woodland\'s Faye</li>'+
  1454. '<li data-chb-c="fffeff" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/defeeeb45d5b.jpg">Hella Cool</li>'+
  1455. '<li data-chb-c="7b98a2" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/summer2015/Kindred_site_header_970x150.jpg">Lake Kindred</li>'+
  1456. '<li data-chb-c="580d14" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/vday2015/2015valentines_header.jpg">Love Me Love Me Not</li>'+
  1457. '<li data-chb-c="100e05" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/d9c8d86f8f39.png">Braintologists Unite</li>'+
  1458. '<li data-chb-c="305377" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/spring2015/header/201503_marchevent_header.jpg">Buffer Everyday</li>'+
  1459. '<li data-chb-c="103a7f" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/easter2015/201504_easterevent_header.jpg">Interstellar Bunvasion</li>'+
  1460. '<li data-chb-c="3d344b" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/75e15a8e3ac7.jpg">Summer Sale</li>'+
  1461. '<li data-chb-c="243730" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/august2015/site_header_2015_august_event.jpg">Spirit of Smackdown</li>'+
  1462. '<li data-chb-c="002232" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/sept2015/2015_charge_event_header.jpg">Force to be Reckoned</li>'+
  1463. '<li data-chb-c="212527" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/halloween2015/header/201510_halloween_header.jpg">Shadow Lab</li>'+
  1464. '<li data-chb-c="f4feff" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/winter2015/201512_xmasevent_header.jpg">Bitter Revival</li>'+
  1465. '<li data-chb-c="15181f" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/73429effaa9d.jpg">Black Friday Sale</li>'+
  1466. '</ul></div>'+
  1467. '<div class="ugm_chb_spandiv"><span class="chb_year">2016</span>'+
  1468. '<ul class="chb_list">'+
  1469. '<li data-chb-c="feccc5" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/d9c61c26ebbf.jpg">Heads or Tails</li>'+
  1470. '<li data-chb-c="fcd5e1" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/e812119ce109.jpg">Talkin Ship</li>'+
  1471. '<li data-chb-c="180d0d" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/44a9765bf81c.jpg">Unluck in Love</li>'+
  1472. '<li data-chb-c="fbfaf6" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/0021d44b7901.jpg">Imagicnation</li>'+
  1473. '<li data-chb-c="3e528c" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/easter2016/201603_easterevent_header.jpg">Bunvoyage</li>'+
  1474. '<li data-chb-c="f8eac7" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/dd424154c28f.jpg">Quartz Stub</li>'+
  1475. '<li data-chb-c="1f0808" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/28706ca5d5f5.jpg">You Lied To Me 1</li>'+
  1476. '<li data-chb-c="1f0808" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/e08fd7ba5ee9.jpg">You Lied To Me 2</li>'+
  1477. '<li data-chb-c="1f0808" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/d3235b0630b4.jpg">You Lied To Me 3</li>'+
  1478. '<li data-chb-c="1f0808" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/35c2f46c18cd.jpg">You Lied To Me 4</li>'+
  1479. '<li data-chb-c="1f0808" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/b74324a0ef2f.jpg">You Lied To Me 5</li>'+
  1480. '<li data-chb-c="c7e18c" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/4c9469b4a4ed.jpg">Spring Fling</li>'+
  1481. '<li data-chb-c="d1e8f3" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/aa8d602572c3.jpg">Geemoji</li>'+
  1482. '<li data-chb-c="197583" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/6156c1128f3c.png">Everything Is Fine</li>'+
  1483. '<li data-chb-c="383838" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/b1c8972573cd.jpg">Afterschool Life</li>'+
  1484. '<li data-chb-c="1f1f21" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/93bdf88dd6b1.jpg">Memorial Sale</li>'+
  1485. '<li data-chb-c="1f1f1f" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/3a4fe67d3685.jpg">CONnect</li>'+
  1486. '<li data-chb-c="252525" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/41944e01124f.jpg">Apunkalyptic</li>'+
  1487. '<li data-chb-c="000018" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/26c88e5cc160.jpg">Lucid Dreams</li>'+
  1488. '<li data-chb-c="1e1600" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/2df2a339521d.jpg">Carnivile</li>'+
  1489. '<li data-chb-c="17172f" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/56586a21ca11.jpg">Occult de Sac</li>'+
  1490. '<li data-chb-c="183b61" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/6341b2b023ff.jpg">Zurg: Generations</li>'+
  1491. '<li data-chb-c="03060f" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/182cc9272e8a.jpg">Snugvember</li>'+
  1492. '<li data-chb-c="ffffff" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/62a9e133b978.jpg">Black Friday 2k16</li>'+
  1493. '<li data-chb-c="afb7cc" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/9d515ae274be.jpg">Heavenly Holiday</li>'+
  1494. '<li data-chb-c="1130ad" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/a2ce16420dce.jpg">Siege of the Nutcracker</li>'+
  1495. '</ul></div>'+
  1496. '<div class="ugm_chb_spandiv"><span class="chb_year">2017</span>'+
  1497. '<ul class="chb_list">'+
  1498. '<li data-chb-c="ced4d4" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/e3d8c48ebbcc.jpg">Fresh Line</li>'+
  1499. '<li data-chb-c="262f4e" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/df7d2bf0b3b9.jpg">Friend Zone</li>'+
  1500. '<li data-chb-c="f8f3f3" data-chb-bg="http://s.cdn.gaiaonline.com/images/event/vday2017/header.png">Labu-Labu Fest</li>'+
  1501. '<li data-chb-c="271c2c" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/ba4c1d20a784.jpg">OK! pop</li>'+
  1502. '<li data-chb-c="fdf8d0" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/d29c43497346.jpg">Game Night Fight</li>'+
  1503. '<li data-chb-c="617a98" data-chb-bg="http://w.cdn.gaiaonline.com/mfs/index/adminupload/8604503059c0.jpg">Finalz Weak</li>'+
  1504. '</ul></div>'+
  1505. '</div>' +
  1506. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1507.  
  1508. // Load
  1509.  
  1510. var chb_chosen = GM_getValue('chb_selectedbg', '');
  1511.  
  1512. $( '.chb_list li[data-chb-bg*="'+chb_chosen+'"]' ).css('background', '#dfdfdf');
  1513.  
  1514. // Save
  1515.  
  1516. $('.chb_list li').click(function(){
  1517.  
  1518. $('.chb_list li').each(function(){
  1519. $(this).css('background', '#f8f8f8');
  1520. });
  1521.  
  1522. var chb_sel = $(this).attr('data-chb-bg');
  1523. var chb_selc = $(this).attr('data-chb-c');
  1524. var chb_bg = document.getElementById('gaia_header').getElementsByTagName('div')[0];
  1525. var chb_full = 'url("' + chb_sel + '") no-repeat #' + chb_selc;
  1526. var chb_nonc = '#' + chb_selc;
  1527.  
  1528. $(chb_bg).removeAttr( 'style' );
  1529. chb_bg.style.background = chb_sel;
  1530. $(chb_bg).css('background', chb_full);
  1531. addGlobalStyle('.header_content::after {content: " "; position: absolute; height: 100%; width: 100%; background: '+chb_full+' !important; }');
  1532. addGlobalStyle('.header_content * {z-index: 2;}');
  1533. addGlobalStyle('#user_header_wrap {z-index: 2; position: relative; float: right;}');
  1534. GM_setValue('chb_selectedbg', chb_sel);
  1535. GM_setValue('chb_selectedbgc', chb_selc);
  1536.  
  1537. if (!GM_getValue('centeredforums_enabled')) {
  1538. $('#gaia_header').removeAttr( 'style' );
  1539. $('#gaia_header').css('background', chb_nonc);
  1540. }
  1541.  
  1542. $(this).css('background', '#dfdfdf');
  1543.  
  1544. });
  1545.  
  1546. // Set
  1547.  
  1548. $('#ugm_chb_mainbtn').click({div: '#ugm_chb_div', state: 'inline-block'}, ugm_menu_openclose);
  1549. $('#ugm_chb_close').click({div: '#ugm_chb_div', state: 'none'}, ugm_menu_openclose);
  1550.  
  1551. /*!
  1552. * Sub Menu - User Tag
  1553. */
  1554.  
  1555. // Element
  1556.  
  1557. $('<div class="ugm_usertag_div">' +
  1558. '<div class="ugm_usertag_close">â—„ Main Menu</div>' +
  1559. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1560.  
  1561. // Set
  1562.  
  1563. $('#ugm_usertag_mainbtn').click({div: '.ugm_usertag_div', state: 'inline-block'}, ugm_menu_openclose);
  1564. $('.ugm_usertag_close').click({div: '.ugm_usertag_div', state: 'none'}, ugm_menu_openclose);
  1565.  
  1566. // Load
  1567.  
  1568. var gmarr = GM_listValues();
  1569. var taggedarr = gmarr.filter(function (el) { return (el.indexOf('idtag_') >= 0); });
  1570. $('<div id="ugm_usertag_table"><table id=""><tr><th>Name</th><th>Tag</th><th>Manage</th></tr></table></div>').appendTo('.ugm_usertag_div');
  1571.  
  1572. for ( var i = 0 ; i < taggedarr.length ; i++ ) {
  1573. var ugm_tagres = GM_getValue(taggedarr[i], '');
  1574. $('<tr><td uid="' + ugm_tagres[2] + '">' + ugm_tagres[1] + '</td><td><input value="' + ugm_tagres[0] + '" maxlength="25"></td><td>' + '<a class="ugm_tagsave">Save</a> <a class="ugm_tagdel">Delete</a></td></tr>').appendTo('#ugm_usertag_table table');
  1575. }
  1576.  
  1577. // Save
  1578.  
  1579. $('.ugm_tagsave').click(function(){
  1580.  
  1581. var ugm_usertag = [];
  1582. var ugm_tagdesc = $(this).parent().prev().find('input').val();
  1583. var ugm_tagname = $(this).parent().prev().prev().html();
  1584. var ugm_tagid = $(this).parent().prev().prev().attr('uid');
  1585. var ugm_savename = "idtag_" + ugm_tagid;
  1586. ugm_usertag.push(ugm_tagdesc);
  1587. ugm_usertag.push(ugm_tagname);
  1588. ugm_usertag.push(ugm_tagid);
  1589.  
  1590. GM_setValue(ugm_savename, ugm_usertag);
  1591. ugm_saved(this);
  1592.  
  1593. });
  1594.  
  1595. // Delete
  1596.  
  1597. $('.ugm_tagdel').click(function(){
  1598.  
  1599. var ugm_tagid = $(this).parent().prev().prev().attr('uid');
  1600. var ugm_savename = "idtag_" + ugm_tagid;
  1601. GM_deleteValue(ugm_savename);
  1602. $(this).parent().parent().remove();
  1603.  
  1604. });
  1605.  
  1606. /*!
  1607. * Sub Menu - Instant Quote
  1608. */
  1609.  
  1610. // Element
  1611.  
  1612. $('<div class="ugm_qrqq_div">' +
  1613. '<div class="ugm_qrqq_close">â—„ Main Menu</div>' +
  1614. '<span id="ugm_qrqq_desc">Select Instant Quote Mode:</span>' +
  1615. '<form id="ugm_qrqq_list">' +
  1616. '<input type="radio" name="quotemode" value="empty"><label>Empty Quote (Fastest)</label><br/>' +
  1617. '<input type="radio" name="quotemode" value="nobbc"><label>Plain Text Full Quote</label><br/>' +
  1618. '<input type="radio" name="quotemode" value="full"><label>Full Quote</label><br/>' +
  1619. '<input type="radio" name="quotemode" value="spoilered"><label>Spoiler-Wrapped Full Quote</label>' +
  1620. '</form>' +
  1621. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1622.  
  1623. // Set
  1624.  
  1625. $('#ugm_qrqq_mainbtn').click({div: '.ugm_qrqq_div', state: 'inline-block'}, ugm_menu_openclose);
  1626. $('.ugm_qrqq_close').click({div: '.ugm_qrqq_div', state: 'none'}, ugm_menu_openclose);
  1627.  
  1628. // Save Load
  1629.  
  1630. $('#ugm_qrqq_list input').change(function(){GM_setValue('qrqq_mode', document.getElementById("ugm_qrqq_list").elements["quotemode"].value);});
  1631. $('#ugm_qrqq_list input[value="' + GM_getValue('qrqq_mode', 'empty') + '"]').prop("checked",true);
  1632.  
  1633. /*!
  1634. * Sub Menu - Wishlist Items Indicator
  1635. */
  1636.  
  1637. // Element
  1638.  
  1639. $('<div class="ugm_wishlisted_div">' +
  1640. '<div class="ugm_wishlisted_close">â—„ Main Menu</div>' +
  1641. '<span id="ugm_wishlisted_desc">Indicate your wishlisted items, with a red background, when viewing:</span>' +
  1642. '<ul id="ugm_wishlisted_list">' +
  1643. '<li><input type="checkbox" id="wled_search"><label for="wled_search"></label>Marketplace Search</li>' +
  1644. '<li><input type="checkbox" id="wled_userstore"><label for="wled_userstore"></label>Userstores</li>' +
  1645. '<li><input type="checkbox" id="wled_imd"><label for="wled_imd"></label>Item Market Detail (Indicated as text)</li>' +
  1646. '<li><input type="checkbox" id="wled_vs"><label for="wled_vs"></label>All Listings</li>' +
  1647. '<li><input type="checkbox" id="wled_gf"><label for="wled_gf"></label>Go Fusion</li>' +
  1648. '</ul>' +
  1649. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1650.  
  1651. // Set
  1652.  
  1653. $('#ugm_wishlisted_mainbtn').click({div: '.ugm_wishlisted_div', state: 'inline-block'}, ugm_menu_openclose);
  1654. $('.ugm_wishlisted_close').click({div: '.ugm_wishlisted_div', state: 'none'}, ugm_menu_openclose);
  1655.  
  1656. /*!
  1657. * Sub Menu - Forum Lite Upgrade
  1658. */
  1659.  
  1660. // Element
  1661.  
  1662. $('<div class="ugm_forumlite_div">' +
  1663. '<div class="ugm_forumlite_close">â—„ Main Menu</div>' +
  1664. '<span id="ugm_forumlite_desc">Changes the appearance. Leave empty for default.</span>' +
  1665. '<ul id="ugm_forumlite_list">' +
  1666. '<li><input type="checkbox" id="forumlite_bluebg"><label for="forumlite_bluebg"></label>Hide Blue Gradient Separator</li>' +
  1667. '<li><input type="text" id="forumlite_bgcolor"><label for="forumlite_bgcolor"></label>BG Hex Color (Ex: #EEEEEE)</li>' +
  1668. '<li><input type="text" id="forumlite_bgimage"><label for="forumlite_bgimage"></label>BG Image URL</li>' +
  1669. '</ul>' +
  1670. '<a id="ugm_forumlite_save">Save</a>' +
  1671. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1672.  
  1673. // Set
  1674.  
  1675. $('#ugm_forumlite_mainbtn').click({div: '.ugm_forumlite_div', state: 'inline-block'}, ugm_menu_openclose);
  1676. $('.ugm_forumlite_close').click({div: '.ugm_forumlite_div', state: 'none'}, ugm_menu_openclose);
  1677.  
  1678. // Save Load
  1679.  
  1680. $('#forumlite_bluebg').change(function(){GM_setValue('forumlitebluebg_enabled', this.checked);});
  1681. $('#forumlite_bluebg').prop('checked', GM_getValue('forumlitebluebg_enabled'));
  1682. $('#forumlite_bgcolor').val(GM_getValue('forumlite_bgc',''));
  1683. $('#forumlite_bgimage').val(GM_getValue('forumlite_bgi',''));
  1684.  
  1685. $('#ugm_forumlite_save').click(function(){
  1686. var forumlite_bgcolor = $('#forumlite_bgcolor').val();
  1687. var forumlite_bgimage = $('#forumlite_bgimage').val();
  1688. GM_setValue('forumlite_bgc', forumlite_bgcolor);
  1689. GM_setValue('forumlite_bgi', forumlite_bgimage);
  1690. ugm_saved(this);
  1691. });
  1692.  
  1693. /*!
  1694. * Sub Menu - BBCode Generator
  1695. */
  1696.  
  1697. // Element
  1698.  
  1699. $('<div class="ugm_bbcodegen_div">' +
  1700. '<div class="ugm_bbcodegen_close">â—„ Main Menu</div>' +
  1701. '<span id="ugm_bbcodegen_desc">Adds a BBCode button that generates the items BBCodes, when viewing:</span>' +
  1702. '<ul id="ugm_bbcodegen_list">' +
  1703. '<li><input type="checkbox" id="ugm_invobbcodecb"><label for="ugm_invobbcodecb"></label>Inventory</li>' +
  1704. '<li><input type="checkbox" id="ugm_wishbbcodecb"><label for="ugm_wishbbcodecb"></label>Wishlist</li>' +
  1705. '<li><input type="checkbox" id="ugm_itembbcodecb"><label for="ugm_itembbcodecb"></label>Market Listing</li>' +
  1706. '<li><input type="checkbox" id="ugm_equipbbcb"><label for="ugm_equipbbcb">Avatar Dress Up</li>' +
  1707. '<li><input type="checkbox" id="ugm_mystorebbcb"><label for="ugm_mystorebbcb">My Store</li>' +
  1708. '</ul>' +
  1709. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1710.  
  1711. // Set
  1712.  
  1713. $('#ugm_bbcodegen_mainbtn').click({div: '.ugm_bbcodegen_div', state: 'inline-block'}, ugm_menu_openclose);
  1714. $('.ugm_bbcodegen_close').click({div: '.ugm_bbcodegen_div', state: 'none'}, ugm_menu_openclose);
  1715.  
  1716. /*!
  1717. * Sub Menu - General Fixes
  1718. */
  1719.  
  1720. // Element
  1721.  
  1722. $('<div class="ugm_genfix_div">' +
  1723. '<div class="ugm_genfix_close">â—„ Main Menu</div>' +
  1724. '<ul id="ugm_genfix_list">' +
  1725. '<li><input type="checkbox" id="ugm_flashavatarscb"><label for="ugm_flashavatarscb"></label>Animated Avatar' +
  1726. '<span class="ugm_genfix_lidesc">Right-clicking animated avatars no longer redirects to profiles.</span>' +
  1727. '</li>' +
  1728. '<li><input type="checkbox" id="ugm_bettermarriagecb"><label for="ugm_bettermarriagecb"></label>Marriage Font' +
  1729. '<span class="ugm_genfix_lidesc">Fixes the font of the marriage text to make it look less off.</span>' +
  1730. '</li>' +
  1731. '<li><input type="checkbox" id="ugm_commascb"><label for="ugm_commascb"></label>Commas' +
  1732. '<span class="ugm_genfix_lidesc">Adds commas to all gold and cash amounts on the site.</span>' +
  1733. '</li>' +
  1734. '<li><input type="checkbox" id="ugm_anf"><label for="ugm_anf">Async Notification' +
  1735. '<span class="ugm_genfix_lidesc">Fixes the issue where Async Notification appears behind.</span>' +
  1736. '</li>' +
  1737. '<li><input type="checkbox" id="ugm_marketquantityfixcb"><label for="ugm_marketquantityfixcb">Market Quantity' +
  1738. '<span class="ugm_genfix_lidesc">Fixes a layout error in some Game Items.</span>' +
  1739. '</li>' +
  1740. '<li><input type="checkbox" id="ugm_vmffcb"><label for="ugm_vmffcb">View My Findings' +
  1741. '<span class="ugm_genfix_lidesc">Fixes the issue where the findings stretch outside the page.</span>' +
  1742. '</li>' +
  1743. '<li><input type="checkbox" id="ugm_commentlinkscb"><label for="ugm_commentlinkscb">View Comments Link' +
  1744. '<span class="ugm_genfix_lidesc">Adds [View All Comments] on comment page.</span>' +
  1745. '</li>' +
  1746. '<li><input type="checkbox" id="ugm_fsdccb"><label for="ugm_fsdccb">Forum Search Cleanup' +
  1747. '<span class="ugm_genfix_lidesc">Cleans up the drop down menu when doing a forum search.</span>' +
  1748. '</li>' +
  1749. '<li><input type="checkbox" id="ugm_pnicb"><label for="ugm_pnicb">Page Number Jump' +
  1750. '<span class="ugm_genfix_lidesc">Page Number Jump in forums, search, posts and topics.</span>' +
  1751. '</li>' +
  1752. '<li><input type="checkbox" id="ugm_rvccb"><label for="ugm_rvccb">Real Vote Count' +
  1753. '<span class="ugm_genfix_lidesc">Shows the number of likes and dislikes instead of totals.</span>' +
  1754. '</li>' +
  1755. '<li><input type="checkbox" id="ugm_hlkp"><label for="ugm_hlkp">Hide Lake Kindred Pets' +
  1756. '<span class="ugm_genfix_lidesc">Lake Kindreds Pets will no longer be displayed in forums.</span>' +
  1757. '</li>' +
  1758. '<li><input type="checkbox" id="ugm_tsdm"><label for="ugm_tsdm">Trash / Sell / Donate Max Qty' +
  1759. '<span class="ugm_genfix_lidesc">Always trash, sell, or donate max quantity of an item.</span>' +
  1760. '</li>' +
  1761. '</ul>' +
  1762. '</div>').appendTo('#gaiaupgrade_mainpanel');
  1763.  
  1764. // Set
  1765.  
  1766. $('#ugm_genfix_mainbtn').click({div: '.ugm_genfix_div', state: 'inline-block'}, ugm_menu_openclose);
  1767. $('.ugm_genfix_close').click({div: '.ugm_genfix_div', state: 'none'}, ugm_menu_openclose);
  1768.  
  1769. /*!
  1770. * BG CSS
  1771. */
  1772.  
  1773. waitForKeyElements ('#bg_userbar',ugm_bgcompatibility);
  1774.  
  1775. function ugm_bgcompatibility(){
  1776. addGlobalStyle('.megamenu-section-trigger {background-image: none !important; box-shadow: rgba(0,0,0,0.35) 0 -1px 0 inset, rgba(0,0,0,0.5) 0 1px 0 inset, rgba(255,255,255,0.25) 0 2px 0 inset, rgba(0,0,0,0.25) 0 0 0.25em !important;}');
  1777. addGlobalStyle('.megamenu-menu-color .megamenu-section-trigger {top: -1px !important; box-shadow: rgba(0,0,0,0.35) 0 -1px 0 inset, rgba(0,0,0,0.5) 0 1px 0 inset, rgba(255,255,255,0.25) 0 2px 0 inset, rgba(0,0,0,0.25) 0 0 0.25em !important;}');
  1778. addGlobalStyle('#gaia_menu_bar {background-image: none !important; box-shadow: rgba(0,0,0,0.35) 0 -1px 0 inset, rgba(0,0,0,0.5) 0 1px 0 inset, rgba(255,255,255,0.25) 0 2px 0 inset, rgba(0,0,0,0.25) 0 0 0.25em !important;}');
  1779. addGlobalStyle('.panel-title {background-image: none !important; border-bottom: 10px solid #fff; padding: 15px 0 0 10px !important; height: 28px !important;}');
  1780. addGlobalStyle('.megamenu-standard-menu>a {color: #fff !important;}');
  1781. addGlobalStyle('.megamenu-no-panel>a {color: #fff !important}');
  1782. addGlobalStyle('.panel-title {color: #fff !important; }');
  1783. addGlobalStyle('#color_menu {display: none !important; }');
  1784.  
  1785. addGlobalStyle('.no-js .mega-menu *:hover .megamenu-section-trigger, .no-js .mega-menu .megamenu-section-trigger:hover, .mega-menu .panel-open .megamenu-section-trigger { padding-top: 6px !important; background: transparent !important; height: 32px !important; }');
  1786. addGlobalStyle('.lt_selector, .rt_selector {background: transparent !important;}');
  1787. addGlobalStyle('#main_sub:hover {position:absolute !important;top:32px !important;}');
  1788. addGlobalStyle('#gaiaupgrade_menu:hover #main_sub {position:absolute !important;top:32px !important; }');
  1789. addGlobalStyle('#main_sub_features { box-shadow: none !important; left: 0px !important; width: 446px !important; font: normal 14px "Century Gothic", "TeXGyreAdventorBold", Arial, Tahoma, Verdana, sans-serif !important; }');
  1790.  
  1791. addGlobalStyle('#runway_menu:hover #rhn_favorites { top: 32px !important}');
  1792. addGlobalStyle('#rhn_favorites:hover { top: 32px !important}');
  1793. }
  1794.  
  1795. waitForKeyElements ('.bg_pf',spoilerbgready);
  1796.  
  1797. function spoilerbgready() {
  1798.  
  1799. if ($('.bg_pf').length > 0) {
  1800. addGlobalStyle('#custom_spoiler {cursor: pointer; background:url("http://i.imgur.com/gRtp5MX.png") 0px 0px transparent; display: block; height: 19px; left: 442px !important; position: absolute; top: 6px !important; width: 50px;');
  1801. addGlobalStyle('#custom_ulist {cursor: pointer; background:url("http://i.imgur.com/gRtp5MX.png") -118px 0px transparent; display: block; height: 19px; left: 514px !important; position: absolute; top: 6px !important; width: 26px;');
  1802. addGlobalStyle('#custom_olist {cursor: pointer; background:url("http://i.imgur.com/gRtp5MX.png") -144px 0px transparent; display: block; height: 19px; left: 542px !important; position: absolute; top: 6px !important; width: 26px;');
  1803. addGlobalStyle('#custom_items {cursor: pointer; background:url("http://i.imgur.com/gRtp5MX.png") -170px 0px transparent; display: block; height: 19px; left: 570px !important; position: absolute; top: 6px !important; width: 26px;');
  1804. addGlobalStyle('#custom_indent {cursor: pointer; background:url("http://i.imgur.com/gRtp5MX.png") -196px 0px transparent; display: block; height: 19px; left: 598px !important; position: absolute; top: 6px !important; width: 26px;}');
  1805. addGlobalStyle('#vbb_btn {display: none !important;}');
  1806. addGlobalStyle('#ugm_poststyler_tab_div { background: #fcfcfc; border: 1px solid #ddd; position: relative !important; width: 41.7%; top: -67px !important;}');
  1807. }
  1808. if (document.location.pathname.match(/^\/profile\/privmsg/)) {
  1809. addGlobalStyle('#custom_spoiler {left: 460px !important; top: 6px !important;}');
  1810. addGlobalStyle('#custom_ulist {left: 532px !important; top: 6px !important;}');
  1811. addGlobalStyle('#custom_olist {left: 560px !important; top: 6px !important;}');
  1812. addGlobalStyle('#custom_items {left: 588px !important; top: 6px !important;}');
  1813. addGlobalStyle('#custom_indent {left: 616px !important; top: 6px !important;}');
  1814. addGlobalStyle('#vbb_btn {display: none !important;}');
  1815. addGlobalStyle('#ugm_poststyler_tab_div { background: #fafafa !important; border: 1px solid #ddd !important; position: relative !important; top: -53px !important; width: 49.7% !important;}');
  1816. }
  1817.  
  1818. }
  1819.  
  1820. /*!
  1821. * Sub Checkbox
  1822. */
  1823.  
  1824. var menu_subcb = [ {
  1825. button: "ugm_msoiicb",
  1826. save: "msoii_enabled"
  1827. }, {
  1828. button: "ugm_uoicb",
  1829. save: "uoi_enabled"
  1830. }, {
  1831. button: "ugm_osicb",
  1832. save: "osi_enabled"
  1833. }, {
  1834. button: "ugm_wishowncb",
  1835. save: "wishown_enabled"
  1836. }, {
  1837. button: "ugm_ovscb",
  1838. save: "ovs_enabled"
  1839. }, {
  1840. button: "ugm_ogfcb",
  1841. save: "ogf_enabled"
  1842. }, {
  1843. button: "ugm_owoicb",
  1844. save: "owoi_enabled"
  1845. }, {
  1846. button: "wled_search",
  1847. save: "wledsearch_enabled"
  1848. }, {
  1849. button: "wled_userstore",
  1850. save: "wleduserstore_enabled"
  1851. }, {
  1852. button: "wled_imd",
  1853. save: "wledimd_enabled"
  1854. }, {
  1855. button: "wled_vs",
  1856. save: "wledvs_enabled"
  1857. }, {
  1858. button: "wled_gf",
  1859. save: "wledgf_enabled"
  1860. }, {
  1861. button: "ugm_invobbcodecb",
  1862. save: "invobbcode_enabled"
  1863. }, {
  1864. button: "ugm_wishbbcodecb",
  1865. save: "wishbbcode_enabled"
  1866. }, {
  1867. button: "ugm_itembbcodecb",
  1868. save: "itembbcode_enabled"
  1869. }, {
  1870. button: "ugm_equipbbcb",
  1871. save: "equipbb_enabled"
  1872. }, {
  1873. button: "ugm_mystorebbcb",
  1874. save: "mystorebb_enabled"
  1875. }, {
  1876. button: "ugm_flashavatarscb",
  1877. save: "flashavatars_enabled"
  1878. }, {
  1879. button: "ugm_bettermarriagecb",
  1880. save: "bettermarriage_enabled"
  1881. }, {
  1882. button: "ugm_commascb",
  1883. save: "commas_enabled"
  1884. }, {
  1885. button: "ugm_anf",
  1886. save: "anf_enabled"
  1887. }, {
  1888. button: "ugm_marketquantityfixcb",
  1889. save: "marketquantityfix_enabled"
  1890. }, {
  1891. button: "ugm_vmffcb",
  1892. save: "vmff_enabled"
  1893. }, {
  1894. button: "ugm_commentlinkscb",
  1895. save: "commentlinks_enabled"
  1896. }, {
  1897. button: "ugm_fsdccb",
  1898. save: "fsdc_enabled"
  1899. }, {
  1900. button: "ugm_pnicb",
  1901. save: "pni_enabled"
  1902. }, {
  1903. button: "ugm_rvccb",
  1904. save: "rvc_enabled"
  1905. }, {
  1906. button: "ugm_hlkp",
  1907. save: "hlkp_enabled"
  1908. }, {
  1909. button: "ugm_tsdm",
  1910. save: "tsdm_enabled"
  1911. } ]
  1912.  
  1913. for ( var i = 0 ; i < menu_subcb.length ; i++ ) {
  1914. $('#' + menu_subcb[i].button).attr('data-save', menu_subcb[i].save);
  1915. $('#' + menu_subcb[i].button).change(function(){GM_setValue($(this).attr('data-save'), this.checked);});
  1916. $('#' + menu_subcb[i].button).prop('checked', GM_getValue(menu_subcb[i].save));
  1917. }
  1918.  
  1919.  
  1920. /*!
  1921. * Condition Gaia Ready
  1922. */
  1923.  
  1924. /* Autocomma */ if ( GM_getValue('autocomma_enabled') ) { ugm_autocomma(); }
  1925. /* Easy Undercut */ if ( GM_getValue('undercutter_enabled') && document.location.pathname.match(/^\/marketplace\/mystore\/showinventory\//) ) { ugm_undercutter(); }
  1926. /* More BBCodes */ if ( GM_getValue('morebbcodes_enabled') && ( document.location.pathname.match(/^\/forum\/compose\/entry\//) || document.location.pathname.match(/^\/forum\/compose\/topic\//) || document.location.pathname.match(/^\/profile\/privmsg/) ) ) { ugm_morebbcodes(); }
  1927. /* New Arena Layout */ if ( GM_getValue('betteraviarena_enabled') && ( document.location.pathname.match(/^\/arena\/gaia\/original-avatar\/popular/) || document.location.pathname.match(/^\/arena\/gaia\/cosplay-avatar\/popular/) || document.location.pathname.match(/^\/arena\/recent\/t%3Agaia\/c%3Aavatar\/n%3Aoriginal-avatar/) || document.location.pathname.match(/^\/arena\/recent\/t%3Agaia\/c%3Aavatar\/n%3Acosplay-avatar/) || document.location.pathname.match(/^\/arena\/recent\/n%3Aoriginal-avatar\/t%3Agaia\/c%3Aavatar/) || document.location.pathname.match(/^\/arena\/recent\/n%3Acosplay-avatar\/t%3Agaia\/c%3Aavatar/) || document.location.pathname.match(/^\/arena\/avatar\/all\/p/) || document.location.pathname.match(/^\/arena\/recent\/\/t%3Agaia\/c%3Aavatar/) ) ) { ugm_betteraviarena(); }
  1928. /* New Emoticons */ if ( GM_getValue('newemoticons_enabled') && ( document.location.pathname.match(/^\/forum\/compose\/entry\//) || document.location.pathname.match(/^\/forum\/compose\/topic\//) || document.location.pathname.match(/^\/profile\/privmsg/) || document.location.pathname.match(/^\/account\/signature/) || window.location.href.indexOf("mode=addcomment") > -1 || document.location.pathname.match(/^\/guilds\/posting/) ) ) { ugm_emoticons(); }
  1929. /* Wishlist Sorter */ if ( GM_getValue('wishsorter_enabled') && document.location.pathname.match(/^\/account\/wishlist/) ) { ugm_wishsorter(); }
  1930. /* Post Format */ if ( GM_getValue('poststyler_enabled') && ( document.location.pathname.match(/^\/forum\/compose\/entry\//) || document.location.pathname.match(/^\/forum\/compose\/topic\//) || document.location.pathname.match(/^\/profile\/privmsg/) || window.location.href.indexOf("mode=addcomment") > -1 || document.location.pathname.match(/^\/guilds\/posting/) )) { ugm_poststyler(); }
  1931. /* Post Action Saver */ if ( GM_getValue('postacter_enabled') && document.location.pathname.match(/^\/forum\/compose\/entry\/new\//) ) { ugm_postacter(); }
  1932. /* Announce Remover */ if ( document.location.pathname.match(/^\/news/) ) {} else { if ( GM_getValue('annrem_enabled') ) { ugm_annrem(); } }
  1933. /* Item Marker Editor*/ if ( GM_getValue('itemmarker_enabled') && document.location.pathname.match(/^\/marketplace\/mystore\/showinventory\//) ) { ugm_itemmarker(); }
  1934. /* Item Marker */ if ( GM_getValue('itemmarker_enabled') && ( document.location.pathname.match(/^\/gaia\/bank/) || document.location.pathname.match(/^\/inventory/) ) ) { ugm_itemmarker2(); }
  1935. /* Topic Filter */ if ( GM_getValue('hidebigtopics_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/f.\d+/) || document.location.pathname.match(/^\/forum\/list\/\d+/)) ) { ugm_hidebigtopics(); }
  1936. /* Centered Forums */ if ( GM_getValue('centeredforums_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/f.\d+/) || document.location.pathname.match(/^\/forum\/compose\/entry\//) || document.location.pathname.match(/^\/forum\/compose\/topic\//) || document.location.pathname.match(/^\/forum\/.*\/t.\d+/) || document.location.pathname.match(/^\/forum\/list\/\d+/) )) { ugm_centeredforums2(); }
  1937. /* Achievement Org */ if ( GM_getValue('alphatitle_enabled') && document.location.pathname.match(/^\/achievements\//) ) { ugm_alphatitle(); }
  1938. /* Dumpster Dive */ if ( GM_getValue('dumpster_enabled') ) { ugm_dumpster(); }
  1939. /* Disable Topic Vote */ if ( GM_getValue('disablevoting_enabled') && ( document.location.pathname.match(/^\/forum\/compose\/topic\//))) { ugm_disablevoting(); }
  1940. /* Storage Upgrade */ if ( GM_getValue('invoupgrade_enabled') && document.location.pathname.match(/^\/inventory/) ) { ugm_storageupgrade(); }
  1941. /* Wishlist Notifier */ if ( GM_getValue('listingalert_enabled') ) { listingalert(); }
  1942. /* Owned Listing Qty */ if ( GM_getValue('olq_enabled') && document.location.pathname.match(/^\/marketplace\/itemdetail\//) ) { ugm_olq(); }
  1943. /* Item Direct Link */ if ( GM_getValue('idml_enabled') && document.location.pathname.match(/^\/inventory/) ) { ugm_idml(); }
  1944. /* PM Cooldown */ if ( GM_getValue('pmcd_enabled') && ( document.location.pathname.match(/^\/profile\/privmsg/) ) ) { ugm_pmcd(); }
  1945. /* Daily Chance */ if ( GM_getValue('dailychance_enabled') ) { ugm_dailychance(); }
  1946. /* Custom Ava Preview */ if ( GM_getValue('avatarpreviews_enabled') && ( document.location.pathname.match(/^\/avatar/) && !document.location.pathname.match(/^\/avatar\/showoff/) ) ) { ugm_avatarpreviews(); }
  1947. /* More User Menu */ if ( GM_getValue('udmu_enabled') && document.location.pathname.match(/^\/marketplace\/userstore\//) ) { ugm_udmu3(); }
  1948. /* Notice Viewer */ if ( GM_getValue('inotice_enabled') ) { ugm_inotice(); }
  1949. /* Wishlist Arranger */ if ( GM_getValue('wisharr_enabled') && document.location.pathname.match(/^\/account\/wishlist/) ) { ugm_wisharr2(); }
  1950. /* Favorite Links */ if ( GM_getValue('rhn_enabled') ) { ugm_rhn2(); }
  1951. /* Centered Guild */ if ( GM_getValue('cgf_enabled') && document.location.pathname.match(/^\/guilds\/viewtopic/)) { ugm_cgf2(); }
  1952. /* Avatar Value */ if ( GM_getValue('avival_enabled') && ( document.location.pathname.match(/^\/avatar/) ) ) { ugm_avival(); }
  1953. /* Announce Viewer */ if ( document.location.pathname.match(/^\/news\//) || GM_getValue('annrem_enabled') ) {} else { if ( GM_getValue('annview_enabled') ) { ugm_annview(); } }
  1954. /* Detailed Sell Page */ if ( GM_getValue('sioq_enabled') && document.location.pathname.match(/^\/marketplace\/mystore\/showinventory\//) ) { ugm_sioq(); }
  1955. /* Online Members */ if ( GM_getValue('ontime_enabled') ) { ugm_ontime(); }
  1956. /* Easy Gifter Reply */ if ( GM_getValue('pmgifter_enabled') && ( window.location.href.indexOf('profile\/privmsg\.php\?folder=inbox&mode=read') > -1 ) ) { ugm_pmgifter(); }
  1957. /* PM Viewer */ if ( GM_getValue('pmviewer_enabled') ) { ugm_pmviewer(); }
  1958. /* Quick PM Reply */ if ( GM_getValue('pmqr_enabled') && ( window.location.href.indexOf('profile\/privmsg\.php\?folder=inbox&mode=read') > -1 ) ) { ugm_pmqr(); }
  1959. /* Clickable Trades */ if ( GM_getValue('cti_enabled') && (document.location.pathname.match(/^\/gaia\/bank/) ) ) { ugm_cti(); }
  1960. /* Inventory Arranger */ if ( GM_getValue('ipar_enabled') && document.location.pathname.match(/^\/inventory/) ) { ugm_ipar(); }
  1961. /* Easy Bid */ if ( GM_getValue('easybid_enabled') && document.location.pathname.match(/^\/marketplace\/userstore\/\d+\/bid\//) && (document.location.href.indexOf('confirm') === -1) ) { ugm_easybid(); }
  1962. /* Easy Item Report */ if ( GM_getValue('mistag_enabled') && document.location.pathname.match(/^\/marketplace\/itemdetail\//) ) { ugm_mistag(); }
  1963. /* User Tag 2 */ if ( GM_getValue('usertag_enabled') && document.location.pathname.match(/^\/gsearch\/.*/) ) { ugm_usertag2(); }
  1964. /* Friends List Upgrade */ if ( GM_getValue('flu_enabled') && document.location.pathname.match(/^\/mygaia/) ) { ugm_flu(); }
  1965. /* Friends List Upgrade 2*/ if ( GM_getValue('flu_enabled') && document.location.pathname.match(/^\/friends/) ) { ugm_flu2(); }
  1966. /* Game Item Qty Sorter */ if ( GM_getValue('giqs_enabled') && document.location.pathname.match(/^\/marketplace\/itemdetail\//) ) { ugm_giqs(); }
  1967. /* Detailed Outfit Buy */ if ( GM_getValue('dobp_enabled') && document.location.pathname.match(/^\/marketplace\/outfits\//) ) { ugm_dobp(); }
  1968. /* Wishlist Delete All */ if ( GM_getValue('wda_enabled') && document.location.pathname.match(/^\/account\/wishlist/) ) { ugm_wda(); }
  1969. /* Avatar Builder Upgrade */ if ( GM_getValue('nab_enabled') && document.location.pathname.match(/^\/avibuilder/) ) { ugm_nab2(); }
  1970. /* GaiaUpgrade Report */ if ( document.location.pathname.match(/^\/forum\/compose\/entry\/new\/96435915/) ) { ugm_gurep(); }
  1971.  
  1972. /*!
  1973. * Owned Items
  1974. */
  1975.  
  1976. /* Search */ if ( GM_getValue('owned_enabled') && GM_getValue('msoii_enabled') && document.location.pathname.match(/^\/marketplace\/itemsearch\//) ) { ugm_msoii(); }
  1977. /* Userstore */ if ( GM_getValue('owned_enabled') && GM_getValue('uoi_enabled') && document.location.pathname.match(/^\/marketplace\/userstore\//) ) { ugm_uoi(); }
  1978. /* Gold GC Shop */ if ( GM_getValue('owned_enabled') && GM_getValue('osi_enabled') && document.location.pathname.match(/^\/gaia\/shopping.php/)) { ugm_osi(); }
  1979. /* Wishlist */ if ( GM_getValue('owned_enabled') && GM_getValue('wishown_enabled') && document.location.pathname.match(/^\/account\/wishlist/) ) { ugm_wishown(); }
  1980. /* Vendsearch */ if ( GM_getValue('owned_enabled') && GM_getValue('ovs_enabled') && document.location.pathname.match(/^\/marketplace\/vendsearch/) ) { ugm_ovs(); }
  1981. /* GoFusion */ if ( GM_getValue('owned_enabled') && GM_getValue('ogf_enabled') && document.location.pathname.match(/^\/gofusion/) ) { ugm_ogf(); }
  1982.  
  1983. /*!
  1984. * Wishlisted Items
  1985. */
  1986.  
  1987. /* Search */ if ( GM_getValue('wishlisted_enabled') && GM_getValue('wledsearch_enabled') && document.location.pathname.match(/^\/marketplace\/itemsearch\//) ) { ugm_wled(); }
  1988. /* Userstore */ if ( GM_getValue('wishlisted_enabled') && GM_getValue('wleduserstore_enabled') && document.location.pathname.match(/^\/marketplace\/userstore\//) ) { ugm_wled(); }
  1989. /* Item Market */ if ( GM_getValue('wishlisted_enabled') && GM_getValue('wledimd_enabled') && document.location.pathname.match(/^\/marketplace\/itemdetail\//) ) { ugm_wled(); }
  1990. /* Vendsearch */ if ( GM_getValue('wishlisted_enabled') && GM_getValue('wledvs_enabled') && document.location.pathname.match(/^\/marketplace\/vendsearch\//) ) { ugm_wled(); }
  1991. /* GoFusion */ if ( GM_getValue('wishlisted_enabled') && GM_getValue('wledgf_enabled') && document.location.pathname.match(/^\/gofusion/) ) { ugm_wled(); }
  1992.  
  1993. /*!
  1994. * BBCode Generator
  1995. */
  1996.  
  1997. /* Inventory */ if ( GM_getValue('bbcodegen_enabled') && GM_getValue('invobbcode_enabled') && document.location.pathname.match(/^\/inventory/) ) { ugm_invobbcode(); }
  1998. /* Wishlist MP BBCode */ if ( GM_getValue('bbcodegen_enabled') && GM_getValue('wishbbcode_enabled') && (document.location.pathname == "/marketplace/") ) { ugm_wishbbcode(); }
  1999. /* Wishlist BBCode */ if ( GM_getValue('bbcodegen_enabled') && GM_getValue('wishbbcode_enabled') && document.location.pathname.match(/^\/account\/wishlist/) ) { ugm_wishbbcode_b(); }
  2000. /* Market Listing */ if ( GM_getValue('bbcodegen_enabled') && GM_getValue('itembbcode_enabled') && document.location.pathname.match(/^\/marketplace\/itemdetail\//) ) { ugm_itembbcode(); }
  2001. /* Avatar Dress Up */ if ( GM_getValue('bbcodegen_enabled') && GM_getValue('equipbb_enabled') && document.location.pathname.match(/^\/avatar/) ) { ugm_equipbb(); }
  2002. /* My Store */ if ( GM_getValue('bbcodegen_enabled') && GM_getValue('mystorebb_enabled') && document.location.pathname.match(/^\/marketplace\/mystore/) ) { ugm_mystorebb(); }
  2003.  
  2004. /*!
  2005. * General Fixes
  2006. */
  2007.  
  2008. /* Comma Fix */ if ( GM_getValue('genfix_enabled') && GM_getValue('commas_enabled') ) { ugm_commas(); }
  2009. /* View Comments Link */ if ( GM_getValue('genfix_enabled') && GM_getValue('commentlinks_enabled') && (window.location.href.indexOf("mode=addcomment") > -1)) { ugm_vcl(); }
  2010. /* Page Numbers - Forums */ if ( GM_getValue('genfix_enabled') && GM_getValue('pni_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/f.\d+/) || document.location.pathname.match(/^\/forum\/list\/\d+/))) { ugm_pni_forums(); }
  2011. /* Page Numbers - Search */ if ( GM_getValue('genfix_enabled') && GM_getValue('pni_enabled') && document.location.pathname.match(/^\/gsearch\/.*/) ) { ugm_pni_search(); }
  2012. /* Page Numbers - MPosts */ if ( GM_getValue('genfix_enabled') && GM_getValue('pni_enabled') && ( document.location.pathname.match(/^\/forum\/search\/posts\.user\/.*/) || document.location.pathname.match(/^\/forum\/myposts.*/) )) { ugm_pni_myposts(); }
  2013. /* Page Numbers - MTopic */ if ( GM_getValue('genfix_enabled') && GM_getValue('pni_enabled') && ( document.location.pathname.match(/^\/forum\/search\/topics\.user\/.*/) || document.location.pathname.match(/^\/forum\/mytopics.*/) )) { ugm_pni_mytopics(); }
  2014. /* Trash Sell Donate Max */ if ( GM_getValue('genfix_enabled') && GM_getValue('tsdm_enabled') && document.location.pathname.match(/^\/inventory/) ) { ugm_tsdm(); }
  2015.  
  2016. /*!
  2017. * Condition Topic Ready
  2018. */
  2019.  
  2020. waitForKeyElements ('#post_container',ugm_threadbasedmods);
  2021.  
  2022. function ugm_threadbasedmods(){
  2023.  
  2024. /* Instant Quote & Reply */ if ( document.location.pathname.match(/^\/forum\/compose\//) ) {} else { if ( GM_getValue('qrqq_enabled') && document.location.pathname.match(/^\/forum\//) ) { ugm_qrqq(); } }
  2025. /* New Emoticons */ if ( GM_getValue('newemoticons_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/t.\d+/) || document.location.pathname.match(/^\/guilds\/viewtopic/) ) ) { ugm_emoticons_qr(); }
  2026. /* Post Format */ if ( GM_getValue('poststyler_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/t.\d+/) || document.location.pathname.match(/^\/guilds\/viewtopic/) ) ) { ugm_poststyler_qr(); }
  2027. /* QRQQ + Emoticons */ if ( GM_getValue('qrqq_enabled') && GM_getValue('newemoticons_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/t.\d+/) || document.location.pathname.match(/^\/guilds\/viewtopic/) ) ) { ugm_emoticons_qr2(); }
  2028. /* Multiquote */ if ( GM_getValue('multiquote_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/) ) { ugm_multiquote(); }
  2029. /* Guild Layout - Topics*/ if ( GM_getValue('gfu_enabled') && document.location.pathname.match(/^\/guilds\/viewtopic/) ) { ugm_gfut(); }
  2030. /* Guild Quick Reply */ if ( GM_getValue('gqr_enabled') && document.location.pathname.match(/^\/guilds\/viewtopic/) ) { ugm_gqr(); }
  2031. /* Tip Cooldown */ if ( GM_getValue('tipcd_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/t.\d+/) ) ) { ugm_tipcd(); }
  2032. /* More User Menu Option */ if ( GM_getValue('udmu_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/) ) { ugm_udmu2(); }
  2033. /* Owned - Others Wish */ if ( GM_getValue('owned_enabled') && GM_getValue('owoi_enabled') && ( document.location.pathname.match(/^\/forum\/.*\/t.\d+/) ) ) { ugm_owoi(); }
  2034. /* User Tag */ if ( GM_getValue('usertag_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/) ) { ugm_usertag(); }
  2035. /* Instant Edit */ if ( document.location.pathname.match(/^\/forum\/compose\//) ) {} else { if ( GM_getValue('iedit_enabled') && document.location.pathname.match(/^\/forum\//) ) { ugm_iedit(); } }
  2036. /* Forum Lite Upgrade */ if ( GM_getValue('forumlite_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/)) { ugm_forumlite(); }
  2037. /* Disable Avatar Fave */ if ( GM_getValue('daf_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/)) { ugm_daf(); }
  2038. /* Quick Reply Resize */ if ( document.location.pathname.match(/^\/forum\/.*\/t.\d+/) || document.location.pathname.match(/^\/guilds\/viewtopic/) ) {
  2039. if ( GM_getValue('qrqq_enabled') || GM_getValue('newemoticons_enabled') || GM_getValue('poststyler_enabled') ) {
  2040. $('#qr_container').css({ 'width': '560px', 'background': '#eee none repeat scroll 0 0', 'border': '1px solid #7e7e7e', 'border-radius': '5px'});
  2041. $('#qr_text').css({ 'width': '528px'});
  2042. }
  2043. }
  2044. /* General Fixes */
  2045. /* Animated Fix */ if ( GM_getValue('genfix_enabled') && GM_getValue('flashavatars_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/)) { ugm_flashavatars(); }
  2046. /* Real Vote Count */ if ( GM_getValue('genfix_enabled') && GM_getValue('rvc_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/)) { ugm_rvc(); }
  2047. /* Hide LK Pets */ if ( GM_getValue('genfix_enabled') && GM_getValue('hlkp_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/)) { ugm_hlkp(); }
  2048.  
  2049.  
  2050. }
  2051. });
  2052.  
  2053. /*!
  2054. * Condition Preload
  2055. */
  2056.  
  2057. /* Centered Forums */ if ( GM_getValue('centeredforums_enabled') && ( document.location.pathname.match(/^\/forum\/f.\d+/) || document.location.pathname.match(/^\/forum\/.*\/f.\d+/) || document.location.pathname.match(/^\/forum\/compose\/entry\//) || document.location.pathname.match(/^\/forum\/compose\/topic\//) || document.location.pathname.match(/^\/forum\/.*\/t.\d+/) || document.location.pathname.match(/^\/forum\/list\/\d+/) )) { ugm_centeredforums(); }
  2058. /* Guild Layout */ if ( GM_getValue('gfu_enabled') && document.location.pathname.match(/^\/guilds\/viewforum/) ) { ugm_gfu(); }
  2059. /* More User Menu Option */ if ( GM_getValue('udmu_enabled') && (document.location.pathname.match(/^\/forum\/.*\/t.\d+/) || document.location.pathname.match(/^\/marketplace\/userstore\//)) ) { ugm_udmu(); }
  2060. /* Wishlist Arranger */ if ( GM_getValue('wisharr_enabled') && document.location.pathname.match(/^\/account\/wishlist/) ) { ugm_wisharr(); }
  2061. /* Favorite Links */ if ( GM_getValue('rhn_enabled') ) { ugm_rhn(); }
  2062. /* Custom Header BG */ if ( GM_getValue('chb_enabled') ) { ugm_chb(); }
  2063. /* Guild Centered */ if ( GM_getValue('cgf_enabled') && ( document.location.pathname.match(/^\/guilds\/viewforum/) || document.location.pathname.match(/^\/guilds\/viewtopic/))) { ugm_centeredforums(); ugm_cgf(); }
  2064. /* Forum Lite Upgrade */ if ( GM_getValue('forumlite_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/)) { ugm_forumlite(); }
  2065. /* Detailed Outfit Buy */ if ( GM_getValue('dobp_enabled') && document.location.pathname.match(/^\/marketplace\/outfits\//) ) { ugm_dobp_css(); }
  2066. /* Avatar Builder Upgrade */ if ( GM_getValue('nab_enabled') && document.location.pathname.match(/^\/avibuilder/) ) { ugm_nab(); }
  2067.  
  2068. /* General Fixes */
  2069. /* Marriage Font Fix */ if ( GM_getValue('genfix_enabled') && GM_getValue('bettermarriage_enabled') && document.location.pathname.match(/^\/forum\/.*\/t.\d+/)) { ugm_bettermarriage(); }
  2070. /* View My Findings Fix */ if ( GM_getValue('genfix_enabled') && GM_getValue('vmff_enabled') && ( document.location.pathname.match(/^\/avatar/) ) ) { ugm_vmff(); }
  2071. /* Market Quantity Fix */ if ( GM_getValue('genfix_enabled') && GM_getValue('marketquantityfix_enabled') && document.location.pathname.match(/^\/marketplace\/itemdetail\//) ) { ugm_marketquantityfix(); }
  2072. /* Async Notif Fix */ if ( GM_getValue('genfix_enabled') && GM_getValue('anf_enabled') ) { ugm_anf(); }
  2073. /* Forum Search Cleanup */ if ( GM_getValue('genfix_enabled') && GM_getValue('fsdc_enabled') && document.location.pathname.match(/^\/gsearch/) ) { ugm_fsdc(); }
  2074.  
  2075. /*!
  2076. * Main Functions
  2077. */
  2078.  
  2079. /*!
  2080. * Auto Comma
  2081. */
  2082.  
  2083. function ugm_autocomma() {
  2084.  
  2085. // Logic
  2086.  
  2087. function add_commas(number){
  2088. number = number.replace(/,/g, "");
  2089. number = '' + number;
  2090. if (number.length > 3) {
  2091. var mod = number.length % 3;
  2092. var output = (mod > 0 ? (number.substring(0,mod)) : '');
  2093. for (i=0 ; i < Math.floor(number.length / 3); i++) {
  2094. if ((mod == 0) && (i == 0))
  2095. output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
  2096. else
  2097. output += ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
  2098. }
  2099. return (output);
  2100. }
  2101. else return number;
  2102. }
  2103.  
  2104. // Apply
  2105.  
  2106. document.body.onkeyup=function(e){
  2107. e = e || event;
  2108. var target = e.target || e.srcElement
  2109.  
  2110. // Menu
  2111.  
  2112. if((target.id.indexOf("ugm_wishnotifier_priceval")==0) || (target.id.indexOf("ugm_undercutter_customval")==0)){
  2113. target.value=add_commas(target.value);
  2114. }
  2115.  
  2116. // Trade Bid
  2117.  
  2118. if (( document.location.pathname.match(/^\/marketplace\/mystore\/showinventory\//) || document.location.pathname.match(/^\/gaia\/bank/) || ( window.location.href.indexOf("bid") > -1) )) {
  2119. if( target.id.indexOf("yui")==0 && target.type!="password" && target.name!="bank_subject" && target.className!="modal-qty-input" && target.name!="item_param" && target.className.indexOf("rhn")!=0){
  2120. target.value=add_commas(target.value);
  2121. }
  2122. }
  2123.  
  2124. // Market Min-Max
  2125.  
  2126. if((target.id.indexOf("formMin")==0) || (target.id.indexOf("formMax")==0)){
  2127. target.value=add_commas(target.value);
  2128. }
  2129.  
  2130. // Sell
  2131.  
  2132. if( target.id.indexOf("buy-now-price")==0 ){
  2133. target.value=add_commas(target.value);
  2134. target.removeAttribute('onchange');
  2135. }
  2136.  
  2137. }
  2138.  
  2139. // Empty Zeros
  2140.  
  2141. document.body.onclick=function(e){
  2142. e = e || event;
  2143. var target = e.target || e.srcElement
  2144. if( target.id.indexOf('yui') == 0 && target.value == '0' && target.name != 'optionId' ){ target.value=''; }
  2145. if ( target.id.indexOf('buy-now-price') == 0 && target.value == '0' ) { target.value=''; }
  2146. }
  2147.  
  2148. // Bid Comma Remove
  2149.  
  2150. if ( window.location.href.indexOf("bid") > -1 ) {
  2151. $('.cta-button-sm').click(function() {
  2152. var bid = document.getElementsByClassName('marketplaceInputField')[0];
  2153. var bid2 = $(bid).val().replace(/,/g, '');
  2154. $(bid).val(bid2);
  2155. });
  2156. }
  2157. }
  2158.  
  2159. /*!
  2160. * Instant Quote & Reply
  2161. */
  2162.  
  2163. function ugm_qrqq() {
  2164.  
  2165. // Instant Quote
  2166.  
  2167. var quotebtn = document.getElementsByClassName("cta-button-sm post-quote");
  2168. var compose = document.getElementsByClassName("cta-dropdown-md-arrow quick_reply qa_quickreply")[0].href;
  2169. for ( var i = 0; i < quotebtn.length; i++) { quotebtn[i].setAttribute('style', 'position:relative; left:-17px;'); }
  2170. $('<a href="' + compose + '" style="cursor: pointer; background-position: right -1627px; left: 55px; position: relative; top: 0px;" class="quickquote cta-dropdown-md-arrow quick_reply"></a>').insertAfter(quotebtn);
  2171.  
  2172. // Apply
  2173.  
  2174. $('.quickquote').click(function() {
  2175.  
  2176. // Content
  2177.  
  2178. var ugm_quotemode = GM_getValue('qrqq_mode', 'empty');
  2179. var username = $(this).closest('.post').find('.user_name').html();
  2180. var dwt = this.parentNode.parentNode.parentNode.parentNode.getElementsByClassName('content')[0];
  2181. var sod = this.parentNode.parentNode.parentNode.parentNode.getElementsByClassName('postcontent')[0];
  2182. if ( dwt ) { var unfiltered = dwt.cloneNode(true); }
  2183. else if ( sod ) { var unfiltered = sod.cloneNode(true); }
  2184. var quotetd = unfiltered.getElementsByClassName('quoted');
  2185. var citetd = unfiltered.getElementsByClassName('cite');
  2186. for ( var i = 0 ; i < quotetd.length ; i++ ) {
  2187. quotetd[i].remove();
  2188. citetd[i].remove();
  2189. }
  2190. var plaintext = unfiltered.textContent.replace(/\[quote.+?\[\/quote]/g,'').trim();
  2191.  
  2192. // Modes
  2193.  
  2194. switch (ugm_quotemode) {
  2195.  
  2196. // Empty
  2197.  
  2198. case "empty":
  2199. var quotemessage = '[quote="' + username + '"][/quote]';
  2200. setTimeout(function(){document.getElementById("qr_text").value = quotemessage ;}, 100);
  2201. break;
  2202.  
  2203. // Plain
  2204.  
  2205. case "nobbc":
  2206. var quotemessage = '[quote="' + username + '"]' + plaintext + '[/quote]';
  2207. setTimeout(function(){document.getElementById("qr_text").value = quotemessage ;}, 100);
  2208. break;
  2209.  
  2210. // Full
  2211.  
  2212. case "full":
  2213. var quotelink = $(this).prev().attr('href');
  2214. setTimeout(function(){
  2215. document.getElementById("qr_text").value = 'Loading...' ;
  2216. document.getElementById("qr_text").disabled = true;
  2217. }, 100);
  2218.  
  2219. GM_xmlhttpRequest({
  2220. method: "GET",
  2221. url: "http://www.gaiaonline.com" + quotelink,
  2222. onload: function(response) {
  2223. var parser=new DOMParser();
  2224. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  2225. var quotemessage = innerDoc.getElementById('message').value;
  2226. document.getElementById("qr_text").value = quotemessage;
  2227. document.getElementById("qr_text").disabled = false;
  2228. }
  2229. });
  2230. break;
  2231.  
  2232. // Spoilered
  2233.  
  2234. case "spoilered":
  2235. var quotelink = $(this).prev().attr('href');
  2236. setTimeout(function(){
  2237. document.getElementById("qr_text").value = 'Loading...' ;
  2238. document.getElementById("qr_text").disabled = true;
  2239. }, 100);
  2240.  
  2241. GM_xmlhttpRequest({
  2242. method: "GET",
  2243. url: "http://www.gaiaonline.com" + quotelink,
  2244. onload: function(response) {
  2245. var parser=new DOMParser();
  2246. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  2247. var quotemessage = innerDoc.getElementById('message').value.replace(/(\[quote(|.+?)"\])/, '$1[spoiler]').slice(0,-8) + '[/spoiler][/quote]';
  2248. document.getElementById("qr_text").value = quotemessage;
  2249. document.getElementById("qr_text").disabled = false;
  2250. }
  2251. });
  2252. break;
  2253. }
  2254. });
  2255.  
  2256. // Hover
  2257.  
  2258. $('.quickquote').hover(function(){
  2259. $(this).css('background-position', 'right -1656px');
  2260. },function(){
  2261. $(this).css('background-position', 'right -1627px');
  2262. });
  2263.  
  2264. // BBCode Buttons
  2265.  
  2266. $('<div id="qr_bbdiv">'+
  2267. '<a id="qrbold" class="qr_bbcodes"></a>' +
  2268. '<a id="qritalic" class="qr_bbcodes"></a>' +
  2269. '<a id="qrunderline" class="qr_bbcodes"></a>' +
  2270. '<a id="qrstrike" class="qr_bbcodes"></a>' +
  2271. '<a id="qrcenter" class="qr_bbcodes"></a>' +
  2272. '<a id="qrimg" class="qr_bbcodes"></a>' +
  2273. '<a id="qrspoiler" class="qr_bbcodes"></a>'+
  2274. '<a id="qrvideo" class="qr_bbcodes"></a>'+
  2275. '<a id="qrurl" class="qr_bbcodes"></a>'+
  2276. '</div>').appendTo('#qr_container');
  2277.  
  2278. // BBCode Functions
  2279.  
  2280. $('#qrbold').click(function() { wrapText('qr_text', '[b]', '[/b]'); });
  2281. $('#qritalic').click(function() { wrapText('qr_text', '[i]', '[/i]'); });
  2282. $('#qrunderline').click(function() { wrapText('qr_text', '[u]', '[/u]'); });
  2283. $('#qrstrike').click(function() { wrapText('qr_text', '[strike]', '[/strike]'); });
  2284. $('#qrcenter').click(function() { wrapText('qr_text', '[center]', '[/center]'); });
  2285. $('#qrimg').click(function() { wrapText('qr_text', '[img]', '[/img]'); });
  2286. $('#qrspoiler').click(function() { wrapText('qr_text', '[spoiler]', '[/spoiler]'); });
  2287. $('#qrvideo').click(function() { wrapText('qr_text', '[video]', '[/video]'); });
  2288. $('#qrurl').click(function() { wrapText('qr_text', '[url=]', '[/url]'); });
  2289. }
  2290.  
  2291. /*!
  2292. * Easy Undercut
  2293. */
  2294.  
  2295. function ugm_undercutter() {
  2296.  
  2297. waitForKeyElements (".duration",undercut);
  2298. function undercut(){
  2299.  
  2300. document.getElementById('buy-now-price').removeAttribute('onchange');
  2301. $('<a id="undercut">Undercut</a>').insertAfter('.buy-now input');
  2302.  
  2303. $('#undercut').click(function() {
  2304.  
  2305. var ugm_undercutter_res = GM_getValue('ugm_undercutter_choice', 'Exact');
  2306.  
  2307. if ( $('.item-value #sioq_txt #truelbp').length > 0 ) {
  2308. var un_lowest = $('.item-value #sioq_txt #truelbp').html().replace('g','').replace(/\,/g, '');
  2309. } else {
  2310. var un_lowest = $('.item-value th:contains("Lowest")').next().html().replace('g','').replace(/\,/g, '');
  2311. }
  2312.  
  2313. if ( ugm_undercutter_res == 'Exact' ) {
  2314. var un_num = Math.floor(parseFloat(un_lowest.replace(/\,/g, ''), 10) - parseFloat(GM_getValue('undercut_customval', '1').replace(/\,/g, '')));
  2315. if ( un_num < 1 ) {
  2316. un_num = 1;
  2317. }
  2318. } else if ( ugm_undercutter_res == 'Percent' ) {
  2319. var un_num = Math.floor(parseInt(un_lowest.replace(/\,/g, ''), 10) * parseFloat(GM_getValue('undercut_percentval', '1')/100));
  2320. }
  2321.  
  2322. if ( un_num == "0" ) {
  2323. $('.buy-now input').val('1');
  2324. } else {
  2325. $('.buy-now input').val(addCommas(un_num));
  2326. }
  2327.  
  2328. $('select[name=days]').val(GM_getValue('undercut_durdays'));
  2329. $('select[name=hours]').val(GM_getValue('undercut_durhrs'));
  2330. $('select[name=minutes]').val(GM_getValue('undercut_durmins'));
  2331. $('[name="gcash_enable"]').prop('checked', GM_getValue('undercut_gcp_enabled'));
  2332.  
  2333. if ( $('.aftertax').length > 0 ) {
  2334. var aftertax = parseFloat($('.buy-now input').val().replace(/,/g,'')) * .95;
  2335. $('.aftertax').html(addCommas(Math.round(aftertax)) + 'g');
  2336. }
  2337. });
  2338. }
  2339. }
  2340.  
  2341. /*!
  2342. * More BBCodes
  2343. */
  2344.  
  2345. function ugm_morebbcodes() {
  2346.  
  2347. waitForKeyElements ('#format-video',spoilerready);
  2348.  
  2349. function spoilerready() {
  2350. $('<a id="custom_spoiler"></a>'+
  2351. '<a id="custom_ulist"></a>'+
  2352. '<a id="custom_olist"></a>'+
  2353. '<a id="custom_items"></a>'+
  2354. '<a id="custom_indent"></a>').appendTo('.format-extra.last');
  2355.  
  2356. $('#custom_spoiler').click(function() {wrapText("message", "[spoiler]", "[/spoiler]");});
  2357. $('#custom_ulist').click(function() {wrapText("message", "[list]", "[/list]");});
  2358. $('#custom_olist').click(function() {wrapText("message", "[list=1]", "[/list]");});
  2359. $('#custom_items').click(function() {wrapText("message", "[*]", "");});
  2360. $('#custom_indent').click(function() {wrapText("message", ":tab:", "");});
  2361. }
  2362.  
  2363. if (document.location.pathname.match(/^\/profile\/privmsg/)) {
  2364. addGlobalStyle('#custom_spoiler {left: 317px; top: 37px;}');
  2365. addGlobalStyle('#custom_ulist {left: 389px; top: 37px;}');
  2366. addGlobalStyle('#custom_olist {left: 417px; top: 37px;}');
  2367. addGlobalStyle('#custom_items {left: 445px; top: 37px;}');
  2368. addGlobalStyle('#custom_indent {left: 473px; top: 37px;}');
  2369. }
  2370. else {
  2371. addGlobalStyle('#custom_spoiler {left: 369px; top: 35px;}');
  2372. addGlobalStyle('#custom_ulist {left: 441px; top: 35px;}');
  2373. addGlobalStyle('#custom_olist {left: 469px; top: 35px;}');
  2374. addGlobalStyle('#custom_items {left: 497px; top: 35px;}');
  2375. addGlobalStyle('#custom_indent {left: 525px; top: 35px;}');
  2376. }
  2377.  
  2378. addGlobalStyle('#format-video {background: url("http://i.imgur.com/130VQFt.png") no-repeat -50px 0 !important; width: 50px !important;}');
  2379. addGlobalStyle('#vbb_btn {background: transparent; position: absolute; top: 35px; left: 317px; height: 19px; width: 50px; cursor: pointer}');
  2380. addGlobalStyle('#vbb_btn:hover {background: url("http://i.imgur.com/130VQFt.png") no-repeat -50px -19px !important;}');
  2381.  
  2382. function wrapText2(elementID, openTag, closeTag) {
  2383. var textArea = $('#' + elementID);
  2384. var len = textArea.val().length;
  2385. var start = textArea[0].selectionStart;
  2386. var end = textArea[0].selectionEnd;
  2387. var selectedText = textArea.val().substring(start, end);
  2388. var vidurl = prompt("Enter your video url", selectedText);
  2389.  
  2390. if ( vidurl != null ) {
  2391. var replacement = openTag + vidurl + closeTag;
  2392. textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
  2393. }
  2394. }
  2395.  
  2396. waitForKeyElements('#format-media', apply_vbb);
  2397.  
  2398. function apply_vbb() {
  2399. $('<span id="vbb_btn"></span>').insertAfter('#format-video');
  2400. $('#vbb_btn').click(function(){
  2401. wrapText2("message", "[video]", "[/video]");
  2402. });
  2403. }
  2404. }
  2405.  
  2406. /*!
  2407. * Item BBCode
  2408. */
  2409.  
  2410. function ugm_itembbcode() {
  2411.  
  2412. $('#gaia_content #preview_button').css({"width": "89px"});
  2413. $('#preview_button span:nth-child(2),#graph_button span:nth-child(2)').css({"width": "74px", "text-align": "center"});
  2414. $('<a id="itembb"><span id="itembbspan">Get BBCode</span></a>').appendTo('#item_thumb');
  2415.  
  2416. var thumb = document.getElementById('item_thumb').getElementsByTagName('img')[0].src;
  2417. var itemname = document.getElementById('vend_item_title').innerHTML.replace(" (Any)","").trim();
  2418. $('.poses_anchor, .poseless_item').addClass('allpose');
  2419.  
  2420. if ( $( "#items_palette" ).length ) { var allposes = document.getElementById('items_palette').getElementsByClassName('allpose'); }
  2421. var hed1 = "Linked Thumbnail";
  2422. var hed2 = "Linked Name";
  2423. var hed3 = "Poses Thumbnail";
  2424.  
  2425. $('#itembb').click(function() {
  2426.  
  2427. var limg = '[url=' + document.URL + '][img]' + thumb + '[/img]' + '[/url]';
  2428. var lnam = '[url=' + document.URL + ']' + itemname + '[/url]';
  2429. var lpos = "";
  2430.  
  2431. if ( $('#items_palette').length ) {
  2432. for (var i = 0; i < allposes.length; i++) { lpos += '[img]' + allposes[i].src + '[/img]'; }
  2433. lpos += '\n' + '[url=' + document.URL + ']' + itemname + '[/url]';
  2434. } else {
  2435. lpos = "";
  2436. }
  2437.  
  2438. ugm_global_bbcodegen(limg, lnam, lpos, hed1, hed2, hed3);
  2439. });
  2440. }
  2441.  
  2442. /*!
  2443. * Inventory BBCode
  2444. */
  2445.  
  2446. function ugm_invobbcode() {
  2447.  
  2448. $('#save_order_button span').html('Save');
  2449. $('#save_order').css({ "position": "relative", "left": "-10px" });
  2450. $('<button type="button" id="ugm_invobtn" class="cta-button-md"><span>BBCode</span></button>').insertAfter('#discard_order_button');
  2451.  
  2452. $('#ugm_invobtn').click(function() {
  2453. var invo = document.querySelectorAll('.item-list.yui3-dd-drop:not(.yui-hidden)');
  2454. var numb = invo[0].getElementsByTagName('li');
  2455. var srcs = invo[0].getElementsByTagName('img');
  2456. var seld = invo[0].getElementsByClassName('drag-selected');
  2457. var limg = "";
  2458. var lnam = "";
  2459. var oimg = "";
  2460. var hed1 = 'Linked Thumbnails';
  2461. var hed2 = 'Linked Names';
  2462. var hed3 = 'Thumbnails';
  2463.  
  2464.  
  2465. if (seld.length > 0) {
  2466. for (var i = 0; i < seld.length; i++) {
  2467. limg += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + seld[i].getAttribute('data-item') + "/][img]http:"+ seld[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img][/url]";
  2468. lnam += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + seld[i].getAttribute('data-item') + "/]"+ seld[i].getElementsByTagName('img')[0].getAttribute('alt') + "[/url]" + "\n";
  2469. oimg += "[img]http:"+ seld[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img]";
  2470. }
  2471. } else {
  2472. for (var i = 0; i < numb.length; i++) {
  2473. limg += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + numb[i].getAttribute('data-item') + "/][img]http:"+ srcs[i].getAttribute('src') + "[/img][/url]";
  2474. lnam += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + numb[i].getAttribute('data-item') + "/]"+ srcs[i].getAttribute('alt') + "[/url]" + "\n";
  2475. oimg += "[img]http:"+ srcs[i].getAttribute('src') + "[/img]";
  2476. }
  2477. }
  2478. ugm_global_bbcodegen(limg, lnam, oimg, hed1, hed2, hed3);
  2479. });
  2480. }
  2481.  
  2482. /*!
  2483. * New Arena Layout
  2484. */
  2485.  
  2486. function ugm_betteraviarena() {
  2487.  
  2488. var ava_tags = document.getElementsByTagName('img');
  2489. for (var i = 0; i < ava_tags.length; i++) {
  2490. ava_tags[i].src = ava_tags[i].src.replace('_48x48.gif', '.png');
  2491. }
  2492.  
  2493. addGlobalStyle('#arena-content #arena-content-main #arena-content-ul .arena-content-li { height: 170px !important;}');
  2494. addGlobalStyle('#arena-content #arena-content-main #arena-content-ul .arena-content-li .img, #arena-content #arena-content-main #arena-content-ul .arena-content-li .img .fourtybyeight { height: 150px !important; width: 120px !important;}');
  2495. addGlobalStyle('#arena-content #arena-content-main #arena-content-ul .arena-content-li .desc { width: 120px !important;}');
  2496.  
  2497. }
  2498.  
  2499. /*!
  2500. * View Comments Link
  2501. */
  2502.  
  2503. function ugm_vcl() {
  2504.  
  2505. $('<li><a id="comlinks_converted" href="' + window.location.href.replace('addcomment', 'comments') + '"><u> [view all comments] </u></a></li>' +
  2506. '<li><a id="comlinks_converted" href="' + window.location.href.replace('addcomment', 'comments') + '&safe=1"><u> [view safe comments] </u></a></li>').appendTo('#comments .links');
  2507.  
  2508. }
  2509.  
  2510. /*!
  2511. * Marriage Font Fix
  2512. */
  2513.  
  2514. function ugm_bettermarriage() {
  2515.  
  2516. addGlobalStyle('#marriage_share > p { font-size: 11px !important; margin:10px 0 0 !important;}');
  2517. addGlobalStyle('#marriage_share > p > a { text-decoration: none !important; color: inherit !important;}');
  2518.  
  2519. }
  2520.  
  2521. /*!
  2522. * New Emoticons
  2523. */
  2524.  
  2525. function ugm_emoticons() {
  2526.  
  2527. // Add Hidden Emoticons
  2528.  
  2529. waitForKeyElements ('.emotion_zzz', ugm_hiddenemoticons);
  2530. function ugm_hiddenemoticons(){
  2531. var emotionstab = $('.emotion_zzz').parent();
  2532. $('.hidemote').remove();
  2533. $('<li><a href="#" rel="emoticon-control" class="phark hidemote" title="Fu - :fu:" id="hidemote_fu">Fu</a></li>').insertAfter(emotionstab);
  2534. $('<li><a href="#" rel="emoticon-control" class="phark hidemote" title="Mcsourface - :mcsourface:" id="hidemote_mrsourface">Mcsourface</a></li>').insertAfter(emotionstab);
  2535. $('<li><a href="#" rel="emoticon-control" class="phark hidemote" title="Poo - :poo:" id="hidemote_poo">Poo</a></li>').insertAfter(emotionstab);
  2536. }
  2537.  
  2538. waitForKeyElements ('.gaia_diamond', ugm_hiddenemoticons2);
  2539. function ugm_hiddenemoticons2(){
  2540. var emotionstab = $('.gaia_diamond').parent();
  2541. $('.hidemote2').remove();
  2542. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Diedrich - :diedrich:" id="hidemote_diedrich">Diedrich</a></li>').insertAfter(emotionstab);
  2543. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Bapecow - :bapecow:" id="hidemote_bapecow">Bapecow</a></li>').insertAfter(emotionstab);
  2544. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Reve - :reve:" id="hidemote_reve">Reve</a></li>').insertAfter(emotionstab);
  2545. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Northkittenstar - :northkittenstar:" id="hidemote_northkittenstar">Northkittenstar</a></li>').insertAfter(emotionstab);
  2546. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Jet - :jet:" id="hidemote_jet">Jet</a></li>').insertAfter(emotionstab);
  2547. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Omnomkiki - :omnomkiki:" id="hidemote_omnomkiki">Omnomkiki</a></li>').insertAfter(emotionstab);
  2548. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Omnomcoco - :omnomcoco:" id="hidemote_omnomcoco">Omnomcoco</a></li>').insertAfter(emotionstab);
  2549. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Omnomgrunny - :omnomgrunny:" id="hidemote_omnomgrunny">Omnomgrunny</a></li>').insertAfter(emotionstab);
  2550. $('<li><a href="#" rel="emoticon-control" class="phark hidemote2" title="Starseed - :starseed:" id="hidemote_starseed">Starseed</a></li>').insertAfter(emotionstab);
  2551. }
  2552.  
  2553. var shortcuts = [
  2554. "ulikeit", "DX", "8D", "hehe", "bad", "good", "grr", "hah", "haha", "hmph", "inlove", "kiss", "smiles", "poker",
  2555. "srs", "tongue", "tsun", "uu", "33", "ayylmao", "blink", "DD", "D8", "dirty", "doomed", "gentleman", "gng", "goody",
  2556. "grrr", "gul", "heh", "gasp", "like", "nyehh", "pouts", "sweats", "drools", "rage", "yara", "wtf", "stunned", "seduced",
  2557. "saywhat", "rainbow", "sorry", "gah", "love", "break", "non", "nish", "nod", "v3v", "shake", "ok", "amirite", "contempt",
  2558. "dumb", "yawn", "innocent", "noo", "excited", "domo", "sure", "dislike", "poop", "wail", "tem", "flip", "winking"];
  2559.  
  2560. function emoticons_launch(textbox) {
  2561.  
  2562. // Select
  2563.  
  2564. waitForKeyElements ('#emoticon_set', ugm_emoticonsdiv);
  2565. function ugm_emoticonsdiv() {
  2566.  
  2567. $('<option value="Upgrade">Upgrade</option>').appendTo('#emoticon_set');
  2568.  
  2569. var myNode = document.getElementById('emoticons');
  2570. while (myNode.firstChild) { myNode.removeChild(myNode.firstChild); }
  2571. $('#emoticon_set').val("Upgrade").change();
  2572. $('#emoticon_set').ready(loadupgrade);
  2573. $('#emoticon_set').change(loadupgrade);
  2574.  
  2575. function loadupgrade() {
  2576. setTimeout(function(){if ( $('#emoticon_set').val() == 'Upgrade' ) {ugm_emoticon_f();}}, 500);
  2577. }
  2578. }
  2579.  
  2580. // Emoticons
  2581.  
  2582. function ugm_emoticon_f() {
  2583.  
  2584. for (var i = 0 ; i < shortcuts.length ; i++) {
  2585. $('<li><a class="ugm_smileys" id="ugm_emoticon_' + shortcuts[i] + '" name=":' + shortcuts[i] + ':")></a></li>').appendTo('#emoticons');
  2586. }
  2587.  
  2588. function ugm_emoticon_addemote(emote) {
  2589. var ugm_emoticon_caretPos = document.getElementById(textbox).selectionStart;
  2590. var ugm_emoticon_textAreaTxt = jQuery('#' + textbox).val();
  2591. jQuery('#' + textbox).val(ugm_emoticon_textAreaTxt.substring(0, ugm_emoticon_caretPos) + emote + ugm_emoticon_textAreaTxt.substring(ugm_emoticon_caretPos) );
  2592. }
  2593.  
  2594. $('.ugm_smileys').click(function() {
  2595. ugm_emoticon_addemote(this.name);
  2596. });
  2597. }
  2598.  
  2599. // Shortcut - Image
  2600.  
  2601. $('.eti').click(ugm_emoticon_smiletoimg);
  2602. $('.eti2').click(ugm_emoticon_smiletoimg2);
  2603.  
  2604. function ugm_emoticon_smiletoimg() {
  2605. var ta = $('#' + textbox);
  2606. $(".ugm_smileys").each(function(){
  2607. var str=$(this).attr("name");
  2608. var url = $(this).css('background-image').replace(/^url\(['"]?([^'"]+)['"]?\)/,'$1');
  2609. var re = new RegExp(str,"g");
  2610. ta.val(ta.val().replace(re,"[img]"+url+"[/img]"));
  2611. });
  2612. }
  2613.  
  2614. function ugm_emoticon_smiletoimg2() {
  2615. ugm_emoticon_smiletoimg();
  2616. setTimeout(function() { ugm_emoticon_bbtotext(); }, 500);
  2617. }
  2618.  
  2619. // Image - Shortcut
  2620.  
  2621. waitForKeyElements ('#ugm_emoticon_gah',ugm_emoticon_bbtotext);
  2622.  
  2623. function ugm_emoticon_bbtotext() {
  2624. var ta = $('#' + textbox);
  2625. $(".ugm_smileys").each(function(){
  2626. var str=$(this).attr("name");
  2627. var url = $(this).css('background-image').replace(/^url\(['"]?([^'"]+)['"]?\)/,'$1');
  2628. var re = new RegExp("\\[img\\]"+url+"\\[/img\\]","g");
  2629. ta.val(ta.val().replace(re, str));
  2630. });
  2631. }
  2632.  
  2633. }
  2634.  
  2635. // Page Mode
  2636.  
  2637. if ( document.location.pathname.match(/^\/forum\/compose\/entry\//) || document.location.pathname.match(/^\/forum\/compose\/topic\//) || document.location.pathname.match(/^\/profile\/privmsg/) ) {
  2638. $('button[name=action_submit]').addClass('eti');
  2639. $('button[name=action_preview]').addClass('eti');
  2640. $('#btn_preview').addClass('eti');
  2641. $('#btn_send').addClass('eti');
  2642. var embox = 'message';
  2643. emoticons_launch(embox);
  2644. } else if ( document.location.pathname.match(/^\/account\/signature/) ) {
  2645. $('.cta-button-sm').addClass('eti');
  2646. $('#signature-preview-link').addClass('eti2');
  2647. var embox = 'signature-content';
  2648. emoticons_launch(embox);
  2649. } else if ( window.location.href.indexOf('mode=addcomment') > -1 ) {
  2650. $('input[name=submit]').addClass('eti');
  2651. $('input[name=preview]').addClass('eti');
  2652. var embox = 'comment';
  2653. emoticons_launch(embox);
  2654. } else if ( document.location.pathname.match(/^\/guilds\/posting/)) {
  2655. $('input[title=Submit]').addClass('eti');
  2656. $('input[title=Preview]').addClass('eti');
  2657. var embox = 'textInputArea';
  2658. emoticons_launch(embox);
  2659. addGlobalStyle('#textInputArea { width: 505px !important; }');
  2660. addGlobalStyle('#editor { left: 252px !important; }');
  2661. }
  2662. }
  2663.  
  2664. /*!
  2665. * New Emoticons
  2666. * Quick Reply
  2667. * Shortuct - Image
  2668. */
  2669.  
  2670. function ugm_emoticons_qr() {
  2671.  
  2672. var shortcuts = [
  2673. "ulikeit", "DX", "8D", "hehe", "bad", "good", "grr", "hah", "haha", "hmph", "inlove", "kiss", "smiles", "poker",
  2674. "srs", "tongue", "tsun", "uu", "33", "ayylmao", "blink", "DD", "D8", "dirty", "doomed", "gentleman", "gng", "goody",
  2675. "grrr", "gul", "heh", "gasp", "like", "nyehh", "pouts", "sweats", "drools", "rage", "yara", "wtf", "stunned", "seduced",
  2676. "saywhat", "rainbow", "sorry", "gah", "love", "break", "non", "nish", "nod", "v3v", "shake", "ok", "amirite", "contempt",
  2677. "dumb", "yawn", "innocent", "noo", "excited", "domo", "sure", "dislike", "poop", "wail", "tem", "flip", "winking"];
  2678.  
  2679. $('#qr_submit').click(ugm_emoticon_qr_smiletoimg);
  2680.  
  2681. function ugm_emoticon_qr_smiletoimg() {
  2682. var ta = $('#qr_text');
  2683. $('.ugm_smileys').each(function(){
  2684. var str=$(this).attr('name');
  2685. var url = $(this).css('background-image').replace(/^url\(['"]?([^'"]+)['"]?\)/,'$1');
  2686. var re = new RegExp(str,"g");
  2687. ta.val(ta.val().replace(re,"[img]"+url+"[/img]"));
  2688. });
  2689. }
  2690. }
  2691.  
  2692. /*!
  2693. * New Emoticons
  2694. * Quick Reply
  2695. */
  2696.  
  2697. function ugm_emoticons_qr2() {
  2698.  
  2699. waitForKeyElements ('#ugm_poststyler_tab2_loadqr',ugm_emoticon_qr_selection);
  2700.  
  2701. function ugm_emoticon_qr_selection() {
  2702.  
  2703. var shortcuts = [
  2704. "ulikeit", "DX", "8D", "hehe", "bad", "good", "grr", "hah", "haha", "hmph", "inlove", "kiss", "smiles", "poker",
  2705. "srs", "tongue", "tsun", "uu", "33", "ayylmao", "blink", "DD", "D8", "dirty", "doomed", "gentleman", "gng", "goody",
  2706. "grrr", "gul", "heh", "gasp", "like", "nyehh", "pouts", "sweats", "drools", "rage", "yara", "wtf", "stunned", "seduced",
  2707. "saywhat", "rainbow", "sorry", "gah", "love", "break", "non", "nish", "nod", "v3v", "shake", "ok", "amirite", "contempt",
  2708. "dumb", "yawn", "innocent", "noo", "excited", "domo", "sure", "dislike", "poop", "wail", "tem", "flip", "winking"];
  2709.  
  2710. $('<ul id="qr_emoticons"></ul>').insertAfter('#ugm_poststyler_qrbtn');
  2711. for (var i = 0 ; i < shortcuts.length ; i++) { $('<li><a class="ugm_smileys" id="ugm_emoticon_' + shortcuts[i] + '" name=":' + shortcuts[i] + ':")></a></li>').appendTo('#qr_emoticons'); }
  2712.  
  2713. function ugm_emoticon_addemoteqr(emote) {
  2714. var ugm_emoticon_caretPos = document.getElementById("qr_text").selectionStart;
  2715. var ugm_emoticon_textAreaTxt = jQuery("#qr_text").val();
  2716. jQuery('#qr_text').val(ugm_emoticon_textAreaTxt.substring(0, ugm_emoticon_caretPos) + emote + ugm_emoticon_textAreaTxt.substring(ugm_emoticon_caretPos) );
  2717. }
  2718.  
  2719. $('.ugm_smileys').click(function() { ugm_emoticon_addemoteqr(this.name); });
  2720. }
  2721. }
  2722.  
  2723. /*!
  2724. * Wishlist Sorter
  2725. */
  2726.  
  2727. function ugm_wishsorter() {
  2728.  
  2729. var ugm_wishlist_list = $('div#wishlist_drop_target'),
  2730. ugm_wishlist_li = ugm_wishlist_list.children('div');
  2731.  
  2732. $('<button id="ugm_wishsort1" class="ugm_wishsortbtn gAutoTooltip top-center delay-0" title="Alphabetically arrange from A to Z">A-Z</button>' +
  2733. '<button id="ugm_wishsort2" class="ugm_wishsortbtn gAutoTooltip top-center delay-0" title="Alphabetically arrange from Z to A">Z-A</button>' +
  2734. '<button id="ugm_wishsort3" class="ugm_wishsortbtn gAutoTooltip top-center delay-0" title="Arrange from lowest to highest ABP">ABP Asc.</button>' +
  2735. '<button id="ugm_wishsort4" class="ugm_wishsortbtn gAutoTooltip top-center delay-0" title="Arrange from highest to lowest ABP">ABP Desc.</button>' +
  2736. '<button id="ugm_wishsort5" class="ugm_wishsortbtn gAutoTooltip top-center delay-0" title="Groups similar items">Type (Beta)</button>').insertAfter('.description');
  2737.  
  2738. function ugm_wishrebuild() {
  2739. $('.wish_box').each(function() {
  2740. $(this).removeClass('row-even');
  2741. $(this).removeClass('row-odd');
  2742. });
  2743. $('.wish_box:even').addClass('row-even');
  2744. $('.wish_box:odd').addClass('row-odd');
  2745. }
  2746.  
  2747. // A-Z
  2748.  
  2749. $('#ugm_wishsort1').click(function() {
  2750. var alphabeticallyOrderedDivs = ugm_wishlist_li.sort(function (a, b) {
  2751. return String.prototype.localeCompare.call($(a).find('.wish_name').html(), $(b).find('.wish_name').html());
  2752. });
  2753. $("#wishlist_drop_target").html(alphabeticallyOrderedDivs);
  2754. ugm_wishrebuild();
  2755. return false;
  2756. });
  2757.  
  2758. // Z-A
  2759.  
  2760. $('#ugm_wishsort2').click(function() {
  2761. var alphabeticallyOrderedDivs = ugm_wishlist_li.sort(function (a, b) {
  2762. return String.prototype.localeCompare.call($(b).find('.wish_name').html(), $(a).find('.wish_name').html());
  2763. });
  2764. $("#wishlist_drop_target").html(alphabeticallyOrderedDivs);
  2765. ugm_wishrebuild();
  2766. return false;
  2767. });
  2768.  
  2769. // ABP+
  2770.  
  2771. $('#ugm_wishsort3').click(function() {
  2772. $('#ugm_wishsort3').text('Loading...');
  2773. GM_xmlhttpRequest({
  2774. method: "GET",
  2775. url: "http://www.gaiaonline.com/marketplace/",
  2776. onload: function(response) {
  2777. var parser=new DOMParser();
  2778. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  2779. var wishtr = innerDoc.getElementById('wishlist').getElementsByClassName('miniWishlist');
  2780. var wishsort_arr = [];
  2781.  
  2782. for ( var i = 0 ; i < wishtr.length; i++ ) {
  2783. var wishsort_arr1 = new Array();
  2784. wishsort_arr1[0] = wishtr[i].getElementsByClassName('itemDescription')[0].getElementsByTagName('a')[0].innerHTML;
  2785. wishsort_arr1[1] = parseFloat(wishtr[i].getElementsByClassName('ws_prices')[0].getElementsByTagName('span')[0].innerHTML.replace(/\,/g,'').replace('g',''));
  2786. wishsort_arr.push(wishsort_arr1);
  2787. }
  2788.  
  2789. var wishsorted = wishsort_arr.sort(function compareSecondColumn(a, b) {
  2790. if (a[1] === b[1]) {
  2791. return 0;
  2792. } else {
  2793. return (a[1] < b[1]) ? -1 : 1;
  2794. }
  2795. });
  2796.  
  2797. var wishsorted2 = wishsorted.map(function(val){
  2798. return val.slice(0, -1);
  2799. });
  2800.  
  2801. $.each(wishsorted2,function(index,value){
  2802. $('#wishlist_drop_target').append($('.wish_box').has('div:contains('+value+')'));
  2803. });
  2804.  
  2805. $('#ugm_wishsort3').text('ABP Asc.');
  2806. ugm_wishrebuild();
  2807. }
  2808. });
  2809. return false;
  2810. });
  2811.  
  2812. // ABP-
  2813.  
  2814. $('#ugm_wishsort4').click(function() {
  2815. $('#ugm_wishsort4').html('Loading...');
  2816. GM_xmlhttpRequest({
  2817. method: "GET",
  2818. url: "http://www.gaiaonline.com/marketplace/",
  2819. onload: function(response) {
  2820. var parser=new DOMParser();
  2821. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  2822. var wishtr = innerDoc.getElementById('wishlist').getElementsByClassName('miniWishlist');
  2823. var wishsort_arr = [];
  2824.  
  2825. for ( var i = 0 ; i < wishtr.length; i++ ) {
  2826. var wishsort_arr1 = new Array();
  2827. wishsort_arr1[0] = wishtr[i].getElementsByClassName('itemDescription')[0].getElementsByTagName('a')[0].innerHTML;
  2828. wishsort_arr1[1] = parseFloat(wishtr[i].getElementsByClassName('ws_prices')[0].getElementsByTagName('span')[0].innerHTML.replace(/\,/g,'').replace('g',''));
  2829. wishsort_arr.push(wishsort_arr1);
  2830. }
  2831.  
  2832. var wishsorted = wishsort_arr.sort(function compareSecondColumn(a, b) {
  2833. if (a[1] === b[1]) {
  2834. return 0;
  2835. } else {
  2836. return (a[1] > b[1]) ? -1 : 1;
  2837. }
  2838. });
  2839.  
  2840. var wishsorted2 = wishsorted.map(function(val){
  2841. return val.slice(0, -1);
  2842. });
  2843.  
  2844. $.each(wishsorted2,function(index,value){
  2845. $('#wishlist_drop_target').append($('.wish_box').has('div:contains('+value+')'));
  2846. });
  2847.  
  2848. $('#ugm_wishsort4').html('ABP Desc.');
  2849. ugm_wishrebuild();
  2850. }
  2851. });
  2852. return false;
  2853. });
  2854.  
  2855. // Type
  2856.  
  2857. $('#ugm_wishsort5').click(function() {
  2858. var alphabeticallyOrderedDivs = ugm_wishlist_li.sort(function (a, b) {
  2859. return String.prototype.localeCompare.call($(a).find('.wish_name').html().split(' ').splice(-1), $(b).find('.wish_name').html().split(' ').splice(-1));
  2860. });
  2861. $("#wishlist_drop_target").html(alphabeticallyOrderedDivs);
  2862. ugm_wishrebuild();
  2863. return false;
  2864. });
  2865. }
  2866.  
  2867. /*!
  2868. * Post Format
  2869. */
  2870.  
  2871. function ugm_poststyler() {
  2872.  
  2873. // Full Reply
  2874.  
  2875. waitForKeyElements ('#emoticons',ugm_poststylerdiv);
  2876.  
  2877. function ugm_poststylerdiv(){
  2878. $('<div id="ugm_poststyler_tab_div">' +
  2879. '<div id="ugm_poststyler_tab_divsub">' +
  2880. '<button id="ugm_poststyler_tab1_load">A</button>' +
  2881. '<button id="ugm_poststyler_tab2_load">B</button>' +
  2882. '<button id="ugm_poststyler_tab3_load">C</button>' +
  2883. '<button id="ugm_poststyler_tab4_load">D</button>' +
  2884. '<button id="ugm_poststyler_tab5_load">E</button>' +
  2885. '<div id="ugm_poststyler_disableauto"><input type="checkbox" id="ugm_poststyler_disablecb">Disable</div>' +
  2886. '</div>'+
  2887. '</div>').insertAfter('#format_controls');
  2888.  
  2889. $('#emoticon_set').css({
  2890. "background": "#eee none repeat scroll 0 0",
  2891. "border": "1px solid #999",
  2892. "color": "#222",
  2893. "height": "22px",
  2894. "left": "6px",
  2895. "position": "relative",
  2896. "width": "90px",
  2897. "z-index": "2",
  2898. "font-size": "11px"
  2899. });
  2900.  
  2901. if ( document.location.pathname.match(/^\/forum\/compose\/entry\//) || document.location.pathname.match(/^\/forum\/compose\/topic\//) || window.location.href.indexOf("mode=addcomment") > -1 ) {
  2902. $('#ugm_poststyler_tab_div').css({'top': '68px'});
  2903. }
  2904.  
  2905. if ( document.location.pathname.match(/^\/profile\/privmsg/) || document.location.pathname.match(/^\/guilds\/posting/) ) {
  2906. $('#ugm_poststyler_tab_div').css({'top': '70px'});
  2907. }
  2908.  
  2909. $('#ugm_poststyler_tab1_load').click(function() {
  2910. ugm_ps_applypost('poststyle_a_prefix','poststyle_a_suffix');
  2911. return false;
  2912. });
  2913.  
  2914. $('#ugm_poststyler_tab2_load').click(function() {
  2915. ugm_ps_applypost('poststyle_b_prefix','poststyle_b_suffix');
  2916. return false;
  2917. });
  2918.  
  2919. $('#ugm_poststyler_tab3_load').click(function() {
  2920. ugm_ps_applypost('poststyle_c_prefix','poststyle_c_suffix');
  2921. return false;
  2922. });
  2923.  
  2924. $('#ugm_poststyler_tab4_load').click(function() {
  2925. ugm_ps_applypost('poststyle_d_prefix','poststyle_d_suffix');
  2926. return false;
  2927. });
  2928.  
  2929. $('#ugm_poststyler_tab5_load').click(function() {
  2930. ugm_ps_applypost('poststyle_e_prefix','poststyle_e_suffix');
  2931. return false;
  2932. });
  2933. }
  2934.  
  2935. // Auto
  2936.  
  2937. var ugm_post_defres = GM_getValue('ugm_postdef');
  2938. $('button[name=action_submit], #btn_send, input[value=Submit], input[title=Submit]').click(function() {
  2939. if (!document.getElementById('ugm_poststyler_disablecb').checked) {
  2940. switch (ugm_post_defres) {
  2941. case "PF1":
  2942. ugm_ps_applypost('poststyle_a_prefix','poststyle_a_suffix');
  2943. break;
  2944. case "PF2":
  2945. ugm_ps_applypost('poststyle_b_prefix','poststyle_b_suffix');
  2946. break;
  2947. case "PF3":
  2948. ugm_ps_applypost('poststyle_c_prefix','poststyle_c_suffix');
  2949. break;
  2950. case "PF4":
  2951. ugm_ps_applypost('poststyle_d_prefix','poststyle_d_suffix');
  2952. break;
  2953. case "PF5":
  2954. ugm_ps_applypost('poststyle_e_prefix','poststyle_e_suffix');
  2955. break;
  2956. }
  2957. }
  2958. });
  2959.  
  2960. // Apply
  2961.  
  2962. function ugm_ps_applypost(prefixid,suffixid) {
  2963.  
  2964. if ( document.location.pathname.match(/^\/forum\/compose\/entry\/new/) || document.location.pathname.match(/^\/forum\/compose\/topic\/new/) || document.location.pathname.match(/^\/profile\/privmsg/) ) {
  2965. var thetextarea = document.getElementById('message');
  2966. } else if ( window.location.href.indexOf("mode=addcomment") > -1 ) {
  2967. var thetextarea = document.getElementById('comment');
  2968. } else if ( document.location.pathname.match(/^\/guilds\/posting/) ) {
  2969. var thetextarea = document.getElementById('textInputArea');
  2970. }
  2971.  
  2972. // Convert to HTML
  2973.  
  2974. $('<div id="ugm_ps_wrap" style="display:none;"></div>').appendTo('body');
  2975. var messagecont = thetextarea.value;
  2976. var htm = messagecont.replace(/\[quote(|.+?")\]/g, '<div class$1>').replace(/\[\/quote]/g, '</div>').replace(/\n/g, '<br>');
  2977. $('#ugm_ps_wrap').text(htm);
  2978. $('#ugm_ps_wrap').html($('#ugm_ps_wrap').text());
  2979.  
  2980. // Differentiates quote trees
  2981.  
  2982. $("#ugm_ps_wrap>div").each(function(){
  2983. var outer = this.outerHTML;
  2984. var regex = new RegExp('<' + this.tagName, 'i');
  2985. var newTag = outer.replace(regex, '<span');
  2986. regex = new RegExp('</' + this.tagName + '>$', 'i');
  2987. newTag = newTag.replace(regex, '</span>');
  2988. $(this).replaceWith(newTag);
  2989. });
  2990.  
  2991. // Adds post style
  2992.  
  2993. var msg = $('#ugm_ps_wrap').prop('innerHTML');
  2994.  
  2995. // no quote
  2996. if (msg.indexOf("</span>") == -1) {
  2997. var msg2 = GM_getValue(prefixid, '') + msg + GM_getValue(suffixid, '');
  2998. }
  2999. // message before quote
  3000. else if (msg.substring(0, 5) != "<span"){
  3001. var msg2 = GM_getValue(prefixid, '') + msg.replace(/(\<span[\s\S]*\<\/span>)/g, GM_getValue(suffixid, '') + '$1');
  3002. }
  3003. // normal quote or multiquote
  3004. else if (msg.indexOf("</span>") >= 0) {
  3005. var msg1 = msg.replace(/(\<span[\s\S]+?\<\/span\>)/g, GM_getValue(suffixid, '') + '$1' + GM_getValue(prefixid, '')) + GM_getValue(suffixid, '');
  3006. var msg2 = msg1.replace(GM_getValue(suffixid, ''), '');
  3007. }
  3008.  
  3009. // Similarize quote trees
  3010.  
  3011. $('#ugm_ps_wrap').text(msg2);
  3012. $('#ugm_ps_wrap').html($('#ugm_ps_wrap').text());
  3013.  
  3014. $("#ugm_ps_wrap>span").each(function(){
  3015. var outer = this.outerHTML;
  3016. var regex = new RegExp('<' + this.tagName, 'i');
  3017. var newTag = outer.replace(regex, '<div');
  3018. regex = new RegExp('</' + this.tagName + '>$', 'i');
  3019. newTag = newTag.replace(regex, '</div>');
  3020. $(this).replaceWith(newTag);
  3021. });
  3022.  
  3023. var msg3 = $('#ugm_ps_wrap').prop('innerHTML');
  3024.  
  3025. // Reverts to BBC
  3026.  
  3027. var ms2 = msg3.replace(/<div class(.+?)>/g, '[quote$1]').replace(/<\/div>/g, '[/quote]').replace(/=""/g, '').replace(/<br>/g, '\n');
  3028. thetextarea.value = decodeEntities(ms2);
  3029.  
  3030. }
  3031. }
  3032.  
  3033. // Quick Reply
  3034.  
  3035. function ugm_poststyler_qr() {
  3036.  
  3037. $('<div id="ugm_poststyler_qrbtn">' +
  3038. '<button id="ugm_poststyler_tab1_loadqr">A</button>' +
  3039. '<button id="ugm_poststyler_tab2_loadqr">B</button>' +
  3040. '<button id="ugm_poststyler_tab3_loadqr">C</button>' +
  3041. '<button id="ugm_poststyler_tab4_loadqr">D</button>' +
  3042. '<button id="ugm_poststyler_tab5_loadqr">E</button>' +
  3043. '</div>').insertBefore('#qr_text');
  3044.  
  3045. // Auto
  3046.  
  3047. var ugm_post_defres = GM_getValue('ugm_postdef');
  3048. $('#qr_submit, #btn_send').click(function() {
  3049. switch (ugm_post_defres) {
  3050. case "PF1":
  3051. ugm_ps_applypost('poststyle_a_prefix','poststyle_a_suffix');
  3052. break;
  3053. case "PF2":
  3054. ugm_ps_applypost('poststyle_b_prefix','poststyle_b_suffix');
  3055. break;
  3056. case "PF3":
  3057. ugm_ps_applypost('poststyle_c_prefix','poststyle_c_suffix');
  3058. break;
  3059. case "PF4":
  3060. ugm_ps_applypost('poststyle_d_prefix','poststyle_d_suffix');
  3061. break;
  3062. case "PF5":
  3063. ugm_ps_applypost('poststyle_e_prefix','poststyle_e_suffix');
  3064. break;
  3065. }
  3066. });
  3067.  
  3068. // Click
  3069.  
  3070. $('#ugm_poststyler_tab1_loadqr').click(function() {
  3071. ugm_ps_applypost('poststyle_a_prefix','poststyle_a_suffix');
  3072. return false;
  3073. });
  3074.  
  3075. $('#ugm_poststyler_tab2_loadqr').click(function() {
  3076. ugm_ps_applypost('poststyle_b_prefix','poststyle_b_suffix');
  3077. return false;
  3078. });
  3079.  
  3080. $('#ugm_poststyler_tab3_loadqr').click(function() {
  3081. ugm_ps_applypost('poststyle_c_prefix','poststyle_c_suffix');
  3082. return false;
  3083. });
  3084.  
  3085. $('#ugm_poststyler_tab4_loadqr').click(function() {
  3086. ugm_ps_applypost('poststyle_d_prefix','poststyle_d_suffix');
  3087. return false;
  3088. });
  3089.  
  3090. $('#ugm_poststyler_tab5_loadqr').click(function() {
  3091. ugm_ps_applypost('poststyle_e_prefix','poststyle_e_suffix');
  3092. return false;
  3093. });
  3094.  
  3095. // Apply
  3096.  
  3097. function ugm_ps_applypost(prefixid,suffixid) {
  3098.  
  3099. // Convert to HTML
  3100.  
  3101. $('<div id="ugm_ps_wrap" style="display:none;"></div>').appendTo('body');
  3102. var messagecont = document.getElementById('qr_text').value;
  3103. var htm = messagecont.replace(/\[quote(|.+?")\]/g, '<div class$1>').replace(/\[\/quote]/g, '</div>').replace(/\n/g, '<br>');
  3104. $('#ugm_ps_wrap').text(htm);
  3105. $('#ugm_ps_wrap').html($('#ugm_ps_wrap').text());
  3106.  
  3107. // Differentiates quote trees
  3108.  
  3109. $("#ugm_ps_wrap>div").each(function(){
  3110. var outer = this.outerHTML;
  3111. var regex = new RegExp('<' + this.tagName, 'i');
  3112. var newTag = outer.replace(regex, '<span');
  3113. regex = new RegExp('</' + this.tagName + '>$', 'i');
  3114. newTag = newTag.replace(regex, '</span>');
  3115. $(this).replaceWith(newTag);
  3116. });
  3117.  
  3118. // Adds post style
  3119.  
  3120. var msg = $('#ugm_ps_wrap').prop('innerHTML');
  3121.  
  3122. // no quote
  3123. if (msg.indexOf("</span>") == -1) {
  3124. var msg2 = GM_getValue(prefixid, '') + msg + GM_getValue(suffixid, '');
  3125. }
  3126. // message before quote
  3127. else if (msg.substring(0, 5) != "<span"){
  3128. var msg2 = GM_getValue(prefixid, '') + msg.replace(/(\<span[\s\S]*\<\/span>)/g, GM_getValue(suffixid, '') + '$1');
  3129. }
  3130. // normal quote or multiquote
  3131. else if (msg.indexOf("</span>") >= 0) {
  3132. var msg1 = msg.replace(/(\<span[\s\S]+?\<\/span\>)/g, GM_getValue(suffixid, '') + '$1' + GM_getValue(prefixid, '')) + GM_getValue(suffixid, '');
  3133. var msg2 = msg1.replace(GM_getValue(suffixid, ''), '');
  3134. }
  3135.  
  3136. // Similarize quote trees
  3137.  
  3138. $('#ugm_ps_wrap').text(msg2);
  3139. $('#ugm_ps_wrap').html($('#ugm_ps_wrap').text());
  3140.  
  3141. $("#ugm_ps_wrap>span").each(function(){
  3142. var outer = this.outerHTML;
  3143. var regex = new RegExp('<' + this.tagName, 'i');
  3144. var newTag = outer.replace(regex, '<div');
  3145. regex = new RegExp('</' + this.tagName + '>$', 'i');
  3146. newTag = newTag.replace(regex, '</div>');
  3147. $(this).replaceWith(newTag);
  3148. });
  3149.  
  3150. var msg3 = $('#ugm_ps_wrap').prop('innerHTML');
  3151.  
  3152. // Reverts to BBC
  3153.  
  3154. var ms2 = msg3.replace(/<div class(.+?)>/g, '[quote$1]').replace(/<\/div>/g, '[/quote]').replace(/=""/g, '').replace(/<br>/g, '\n');
  3155. document.getElementById('qr_text').value = decodeEntities(ms2);
  3156.  
  3157. }
  3158. }
  3159.  
  3160. /*!
  3161. * Post Action Saver
  3162. */
  3163.  
  3164. function ugm_postacter() {
  3165.  
  3166. $('<div id="ugm_postaction_cbdiv">' +
  3167. '<a id="ugm_postaction_rem" title="Click here to remember your RNG or Dice action.">Remember</a>' +
  3168. '<a id="ugm_postaction_forget" title="Click here to empty your saved settings.">Forget</a>' +
  3169. '<a id="ugm_postaction_info" title="To change, input a new action and click Remember, or click Forget.">?</a>' +
  3170. '<div id="ugm_postaction_note"></div>' +
  3171. '</div>').appendTo('#post_action');
  3172.  
  3173. // Save
  3174.  
  3175. $('#ugm_postaction_rem').click(function() {
  3176.  
  3177. if (document.getElementById('compound_type').value == "50" ) {
  3178. var ugm_postaction_dicesides = document.getElementById('dice_sides').value;
  3179. var ugm_postaction_diceamount = document.getElementById('dice_amount').value;
  3180. GM_setValue('postaction_remembered', 'diceroll');
  3181. GM_setValue('dice_sides', ugm_postaction_dicesides);
  3182. GM_setValue('dice_amount', ugm_postaction_diceamount);
  3183. ugm_postaction_noteupdate();
  3184. } else if (document.getElementById('compound_type').value == "51" ) {
  3185. var ugm_postaction_rngmin = document.getElementById('random-min').value;
  3186. var ugm_postaction_rngmax = document.getElementById('random-max').value;
  3187. GM_setValue('postaction_remembered', 'rng');
  3188. GM_setValue('rng_min', ugm_postaction_rngmin);
  3189. GM_setValue('rng_max', ugm_postaction_rngmax);
  3190. ugm_postaction_noteupdate();
  3191. }
  3192. });
  3193.  
  3194. // Note
  3195.  
  3196. ugm_postaction_noteupdate();
  3197.  
  3198. function ugm_postaction_noteupdate() {
  3199. var ugm_postaction_current = GM_getValue('postaction_remembered');
  3200. if ( ugm_postaction_current == "diceroll" ) {
  3201. document.getElementById('ugm_postaction_note').innerHTML = 'Your saved action is: Roll ' + GM_getValue('dice_amount') + ' ' + GM_getValue('dice_sides') + '-sided dice.';
  3202. } else if ( ugm_postaction_current == "rng" ) {
  3203. document.getElementById('ugm_postaction_note').innerHTML = 'Your saved action is: RNG ' + GM_getValue('rng_min') + ' to ' + GM_getValue('rng_max') + '.';
  3204. }
  3205. }
  3206.  
  3207. // Submit
  3208.  
  3209. $('button[name=action_submit]').click(function() {
  3210. var ugm_postaction_current = GM_getValue('postaction_remembered');
  3211. if ( ugm_postaction_current == "diceroll" ) {
  3212. $("#compound_type").val('50');
  3213. document.getElementById('dice_sides').value = GM_getValue('dice_sides');
  3214. document.getElementById('dice_amount').value = GM_getValue('dice_amount');
  3215. } else if ( ugm_postaction_current == "rng" ) {
  3216. $("#compound_type").val('51');
  3217. document.getElementById('random-min').value = GM_getValue('rng_min');
  3218. document.getElementById('random-max').value = GM_getValue('rng_max');
  3219. }
  3220. });
  3221.  
  3222. // Forget
  3223.  
  3224. $('#ugm_postaction_forget').click(function() {
  3225. GM_setValue('postaction_remembered', '');
  3226. GM_setValue('rng_min', '');
  3227. GM_setValue('rng_max', '');
  3228. GM_setValue('rng_remembered', '');
  3229. GM_setValue('dice_sides', '');
  3230. GM_setValue('dice_amount', '');
  3231. document.getElementById('ugm_postaction_note').innerHTML = '';
  3232. });
  3233. }
  3234.  
  3235. /*!
  3236. * Wishlist BBCode
  3237. * Market
  3238. */
  3239.  
  3240. function ugm_wishbbcode() {
  3241.  
  3242. var tabl = document.getElementsByClassName('miniWishlist');
  3243. var wish = document.getElementById('arrow_wishlist').parentNode.parentNode;
  3244. var limg = "";
  3245. var lnam = "";
  3246. var oimg = "";
  3247.  
  3248. $('<a id="ugm_wishlistbbcode_a">bbcodes</a>').insertAfter('#arrow_wishlist');
  3249. $('<div id="ugm_wishlistbbcode_div">' +
  3250. '<label id="ugm_wishlistbbcode_l1">Linked Thumbnails:</label>' +
  3251. '<textarea id="ugm_wishlistbbcode_t1" readonly></textarea>' +
  3252. '<label id="ugm_wishlistbbcode_l2">Linked Names:</label>' +
  3253. '<textarea id="ugm_wishlistbbcode_t2" readonly></textarea>' +
  3254. '<label id="ugm_wishlistbbcode_l3">Thumbnails:</label>' +
  3255. '<textarea id="ugm_wishlistbbcode_t3" readonly></textarea>' +
  3256. '</div>').appendTo('#wishlist');
  3257.  
  3258. for (i=0 ; i < tabl.length; i++) {
  3259. var srcs = tabl[i].getElementsByTagName('a')[0].href;
  3260. var thum = tabl[i].getElementsByTagName('img')[0].src;
  3261. var name = tabl[i].getElementsByClassName('itemDescription')[0].getElementsByTagName('a')[0].innerHTML;
  3262.  
  3263. limg += '[url=' + srcs + '][img]' + thum + '[/img][/url]';
  3264. lnam += '[url=' + srcs + ']' + name + '[/url]' + '\n';
  3265. oimg += '[img]' + thum + '[/img]';
  3266. }
  3267.  
  3268. document.getElementById('ugm_wishlistbbcode_t1').value = limg;
  3269. document.getElementById('ugm_wishlistbbcode_t2').value = lnam;
  3270. document.getElementById('ugm_wishlistbbcode_t3').value = oimg;
  3271.  
  3272. $('#ugm_wishlistbbcode_a').click(function(){
  3273. if ( $('#ugm_wishlistbbcode_div').css('display') == 'none' ) {
  3274. $(wish).css('height', '501px');
  3275. $('#ugm_wishlistbbcode_div').css({"display": "block"});
  3276. } else {
  3277. $(wish).removeAttr('style');
  3278. $('#ugm_wishlistbbcode_div').css({"display": "none"});
  3279. }
  3280. });
  3281. }
  3282.  
  3283. /*!
  3284. * Wishlist BBCode
  3285. * Wishlist
  3286. */
  3287.  
  3288. function ugm_wishbbcode_b() {
  3289.  
  3290. $('<button id="mainwishbb" class="gAutoTooltip top-center delay-0" title="Generate the BBCode of your wishlist.">Get BBCode</button>').insertAfter('.description');
  3291.  
  3292. $('#mainwishbb').click(function() {
  3293.  
  3294. var wish = document.getElementById('wishlist_drop_target').getElementsByClassName('wish_box');
  3295. var limg = "";
  3296. var lnam = "";
  3297. var oimg = "";
  3298. var hed1 = "Linked Thumbnails";
  3299. var hed2 = "Linked Names";
  3300. var hed3 = "Thumbnails";
  3301.  
  3302. for (var i = 0; i < wish.length; i++) {
  3303. limg += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + wish[i].getAttribute('id').replace('wishlist_item_','') + "/][img]http:"+ wish[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img][/url]";
  3304. lnam += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + wish[i].getAttribute('id').replace('wishlist_item_','') + "/]"+ wish[i].getElementsByClassName('wish_name')[0].innerHTML + "[/url]" + "\n";
  3305. oimg += "[img]http:"+ wish[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img]";
  3306. }
  3307.  
  3308. ugm_global_bbcodegen(limg, lnam, oimg, hed1, hed2, hed3);
  3309.  
  3310. return false;
  3311.  
  3312. });
  3313. }
  3314.  
  3315. /*!
  3316. * Announcement Remover
  3317. */
  3318.  
  3319. function ugm_annrem() {
  3320.  
  3321. if ($(".notify_announcements")[0]){
  3322.  
  3323. var announcements = $('#notifyItemList .notify_item.notify_announcements a');
  3324. var number = parseInt($(announcements).html().match(/\d+/)[0]) + 1;
  3325. var href;
  3326. var i = number;
  3327.  
  3328. $(announcements)
  3329. .after(
  3330. $(document.createElement('img'))
  3331. .attr('id', 'ugm_annrem_loader')
  3332. .attr('src', 'http://i.imgur.com/DJsByCj.gif')
  3333. )
  3334.  
  3335. function myLoop() {
  3336.  
  3337. // Prevents looping through current page's announcement
  3338. if (i === number ) {
  3339. href = $('.notify_icon_announcement').attr('href');
  3340. }
  3341.  
  3342. // Countdown
  3343. $(announcements).html((i-1) + " Announcements");
  3344.  
  3345. // Views the page and gets next announcement thread
  3346. $.ajax({
  3347. method: 'GET',
  3348. url: href,
  3349. success:function(response) {
  3350. href = $($.parseHTML(response)).find('.notify_icon_announcement').attr('href');
  3351. i--;
  3352. if ( i > 0 ) { myLoop(); }
  3353. }
  3354. });
  3355.  
  3356. }
  3357.  
  3358. myLoop();
  3359.  
  3360. // Loading icon
  3361. $('#ugm_annrem_loader').delay(number*1000).fadeOut('slow');
  3362. }
  3363. }
  3364.  
  3365. /*!
  3366. * Item Marker
  3367. */
  3368.  
  3369. function ugm_itemmarker() {
  3370.  
  3371. waitForKeyElements ("#equip ul",ugm_involock_lockload);
  3372.  
  3373. var ugm_involock_involi = document.getElementById('equip').getElementsByTagName('li');
  3374. var ugm_involock_lockarr = JSON.parse(GM_getValue('ugm_involock_savestat', '[]'));
  3375.  
  3376. $('<label id="ugm_involock_label">Item Marker : </label>' +
  3377. '<label id="ugm_involock_showcb">Edit</label>' +
  3378. '<label id="ugm_involock_save">Save</label>' +
  3379. '<label id="ugm_involock_clear">Clear</label>').appendTo('#inventory-search');
  3380.  
  3381. // Ready
  3382.  
  3383. function ugm_involock_lockload() {
  3384. for ( var i = 0; i < ugm_involock_involi.length; i++ ) {
  3385. var ugm_involock_cb = $('<input type="checkbox" class="ugm_involock_cb">').appendTo(ugm_involock_involi[i]);
  3386. }
  3387. for ( var i = 0; i < ugm_involock_lockarr.length; i++ ) {
  3388. $("[data-item='" + ugm_involock_lockarr[i] + "']").addClass('ugm_involock_locked');
  3389. }
  3390. }
  3391.  
  3392. // Check
  3393.  
  3394. $('#ugm_involock_showcb').click(function(){
  3395.  
  3396. for ( var i = 0 ; i < ugm_involock_lockarr.length ; i++ ) {
  3397. $("[data-item='" + ugm_involock_lockarr[i] + "'] input").prop('checked', true);
  3398. }
  3399.  
  3400. $('.ugm_involock_cb').css({"display": "block"});
  3401.  
  3402. $(ugm_involock_involi).click(function(){
  3403. var ugm_involock_thiscb = this.getElementsByTagName('input');
  3404.  
  3405. if ($(ugm_involock_thiscb).prop('checked') == false) {
  3406. ugm_involock_lockarr.push(this.getAttribute('data-item'))
  3407. $(ugm_involock_thiscb).prop('checked', true);
  3408. } else if ($(ugm_involock_thiscb).prop('checked') == true) {
  3409. var i = ugm_involock_lockarr.indexOf(this.getAttribute('data-item'));
  3410. ugm_involock_lockarr.splice(i, 1);
  3411. $(ugm_involock_thiscb).prop('checked', false);
  3412. }
  3413. return false;
  3414. });
  3415. });
  3416.  
  3417. // Save
  3418.  
  3419. $('#ugm_involock_save').click(function(){
  3420. ugm_involock_lockarrunique = ugm_involock_lockarr.filter( function(item, pos) {
  3421. return ugm_involock_lockarr.indexOf(item) == pos;
  3422. })
  3423. GM_setValue('ugm_involock_savestat',JSON.stringify(ugm_involock_lockarrunique));
  3424. location.reload();
  3425. });
  3426.  
  3427. // Clear
  3428.  
  3429. $('#ugm_involock_clear').click(function(){
  3430. GM_setValue('ugm_involock_savestat', '[]');
  3431. location.reload();
  3432. });
  3433. }
  3434.  
  3435. /*!
  3436. * Item Marker
  3437. * Trade
  3438. */
  3439.  
  3440. function ugm_itemmarker2() {
  3441. waitForKeyElements ('#equip ul',ugm_involock_lockload);
  3442. var ugm_involock_lockarr = JSON.parse(GM_getValue('ugm_involock_savestat', '[]'));
  3443. function ugm_involock_lockload() {
  3444. var j = 0, len = ugm_involock_lockarr.length;
  3445. for (j = 0; j < len; j++) {
  3446. $("[data-item='" + ugm_involock_lockarr[j] + "']").addClass('ugm_involock_locked');
  3447. }
  3448. $('.ugm_involock_locked').css({ 'border': '1px solid #5aa2cd', 'background': '#a5d5f2' });
  3449. }
  3450. }
  3451.  
  3452. /*!
  3453. * Market Quantity Fix
  3454. */
  3455.  
  3456. function ugm_marketquantityfix() {
  3457. addGlobalStyle('.vend_rows_ex_quantity_field {padding-right: 7px;}');
  3458. }
  3459.  
  3460. /*!
  3461. * Thread Filter
  3462. */
  3463.  
  3464. function ugm_hidebigtopics() {
  3465.  
  3466. $( document ).ready(function() {
  3467.  
  3468. if ($('.notice').length > 0) {
  3469. document.getElementsByClassName('notice')[0].parentNode.remove();
  3470. }
  3471.  
  3472. $('.rowon, .rowoff').each(function() {
  3473. $(this).addClass('tf_row');
  3474. });
  3475.  
  3476. var tf_max = parseFloat(GM_getValue('hidebigtopics_customval', ''));
  3477. var tf_blacklist = GM_getValue('hmt_names', '')
  3478.  
  3479. if (tf_blacklist.length == 0) {
  3480. var tf_blacklist = "ugmdonotdeletethisone, ugmdonotdeletethistoo";
  3481. }
  3482.  
  3483. var tf_userarray = tf_blacklist.toLowerCase().split(', ');
  3484. var rep_row;
  3485. var use_row;
  3486.  
  3487. function isInArray(value, array) {
  3488. return array.indexOf(value) > -1;
  3489. }
  3490.  
  3491. $('.tf_row').each(function() {
  3492. rep_row = parseFloat(this.getElementsByClassName('replies')[0].innerHTML);
  3493. if (rep_row > tf_max) {
  3494. this.remove();
  3495. }
  3496. use_row = this.getElementsByClassName('creator')[0].getElementsByTagName('a')[0].innerHTML.toLowerCase();
  3497. for (var i = tf_userarray.length - 1; i >= 0; --i) {
  3498. if (use_row.indexOf(tf_userarray[i]) != -1) {
  3499. this.remove();
  3500. }
  3501. }
  3502. });
  3503. $('.tf_row').each(function() {
  3504. $(this).removeClass('rowon');
  3505. $(this).removeClass('rowoff');
  3506. });
  3507. $('.tf_row:even').addClass('rowon');
  3508. $('.tf_row:odd').addClass('rowoff');
  3509. });
  3510. }
  3511.  
  3512. /*!
  3513. * Centered Forums
  3514. */
  3515.  
  3516. function ugm_centeredforums() {
  3517.  
  3518. addGlobalStyle("#thread_header {left: 1px;}");
  3519. addGlobalStyle("#gaia_header .header_content{ margin: 0px auto; border-left: 2px solid #000; border-right: 2px solid #000; width: 1140px !important; background: url('http://s.cdn.gaiaonline.com/images/gaia_global/gaia_header/new_header/il_header_bg_barton_sprite.jpg?v=2') no-repeat scroll 0 0px, rgba(0, 0, 0, 0) url('http://s.cdn.gaiaonline.com/images/gaia_global/gaia_header/new_header/rs_header_bg_barton_tile_sprite.jpg') repeat scroll 0 0 }");
  3520. addGlobalStyle("#content{ margin: 0px auto; width: 1140px !important; border-left: 2px solid #000; border-right: 2px solid #000; border-bottom: 2px solid #000 }");
  3521. addGlobalStyle("#gaia_menu_bar{ margin: 0px auto; width: 1140px !important; border-left: 2px solid #000; border-right: 2px solid #000; }");
  3522. addGlobalStyle("body{ background: #12403d url('http://s.cdn.gaiaonline.com/images/global_bg/bg2.jpg') repeat-x fixed left bottom !important; height: auto !important; position: relative }");
  3523. addGlobalStyle("#topic_header_container{ margin-left: -16px }");
  3524. addGlobalStyle("#gaia_header{ background-image: none !important; }");
  3525. addGlobalStyle("#gaia_footer{ padding: 10px 0px 25px !important; width: 1140px; margin: 0px auto; position: relative; z-index: 1 }");
  3526. addGlobalStyle("#gaia_footer ul{ margin: 0px 0.5% 10px !important; padding: 0px 0px 1.5%; padding-inline-start: 0px; width: 99%; min-height: 5em; display: block; float: left; background: rgba(0, 0, 0, 0.6) none repeat scroll 0% 0%; border-radius: 8px }");
  3527. addGlobalStyle("#gaia_footer ul li{ margin: 0px; padding: 0.25em 0px 0.25em 4% !important; width: 10%; display: block !important; float: left; border: 0px none !important}");
  3528. addGlobalStyle("#gaia_footer a{ color: #fff !important}");
  3529. addGlobalStyle("#gaia_footer a:link{ color: #fff !important}");
  3530. addGlobalStyle("#gaia_footer p{ clear: both; margin: 1% 0px 0px !important; padding: 8px; width: 1124px; background: rgba(255, 255, 255, 0.6) none repeat scroll 0% 0%; border-radius: 4px }");
  3531.  
  3532. }
  3533.  
  3534. function ugm_centeredforums2() {
  3535. $('#gaia_header').removeAttr("style");
  3536. }
  3537.  
  3538. /*!
  3539. * Achievement Organizer
  3540. */
  3541.  
  3542. function ugm_alphatitle() {
  3543.  
  3544. $("#achievement_title_1").html($("#achievement_title_1 option").sort(function (a, b) {
  3545. return a.text == b.text ? 0 : a.text < b.text ? -1 : 1
  3546. }))
  3547.  
  3548. $("#achievement_title_2").html($("#achievement_title_2 option").sort(function (a, b) {
  3549. return a.text == b.text ? 0 : a.text < b.text ? -1 : 1
  3550. }))
  3551.  
  3552. $("#achievement_title_1").val($("#achievement_title_1 option:first").val());
  3553. $("#achievement_title_2").val($("#achievement_title_2 option:first").val());
  3554.  
  3555. $("#complete_ul").css({
  3556. "overflow": "auto",
  3557. "width": "650px",
  3558. "height": "560px"
  3559. });
  3560.  
  3561. }
  3562.  
  3563. /*!
  3564. * Dumpster Dive Reminder
  3565. */
  3566.  
  3567. function ugm_dumpster() {
  3568.  
  3569. $('#get_treasure').click(function(){
  3570. var ugm_dumpster_next = new Date().getTime() + 300000;
  3571. GM_setValue('dumpster_cooldown', ugm_dumpster_next);
  3572. });
  3573.  
  3574. // Positions
  3575.  
  3576. var ugm_dumpster_golddiv = document.getElementById('user_gold_count').parentNode;
  3577. var ugm_dumpster_warning = $('<div id="ugm_dumpster_wrap"><div id="ugm_dumpster_icon"></div><a id="ugm_dumpster_text"></a></div>').appendTo(ugm_dumpster_golddiv);
  3578. var ugm_dumpster_gold = $("#go1d_amt").width() - 40;
  3579. var ugm_dumpster_cash = $("#cash_amt").width() - 40;
  3580. var ugm_dumpster_user = $("#user_account").width() - 107;
  3581. var ugm_dumpster_pos = ugm_dumpster_gold + ugm_dumpster_cash + ugm_dumpster_user + 396;
  3582. var ugm_dumpster_wr = document.getElementById('ugm_dumpster_wrap');
  3583. ugm_dumpster_wr.style.right = ugm_dumpster_pos + "px";
  3584.  
  3585. // BG
  3586.  
  3587. waitForKeyElements ('#bg_widgets',dumpsterbgready);
  3588.  
  3589. function dumpsterbgready() {
  3590. if ($('#bg_widgets').length > 0) {
  3591. $('#ugm_dumpster_wrap').attr('style', 'right: 190px !important; top: 64px !important');
  3592. }
  3593. }
  3594.  
  3595. // Box
  3596.  
  3597. var ugm_dive_reward = $('<div id="ugm_dive_reward"></div>').appendTo('body');
  3598. var ugm_dive_close = $('<a id="ugm_dive_close">x</a>').appendTo('body');
  3599.  
  3600. $('#ugm_dive_close').click(function(){
  3601. $(ugm_dive_reward).css({ "display": "none"});
  3602. $(ugm_dive_close).css({ "display": "none"});
  3603. });
  3604.  
  3605. // Timer
  3606.  
  3607. function ugm_dumpster_clock() {
  3608.  
  3609. var ugm_dumpster_current = new Date().getTime();
  3610. var ugm_dumpster_cooldown = parseInt(GM_getValue('dumpster_cooldown', '0'));
  3611.  
  3612. if (ugm_dumpster_current > ugm_dumpster_cooldown) {
  3613. $('#ugm_dumpster_text').css({ "cursor": "pointer" });
  3614. $('#ugm_dumpster_text').html('Dive Now');
  3615.  
  3616. // Dive
  3617.  
  3618. $('#ugm_dumpster_text').click(function(){
  3619. var ugm_dumpster_next = new Date().getTime() + 310000;
  3620. GM_setValue('dumpster_cooldown', ugm_dumpster_next);
  3621.  
  3622. GM_xmlhttpRequest({
  3623. method: "POST",
  3624. data:"mode=showConfirmed",
  3625. url: "https://www.gaiaonline.com/dumpsterdive/",
  3626. headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", },
  3627. onload: function(response) {
  3628.  
  3629. if(!document.getElementById("dumpster_div")){
  3630. var mydiv = document.createElement("div");
  3631. mydiv.id="dumpster_div";
  3632. mydiv.style.display="none";
  3633. document.body.appendChild(mydiv);
  3634. }
  3635.  
  3636. // Reward
  3637.  
  3638. $('#dumpster_div').html(response.responseText);
  3639. var grant_msg = document.getElementById('grant_image')?document.getElementById("header_text").innerHTML +
  3640. "<br/><img src='" +
  3641. document.getElementById('grant_image').src +
  3642. "'/><br/>" +
  3643. "<a href='http://www.gaiaonline.com/marketplace/itemsearch//?search=" +
  3644. document.getElementById('grant_text1').innerHTML.replace(/\d+ /, '').replace(/ /g,'+') + "' style='color: #ddd !important;' target='_blank' >" +
  3645. document.getElementById('grant_text1').innerHTML +
  3646. "</a><br/>" +
  3647. document.getElementById('grant_text2').innerHTML:"The dumpster seems to be empty. Try again later.";
  3648.  
  3649. $(ugm_dive_reward).css({ "display": "block"});
  3650. $(ugm_dive_close).css({ "display": "block"});
  3651. $(ugm_dive_reward).html(grant_msg);
  3652.  
  3653. // Message
  3654.  
  3655. var pm_msg = document.getElementById('grant_text3')?document.createElement('button'):"";
  3656. var donor = document.getElementById('grant_text2').innerHTML.replace('Donated by: ','');
  3657. $(pm_msg).appendTo(ugm_dive_reward);
  3658. $(pm_msg).css({ "display": "block", "font-size": "11px", "height": "23px", "left": "0", "margin": "4px auto", "position": "relative", "right": "0", "width": "80px", });
  3659. $(pm_msg).text('Send Pm');
  3660. $(pm_msg).click(function(){
  3661. $(pm_msg).text('Loading...');
  3662. GM_xmlhttpRequest({
  3663. method: "GET",
  3664. url: "http://www.gaiaonline.com/profile/privmsg.php?mode=post",
  3665. onload: function(response) {
  3666. var parser=new DOMParser();
  3667. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  3668. var pmform = innerDoc.getElementById('entry_form').outerHTML;
  3669. $(pmform).appendTo(ugm_dive_reward);
  3670. $('#ugm_dive_reward #entry_form #username').val(donor);
  3671. $('#ugm_dive_reward #entry_form .subject').val('Dumpster Diving: I got your item!');
  3672. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(1)').css({ "display": "none"});
  3673. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(2)').css({ "display": "none"});
  3674. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(3)').css({ "display": "none"});
  3675. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(4)').css({ "display": "none"});
  3676. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(5)').css({ "display": "none"});
  3677. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(6)').css({ "display": "none"});
  3678. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(8)').css({ "display": "none"});
  3679. $('#ugm_dive_reward #entry_form .forumline > tbody > tr:nth-child(10)').css({ "display": "none"});
  3680. $('#ugm_dive_reward #entry_form #btn_preview').css({ "display": "none"});
  3681. $('#ugm_dive_reward #entry_form #btn_cancel').css({ "display": "none"});
  3682. $('#ugm_dive_reward #entry_form').css({ "left": "-45px", "position": "relative", "top": "-120px", "overflow": "hidden", "height": "181px", "width": "310px"});
  3683. $('#ugm_dive_reward #entry_form table').css("cssText", "width: 200px !important;");
  3684. $('#ugm_dive_reward #entry_form #message').css({ "height": "120px", "width": "280px", "resize": "none", "overflow-y": "auto", "overflow-x": "hidden"});
  3685. $('#ugm_dive_reward #entry_form #message').parent().parent().css({ "text-align": "left"});
  3686. $('#ugm_dive_reward #entry_form .submit_form').css("cssText", "margin-top: -12px !important;");
  3687. $(pm_msg).remove();
  3688. }
  3689. });
  3690. });
  3691. }
  3692. });
  3693. ugm_dumpster_clock();
  3694. });
  3695. } else {
  3696. var ugm_dumpster_timeleft = (ugm_dumpster_cooldown - ugm_dumpster_current);
  3697. var ugm_dumpster_mins = Math.floor((ugm_dumpster_timeleft % 36e5) / 6e4);
  3698. var ugm_dumpster_secs = Math.floor((ugm_dumpster_timeleft % 6e4) / 1000);
  3699.  
  3700. if (ugm_dumpster_secs.toString().length == 1) {
  3701. ugm_dumpster_secs = "0" + ugm_dumpster_secs;
  3702. }
  3703.  
  3704. document.getElementById('ugm_dumpster_text').innerHTML = ugm_dumpster_mins + ":" + ugm_dumpster_secs;
  3705. setTimeout(ugm_dumpster_clock, 1000);
  3706.  
  3707. $('#ugm_dumpster_text').click(function(){ return; });
  3708. }
  3709. }
  3710.  
  3711. ugm_dumpster_clock();
  3712.  
  3713. // Back
  3714.  
  3715. $('#ugm_dumpster_text').click(function(){
  3716. var ugm_dumpster_was = window.location.href;
  3717. GM_setValue('dumpster_where', ugm_dumpster_was);
  3718. });
  3719.  
  3720. $('.gaia_menuitem_dumpsterdive').click(function(){
  3721. var ugm_dumpster_was = window.location.href;
  3722. GM_setValue('dumpster_where', ugm_dumpster_was);
  3723. });
  3724.  
  3725. if ( document.location.pathname.match(/^\/dumpsterdive/) ) {
  3726. var ugm_dumpster_was = GM_getValue('dumpster_where', '');
  3727. var ugm_dumpster_returntext = $('<a id="ugm_dumpster_returnlink">Return to what I was doing</a>').insertAfter('#get_treasure');
  3728. $("#ugm_dumpster_returnlink").attr("href", ugm_dumpster_was);
  3729. }
  3730. }
  3731.  
  3732. /*!
  3733. * Disable Topic Voting
  3734. */
  3735.  
  3736. function ugm_disablevoting() {
  3737. $("#disable_like").prop("checked", true);
  3738. }
  3739.  
  3740. /*!
  3741. * Storage Upgrade
  3742. */
  3743.  
  3744. function ugm_storageupgrade() {
  3745.  
  3746. var element = $('#temp_storage');
  3747. var originalY = element.offset().top;
  3748. var topMargin = 20;
  3749.  
  3750. element.css('position', 'relative');
  3751. $(window).on('scroll', function(event) {
  3752. var scrollTop = $(window).scrollTop();
  3753.  
  3754. element.stop(false, false).animate({
  3755. top: scrollTop < originalY
  3756. ? 0
  3757. : scrollTop - originalY + topMargin
  3758. }, 300);
  3759. });
  3760.  
  3761. }
  3762.  
  3763. /*!
  3764. * Owned Items Indicator
  3765. * Wishlist
  3766. */
  3767.  
  3768. function ugm_wishown(){
  3769.  
  3770. $( document ).ready(function() {
  3771.  
  3772. // Link
  3773.  
  3774. var wishes = document.getElementsByClassName('wish_box');
  3775. var length = wishes.length
  3776. var id;
  3777. var gsi = [];
  3778. var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=';
  3779.  
  3780. for ( i = 0 ; i < length ; i++ ) {
  3781. id = $(wishes[i]).attr('id').match(/\d+/)[0];
  3782. $(wishes[i]).find('a').attr('href', 'http://www.gaiaonline.com/marketplace/itemdetail/' + id);
  3783. $(wishes[i]).find('a').attr('target', '_blank');
  3784. gsi.push('[111,[' + id + ']]');
  3785. }
  3786.  
  3787. url += '[' + gsi.join(',') + ']';
  3788.  
  3789. // Compare
  3790.  
  3791. var itin;
  3792. GM_xmlhttpRequest({
  3793. method: "GET",
  3794. url: url,
  3795. onload: function(response) {
  3796.  
  3797. var legend = document.createElement("span");
  3798. legend.innerHTML = " - Owned";
  3799. legend.style.borderLeft = "13px solid #c7d6ec";
  3800. legend.style.position = "relative";
  3801. legend.style.top = "-4px";
  3802. legend.style.left = "-2px";
  3803. document.getElementById("endline").appendChild(legend);
  3804.  
  3805. var sel = document.createElement("select");
  3806. sel.onchange = dupesel;
  3807. sel.style.width = "100%";
  3808. sel.options[0] = new Option("Choose what to do with items already in your inventory", "chs");
  3809. sel.options[1] = new Option("Change status to bought", "stat");
  3810. sel.options[2] = new Option("Tick the delete checkbox", "del");
  3811. sel.options[3] = new Option("Reset", "reset");
  3812. document.getElementById("endline").appendChild(sel);
  3813.  
  3814. for ( i = 0; (i < length) && (i < 20); i++ ) {
  3815.  
  3816. if (JSON.parse(response.responseText)[i][1]) {
  3817. wishes[i].style.backgroundColor = "#c7d6ec";
  3818. wishes[i].classList.add('wish_arr_owned');
  3819. }
  3820.  
  3821. }
  3822.  
  3823. }
  3824. });
  3825.  
  3826. // Action
  3827.  
  3828. function dupesel() {
  3829.  
  3830. var mode = this.value;
  3831.  
  3832. switch (mode) {
  3833. case 'chs':
  3834. break;
  3835. case 'stat':
  3836. $('.wish_arr_owned').find('select').val('2');
  3837. break;
  3838. case 'del':
  3839. $('.wish_arr_owned').find('.fval input[name*="delete"]').prop('checked', true);
  3840. break;
  3841. case 'reset':
  3842. $('.wish_arr_owned').find('select').val('4');
  3843. $('.wish_arr_owned').find('.fval input[name*="delete"]').prop('checked', false);
  3844. break;
  3845. }
  3846.  
  3847. }
  3848. });
  3849.  
  3850. addGlobalStyle('#gaia_content .wishlist_box .row-even {background-color: #f5f5f5 !important;}');
  3851. }
  3852.  
  3853. /*!
  3854. * Animated Avatar Fix
  3855. */
  3856.  
  3857. function ugm_flashavatars(){
  3858.  
  3859. waitForKeyElements ('#animated_item',flashtoimg);
  3860. function flashtoimg() {
  3861.  
  3862. // Right-click
  3863.  
  3864. $("#animated_item object object img").each(function(){
  3865. $(this).prependTo($(this).parent().parent().parent());
  3866. $(this).css({
  3867. "position": "absolute",
  3868. "opacity": "0"
  3869. });
  3870. $(this).attr('class', 'nonanim');
  3871. });
  3872.  
  3873. // Left-click
  3874.  
  3875. var anim = $(".nonanim").siblings();
  3876. $(anim).each(function(){
  3877. var onm = $(this).attr('onmousedown').match(/\'(.*)\'/)[1];
  3878. $(this).siblings().wrap('<a href="' + onm + '"></a>');
  3879. });
  3880.  
  3881. // NoRedirect
  3882.  
  3883. var animated = $("#animated_item object");
  3884. animated.removeAttr("onmousedown");
  3885. }
  3886. }
  3887.  
  3888. /*
  3889. *! Wishlist Listing Notifier
  3890. */
  3891.  
  3892. function listingalert(){
  3893.  
  3894. // Wishlist
  3895.  
  3896. var wishval = GM_getValue('wishnotifier_wishval', '');
  3897.  
  3898. if (wishval) {
  3899. GM_xmlhttpRequest({
  3900. method: "GET",
  3901. url: "http://www.gaiaonline.com/marketplace/",
  3902. onload: function(response) {
  3903. var parser=new DOMParser();
  3904. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  3905. var wishval = GM_getValue('wishnotifier_wishval', '');
  3906. var listings = innerDoc.getElementById('wishlist').getElementsByClassName("itemListing");
  3907. var names = innerDoc.getElementById('wishlist').getElementsByClassName("itemDescription");
  3908. var toalert = "";
  3909. var i;
  3910. for (i=0;i<wishval;i++) {
  3911. var list_num = parseInt(listings[i].childNodes[1].innerHTML);
  3912. var list_nam = names[i].querySelector('a').innerHTML;
  3913. var list_url= names[i].querySelector('a').id.replace('a_', '');
  3914. if (list_num>0) {
  3915. toalert += "<a href='http://www.gaiaonline.com/marketplace/itemdetail/" + list_url + "'>" + list_nam + "</a> has " + list_num +" listing(s).<br/>";
  3916. }
  3917. }
  3918. if (toalert.length ==0){}
  3919. else {
  3920. var wishlistalert = document.createElement("div");
  3921. wishlistalert.innerHTML = toalert;
  3922. wishlistalert.id ="wishlistnotifier";
  3923. document.body.appendChild(wishlistalert);
  3924.  
  3925. setTimeout(function(){$(wishlistalert).fadeOut();}, 5000);
  3926. }
  3927. }
  3928. });
  3929. }
  3930.  
  3931. // Price
  3932.  
  3933. var idval = GM_getValue('wishnotifier_idval', '');
  3934. var prval = GM_getValue('wishnotifier_priceval', '');
  3935.  
  3936. if ((idval) && (prval)) {
  3937. GM_xmlhttpRequest({
  3938. method: "GET",
  3939. url: "http://www.gaiaonline.com/marketplace/itemdetail/"+idval,
  3940. onload: function(response) {
  3941. var parser=new DOMParser();
  3942. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  3943. var wishval = parseFloat(GM_getValue('wishnotifier_priceval', '').replace(/\,/g,''));
  3944. var lowest = innerDoc.getElementsByClassName('vend_rows_ex_rowA')[0].getElementsByClassName('vend_rows_ex_buy')[0].getElementsByTagName('strong')[0].innerHTML;
  3945. var lp = parseFloat(lowest.replace(/\,/g,''));
  3946. var itemname = innerDoc.getElementById('vend_item_title').innerHTML.replace(/ *\([^)]*\) */g, "").trim();
  3947. var toalert = "";
  3948. if (lp < wishval) {
  3949. toalert+= "<a href='http://www.gaiaonline.com/marketplace/itemdetail/" + idval + "'>" + itemname + "</a> has a listing worth " + lowest + ".<br/>";
  3950. }
  3951. if (toalert.length ==0){}
  3952. else {
  3953. var wishlistalert = document.createElement("div");
  3954. wishlistalert.innerHTML = toalert;
  3955. wishlistalert.id ="wishlistnotifier2";
  3956. document.body.appendChild(wishlistalert);
  3957.  
  3958. setTimeout(function(){$(wishlistalert).fadeOut();}, 5000);
  3959. }
  3960. }
  3961. });
  3962. }
  3963. }
  3964.  
  3965. /*!
  3966. * Owned Listing Quantity
  3967. */
  3968.  
  3969. function ugm_olq() {
  3970. if ( $('strong:contains("You own this item.")').length ) {
  3971. var msg = $('strong:contains("You own this item.")')
  3972. num = msg.closest('p').attr('title').match(/\d+/)[0];
  3973. $(msg).html("You own " + num + " of this item.");
  3974. }
  3975. }
  3976.  
  3977. /*!
  3978. * Owned Items Indicator
  3979. * Market Search
  3980. */
  3981.  
  3982. function ugm_msoii() {
  3983.  
  3984. var items = document.getElementsByClassName('sparkles_container');
  3985. var id;
  3986. var gsi = [];
  3987. var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=';
  3988.  
  3989. for ( i = 0 ; i < items.length ; i++ ) {
  3990. id = $(items[i]).find('a:first').attr('href').match(/\d+/)[0];
  3991. gsi.push('[111,[' + id + ']]');
  3992. }
  3993.  
  3994. url += '[' + gsi.join(',') + ']';
  3995.  
  3996. GM_xmlhttpRequest({
  3997. method: "GET",
  3998. url: url,
  3999. onload: function(response) {
  4000.  
  4001. for ( i = 0; i < items.length; i++ ) {
  4002.  
  4003. if (JSON.parse(response.responseText)[i][1]) {
  4004. $(items[i]).closest('.item_rowA,.item_rowB')[0].style.setProperty ("background-color", "#c7d6ec", "important");
  4005. }
  4006.  
  4007. }
  4008.  
  4009. }
  4010. });
  4011.  
  4012. addGlobalStyle('#gaia_content .item_rowB {background: #f5f5f5; }');
  4013. }
  4014.  
  4015. /*!
  4016. * Detailed Inventory Items
  4017. */
  4018.  
  4019. function ugm_idml(){
  4020.  
  4021. function ugm_idml_detailed(url,div){
  4022.  
  4023. $('<div id="idmld_text" style="font-size: 11px;">Fetching detailed information...</div>').appendTo(div);
  4024.  
  4025. GM_xmlhttpRequest({
  4026. method: "GET",
  4027. url: url,
  4028. onload: function(response) {
  4029. var parser=new DOMParser();
  4030. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  4031. var msg = '';
  4032. var pq = innerDoc.getElementsByTagName('p');
  4033. var search = "You own this item.";
  4034. var found;
  4035. var lq = innerDoc.getElementById('listing_count').innerHTML.replace(/(^\d+)(.+$)/,'$1');
  4036.  
  4037. for (var i = 0; i < pq.length; i++) {
  4038. if (pq[i].innerHTML.indexOf(search) > -1) {
  4039. found = pq[i].getAttribute('title').match(/\d+/)[0];
  4040. msg = 'Quantity You Own: ' + found + '<br/>';
  4041. break;
  4042. }
  4043. }
  4044.  
  4045. if (( innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy').length > 0 ) && ( innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy')[0].getElementsByTagName('strong').length > 0 )) {
  4046. var lbp = innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy')[0].getElementsByTagName('strong')[0].innerHTML;
  4047. msg += 'Lowest Buy Price: ' + lbp + 'g<br/>';
  4048. } else {
  4049. msg += 'Lowest Buy Price: None<br/>';
  4050. }
  4051.  
  4052. if ( innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy').length > 0 ) {
  4053. msg += 'Listings: ' + lq + '<br/>';
  4054. } else {
  4055. msg += 'Listings: None<br/>';
  4056. }
  4057.  
  4058. $('#idmld_text').html(msg);
  4059. }
  4060. });
  4061. }
  4062.  
  4063. waitForKeyElements ('#pricing',ugm_iuln);
  4064. function ugm_iuln(){
  4065. var ugm_iuln_link = $('a:contains("Sell on Marketplace")').attr('href');
  4066. var str = ugm_iuln_link;
  4067. num = +str.match(/item\_id\=(\d+)/)[1];
  4068. var ugm_iuln_name = document.getElementById('basic').getElementsByTagName("h3")[0];
  4069. $(ugm_iuln_name).wrap("<a target='_blank' href='http://www.gaiaonline.com/marketplace/itemdetail/" + num + "'></a>");
  4070. $(ugm_iuln_name).css({ "color": "#000000", "text-decoration": "underline" });
  4071.  
  4072. var url = "http://www.gaiaonline.com/marketplace/itemdetail/" + num;
  4073. var div = "#pricing";
  4074. ugm_idml_detailed(url,div);
  4075. }
  4076. waitForKeyElements (".choice_text",iuln_riglinks);
  4077. function iuln_riglinks() {
  4078. var item_id = document.getElementById('qa_giftitem').href.match(/item\=(.*)s/)[1];
  4079. $('.choice_text h3').wrap( "<a target='_blank' style='color: #000000 !important;' href='http://www.gaiaonline.com/marketplace/itemdetail/" + item_id + "/'></a>" );
  4080.  
  4081. $('#choice_items > div > a.use').each(function(){
  4082. var a = $(this).attr('href').match(/use\/.*\/(.*)\?/)[1];
  4083. var p = $(this).next();
  4084. $(p).wrap("<a target='_blank' style='color: #000000 !important;' href='http://www.gaiaonline.com/marketplace/itemdetail/" + a + "/'></a>" );
  4085. });
  4086.  
  4087. var url = "http://www.gaiaonline.com/marketplace/itemdetail/" + item_id;
  4088. var div = "#choice";
  4089. ugm_idml_detailed(url,div);
  4090. }
  4091. waitForKeyElements (".list_text",iuln_bundlelinks);
  4092. function iuln_bundlelinks() {
  4093. var item_id = document.getElementById('qa_giftitem').href.match(/item\=(.*)s/)[1];
  4094. $('.list_text h3').wrap( "<a target='_blank' style='color: #000000 !important;' href='http://www.gaiaonline.com/marketplace/itemdetail/" + item_id + "/'></a>" );
  4095. $('td:not(.qty,.img)').each(function(){
  4096. var url = $(this).html();
  4097. $(this).wrap("<a target='_blank' style='color: #000000 !important;' href='http://www.gaiaonline.com/marketplace/itemsearch//?search=" + url + "/'></a>");
  4098. });
  4099.  
  4100. var url = "http://www.gaiaonline.com/marketplace/itemdetail/" + item_id;
  4101. var div = ".list_text";
  4102. ugm_idml_detailed(url,div);
  4103. }
  4104. }
  4105.  
  4106. /*!
  4107. * Private Message Cooldown
  4108. */
  4109.  
  4110. function ugm_pmcd(){
  4111.  
  4112. if( $('#btn_send').length ) {
  4113.  
  4114. var pmbtn = document.getElementById('btn_send').getElementsByTagName('span')[0];
  4115.  
  4116. function ugm_pmcd_clock() {
  4117.  
  4118. var ugm_pmcd_current = new Date().getTime();
  4119. var ugm_pmcd_cooldown = parseInt(GM_getValue('pmcd_cooldown', '0'));
  4120.  
  4121. if (ugm_pmcd_current > ugm_pmcd_cooldown) {
  4122.  
  4123. pmbtn.innerHTML = "Send";
  4124. $('#btn_send').click(function(){
  4125. var ugm_pm_next = new Date().getTime() + 60500;
  4126. GM_setValue('pmcd_cooldown', ugm_pm_next);
  4127. ugm_pmcd_clock();
  4128. });
  4129. } else {
  4130. var ugm_pmcd_timeleft = (ugm_pmcd_cooldown - ugm_pmcd_current);
  4131. var ugm_pmcd_mins = Math.floor((ugm_pmcd_timeleft % 36e5) / 6e4);
  4132. var ugm_pmcd_secs = Math.floor((ugm_pmcd_timeleft % 6e4) / 1000);
  4133. if (ugm_pmcd_secs.toString().length == 1) { ugm_pmcd_secs = "0" + ugm_pmcd_secs; }
  4134. pmbtn.innerHTML = ugm_pmcd_mins + ":" + ugm_pmcd_secs;
  4135. setTimeout(ugm_pmcd_clock, 1000);
  4136. }
  4137. }
  4138. ugm_pmcd_clock();
  4139. }
  4140. }
  4141.  
  4142. /*!
  4143. * Multiquote
  4144. */
  4145.  
  4146. function ugm_multiquote() {
  4147.  
  4148. var tipbtn = document.getElementsByClassName("tipbox");
  4149.  
  4150. for ( i = 0 ; i < tipbtn.length ; i++ ) {
  4151. var tipli = tipbtn[i].parentNode;
  4152. $("<li><a title='Multiquote' class='cta-button-sm post-quote multiquote' style='position: relative; left: 0px; width: 21px; text-align:center; cursor: pointer; font-weight: bold; font-family: tahoma;'><span>+</span></a></li>").insertBefore(tipli);
  4153. }
  4154.  
  4155. $('.multiquote').click(function() {
  4156. if (this.getElementsByTagName('span')[0].innerHTML == "+") {
  4157. this.getElementsByTagName('span')[0].innerHTML = "-";
  4158. $(this).addClass('toquote');
  4159. } else {
  4160. this.getElementsByTagName('span')[0].innerHTML = "+";
  4161. $(this).removeClass('toquote');
  4162. }
  4163. });
  4164.  
  4165. $('.qa_quickreply').click(function() {
  4166. var allquoted = "";
  4167. $('.toquote').each(function () {
  4168. var username = this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('div')[0].getElementsByTagName('div')[0].getElementsByTagName('div')[0].getElementsByTagName('div')[0].innerHTML;
  4169. allquoted+= '[quote="' + username + '"][/quote]\n';
  4170. });
  4171. setTimeout(function(){document.getElementById("qr_text").value = allquoted;}, 100);
  4172. });
  4173. }
  4174.  
  4175. /*!
  4176. * Daily Chance Upgrade
  4177. */
  4178.  
  4179. function ugm_dailychance() {
  4180.  
  4181. if ( $("#dailyChance_clawMachine").length ) {
  4182.  
  4183. $('#dailyChance_clawMachine').css({"background-image":"url('http://i.imgur.com/7mBgsFO.gif')"});
  4184. $('#dailyChance_clawMachine').removeAttr('href');
  4185. $('<div id="dailychanceupgrade_trigger"></div>' ).insertBefore("#dailyChance_clawMachine");
  4186. $('#dailychanceupgrade_trigger').css({"height":"97px","width":"69px","position":"absolute","cursor":"pointer"});
  4187. $('<div id="dailychanceupgrade_div">' +
  4188. '<div id="dcu_h3">Daily Chance Upgrade</div>' +
  4189. '<table>' +
  4190. '<tbody>' +
  4191. '<tr>' +
  4192. '<td>Home</td>' +
  4193. '<td>My Gaia</td>' +
  4194. '<td>Forums</td>' +
  4195. '<td>Games</td>' +
  4196. '<td>World</td>' +
  4197. '</tr>' +
  4198. '<tr>' +
  4199. '<td id="dcu_r1" class="dcu_r"></td>' +
  4200. '<td id="dcu_r2" class="dcu_r"></td>' +
  4201. '<td id="dcu_r3" class="dcu_r"></td>' +
  4202. '<td id="dcu_r4" class="dcu_r"></td>' +
  4203. '<td id="dcu_r5" class="dcu_r"></td>' +
  4204. '</tr>' +
  4205. '</tbody>' +
  4206. '</table>' +
  4207. '<table id="dcu_t2">' +
  4208. '<tbody>' +
  4209. '<tr>' +
  4210. '<td>Shops</td>' +
  4211. '<td>Mobile</td>' +
  4212. '<td>GoFusion</td>' +
  4213. '<td>GCash</td>' +
  4214. '</tr>' +
  4215. '<tr>' +
  4216. '<td id="dcu_r8" class="dcu_r"></td>' +
  4217. '<td id="dcu_r12" class="dcu_r"></td>' +
  4218. '<td id="dcu_r1271" class="dcu_r"></td>' +
  4219. '<td id="dcu_r1279" class="dcu_r"></td>' +
  4220. '</tr>' +
  4221. '</tbody>' +
  4222. '</table>' +
  4223. '</div>').appendTo("body");
  4224. $('<div id="dailychanceupgrade_trigger"></div>').insertBefore("#dailyChance_clawMachine");
  4225. $( '<div id="dailychanceupgrade_shadow"></div>' ).appendTo("body");
  4226.  
  4227. $('#dailychanceupgrade_trigger').click(function() {
  4228. $('#dailychanceupgrade_div').css("display", "block");
  4229. $('#dailychanceupgrade_shadow').css("display", "block");
  4230. });
  4231.  
  4232. $('#dailychanceupgrade_shadow').click(function() {
  4233. $('#dailychanceupgrade_div').fadeOut('fast');
  4234. $('#dailychanceupgrade_shadow').fadeOut('fast');
  4235. });
  4236.  
  4237. $('#dailychanceupgrade_shadow').css({"position": "absolute","top": "0px","left": "0px", "width": "100%", "height": "100%","background": "#000","opacity": "0.7","filter": "alpha(opacity=0)","z-index": "191","display": "none"});
  4238. $('#dailychanceupgrade_div').css({"display":"none", "background": "rgba(45, 120, 191, 0.5)","border": "1px solid #40a6ff","height": "351px","left": "0","margin": "0 auto","padding": "4px","position": "fixed","right": "0","top": "150px","width": "560px","z-index": "192"});
  4239. $('#dcu_h3').css({"background": "#5da7da","border": "1px solid #226dba","color": "#f0f7fb","font-size": "14px","font-weight": "bold","height": "17px","margin-bottom": "15px","outline": "1px solid #40a6ff","padding": "7px 0","position": "relative","text-align": "center","width": "558px"});
  4240. $('#dailychanceupgrade_div table').css({"border-collapse": "separate","border-spacing": "10px 0px","height": "40%","left": "0","margin": "0 auto","position": "relative","right": "0","width": "auto"});
  4241. $('#dcu_t2').css({"top":"11px"});
  4242. $('#dailychanceupgrade_div td').css({"padding": "1px","text-align": "center","width":"100px","border-spacing":"3px","font-weight":"bold", "max-width": "100px"});
  4243. $('#dailychanceupgrade_div tr:even').css({"height":"30%","background":"rgba(0, 0, 0, 0.4)"});
  4244. $('#dailychanceupgrade_div tr:even td').css({"font-size": "12px", "color":"#fff","cursor":"default"});
  4245. $('#dailychanceupgrade_div tr:odd').css({"height":"70%","background":"transparent"});
  4246. $('#dailychanceupgrade_div tr:odd td').css({"font-size": "11px", "background":"rgba(0, 0, 0, 0.4) url('http://i.imgur.com/jiO9ncH.png') no-repeat scroll 25px 30px","text-shadow": "0 -1px 2px #fff, 0 1px 2px #fff, 1px 0 2px #fff, -1px 0 2px #fff", "color": "#555", "cursor": "pointer" });
  4247.  
  4248. $('.dcu_r').click(function() {
  4249. $(this).css({"background-position":"-84px 13px"});
  4250. var idnum = $(this).attr('id').match(/\d+/)[0];
  4251. GM_xmlhttpRequest({
  4252. method: "GET",
  4253. url: "http://www.gaiaonline.com/dailycandy/pretty/?action=issue&list_id=" + idnum,
  4254. onload: function(response) {
  4255. var parser=new DOMParser();
  4256. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  4257. var reward = innerDoc.getElementsByClassName('item-name');
  4258.  
  4259. if ($(reward)[0]){
  4260. document.getElementById('dcu_r'+idnum).innerHTML = reward[0].innerHTML;
  4261. } else {
  4262. document.getElementById('dcu_r'+idnum).innerHTML = "Reward claimed.";
  4263. }
  4264. }
  4265. });
  4266. });
  4267. }
  4268. }
  4269.  
  4270. /*!
  4271. * Avatar Custom Preview
  4272. */
  4273.  
  4274. function ugm_avatarpreviews() {
  4275.  
  4276.  
  4277. $('#background').remove();
  4278. $('#animation').html($('#animation').html().replace('Show Animation', ' Show Animation & Custom Previews'));
  4279. $('#animation input').css({"top":"2px","position":"relative"});
  4280. $('<div id="custombg"></div>').insertAfter("#av_anim_preview #animated_item");
  4281. $('#custombg').css({"height":"300px","width":"239px", "position":"absolute","top":"152px","z-index":"1"});
  4282. $('#av_anim_preview #animated_item').css({"z-index":"2","position":"relative"});
  4283. $('<select id="avabg" style="width:100px;margin-top:7px">' +
  4284. '<option value="avabg0">Default</option>' +
  4285. '<option value="avabg1">Small</option>' +
  4286. '<option value="avabg2">Room</option>' +
  4287. '<option value="avabg3">Forums</option>' +
  4288. '<option value="avabg4">Rally</option>' +
  4289. '<option value="avabg5">Towns 2</option>' +
  4290. '<option value="avabg6">Hollywood</option>' +
  4291. '</select>' +
  4292. '<label style="position:relative;left:10px;"><input type="checkbox" value="persist" id="persist" style="position:relative;top:2px"> Persist Preview</label>').appendTo("#animation");
  4293.  
  4294. // Effects
  4295.  
  4296. $('#avabg').change(optionchange);
  4297. $('#btn_cancel, #undo, #av_footer a, #av_ss').click(function() {
  4298. if (document.getElementById('persist').checked) {
  4299. setTimeout(optionchange, 2500)
  4300. } else {
  4301. reset();
  4302. }
  4303. });
  4304. $('#av_mouth, #av_stance, #outfits_tab, #nav_page1 li').click(reset);
  4305.  
  4306. // Change
  4307.  
  4308. function optionchange() {
  4309.  
  4310. var choice = $('#avabg').val();
  4311. switch (choice) {
  4312. case "avabg0":
  4313. $('#AnimatedItemLoaderPreview').attr({height:"300px",width:"240px"});
  4314. $('#custombg').css({"background":"white"});
  4315. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"0","left":"0"});
  4316. break;
  4317. case "avabg1":
  4318. $('#AnimatedItemLoaderPreview').attr({height:"150px",width:"120px"});
  4319. $('#custombg').css({"background":"white"});
  4320. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"140px","left":"55px"});
  4321. break;
  4322. case "avabg2":
  4323. $('#AnimatedItemLoaderPreview').attr({height:"300px",width:"240px"});
  4324. $('#custombg').css({"background":"url('http://s.cdn.gaiaonline.com/images/inventory/il_dressing_room_240x300.jpg')"});
  4325. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"0","left":"0"});
  4326. break;
  4327. case "avabg3":
  4328. $('#AnimatedItemLoaderPreview').attr({height:"150px",width:"120px"});
  4329. $('#custombg').css({"background":"url('http://i.imgur.com/JUJ1Ahw.png')"});
  4330. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"63px","left":"102px"});
  4331. break;
  4332. case "avabg4":
  4333. $('#AnimatedItemLoaderPreview').attr({height:"150px",width:"120px"});
  4334. $('#custombg').css({"background":"url('http://i.imgur.com/ndtAo6P.png')"});
  4335. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"63px","left":"102px"});
  4336. break;
  4337. case "avabg5":
  4338. $('#AnimatedItemLoaderPreview').attr({height:"150px",width:"120px"});
  4339. $('#custombg').css({"background":"url('http://i.imgur.com/YEAhVL0.png')"});
  4340. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"63px","left":"102px"});
  4341. break;
  4342. case "avabg6":
  4343. $('#AnimatedItemLoaderPreview').attr({height:"150px",width:"120px"});
  4344. $('#custombg').css({"background":"url('http://i.imgur.com/64qhCtG.png')"});
  4345. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"63px","left":"102px"});
  4346. break;
  4347. }
  4348. }
  4349.  
  4350. // Reapplying
  4351.  
  4352. waitForKeyElements ('.clear',inventoryload);
  4353. function inventoryload() {
  4354.  
  4355. // With Poses
  4356.  
  4357. waitForKeyElements ('.container',withposes);
  4358. function withposes() {
  4359. $('.container ul li').click(function() {
  4360. if (document.getElementById('persist').checked) {
  4361. setTimeout(optionchange, 2500)
  4362. } else {
  4363. reset();
  4364. }
  4365. });
  4366. }
  4367.  
  4368. // Without Poses
  4369.  
  4370. $('.inventorymodule-itemdelegate.inInventory').click(function() {
  4371. if (document.getElementById('persist').checked) {
  4372. setTimeout(optionchange, 2500)
  4373. } else {
  4374. reset();
  4375. }
  4376. });
  4377. }
  4378.  
  4379. // Reset
  4380.  
  4381. function reset() {
  4382. $("#avabg").val("avabg0");
  4383. $('#AnimatedItemLoaderPreview').attr({height:"300px",width:"240px"});
  4384. $('#custombg').css({"background":"white"});
  4385. $('#AnimatedItemLoaderPreview').css({"position":"relative","top":"0","left":"0"});
  4386. }
  4387. }
  4388.  
  4389. /*!
  4390. * Owned Items Indicator
  4391. * Userstore
  4392. */
  4393.  
  4394. function ugm_uoi() {
  4395.  
  4396. var items = document.getElementsByClassName('sparkles_container');
  4397. var id;
  4398. var gsi = [];
  4399. var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=';
  4400.  
  4401. for ( i = 0 ; i < items.length ; i++ ) {
  4402. id = $(items[i]).find('a:first').attr('href').match(/\d+/)[0];
  4403. gsi.push('[111,[' + id + ']]');
  4404. }
  4405.  
  4406. url += '[' + gsi.join(',') + ']';
  4407.  
  4408. GM_xmlhttpRequest({
  4409. method: "GET",
  4410. url: url,
  4411. onload: function(response) {
  4412.  
  4413. for ( i = 0; i < items.length; i++ ) {
  4414.  
  4415. if (JSON.parse(response.responseText)[i][1]) {
  4416. $(items[i]).closest('.vend_rows_sh_rowA')[0].style.setProperty ("background-color", "#c7d6ec", "important");
  4417. }
  4418.  
  4419. }
  4420.  
  4421. }
  4422. });
  4423.  
  4424. }
  4425.  
  4426. /*!
  4427. * Guild New Forum Layout
  4428. */
  4429.  
  4430. function ugm_gfu() {
  4431.  
  4432. addGlobalStyle('.guilds-forum-topic-delegate:nth-child(odd){background:#f8f8f8 !important}');
  4433. addGlobalStyle('.guilds-forum-topic-delegate:nth-child(even){background:#ffffff !important}');
  4434. addGlobalStyle('.row1.topic-title-link-cell{background:transparent !important}');
  4435. addGlobalStyle('.guilds-forum-topic-delegate>td:nth-child(2) span{font-size:13px !important}');
  4436. addGlobalStyle('.name{font-size:13px !important}');
  4437. addGlobalStyle('.name a{text-decoration:none !important}');
  4438. addGlobalStyle('.guilds-topic-list-last-post-column{background:transparent !important;text-align:left !important}');
  4439. addGlobalStyle('.guilds-forum-topic-delegate{height:32px !important}');
  4440. addGlobalStyle('.guilds-topic-list-last-post-column span{font-size:11px !important}');
  4441. addGlobalStyle('.guilds-topic-list-last-post-column span a{text-decoration:none !important}');
  4442. addGlobalStyle('.guilds-forum-topic-delegate>td:nth-child(2){text-align:center !important}');
  4443. addGlobalStyle('#guild_header{top:10px !important;margin-bottom:20px !important;width:96.6% !important}');
  4444. addGlobalStyle('#content{background:#e4ded8 !important; padding-right:25%}');
  4445. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody>tr>td:nth-child(1){background:#fff !important;}');
  4446. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody>tr>td:nth-child(1)>img{display:none !important;}');
  4447. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1){background:#fff !important;}');
  4448. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td{background:#bed4e8 !important;border-top: 8px solid #fff !important;font-weight: bold !important;padding: 5px 19px !important}');
  4449. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td>img{display:none !important;}');
  4450. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(1):after{content:"Topic";}');
  4451. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2){text-indent: 11px}');
  4452. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2):after{content:"Replies";}');
  4453. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(3){text-indent: -18px}');
  4454. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(3):after{content:"Author"; text-indent: -18px}');
  4455. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(4){text-indent: -18px}');
  4456. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(4):after{content:"Last Post";}');
  4457. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(3){background: #fff !important;}');
  4458. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1)>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(3)>img{display: none !important;}');
  4459. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(2){display:none !important;}');
  4460. addGlobalStyle('#guilds-topic-list-table>tbody:nth-child(1)>tr:nth-child(1)>td:nth-child(2)>table:nth-child(1){position:relative !important; top: 8px !important;}');
  4461.  
  4462. $( document ).ready(function() {
  4463.  
  4464. $("img[src$='http://s.cdn.gaiaonline.com/images/template/icons/icon_minipost.gif']").parent().addClass("hasgoto");
  4465. $('.hasgoto>img').remove();
  4466. $('.hasgoto').css({"font-size":"11px","letter-spacing":"2px"});
  4467. $('.hasgoto>a').css({"text-decoration":"none"});
  4468. $('.hasgoto').removeClass('gensmall');
  4469. $('.hasgoto:contains("Go to page:")').each(function(){ $(this).html($(this).html().split("Go to page:").join("")); });
  4470. $('.gensmall').css({"font-size": "11px"});
  4471. $('#guilds-subforum-list-table').parent().siblings().remove();
  4472. $('#guilds-subforum-list-table').parent().parent().parent().parent().siblings().remove();
  4473. $('#guilds-subforum-list-table').parent().css({"padding": "7px","background":"#f3faff","border":"2px solid #b0c0fb"});
  4474. $('#guilds-subforum-list-table a').css({"text-decoration": "none","color":"#3e53a2","font-weight":"bold","font-size":"12px"});
  4475. addGlobalStyle('#guilds-subforum-list-table>tbody>tr{background:transparent !important;}');
  4476. $('#guilds-subforum-list-table').prepend( "<tbody><tr><td style='padding:2px 0 10px 4px;font-weight:bold;'>Subforums:<td></tr></tbody>" );
  4477. $('#guilds-subforum-list-table>tbody:nth-child(2)>tr').css({"display": "inline-table","width":"40%","margin-left":"50px"});
  4478. $('#guilds-subforum-list-table>tbody:nth-child(2)>tr:nth-child(1)').css({"display": "none"});
  4479. $('#guilds-subforum-list-table .folder_icon').css({"background": "url('http://s.cdn.gaiaonline.com/images/forum/ic_subforum.gif')","height":"15px","width":"16px"});
  4480. $('.nav').css({"font-size": "14px","color":"#3e53a2","text-decoration":"none","position":"relative","top":"7px"});
  4481. $('span.nav:contains("Page")').css({"display": "none"});
  4482. $('span.nav').html(' » ');
  4483. $('span.nav').css({"color":"#000000"});
  4484. var announcement_icon = $("img[src$='http://s.cdn.gaiaonline.com/images/template/folder_announce.gif']");
  4485. $('<span class="announcement_icon"></span>').insertBefore(announcement_icon);
  4486. $('.announcement_icon').css({"background":"url('http://s.cdn.gaiaonline.com/images/common/thread-icons-sprite.png') 0 -18px","display":"block","width":"19px","height":"18px"});
  4487. announcement_icon.remove();
  4488. var sticky_icon = $("img[src$='http://s.cdn.gaiaonline.com/images/template/folder_sticky.gif']");
  4489. $('<span class="sticky_icon"></span>').insertBefore(sticky_icon);
  4490. $('.sticky_icon').css({"background":"url('http://s.cdn.gaiaonline.com/images/common/thread-icons-sprite.png') 0 -108px","display":"block","width":"19px","height":"18px"});
  4491. sticky_icon.remove();
  4492. var folder_new_icon = $("img[src$='http://s.cdn.gaiaonline.com/images/template/folder_new.gif']");
  4493. $('<span class="folder_new_icon"></span>').insertBefore(folder_new_icon);
  4494. $('.folder_new_icon').css({"background":"url('http://s.cdn.gaiaonline.com/images/common/thread-icons-sprite.png') 0 -72px","display":"block","width":"19px","height":"18px"});
  4495. folder_new_icon.remove();
  4496. var new_hot_icon = $("img[src$='http://s.cdn.gaiaonline.com/images/template/folder_new_hot.gif']");
  4497. $('<span class="new_hot_icon"></span>').insertBefore(new_hot_icon);
  4498. $('.new_hot_icon').css({"background":"url('http://s.cdn.gaiaonline.com/images/common/thread-icons-sprite.png') 0 -72px","display":"block","width":"19px","height":"18px"});
  4499. new_hot_icon.remove();
  4500. var hot_icon = $("img[src$='http://s.cdn.gaiaonline.com/images/template/folder_hot.gif']");
  4501. $('<span class="hot_icon"></span>').insertBefore(hot_icon);
  4502. $('.hot_icon').css({"background":"url('http://s.cdn.gaiaonline.com/images/common/thread-icons-sprite.png') 0 0","display":"block","width":"19px","height":"18px"});
  4503. hot_icon.remove();
  4504. var folder_icon = $("img[src$='http://s.cdn.gaiaonline.com/images/template/folder.gif']");
  4505. $('<span class="folder_icon"></span>').insertBefore(folder_icon);
  4506. $('.folder_icon').css({"background":"url('http://s.cdn.gaiaonline.com/images/common/thread-icons-sprite.png') 0 0","display":"block","width":"19px","height":"18px"});
  4507. folder_icon.remove();
  4508. });
  4509. }
  4510.  
  4511. /*!
  4512. * Guild New Forum Layout
  4513. * Topics
  4514. */
  4515.  
  4516. function ugm_gfut() {
  4517. $('.name').css({"font-size": "12px"});
  4518. var title = document.getElementsByClassName('user_avatar');
  4519. for (i = 0; i < title.length ; i++) {
  4520. var tt = document.getElementsByClassName('user_avatar')[i].getElementsByTagName('span')[1];
  4521. if( !$.trim( $(tt).html() ).length ) { tt.innerHTML = "Member"; }
  4522. tt.setAttribute("style", "color: #999;"); }
  4523. $('.maintitle').parent().css({"background": "rgba(0, 0, 0, 0) url('http://s.cdn.gaiaonline.com/images/forum/forums_title_bg_895x55.jpg') no-repeat scroll 0 16px","border-top": "1px dotted #97a3cb","height": "70px","text-indent": "54px","width":"100%"});
  4524. $('.gensmall').css({"font-size": "11px"});
  4525. $('.nav').css({"font-size": "14px","color":"#3e53a2","text-decoration":"none","font-weight":"bold"});
  4526. }
  4527.  
  4528. /*!
  4529. * Guild Quick Reply BBCodes
  4530. */
  4531.  
  4532. function ugm_gqr() {
  4533.  
  4534. $('#qr_container').css({ "width": "560px", "background-position": "87px 0px" });
  4535. $('#qr_text').css({ "width": "528px" });
  4536.  
  4537. // BBCode Buttons
  4538.  
  4539. $('<div id="qr_bbdiv">'+
  4540. '<a id="qrbold" class="qr_bbcodes"></a>' +
  4541. '<a id="qritalic" class="qr_bbcodes"></a>' +
  4542. '<a id="qrunderline" class="qr_bbcodes"></a>' +
  4543. '<a id="qrstrike" class="qr_bbcodes"></a>' +
  4544. '<a id="qrcenter" class="qr_bbcodes"></a>' +
  4545. '<a id="qrimg" class="qr_bbcodes"></a>' +
  4546. '<a id="qrspoiler" class="qr_bbcodes"></a>'+
  4547. '<a id="qrurl" class="qr_bbcodes"></a>'+
  4548. '</div>').appendTo('#qr_container');
  4549.  
  4550. // BBCode Functions
  4551.  
  4552. $('#qrbold').click(function() { wrapText("qr_text", "[b]", "[/b]"); });
  4553. $('#qritalic').click(function() { wrapText("qr_text", "[i]", "[/i]"); });
  4554. $('#qrunderline').click(function() { wrapText("qr_text", "[u]", "[/u]"); });
  4555. $('#qrstrike').click(function() { wrapText("qr_text", "[strike]", "[/strike]"); });
  4556. $('#qrleft').click(function() { wrapText("qr_text", "[align=left]", "[/align]"); });
  4557. $('#qrcenter').click(function() { wrapText("qr_text", "[center]", "[/center]"); });
  4558. $('#qrright').click(function() { wrapText("qr_text", "[align=right]", "[/align]"); });
  4559. $('#qrimg').click(function() { wrapText("qr_text", "[img]", "[/img]"); });
  4560. $('#qrspoiler').click(function() { wrapText("qr_text", "[spoiler]", "[/spoiler]"); });
  4561. $('#qrurl').click(function() { wrapText('qr_text', '[url=]', '[/url]'); });
  4562.  
  4563. }
  4564.  
  4565. /*!
  4566. * Equiped Items BBCode
  4567. */
  4568.  
  4569. function ugm_equipbb() {
  4570.  
  4571. waitForKeyElements ('#findings',equipbb);
  4572.  
  4573. function equipbb() {
  4574.  
  4575. $('<div class="cta_link" id="equipbb">Get BBCode</div>').insertBefore('#show_off_link');
  4576. $('#equipbb').css({"position": "relative","top":"0","left":"0","cursor":"pointer","margin-top":"5px"});
  4577. $('#equipbb').click(function() {
  4578. var ownd = document.getElementsByClassName('equipped-own')[0].getElementsByTagName('li');
  4579. var pose = "";
  4580. var name = "";
  4581. var thum = "";
  4582. var hed1 = "Linked Thumbnails";
  4583. var hed2 = "Linked Names";
  4584. var hed3 = "Thumbnails";
  4585. for (var i = 0; i < ownd.length; i++) {
  4586. pose += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + ownd[i].getAttribute('data-item') + "/][img]http:"+ ownd[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img][/url]";
  4587. name += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + ownd[i].getAttribute('data-item') + "/]"+ ownd[i].getElementsByTagName('img')[0].getAttribute('alt') + "[/url]" + "\n";
  4588. thum += "[img]http:"+ ownd[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img]";
  4589. }
  4590. if ( $( ".equipped-try" ).length ) {
  4591. var tryd = document.getElementsByClassName('equipped-try')[0].getElementsByTagName('li');
  4592. for (var i = 0; i < tryd.length; i++) {
  4593. pose += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + tryd[i].getAttribute('data-item') + "/][img]http:"+ tryd[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img][/url]";
  4594. name += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + tryd[i].getAttribute('data-item') + "/]"+ tryd[i].getElementsByTagName('img')[0].getAttribute('alt') + "[/url]" + "\n";
  4595. thum += "[img]http:"+ tryd[i].getElementsByTagName('img')[0].getAttribute('src') + "[/img]";
  4596. }
  4597. }
  4598. ugm_global_bbcodegen(pose, name, thum, hed1, hed2, hed3);
  4599. });
  4600. }
  4601. }
  4602.  
  4603. /*!
  4604. * Tip Cooldown
  4605. */
  4606.  
  4607. function ugm_tipcd() {
  4608.  
  4609. $('.tipbox a').css({"width":"58px","text-align":"center"});
  4610.  
  4611. waitForKeyElements ('.tipbox_button_yes',tipready);
  4612. function tipready() {
  4613. $('.tipbox_button_yes').click(function(){
  4614. var tip_next = new Date().getTime() + 10500;
  4615. GM_setValue('tipcd_cooldown', tip_next);
  4616. tiptimer();
  4617. });
  4618. }
  4619.  
  4620. function tiptimer() {
  4621. var tip_time = new Date().getTime();
  4622. var tip_cooldown = parseInt(GM_getValue('tipcd_cooldown', '0'));
  4623. if (tip_time > tip_cooldown) {
  4624. $('.tipbox a span').html('Tip Post');
  4625. $('.tipbox a').removeClass('disabled');
  4626. } else {
  4627. $('.tipbox a').addClass('disabled');
  4628. var tip_left = (tip_cooldown - tip_time);
  4629. var tip_secs = Math.floor((tip_left % 6e4) / 1000);
  4630. var tipmsg = tip_secs;
  4631. $('.tipbox').each(function (){
  4632. $('.tipbox a span').html(tipmsg);
  4633. });
  4634. setTimeout(tiptimer, 1000);
  4635. }
  4636. }
  4637. tiptimer();
  4638. }
  4639.  
  4640. /*!
  4641. * User Dropdown Menu Upgrade
  4642. */
  4643.  
  4644. function ugm_udmu() {
  4645.  
  4646. // CSS for Topics
  4647.  
  4648. addGlobalStyle('.statuslinks .pushBox {display:none !important;}');
  4649. addGlobalStyle('.statuslinks span.offline {background:url("http://i.imgur.com/jghjlWn.png") no-repeat left -15px !important;}');
  4650. addGlobalStyle('.statuslinks span.online {background:url("http://i.imgur.com/jghjlWn.png") no-repeat left top !important;}');
  4651. addGlobalStyle('.fav_stats .udmu_div {background: transparent; height: 100px; width: 122px; position:relative; top:0px; left: 0px; z-index: 3;}');
  4652. addGlobalStyle('.fav_stats .udmu_ul {margin-left: 0 !important; position: relative; width: 100%;}');
  4653. addGlobalStyle('.fav_stats .udmu_li {border-color: transparent; border-style: solid; border-width: 1px; display: inline; float: left; font-size: 11px; height: 18px; left: 0 !important; list-style: outside none none; margin-right: -1px; position: relative; width: 60px;}');
  4654. addGlobalStyle('.fav_stats .udmu_li:nth-child(2n+1) {border-right: none !important;}');
  4655. addGlobalStyle('.fav_stats .udmu_li a {text-align: left !important; font-weight: normal !important; cursor:pointer; color: #333 !important; display: block; height: 100%; line-height: 18px; position: relative; text-decoration: none !important; text-indent: 6px; width: 100%;}');
  4656. addGlobalStyle('.fav_stats .udmu_li:hover {background: #edf0f4 !important;}');
  4657. addGlobalStyle('.fav_stats {cursor:default; height: 23px !important; overflow:hidden; position: absolute;}');
  4658. addGlobalStyle('.fav_stats:hover { height: 23px !important; overflow:unset; position: absolute;}');
  4659. addGlobalStyle('.fav_stats:hover .udmu_li{ background: #fff; border-color: #f2f2f1 #cccccc #cccccc;}');
  4660. addGlobalStyle('.subnav_box .box_content_mini>a {display:none !important;}');
  4661.  
  4662. // CSS for Shops
  4663.  
  4664. addGlobalStyle('.subnav_box .box_content_mini .udmu_div {background: transparent; height: 100px; width: 134px; position:relative; top:0px; left: 0px; z-index: 3;}');
  4665. addGlobalStyle('.subnav_box .box_content_mini .udmu_ul {margin-left: 0 !important; position: relative; width: 100%;}');
  4666. addGlobalStyle('.subnav_box .box_content_mini .udmu_li {font-size: 12px; background: #dde9ec; border:2px solid #c1d0d4; display: inline; float: left; height: 18px; left: 0 !important; list-style: outside none none; margin-bottom: 3px; margin-right: 3px; padding: 1px; border-radius: 2px; position: relative; width: 58px;}');
  4667. addGlobalStyle('.subnav_box .box_content_mini .udmu_li a {cursor:pointer; display: block; height: 100%; line-height: 18px; position: relative; width: 100%; text-decoratio: none !important; text-decoration: none !important;}');
  4668. addGlobalStyle('.subnav_box .box_header_mini {display:none;}');
  4669. addGlobalStyle('.subnav_box .box_footer_mini {display:none;}');
  4670. addGlobalStyle('.subnav_box .box_content_mini {width: 131px !important; border:none !important; background: none !important;}');
  4671.  
  4672. }
  4673.  
  4674. function udmu(userid,userdd) {
  4675.  
  4676. $('<div class="udmu_div">' +
  4677. '<ul class="udmu_ul">' +
  4678. '<li class="udmu_li"><a href="http://www.gaiaonline.com/profiles/'+ userid + '">Profile</a></li>' +
  4679. '<li class="udmu_li"><a href="http://www.gaiaonline.com/friends/add/'+ userid + '">Add</a></li>' +
  4680. '<li class="udmu_li"><a href="http://www.gaiaonline.com/gsearch/posthistory/'+ userid + '">Posts</a></li>' +
  4681. '<li class="udmu_li"><a href="http://www.gaiaonline.com/profile/privmsg.php?mode=post&u='+ userid + '">PM</a></li>' +
  4682. '<li class="udmu_li"><a href="http://www.gaiaonline.com/forum/mytopics/'+ userid + '">Topics</a></li>' +
  4683. '<li class="udmu_li"><a href="http://www.gaiaonline.com/gaia/bank.php?mode=trade&uid='+ userid + '">Trade</a></li>' +
  4684. '<li class="udmu_li"><a href="http://www.gaiaonline.com/profiles/'+ userid + '/?mode=comments">Comments</a></li>' +
  4685. '<li class="udmu_li"><a href="http://www.gaiaonline.com/friends/?hook='+ userid + '">Block</a></li>' +
  4686. '<li class="udmu_li"><a href="http://www.gaiaonline.com/journal/?mode=view&u='+ userid + '">Journal</a></li>' +
  4687. '<li class="udmu_li"><a href="http://www.gaiaonline.com/gaia/shopping.php?key=hbjdcjkygqwygbqw&buyGift=1&userId='+ userid + '">Gift</a></li>' +
  4688. '<li class="udmu_li"><a href="http://www.gaiaonline.com/achievements/public/'+ userid + '">Achieve</a></li>' +
  4689. '<li class="udmu_li"><a href="http://www.gaiaonline.com/marketplace/userstore/'+ userid + '">Store</a></li>' +
  4690. '<li class="udmu_li"><a href="javascript:YAHOO.gaia.apps.ei.getItemList('+ userid + ');">Equipped</a></li>' +
  4691. '<li class="udmu_li"><a id="udmu_viewwish">Wishlist</a></li>' +
  4692. '</ul>' +
  4693. '</div>').appendTo(userdd);
  4694.  
  4695. $(userdd).find('#udmu_viewwish').click(function(){
  4696.  
  4697. $('<div class="ugm_vowbackdrop"></div>').appendTo('#content');
  4698. $('.ugm_vowbackdrop').css({"position": "fixed","top": "0px","left": "0px","width": "100%","height": "100%","background": "rgba(0, 0, 0, 0.5) url('http://s.cdn.gaiaonline.com/images/loader.gif') no-repeat scroll 50% center","z-index": "191","display": "none"});
  4699. $('.ugm_vowbackdrop').css({"background-image":"url('http://s.cdn.gaiaonline.com/images/loader.gif')", "display": "block"});
  4700.  
  4701. GM_xmlhttpRequest({
  4702. method: "GET",
  4703. url: "http://www.gaiaonline.com/profiles/"+userid,
  4704. onload: function(response) {
  4705. var parser=new DOMParser();
  4706. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  4707. var clwish = innerDoc.getElementById('wishlist');
  4708. var cuwish = innerDoc.getElementById('id_wishlist');
  4709.  
  4710. if ($(clwish).length > 0) { classicwish(); }
  4711. else if ($(cuwish).length > 0) { currentwish(); }
  4712. else { nowish(); }
  4713.  
  4714. function classicwish() {
  4715. var wishdiv = innerDoc.getElementById('wishlist').innerHTML;
  4716. var wishdis = document.createElement("div");
  4717. wishdis.innerHTML = wishdiv;
  4718. wishdis.id ="wishlistdisplay";
  4719. document.body.appendChild(wishdis);
  4720.  
  4721. $('#wishlistdisplay').css({"display": "block","background": "#f4f7fa none repeat scroll 0 0","border-radius": "7px","height": "300px","left": "0","margin": "0 auto","padding": "30px","position": "fixed","right": "0","top": "221px","width": "550px","overflow-y": "auto","overflow-x": "hidden", "z-index": "200"});
  4722. $('#wishlistdisplay h2').css({"background": "#5a4564 none repeat scroll 0 0","color": "#fff","left": "-33px","padding": "6px 18px","position": "relative","right": "0","top": "-30px","height": "20px","width": "587px","margin": "0px"});
  4723. $('#wishlistdisplay .items').css({"height": "269px","position": "relative","top": "-14px","width": "560px","overflow": "auto"});
  4724. $('#wishlistdisplay .items li').css({"display": "inline","list-style": "outside none none","padding": "10px"});
  4725. $('#wishlistdisplay .items li a').attr('style', 'text-decoration: none !important');
  4726. $('.ugm_vowbackdrop').css({"background-image":"none"});
  4727.  
  4728. $('#wishlistdisplay .items li a').each(function () {
  4729. var wishid = this.id.match(/\d+/);
  4730. this.href = "http://www.gaiaonline.com/marketplace/itemdetail/" + wishid;
  4731. });
  4732. }
  4733.  
  4734. function currentwish() {
  4735. var wishdiv = innerDoc.getElementById('id_wishlist').innerHTML;
  4736. var wishdis = document.createElement("div");
  4737. wishdis.innerHTML = wishdiv;
  4738. wishdis.id ="wishlistdisplay";
  4739. document.body.appendChild(wishdis);
  4740. $('#wishlistdisplay').css({"background": "#f4f7fa none repeat scroll 0 0","border-radius": "7px","height": "300px","left": "0","margin": "0 auto","padding": "30px","position": "fixed","right": "0","top": "221px","width": "550px","overflow-y": "auto","overflow-x": "hidden", "z-index": "200"});
  4741. $('#wishlistdisplay h2').css({"background": "#5a4564 none repeat scroll 0 0","color": "#fff","left": "-33px","padding": "6px 18px","position": "relative","right": "0","top": "-30px","height": "20px","width": "587px","margin": "0px"});
  4742. $('.item').css({"display": "inline", 'margin-right': '20px'});
  4743. $('.premium_sparkle').css({"display": "none"});
  4744. $('.item_info').attr('style', 'text-decoration: none !important');
  4745. $('.ugm_vowbackdrop').css({"background-image":"none"});
  4746.  
  4747. $('.item_info').each(function () {
  4748. var wishid = this.id.match(/\d+/);
  4749. this.href = "http://www.gaiaonline.com/marketplace/itemdetail/" + wishid;
  4750. });
  4751. }
  4752.  
  4753. function nowish() {
  4754. var wishdis = document.createElement("div");
  4755. wishdis.id ="wishlistdisplay";
  4756. document.body.appendChild(wishdis);
  4757.  
  4758. $('#wishlistdisplay').css({"display": "block","background": "#f4f7fa none repeat scroll 0 0","border-radius": "7px","height": "300px","left": "0","margin": "0 auto","padding": "30px","position": "fixed","right": "0","top": "221px","width": "550px","overflow-y": "auto","overflow-x": "hidden", "z-index": "200"});
  4759. $( '<h2 id="wdh2">Wish List</h2>' ).appendTo("#wishlistdisplay");
  4760. $('#wdh2').css({"background": "#5a4564 none repeat scroll 0 0","color": "#fff","left": "-33px","padding": "6px 18px","position": "relative","right": "0","top": "-30px","height": "20px","width": "587px","margin": "0px"});
  4761. $( '<a style="color:#333;">This user has either no wishlist or their profile is private.</a>' ).appendTo("#wishlistdisplay");
  4762. $('.ugm_vowbackdrop').css({"background-image":"none"});
  4763. }
  4764. }
  4765. });
  4766.  
  4767. $('.ugm_vowbackdrop').click(close_ugmbox);
  4768. function close_ugmbox() {
  4769. $('.ugm_vowbackdrop').remove();
  4770. $('#wishlistdisplay').remove();
  4771. }
  4772. });
  4773. }
  4774.  
  4775. /*!
  4776. * More User Menu Options
  4777. * Topics
  4778. */
  4779.  
  4780. function ugm_udmu2() {
  4781. $('.fav_stats').each(function (){
  4782. var user_id = $(this).parent().siblings('div.user_info_wrapper').find('.user_title img').attr('data-avatar-uid');
  4783. var user_dd = $(this);
  4784. udmu(user_id,user_dd);
  4785. });
  4786. }
  4787.  
  4788. /*!
  4789. * More User Menu Options
  4790. * Userstores
  4791. */
  4792.  
  4793. function ugm_udmu3() {
  4794. $('.subnav_box .box_content_mini').each(function (){
  4795. var user_id = $('#avatar_box a').attr('href').split("/")[5];
  4796. var user_dd = $(this);
  4797. udmu(user_id,user_dd);
  4798. });
  4799.  
  4800. $('.subnav_box .box_content_mini .udmu_li a:contains("Comments")').html($('.subnav_box .box_content_mini .udmu_li a:contains("Comments")').html().replace('Comments','Comment'));
  4801. }
  4802.  
  4803. /*!
  4804. * View My Findings Fix
  4805. */
  4806.  
  4807. function ugm_vmff() {
  4808. addGlobalStyle('#myfindings_list li {padding: 2px;}');
  4809. addGlobalStyle('#myfindings_list {overflow: auto; height: 450px}');
  4810. addGlobalStyle('.yui3-overlay-content.yui3-widget-stdmod { position: fixed; top: 140px; width: 450px; }');
  4811. addGlobalStyle('.market.allow, .pricing {padding: 2px; font-size: 11px; color: #666 !important; }');
  4812. addGlobalStyle('.market.allow a {color: #666 !important; }');
  4813. }
  4814.  
  4815. /*!
  4816. * Notice Viewer
  4817. */
  4818.  
  4819. function ugm_inotice() {
  4820.  
  4821. addGlobalStyle('.notify_item.notify_notices {display: flex !important;}');
  4822. addGlobalStyle('#notifyBubbleContainer {z-index: 191 !important;}');
  4823. $('<a id="open_inotice" class="open_notice">[+]</a>').insertAfter('.notify_icon_notices');
  4824. if ($('.notify_icon_notices').length > 0) { var inotice_n = parseInt($('.notify_icon_notices').html().match(/\d+/)); }
  4825.  
  4826. $('.open_notice').click(function(){
  4827. $('#div_inotice').remove();
  4828. $('<div id="div_inotice">Loading...</div>').insertAfter('#open_inotice');
  4829. GM_xmlhttpRequest({
  4830. method: "GET",
  4831. url: "http://www.gaiaonline.com/mygaia/",
  4832. onload: function(response) {
  4833. var parser=new DOMParser();
  4834. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  4835. var ul_inotice = innerDoc.getElementsByClassName('mystuff')[0].getElementsByClassName('bd')[0].getElementsByTagName('ul')[0].getElementsByTagName('li');
  4836. var li_inotice = "";
  4837. for ( var i = 0 ; i < inotice_n ; i++ ) { li_inotice += ul_inotice[i].innerHTML; }
  4838. $('#div_inotice').html(li_inotice);
  4839. $('<span id="close_inotice">x</span>').appendTo('#div_inotice');
  4840. $('#close_inotice').click(function(){ $('#div_inotice').remove(); });
  4841. }
  4842. });
  4843. });
  4844. }
  4845.  
  4846. /*!
  4847. * Wishlist Arranger
  4848. */
  4849.  
  4850. function ugm_wisharr() {
  4851. addGlobalStyle('#gaia_content .wishlist_box .wish_box .fval { display: none; }');
  4852. addGlobalStyle('#gaia_content .wishlist_box .wish_box .fval { padding-left: 5px !important; padding-top: 1px; padding-bottom: 0px !important;}');
  4853. addGlobalStyle('#gaia_content .wishlist_box .wish_box select { margin-bottom: 2px; }');
  4854. addGlobalStyle('#gaia_content .wishlist_box .wish_box .wish_name { display: none !important; }');
  4855. addGlobalStyle('#gaia_content .wishlist_box .wish_box select { display: none; }');
  4856. addGlobalStyle('#gaia_content .wishlist_box .wish_box { width: 45px !important; }');
  4857. addGlobalStyle('#gaia_content .wishlist_box .row-even { background: #f5f5f5 !important; }');
  4858. addGlobalStyle('#gaia_content .wishlist_box .wish_arr_owned {box-shadow: 50px 0 0 #5da7da inset !important;}');
  4859. addGlobalStyle('#gaia_content .gaia-info .hd { text-indent: -1000px !important; }');
  4860. addGlobalStyle('#wishlist_drop_target { padding-bottom: 80px; padding-right: 40px; width: 410px !important; }');
  4861. }
  4862.  
  4863. function ugm_wisharr2() {
  4864.  
  4865. $('#gaia_content .wishlist_box .wish_box').each(function(){
  4866.  
  4867. $('<div class="screen"></div>').appendTo(this);
  4868. $('<div class="actions"></div>').appendTo(this);
  4869.  
  4870. var theselect = $(this).find('select');
  4871. var theactions = $(this).find('.actions');
  4872. var thescreen = $(this).find('.screen');
  4873. var thepublic = $(this).children('.fval').eq(0);
  4874. var thedelete = $(this).children('.fval').eq(1);
  4875. var thelink = $(this).attr('id').replace('wishlist_item_','');
  4876. var theitem = $(this).find('a').attr('title').replace(' - virtual item', '');
  4877.  
  4878. $(theselect).css({ 'display': 'block' });
  4879. $(thepublic).css({ 'display': 'block' });
  4880. $(thedelete).css({ 'display': 'block' });
  4881.  
  4882. $(theselect).detach().appendTo(theactions);
  4883. $('<span>Public</span>').appendTo(theactions);
  4884. $(thepublic).detach().appendTo(theactions);
  4885. $('<span>Delete</span>').appendTo(theactions);
  4886. $(thedelete).detach().appendTo(theactions);
  4887. $('<span class="tomarket"><a href="http://www.gaiaonline.com/marketplace/itemdetail/'+ thelink +'" target="_blank">Market</a></span>').appendTo(theactions);
  4888. $(thescreen).attr('title', theitem);
  4889.  
  4890. $(thescreen).click( function() {
  4891. $(theactions).toggle();
  4892. } );
  4893.  
  4894. });
  4895.  
  4896. $('.screen').css({'position': 'absolute', 'height': '30px', 'width': '45px', 'margin-top': '0px', 'cursor': 'pointer'});
  4897. $('.actions').css({'position': 'absolute', 'height': '70px', 'width': '80px', 'border': '1px solid #aaa', 'background': '#fafafa', 'margin-top': '35px', 'display': 'none', 'z-index': '1', 'padding': '3px' });
  4898. $('.actions span').css({'display': 'block', 'float': 'right', 'margin-right': '13px', 'position': 'relative', 'width': '35px'});
  4899. $('.tomarket').css({ 'text-align': 'center', 'background': '#eee none repeat scroll 0 0', 'border': '1px solid #ccc', 'display': 'block', 'height': '14px', 'left': '0', 'margin-bottom': '1px', 'margin-left': 'auto', 'margin-right': 'auto', 'position': 'relative', 'right': '0', 'top': '2px', 'width': '78px' });
  4900. $('.tomarket a').css({ 'position': 'relative', 'top': '0px', 'color': '#666' });
  4901.  
  4902. }
  4903.  
  4904. /*!
  4905. * Favorite Links
  4906. */
  4907.  
  4908. function ugm_rhn() {
  4909.  
  4910. addGlobalStyle('#runway_menu { display: block !important; cursor: pointer !important; width: 50px; }');
  4911.  
  4912. }
  4913.  
  4914. function ugm_rhn2() {
  4915.  
  4916. /*
  4917. $('#runway_menu>a').html($('#runway_menu>a').html().replace('Catch', 'Faves'));
  4918. $('#runway_menu>a').removeAttr("href");
  4919. */
  4920.  
  4921. addGlobalStyle('.megamenu-sections {width: 820px !important;}');
  4922.  
  4923. $('#favorites_menu').hover(function(){
  4924. $(this).addClass('panel-open')
  4925. },function(){
  4926. $(this).removeClass('panel-open')
  4927. });
  4928.  
  4929. $('<li class="megamenu-divider"><!-- --></li>' +
  4930. '<li id="favorites_menu" class="megamenu-standard-menu mega-menu-gofusion">' +
  4931. '<a class="megamenu-section-trigger">' +
  4932. '<span class="lt_selector"></span>' +
  4933. 'Faves' +
  4934. '<span class="rt_selector"></span>' +
  4935. '</a>' +
  4936. '</li>').insertAfter('#runway_menu');
  4937.  
  4938.  
  4939. $('<div id="rhn_favorites" class="main_panel_container">' +
  4940. '<div class="main_panel">' +
  4941. '<div class="panel-left">' +
  4942. '<div class="panel-title">Links</div>' +
  4943. '<ul class="panel-links" id="rhn_links_set1">' +
  4944. '<li class="panel-link">' +
  4945. '<span class="panel-img" style="background-position:-353px -45px;"></span>' +
  4946. '<a>My Favorites</a>' +
  4947. '<div class="panel-link-descrip">Explore Gaia faster.</div>' +
  4948. '</li>'+
  4949. '<li class="panel-link">' +
  4950. '<span style="background:none;" class="panel-img"></span>' +
  4951. '<div class="complex-sublist">' +
  4952. '<span style="color: #9981AA;">Links</span>' +
  4953. '<ul id="main_sub_fave_list1">' +
  4954. '</ul>' +
  4955. '</div>' +
  4956. '</li>' +
  4957. '</ul>' +
  4958. '</div>' +
  4959. '<div class="panel-right">' +
  4960. '<div class="panel-title">More Links</div>' +
  4961. '<ul class="panel-links" id="rhn_links_set2">' +
  4962. '<li class="panel-link">' +
  4963. '<span class="panel-img" style="background-position:-353px -45px;"></span>' +
  4964. '<a>More Favorites</a>' +
  4965. '<div class="panel-link-descrip">Explore Gaia faster.</div>' +
  4966. '</li>'+
  4967. '<li class="panel-link">' +
  4968. '<span style="background:none;" class="panel-img"></span>' +
  4969. '<div class="complex-sublist">' +
  4970. '<span style="color: #9981AA;">Links</span>' +
  4971. '<ul id="main_sub_fave_list2">' +
  4972. '</ul>' +
  4973. '</div>' +
  4974. '</li>' +
  4975. '</ul>' +
  4976. '</div>' +
  4977. '<div class="clear"><!-- --></div>' +
  4978. '</div>' +
  4979. '<div class="panel_bottom"></div>' +
  4980. '</div>').insertAfter('#favorites_menu a');
  4981.  
  4982. var rhn_lt;
  4983. var rhn_ll;
  4984. var rhn_lt2;
  4985. var rhn_ll2;
  4986.  
  4987. for ( i = 0; i < 10 ; i++ ) {
  4988.  
  4989. rhn_lt = "gmsv_rhn_title" + [i];
  4990. rhn_ll = "gmsv_rhn_href" + [i];
  4991. rhn_lt2 = "gmsv_rhn_title2" + [i];
  4992. rhn_ll2 = "gmsv_rhn_href2" + [i];
  4993.  
  4994. if ((GM_getValue(rhn_ll, '') != '') || (GM_getValue(rhn_lt, '') != '')) {
  4995. $('<li><a class="panel-link-title" href="' + GM_getValue(rhn_ll, '') + '">' + GM_getValue(rhn_lt, '') + '</a></li>').appendTo('#main_sub_fave_list1');
  4996. }
  4997. if ((GM_getValue(rhn_ll2, '') != '') || (GM_getValue(rhn_lt2, '') !='')) {
  4998. $('<li><a class="panel-link-title" href="' + GM_getValue(rhn_ll2, '') + '">' + GM_getValue(rhn_lt2, '') + '</a></li>').appendTo('#main_sub_fave_list2');
  4999. }
  5000.  
  5001. }
  5002.  
  5003. $('<li>&nbsp;</li>').appendTo('#main_sub_fave_list1');
  5004. $('<li>&nbsp;</li>').appendTo('#main_sub_fave_list2');
  5005.  
  5006. }
  5007.  
  5008. /*
  5009. * Custom Header Background
  5010. */
  5011.  
  5012. function ugm_chb() {
  5013. var chb_saved = GM_getValue('chb_selectedbg', '');
  5014. var chb_savedc = GM_getValue('chb_selectedbgc', '');
  5015. GM_addStyle('.header_content {background: url("' + chb_saved + '") no-repeat #' + chb_savedc + ' !important; }');
  5016.  
  5017. if ( !GM_getValue('centeredforums_enabled') ) {
  5018. GM_addStyle('#gaia_header { background: #'+chb_savedc+';}');
  5019. }
  5020. }
  5021.  
  5022. /*
  5023. * Centered Guild Forums
  5024. */
  5025.  
  5026. function ugm_cgf() {
  5027. GM_addStyle('#content { padding-right: 0px !important; background: #fff; }');
  5028. GM_addStyle('.postLeft div.postBar { position: relative !important; right: 40px !important; float: right; }');
  5029. GM_addStyle('.postRight div.postBar { position: relative !important; right: 40px !important; float: right; }');
  5030. }
  5031.  
  5032. function ugm_cgf2() {
  5033. $('#gaia_footer').detach().insertAfter('#content');
  5034. }
  5035.  
  5036. /*
  5037. * Owned Items Indicator
  5038. * Shops
  5039. */
  5040.  
  5041. function ugm_osi() {
  5042.  
  5043. var observer = new MutationObserver((mutations) => {
  5044. for(let mutation of mutations) {
  5045. var mutations = mutations;
  5046. if (mutations[0].addedNodes[0].nodeName === 'IMG'){
  5047. var items = document.getElementsByClassName('buy-item');
  5048. var id;
  5049. var gsi = [];
  5050. var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=';
  5051.  
  5052. for ( i = 0 ; i < items.length ; i++ ) {
  5053. id = $(items[i]).find('img').attr('data-iid');
  5054. gsi.push('[111,[' + id + ']]');
  5055. }
  5056.  
  5057. url += '[' + gsi.join(',') + ']';
  5058.  
  5059. GM_xmlhttpRequest({
  5060. method: "GET",
  5061. url: url,
  5062. onload: function(response) {
  5063. for ( i = 0; i < items.length; i++ ) {
  5064. if (JSON.parse(response.responseText)[i][1]) {
  5065. $(items[i]).find('img')[0].style.backgroundColor = "#c7d6ec";
  5066. }
  5067. }
  5068. }
  5069. });
  5070. break;
  5071. }
  5072. }
  5073. });
  5074. observer.observe(document.querySelector('#buy-items-group'), {childList:true, subtree: true})
  5075.  
  5076. }
  5077.  
  5078. /*
  5079. * Current Avatar Value
  5080. */
  5081.  
  5082. function ugm_avival() {
  5083.  
  5084. waitForKeyElements ('#equipped_items ul',readyavival);
  5085.  
  5086. function readyavival() {
  5087.  
  5088. if ( !$('#avivaldel').length ) {
  5089.  
  5090. $('<div class="cta_link" id="avival">View Avatar Value</div>').insertBefore('#show_off_link');
  5091.  
  5092. $('#avival').click(function() {
  5093.  
  5094. $('<div class="ugm_vowbackdrop"></div>').appendTo('#content');
  5095. $('.ugm_vowbackdrop').css({"position": "fixed","top": "0px","left": "0px","width": "100%","height": "100%","background": "rgba(0, 0, 0, 0.4)","z-index": "191","display": "block"});
  5096. $('<div id="ugm_avival_div"></div>').appendTo('#content');
  5097. $('<a id="avival_ta1t">Current Avatar Value</a>').appendTo('#ugm_avival_div');
  5098. $('<button id="avival_close">X</button>').appendTo('#ugm_avival_div');
  5099.  
  5100. $('#avival_close,.ugm_vowbackdrop').click(function() {
  5101. $('#ugm_avival_div,.ugm_vowbackdrop').remove();
  5102. return false;
  5103. });
  5104.  
  5105. $('<div id="ugm_avival_wrap">' +
  5106. '<table id="ugm_avival_table">' +
  5107. '<tr>' +
  5108. '<th style="width:50%;">Item Name</th>' +
  5109. '<th style="width:50%;">Lowest Buy Price</th>' +
  5110. '</tr>' +
  5111. '</table>' +
  5112. '</div>').appendTo('#ugm_avival_div');
  5113.  
  5114. var eqitems = document.getElementById('equipped_items').getElementsByTagName('li');
  5115.  
  5116. for (var i = 0; i < eqitems.length; i++) {
  5117. $('<tr class="avival_eq"><td>' + eqitems[i].getAttribute('title').replace(/\(.*?\)/g, '') + '</td><td>Loading...</td></tr>').appendTo('#ugm_avival_table');
  5118. }
  5119.  
  5120. $('<tr><th>Total</th><th id="avival_total"">Loading...</th></tr>').appendTo('#ugm_avival_table');
  5121.  
  5122. function commaSeparateNumber(val){
  5123. while (/(\d+)(\d{3})/.test(val.toString())){
  5124. val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');
  5125. }
  5126. return val;
  5127. }
  5128.  
  5129. var k = 0;
  5130. var price = 0;
  5131.  
  5132. function gpeq () {
  5133. setTimeout(function () {
  5134. GM_xmlhttpRequest({
  5135. method: "GET",
  5136. url: "http://www.gaiaonline.com/marketplace/itemdetail/" + eqitems[k].getAttribute('data-item'),
  5137. onload: function(response) {
  5138. var parser = new DOMParser();
  5139. var innerDoc = parser.parseFromString(response.responseText,"text/html");
  5140. var strongs = innerDoc.getElementById('item_basicdata').getElementsByTagName('strong');
  5141. for ( var i = 0 ; i < strongs.length ; i++ ) {
  5142. var ttt = "Lowest Buy Now Price: ";
  5143. if (strongs[i].innerHTML.indexOf(ttt) != -1) {
  5144. var l = k - 1;
  5145. var lbp = strongs[i].parentNode.innerHTML.replace('<strong>Lowest Buy Now Price: </strong>','').replace(' gold', '');
  5146. document.getElementsByClassName('avival_eq')[l].getElementsByTagName('td')[1].innerHTML = strongs[i].parentNode.innerHTML.replace('Lowest Buy Now Price: ','').replace(' gold', '');
  5147. price += parseFloat(lbp.replace(/,/g, '')) || 0;
  5148. document.getElementById('avival_total').innerHTML = commaSeparateNumber(price);
  5149. }
  5150. }
  5151. }
  5152. });
  5153.  
  5154. if ( !$('#ugm_avival_div').length ){
  5155. return false;
  5156. }
  5157.  
  5158. k++;
  5159. if (k < eqitems.length) {
  5160. gpeq();
  5161. }
  5162. }, 3000)
  5163. }
  5164.  
  5165. gpeq();
  5166.  
  5167. });
  5168.  
  5169. $('<div id="avivaldel" style="position:absolute;"></div>').appendTo('body');
  5170.  
  5171. }
  5172. }
  5173. }
  5174.  
  5175. /*
  5176. * Announcement Viewer
  5177. */
  5178.  
  5179. function ugm_annview() {
  5180.  
  5181. GM_addStyle('.notify_item.notify_announcements {display: flex !important;}');
  5182.  
  5183. if ($('.notify_icon_announcement').length > 0) {
  5184.  
  5185. var number = parseInt($('.notify_icon_announcement').html().match(/\d+/));
  5186. var j = 0;
  5187. var href;
  5188. var title;
  5189.  
  5190. $('.notify_icon_announcement')
  5191. .after(
  5192. $(document.createElement('a'))
  5193. .attr('id','open_iannounce')
  5194. .addClass('open_announce')
  5195. .append(document.createTextNode('[+]'))
  5196. )
  5197.  
  5198. $('.open_announce').click(function(){
  5199.  
  5200. $('#div_iannounce').remove();
  5201. $('#open_iannounce')
  5202. .after(
  5203. $(document.createElement('div'))
  5204. .attr('id','div_iannounce')
  5205. .append(
  5206. $(document.createElement('ul'))
  5207. .attr('id','list_iannounce')
  5208. )
  5209. )
  5210.  
  5211. for (i = 0; i < number ; i++) {
  5212. $('#list_iannounce')
  5213. .append(
  5214. $(document.createElement('li'))
  5215. .append(document.createTextNode('Loading...'))
  5216. )
  5217. };
  5218.  
  5219. function myLoop() {
  5220.  
  5221. // Prevents looping through current page's announcement
  5222. if (j === 0 ) {
  5223. href = $('.notify_icon_announcement').attr('href').match(/\d+/)[0];
  5224. }
  5225.  
  5226. // Views the page and gets next announcement thread
  5227. $.ajax({
  5228. method: 'GET',
  5229. url: 'http://www.gaiaonline.com/news?topic=' + href,
  5230. success:function(response) {
  5231.  
  5232. title = $($.parseHTML(response)).find('#thread_title a').html();
  5233.  
  5234. $('#list_iannounce li').eq(j)
  5235. .html(
  5236. $(document.createElement('a'))
  5237. .attr('href', 'http://www.gaiaonline.com/forum/t.' + href)
  5238. .attr('target', '_blank')
  5239. .append(document.createTextNode(title))
  5240. )
  5241.  
  5242. href = $($.parseHTML(response)).find('.notify_icon_announcement').attr('href').match(/\d+/)[0];
  5243.  
  5244. j++;
  5245. if ( j < number ) { myLoop(); }
  5246. }
  5247. });
  5248.  
  5249. }
  5250.  
  5251. myLoop();
  5252.  
  5253. $('#div_iannounce')
  5254. .append(
  5255. $(document.createElement('span'))
  5256. .attr('id', 'close_iannounce')
  5257. .append(document.createTextNode('x'))
  5258. )
  5259.  
  5260. $('#close_iannounce').click(function(){
  5261. $('#div_iannounce').remove();
  5262. $('#open_iannounce').remove();
  5263. });
  5264.  
  5265. });
  5266. }
  5267. }
  5268.  
  5269. /*
  5270. * Owned Items Indicator
  5271. * Other's Wishlist
  5272. */
  5273.  
  5274. function ugm_owoi(){
  5275.  
  5276. waitForKeyElements('#wishlistdisplay', owoiready);
  5277.  
  5278. function owoiready() {
  5279. //var items = $("#wishlistdisplay img").not('.premium_sparkle');
  5280. var items = document.getElementById('wishlistdisplay').getElementsByTagName('a');
  5281. var id;
  5282. var gsi = [];
  5283. var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=';
  5284.  
  5285. for ( i = 0 ; i < items.length ; i++ ) {
  5286. id = $(items[i]).attr('id').match(/\d+/)[0];
  5287. gsi.push('[111,[' + id + ']]');
  5288. }
  5289.  
  5290. url += '[' + gsi.join(',') + ']';
  5291.  
  5292. GM_xmlhttpRequest({
  5293. method: "GET",
  5294. url: url,
  5295. onload: function(response) {
  5296.  
  5297. for ( i = 0; i < items.length; i++ ) {
  5298.  
  5299. if (JSON.parse(response.responseText)[i][1]) {
  5300. $(items[i]).find('img')[0].style.backgroundColor = "#c7d6ec";
  5301. }
  5302.  
  5303. }
  5304.  
  5305. }
  5306. });
  5307. }
  5308.  
  5309. }
  5310.  
  5311. /*
  5312. * Easy Bid
  5313. */
  5314.  
  5315. function ugm_easybid(){
  5316.  
  5317. $('<button class="cta-button-sm" id="ugm_easybid_btn"><span>Minimum Bid</span></button>').insertAfter('#bidform');
  5318.  
  5319. var currentbid = parseFloat(document.getElementById('transactionWindowInfoTopRight').getElementsByTagName('strong')[2].nextSibling.nodeValue.replace('gold','').replace(/\,/g, ''));
  5320. var increment = parseFloat(document.getElementById('transactionWindowInfoTopRight').getElementsByTagName('strong')[4].nextSibling.nodeValue.replace('gold','').replace(/\,/g, ''));
  5321.  
  5322. if (increment == 0) { increment = 1; }
  5323.  
  5324. var totalbid = currentbid + increment;
  5325.  
  5326. $('#ugm_easybid_btn').click(function(){
  5327. $('#bidform .marketplaceInputField').val(addCommas(totalbid));
  5328. })
  5329.  
  5330. }
  5331.  
  5332. /*
  5333. * User Tag
  5334. */
  5335.  
  5336. function ugm_usertag() {
  5337.  
  5338. $(".user_title").each(function() {
  5339.  
  5340. var defaulttag = $(this).contents().filter(function() {
  5341. return this.nodeType == 3;
  5342. }).text().trim();
  5343.  
  5344. var getid = $(this).find('img').attr('data-avatar-uid');
  5345. var getname = "idtag_" + getid;
  5346. var toload = GM_getValue(getname, '');
  5347.  
  5348. $(this).contents().filter(function() {
  5349. return this.nodeType == 3;
  5350. }).remove();
  5351.  
  5352. if (toload === ''){
  5353. $('<span title="' + defaulttag + '" class="taggedspan gAutoTooltip delay-0">' + defaulttag + '</span>').appendTo(this);
  5354. } else {
  5355. $('<span title="' + defaulttag + '" class="taggedspan gAutoTooltip delay-0">' + toload[0] + '</span>').appendTo(this);
  5356. }
  5357.  
  5358. var getusername = $(this).prev().html();
  5359.  
  5360. $(this).click(function(){
  5361.  
  5362. $('.tagspanodd').remove();
  5363. $('.tagspaneven').remove();
  5364.  
  5365. var evenodd = $(this).parent().parent().parent().parent().attr('class').split(' ');
  5366.  
  5367. if (evenodd[0] == "postOdd") {
  5368. $('<span class="tagspanodd">' +
  5369. '<input type="text" class="tagbox" maxlength="25"></input>' +
  5370. '<a class="tagsave gAutoTooltip delay-0" title="Save Tag">✓</a>' +
  5371. '<a class="tagdel gAutoTooltip delay-0" title="Delete Tag">✗</a>' +
  5372. '<a class="tagcancel gAutoTooltip delay-0" title="Cancel Edit">-</a>' +
  5373. '</span>').insertAfter(this);
  5374. } else if (evenodd[0] == "postEven") {
  5375. $('<span class="tagspaneven">' +
  5376. '<input type="text" class="tagbox" maxlength="25"></input>' +
  5377. '<a class="tagsave gAutoTooltip delay-0" title="Save Tag">✓</a>' +
  5378. '<a class="tagdel gAutoTooltip delay-0" title="Delete Tag">✗</a>' +
  5379. '<a class="tagcancel gAutoTooltip delay-0" title="Cancel Editing">-</a>' +
  5380. '</span>').insertAfter(this);
  5381. }
  5382.  
  5383. $('.tagbox').focus();
  5384. $('.tagbox').ForceAlphaNumOnly();
  5385. $('.tagsave').click(function(){
  5386. var usertag = [];
  5387. var tagdesc = $(this).prev().val();
  5388. usertag.push(tagdesc);
  5389. usertag.push(getusername);
  5390. usertag.push(getid);
  5391. GM_setValue(getname, usertag);
  5392. $('.tagspanodd').remove();
  5393. $('.tagspaneven').remove();
  5394. $('.gaia-tooltip-container').css('visibility', 'hidden');
  5395. $('img[data-avatar-uid="'+getid+'"]').each(function() { $(this).siblings('.taggedspan').html(usertag[0]); });
  5396. });
  5397.  
  5398. $('.tagdel').click(function(){
  5399. var usertag = $(this).prev().val();
  5400. GM_deleteValue(getname);
  5401. $('.tagspanodd').remove();
  5402. $('.tagspaneven').remove();
  5403. $('.gaia-tooltip-container').css('visibility', 'hidden');
  5404. $('img[data-avatar-uid="'+getid+'"]').each(function() { $(this).siblings('.taggedspan').html(defaulttag); });
  5405. });
  5406.  
  5407. $('.tagcancel').click(function(){
  5408. $('.tagspanodd').remove();
  5409. $('.tagspaneven').remove();
  5410. $('.gaia-tooltip-container').css('visibility', 'hidden');
  5411. });
  5412. });
  5413. });
  5414. }
  5415.  
  5416. function ugm_usertag2(){
  5417.  
  5418. $(".gSearchBalloon").each(function() {
  5419.  
  5420. var theuid = $(this).attr('href').replace(/(.+_)(\d+)/, '$2');
  5421. var thetag = GM_getValue('idtag_' + theuid, '');
  5422. if (thetag != '') {
  5423. $('<div style="color:#999;">'+thetag[0]+'</div>').insertAfter(this);
  5424. }
  5425.  
  5426. });
  5427.  
  5428. }
  5429.  
  5430. /*
  5431. * Instant Edit
  5432. */
  5433.  
  5434. function ugm_iedit() {
  5435.  
  5436. $(".cta-button-sm.gray-button.post-edit").each(function() {
  5437. $('<a class="iedit_btn"></a>').insertAfter(this);
  5438. $(this).parent().css({ "width": "60px", "height": "22px" });
  5439. });
  5440.  
  5441. $('.iedit_btn').click(function(){
  5442.  
  5443. $('.iedit_div').remove();
  5444. var editurl = $(this).prev().attr('href');
  5445. var ieditbtn = this;
  5446. $('<div class="iedit_div"><div class="iedit_loader"></div></div>').insertAfter(ieditbtn);
  5447.  
  5448.  
  5449. GM_xmlhttpRequest({
  5450. method: "GET",
  5451. url: "http://www.gaiaonline.com" + editurl,
  5452. onload: function(response) {
  5453. var parser=new DOMParser();
  5454. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  5455. var iedit_content = innerDoc.getElementById('compose_entry').outerHTML;
  5456. $(iedit_content).appendTo('.iedit_div');
  5457. $('.iedit_loader').remove();
  5458. $('<a id="iedit_close"></a>').appendTo('.iedit_div');
  5459. $(".iedit_div #help-tags-info").parent().css({ "display": "none" });
  5460. $('#iedit_close').click(function(){ $('.iedit_div').remove(); });
  5461. }
  5462. });
  5463. });
  5464. }
  5465.  
  5466. /*
  5467. * Easy Item Report
  5468. */
  5469.  
  5470. function ugm_mistag(){
  5471.  
  5472. $('#gaia_content #preview_button').css({"width": "89px"});
  5473. $('#gaia_content #item_thumb').css({"min-height": "275px"});
  5474. $('#preview_button span:nth-child(2),#graph_button span:nth-child(2)').css({"width": "74px", "text-align": "center"});
  5475. $('<a id="mistag_btn" class="report_btn"><span>Mis-tagged</span></a>').appendTo('#item_thumb');
  5476. $('<a id="notrel_btn" class="report_btn"><span>Not Released</span></a>').appendTo('#item_thumb');
  5477. $('<a id="glitch_btn" class="report_btn"><span>Glitched</span></a>').appendTo('#item_thumb');
  5478.  
  5479. $('#mistag_btn').click({id: '99659735'}, itemreport);
  5480. $('#notrel_btn').click({id: '96740131'}, itemreport);
  5481. $('#glitch_btn').click({id: '69242947'}, itemreport);
  5482.  
  5483. function itemreport(event){
  5484.  
  5485. var item_name = $('#vend_item_title').html().replace('(Any)','').trim();
  5486. var item_link = window.location.href.replace(/\?graph=(1|-1)/, '');
  5487. $('<div class="report_div"><div class="report_loader"></div></div>').insertAfter(this);
  5488.  
  5489. GM_xmlhttpRequest({
  5490. method: "GET",
  5491. url: "http://www.gaiaonline.com/forum/compose/entry/new/" + event.data.id,
  5492. onload: function(response) {
  5493. var parser=new DOMParser();
  5494. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  5495. var report_content = innerDoc.getElementById('compose_entry').outerHTML;
  5496. $(report_content).appendTo('.report_div');
  5497. $('.report_loader').remove();
  5498. $('<a id="report_close"></a>').appendTo('.report_div');
  5499. $('.report_div #help-tags-info').parent().css({ "display": "none" });
  5500.  
  5501. var report_type = event.data.id;
  5502.  
  5503. switch (report_type) {
  5504. case "99659735":
  5505. var full_report = '[b]Item Name:[/b] ' + item_name + '\n' + '[b]Item Link:[/b] [url="' + item_link + '"]' + item_link + '[/url]' + '\n[b]Issue:[/b] ';
  5506. break;
  5507. case "96740131":
  5508. var full_report = '[b]Item Name:[/b] ' + item_name + '\n' + '[b]Item Link:[/b] [url="' + item_link + '"]' + item_link + '[/url]';
  5509. break;
  5510. case "69242947":
  5511. var full_report = '[b]Item Name:[/b] ' + item_name + '\n[b]Pose Name:[/b] \n[b]Avatar Gender:[/b] \n[b]Glitch Description:[/b] \n[b]Screencap:[/b] ';
  5512. break;
  5513. }
  5514.  
  5515. $('.report_div #message').val(full_report);
  5516.  
  5517. $('<span id="report_gu"><input type="checkbox" checked>Add "Reported via GaiaUpgrade"</span>').insertBefore('.form_buttons');
  5518.  
  5519. var val = "true";
  5520. $('#report_close').click(function(){ $('.report_div').remove(); });
  5521. $('.report_div #report_gu input').bind('change', function(){ val = "" + this.checked; });
  5522. $('.report_div #btn-submit-top').click(function(){
  5523. switch (val) {
  5524. case "true":
  5525. $('.report_div #message').val($('.report_div #message').val()+'\n\nReported via [url=http://www.gaiaonline.com/forum/t.96435915/]GaiaUpgrade[/url].');
  5526. break;
  5527. case "false":
  5528. break;
  5529. }
  5530. });
  5531. }
  5532. });
  5533. }
  5534. }
  5535.  
  5536. /*
  5537. * Wishlisted Items Indicator
  5538. */
  5539.  
  5540. function ugm_wled() {
  5541.  
  5542. GM_xmlhttpRequest({
  5543. method: "GET",
  5544. url: "http://www.gaiaonline.com/account/wishlist/",
  5545. onload: function(response) {
  5546. var parser=new DOMParser();
  5547. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  5548. var wl = innerDoc.getElementsByClassName('wish_name');
  5549. var wlarr = [];
  5550. for ( var i = 0 ; i < wl.length ; i++ ) { wlarr.push(wl[i].innerHTML); }
  5551.  
  5552. if (document.location.pathname.match(/^\/marketplace\/itemsearch\//)) {
  5553. var res = document.querySelectorAll(".sparkles_container");
  5554. for ( var i = 0 ; i < res.length; i++) {
  5555. var el = res[i].getElementsByTagName('a')[1];
  5556. cu = el.innerHTML.trim();
  5557. if (wlarr.indexOf(cu) != -1) {
  5558. $(el).css({ "color": "#fff", "font-weight": "bold" });
  5559. $(el).parent().parent().css({ "background": "#c57a7a" });
  5560. $(el).parent().parent().parent().css({ "color": "#fff", "background": "#c57a7a" });
  5561. }
  5562. }
  5563. } else if (document.location.pathname.match(/^\/marketplace\/userstore\//)) {
  5564. var res = document.querySelectorAll(".sparkles_container");
  5565. for ( var i = 0 ; i < res.length; i++) {
  5566. var el = res[i].parentNode.getElementsByTagName('a')[1];
  5567. cu = el.innerHTML.trim();
  5568. if (wlarr.indexOf(cu) != -1) {
  5569. $(el).css({ "color": "#fff", "font-weight": "bold" });
  5570. $(el).parent().css({ "background": "#c57a7a" });
  5571. $(el).parent().parent().css({ "color": "#fff", "background": "#c57a7a" });
  5572. }
  5573. }
  5574. } else if (document.location.pathname.match(/^\/marketplace\/itemdetail\//)) {
  5575. var res = document.querySelectorAll(".sparkles_container");
  5576. var res = document.getElementById('vend_item_title');
  5577. var el = res.innerHTML.replace('(Any)','').trim();
  5578. if (wlarr.indexOf(el) != -1) {
  5579. $('<strong>This item is already in your wishlist.</strong>').insertBefore('#arrow_wishlist').parent().parent();
  5580. $('#arrow_wishlist').remove();
  5581. }
  5582. } else if (document.location.pathname.match(/^\/marketplace\/vendsearch\//)) {
  5583. var res = document.querySelectorAll(".sparkles_container");
  5584. for ( var i = 0 ; i < res.length; i++) {
  5585. var el = res[i].getElementsByTagName('a')[0];
  5586. cu = el.getAttribute('title');
  5587. if (wlarr.indexOf(cu) != -1) {
  5588. $(el).css({ "color": "#fff", "font-weight": "bold" });
  5589. $(el).parent().parent().css({ "background": "#c57a7a" });
  5590. $(el).parent().parent().parent().css({ "color": "#fff", "background": "#c57a7a" });
  5591. }
  5592. }
  5593. } else if (document.location.pathname.match(/^\/gofusion/)) {
  5594. var res = document.querySelectorAll(".goal-item-name");
  5595. for ( var i = 0 ; i < res.length; i++ ) {
  5596. var el = res[i];
  5597. cu = el.innerHTML;
  5598. if (wlarr.indexOf(cu) != -1) {
  5599. $(el).parent().parent().css({ "background": "#654c59" });
  5600. $(el).parent().parent().parent().css({ "background": "#654c59", 'overflow': 'hidden' });
  5601. }
  5602. }
  5603. }
  5604. }
  5605. });
  5606. }
  5607.  
  5608. /*
  5609. * Detailed Sell Page
  5610. */
  5611.  
  5612. function ugm_sioq() {
  5613.  
  5614. waitForKeyElements (".buy-now",sioq);
  5615. function sioq(){
  5616.  
  5617. $('<tr><th>After Tax</th><td class="aftertax">0g</td></tr>').insertAfter('.buy-now');
  5618. $('.buy-now input').on("change keyup paste", function(){
  5619. if ( !$('.buy-now input').val()) {
  5620. $('.aftertax').html('0g');
  5621. } else {
  5622. var aftertax = parseFloat($('.buy-now input').val().replace(/,/g,'')) * .95;
  5623. $('.aftertax').html(addCommas(Math.round(aftertax)) + 'g');
  5624. }
  5625. });
  5626.  
  5627. var itemlink = $('.item-info a').attr('href');
  5628. $('<tr id="sioq_txt" style="margin:6px;"><th colspan="6">Fetching detailed information...</th></tr>').appendTo('.item-value tbody');
  5629.  
  5630. GM_xmlhttpRequest({
  5631. method: "GET",
  5632. url: "http://www.gaiaonline.com" + itemlink,
  5633. onload: function(response) {
  5634. var parser=new DOMParser();
  5635. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  5636. var msg = '';
  5637. var pq = innerDoc.getElementsByTagName('p');
  5638. var search = "You own this item.";
  5639. var found;
  5640. var lq = innerDoc.getElementById('listing_count').innerHTML.replace(/(^\d+)(.+$)/,'$1');
  5641.  
  5642. for (var i = 0; i < pq.length; i++) {
  5643. if (pq[i].innerHTML.indexOf(search) > -1) {
  5644. found = pq[i].getAttribute('title').match(/\d+/)[0];
  5645. msg = '<th>Owned Qty </th><td>' + found + '</td>';
  5646. break;
  5647. }
  5648. }
  5649.  
  5650. if (( innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy').length > 0 ) && ( innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy')[0].getElementsByTagName('strong').length > 0 )) {
  5651. var lbp = innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy')[0].getElementsByTagName('strong')[0].innerHTML;
  5652. msg += '<th>LBP </th><td id="truelbp">' + lbp + 'g</td>';
  5653. } else {
  5654. msg += '<th>LBP </th><td>None</td>';
  5655. }
  5656.  
  5657. if ( innerDoc.getElementById('bd').getElementsByClassName('vend_rows_ex_buy').length > 0 ) {
  5658. msg += '<th>Listings </th><td>' + lq + '</td>';
  5659. } else {
  5660. msg += '<th>Listings </th><td>None</td>';
  5661. }
  5662.  
  5663. $('#sioq_txt').html(msg);
  5664. }
  5665. });
  5666. }
  5667. }
  5668.  
  5669. /*
  5670. * Members Online
  5671. */
  5672.  
  5673. function ugm_ontime() {
  5674.  
  5675. GM_addStyle('.goldMessage {display: none !important;}');
  5676.  
  5677. GM_xmlhttpRequest({
  5678. method: "GET",
  5679. url: "http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=[[2100]]",
  5680. onload: function(response) {
  5681.  
  5682. var total = addCommas(JSON.parse(response.responseText)[0][2].total);
  5683. var vis = addCommas(JSON.parse(response.responseText)[0][2].visible);
  5684. var hid = addCommas(JSON.parse(response.responseText)[0][2].hidden);
  5685. var gue = addCommas(JSON.parse(response.responseText)[0][2].guests);
  5686.  
  5687. GM_addStyle('#online_members { position:relative; float: right; top: 5px; color: #fff; font-weight: bold; font-size: 11px; margin-right: 10px; cursor: default; }');
  5688. $('<span id="online_members" class="gAutoTooltip delay-0" title="<b>Visible: </b>' + vis + '<br/><b>Hidden: </b>' + hid + '<br/><b>Guests: </b>' + gue + '">' + total + ' Gaians Online</span>').appendTo('#newmenu');
  5689.  
  5690. }
  5691. });
  5692.  
  5693. }
  5694.  
  5695. /*
  5696. * Forum Lite
  5697. */
  5698.  
  5699. function ugm_forumlite() {
  5700.  
  5701. if ( GM_getValue('forumlitebluebg_enabled') ) { GM_addStyle('.post { background: none !important; border-top: 1px solid rgba(0,0,0,0.2) !important; border-bottom: none !important; }'); }
  5702. else { GM_addStyle('.post { background: transparent url("http://s.cdn.gaiaonline.com/images/mobile_app_assets/forums/postdata_bkdg.png") repeat-x scroll left top; border-top: 1px solid #898989 !important; border-bottom: none !important;}'); }
  5703. var bgcolor = GM_getValue('forumlite_bgc', '#ffffff');
  5704. var bgimage = GM_getValue('forumlite_bgi', 'none');
  5705. if (bgcolor == '') { bgcolor = '#ffffff' }
  5706. if (bgimage == '') { bgimage = 'none' }
  5707. if ( ( bgcolor != '#ffffff' ) || ( bgimage != 'none' ) ) {
  5708. GM_addStyle('#content { background-color: ' + bgcolor + ' !important; }');
  5709. GM_addStyle('#content-padding { background-color: ' + bgcolor + ' !important; }');
  5710. GM_addStyle('#thread_header { background: none !important; }');
  5711. GM_addStyle('#thread_title { background-color: #fff; border-radius: 5px; padding: 3px; }');
  5712. GM_addStyle('#post_container .user_info { background-color: #fff; border-radius: 5px; float: left; padding: 0 5px; }');
  5713. GM_addStyle('#content-padding { background-image: url("' + bgimage + '") !important; }');
  5714. }
  5715.  
  5716. GM_addStyle('.avi_box > #animated_item { position: relative; left: 15px; }');
  5717. GM_addStyle('.achievement_share { display: none; }');
  5718. GM_addStyle('#marriage_share { display: none; }');
  5719. GM_addStyle('.user_title_hint { display: none; }');
  5720. GM_addStyle('.gaia-fb-share-button { display: none !important; }');
  5721. GM_addStyle('.fav_stats { left: 15px; bottom: -30px; position: absolute; }');
  5722. GM_addStyle('.post > .postcontent { position: relative; top: 10px; }');
  5723. GM_addStyle('.post .user_info { height: 31px; left: 150px; position: absolute; width: 178px; }');
  5724. GM_addStyle('.message { position: relative; top: 32px; width: 85% !important; }');
  5725. GM_addStyle('.messagecontent .post-options { float: left; margin-left: -35px !important; position: relative; top: 4px; width: 100%;}');
  5726. GM_addStyle('#content .post.achievement_badges { min-height: 152px !important; }');
  5727. GM_addStyle('.post { margin-bottom: 30px; min-height: 152px !important; margin-bottom: 50px !important; left: -9px; }');
  5728. GM_addStyle('.post .date { color: #898989 !important; }');
  5729. GM_addStyle('.post .date abbr { border-bottom: none !important; }');
  5730. GM_addStyle('.post .date acronym { border-bottom: none !important; }');
  5731. GM_addStyle('.post .post-options .post-directlink { position: relative; top: 7px; display: inline-table !important; }');
  5732. GM_addStyle('.post-signature { margin-top: 55px !important; margin-bottom: -55px }');
  5733. GM_addStyle('.postEven .avatar_wrapper { float: left !important; margin-left: -5px !important; margin-right: 0 !important; }');
  5734. GM_addStyle('.postEven .postcontent .message { margin: 0 0 0 149px !important; }');
  5735. GM_addStyle('.postEven .user_info { text-align: left !important; margin: 0 auto 0 0 !important }');
  5736. GM_addStyle('.postEven .user_title_hint { float: right !important; margin: }');
  5737. GM_addStyle('.postEven .avatar img { -moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); filter: FlipH; -ms-filter: "FlipH";} ');
  5738. GM_addStyle('.postEven .avi_box #animated_item { -moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); filter: FlipH; -ms-filter: "FlipH";} ');
  5739. GM_addStyle('.rollDice { font-size: 12px !important; height: 28px; min-height: 1px !important; padding: 0 0 0 130px !important; position: relative; top: -3px; }');
  5740. GM_addStyle('.genRandomNumber { font-size: 12px !important; height: 21px !important; min-height: 1px !important; padding: 7px 0 0 130px !important; position: relative; top: -3px; margin-bottom: 10px !important; }');
  5741. GM_addStyle('.genRandomNumber strong { font-size: 12px !important; }');
  5742. GM_addStyle('.inventory { background-position: -14px -41px !important; height: 41px !important; top: 4px; }');
  5743. GM_addStyle('.inventory .items { top: 1px !important; }');
  5744. GM_addStyle('.inventory .cap { background-position: 0 -41px !important; height: 50px; width: 5px; }');
  5745. GM_addStyle('.friends { height: 50px; }');
  5746. GM_addStyle('.friends img { position: absolute !important; top: -30px !important; }');
  5747. GM_addStyle('.say .top-left { display: none; }');
  5748. GM_addStyle('.say .top-right { display: none; }');
  5749. GM_addStyle('.say .bottom-left { display: none; }');
  5750. GM_addStyle('.say .bottom-right { display: none; }');
  5751. GM_addStyle('.say .tail { display: none; }');
  5752. GM_addStyle('.say .content { border: 2px solid #7c7d80 !important; border-radius: 15px; padding: 15px !important; }');
  5753. GM_addStyle('.shout .avi-speech-hd { display: none; }');
  5754. GM_addStyle('.shout .avi-speech-ft { display: none; }');
  5755. GM_addStyle('.shout .avi-speech-rtc { display: none; }');
  5756. GM_addStyle('.shout .avi-speech-ltc { display: none; }');
  5757. GM_addStyle('.shout .avi-speech-rbc { display: none; }');
  5758. GM_addStyle('.shout .avi-speech-lbc { display: none; }');
  5759. GM_addStyle('.shout .avi-speech-tail { display: none; }');
  5760. GM_addStyle('.shout .avi-speech-lt { display: none; }');
  5761. GM_addStyle('.shout .avi-speech-rt { display: none; }');
  5762. GM_addStyle('.shout .avi-speech-bd { border: 2px solid #7c7d80 !important; border-radius: 15px; padding: 15px !important; margin: 7px 0px !important; }');
  5763. GM_addStyle('.whisper .top-left { display: none; }');
  5764. GM_addStyle('.whisper .top-right { display: none; }');
  5765. GM_addStyle('.whisper .bottom-left { display: none; }');
  5766. GM_addStyle('.whisper .bottom-right { display: none; }');
  5767. GM_addStyle('.whisper .tail { display: none; }');
  5768. GM_addStyle('.whisper .border-lt { display: none; }');
  5769. GM_addStyle('.whisper .border-rt { display: none; }');
  5770. GM_addStyle('.whisper .content { border: 2px solid #7c7d80 !important; border-radius: 15px; padding: 15px !important; }');
  5771. GM_addStyle('.think .top-left { display: none; }');
  5772. GM_addStyle('.think .top-right { display: none; }');
  5773. GM_addStyle('.think .bottom-left { display: none; }');
  5774. GM_addStyle('.think .bottom-right { display: none; }');
  5775. GM_addStyle('.think .tail { display: none; }');
  5776. GM_addStyle('.think .border-lt { display: none; }');
  5777. GM_addStyle('.think .border-rt { display: none; }');
  5778. GM_addStyle('.think .content { border: 2px solid #7c7d80 !important; border-radius: 15px; padding: 15px !important; margin-top: 0px !important; z-index: unset !important; }');
  5779. GM_addStyle('.think { padding-right: 0px !important; }')
  5780. GM_addStyle('.ornate .avi-speech-hd { display: none; }');
  5781. GM_addStyle('.ornate .avi-speech-ft { display: none; }');
  5782. GM_addStyle('.ornate .avi-speech-rtc { display: none; }');
  5783. GM_addStyle('.ornate .avi-speech-ltc { display: none; }');
  5784. GM_addStyle('.ornate .avi-speech-rbc { display: none; }');
  5785. GM_addStyle('.ornate .avi-speech-lbc { display: none; }');
  5786. GM_addStyle('.ornate .avi-speech-tail { display: none; }');
  5787. GM_addStyle('.ornate .avi-speech-lt { display: none; }');
  5788. GM_addStyle('.ornate .avi-speech-rt { display: none; }');
  5789. GM_addStyle('.ornate .avi-speech-bd { border: 2px solid #7c7d80 !important; border-radius: 15px; padding: 15px !important; margin: 7px 0px !important; min-height: 75px !important; }');
  5790. GM_addStyle('.document .avi-speech-hd { display: none; }');
  5791. GM_addStyle('.document .avi-speech-ft { display: none; }');
  5792. GM_addStyle('.document .avi-speech-rtc { display: none; }');
  5793. GM_addStyle('.document .avi-speech-ltc { display: none; }');
  5794. GM_addStyle('.document .avi-speech-rbc { display: none; }');
  5795. GM_addStyle('.document .avi-speech-lbc { display: none; }');
  5796. GM_addStyle('.document .avi-speech-tail { display: none; }');
  5797. GM_addStyle('.document .avi-speech-lt { display: none; }');
  5798. GM_addStyle('.document .avi-speech-rt { display: none; }');
  5799. GM_addStyle('.document .avi-speech-bd { background: #fff !important; border: 2px solid #7c7d80 !important; border-radius: 15px; padding: 15px !important; margin: 7px 0px !important; min-height: 75px !important; }');
  5800. GM_addStyle('.iedit_div { top: 21px !important; }');
  5801. GM_addStyle('.tagspaneven { width: 200px !important; left: 0px !important; background: transparent; }');
  5802. GM_addStyle('.tagspanodd { width: 200px !important; background: transparent; }');
  5803. GM_addStyle('.div_sigtoggle { background: #cbdfed none repeat scroll 0 0; height: 1px; position: relative; text-align: center; top: 45px; }');
  5804. GM_addStyle('.sig_show { background: #e8f1f6 none repeat scroll 0 0; border: 1px solid #fff; color: #87a3ba; cursor: pointer; display: inline-block; font-size: 8px; outline: 1px solid #c7daec; padding: 0; position: relative; top: -6px; width: 9px; }');
  5805.  
  5806. $('<div class="div_sigtoggle"><span class="sig_show">-</span></div>').insertBefore('.post-signature');
  5807. $('.sig_show').click(function(){
  5808. var uid = this.parentNode.parentNode.getElementsByClassName('user_title')[0].getElementsByTagName('img')[0].getAttribute('data-avatar-uid');
  5809. var fl_hidesig = 'fl_hidesig_' + uid;
  5810. var sig = $(this).parent().next();
  5811. var status;
  5812.  
  5813. if($(sig).css('display') == 'none') {
  5814. $(sig).css({ "display": "block" });
  5815. $(this).html('-');
  5816. status = 'open';
  5817.  
  5818. } else if ($(sig).css('display') == 'block') {
  5819. $(sig).css({ "display": "none" });
  5820. $(this).html('+');
  5821. status = 'close';
  5822. }
  5823.  
  5824. if ( status == 'close' ) {
  5825. GM_setValue(fl_hidesig, 'true');
  5826. } else if ( status == 'open' ) {
  5827. GM_deleteValue(fl_hidesig);
  5828. }
  5829. });
  5830.  
  5831. var usersig = document.getElementById('post_container').getElementsByClassName('post-signature');
  5832. for ( var i = 0 ; i < usersig.length ; i++ ) {
  5833. var userid = usersig[i].parentNode.getElementsByClassName('user_title')[0].getElementsByTagName('img')[0].getAttribute('data-avatar-uid');
  5834. var status = GM_getValue('fl_hidesig_'+userid, 'false');
  5835.  
  5836. if ( status == 'true' ) {
  5837. usersig[i].style.display = 'none';
  5838. usersig[i].previousSibling.getElementsByClassName('sig_show')[0].innerHTML = '+';
  5839. } else if ( status == 'false' ) {
  5840. usersig[i].style.display = 'block';
  5841. }
  5842. }
  5843. }
  5844.  
  5845. /*
  5846. * Owned Items Indicator
  5847. * Vendsearch
  5848. */
  5849.  
  5850. function ugm_ovs() {
  5851.  
  5852. var items = document.getElementsByClassName('sparkles_container');
  5853. var id;
  5854. var gsi = [];
  5855. var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=';
  5856.  
  5857. for ( i = 0 ; i < items.length ; i++ ) {
  5858. id = $(items[i]).find('a:first').attr('href').match(/\d+/)[0];
  5859. gsi.push('[111,[' + id + ']]');
  5860. }
  5861.  
  5862. url += '[' + gsi.join(',') + ']';
  5863.  
  5864. GM_xmlhttpRequest({
  5865. method: "GET",
  5866. url: url,
  5867. onload: function(response) {
  5868.  
  5869. for ( i = 0; i < items.length; i++ ) {
  5870.  
  5871. if (JSON.parse(response.responseText)[i][1]) {
  5872. $(items[i]).closest('.vend_rows_ex_rowA,.vend_rows_ex_rowB')[0].style.setProperty ("background-color", "#c7d6ec", "important");
  5873. }
  5874.  
  5875. }
  5876.  
  5877. }
  5878. });
  5879.  
  5880. addGlobalStyle('#gaia_content .vend_rows_ex_rowB {background: #f5f5f5; }');
  5881.  
  5882. }
  5883.  
  5884. /*
  5885. * Owned Items Indicator
  5886. * GoFusion
  5887. */
  5888.  
  5889. function ugm_ogf() {
  5890.  
  5891. var items = document.getElementsByClassName('formula-row');
  5892. var id;
  5893. var gsi = [];
  5894. var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json&m=';
  5895.  
  5896. for ( i = 0 ; i < items.length ; i++ ) {
  5897. id = $(items[i]).attr('id').match(/\d+/)[0];
  5898. gsi.push('[111,[' + id + ']]');
  5899. }
  5900.  
  5901. url += '[' + gsi.join(',') + ']';
  5902.  
  5903. GM_xmlhttpRequest({
  5904. method: "GET",
  5905. url: url,
  5906. onload: function(response) {
  5907.  
  5908. for ( i = 0; i < items.length; i++ ) {
  5909. if (JSON.parse(response.responseText)[i][1]) {
  5910. $(items[i])[0].style.setProperty ("background", "#306388", "important");
  5911. $(items[i])[0].style.overflow = 'hidden';
  5912. }
  5913.  
  5914. }
  5915.  
  5916. }
  5917. });
  5918.  
  5919. }
  5920.  
  5921. /*
  5922. * Easy Gifter Pm
  5923. */
  5924.  
  5925. function ugm_pmgifter(){
  5926. var sender = $('#gaia_content table.forumline > tbody > tr:nth-child(1) > td:nth-child(2) .genmed').text();
  5927. if (sender.indexOf('[NPC] Rina') > -1) {
  5928. var gifter = document.getElementById('post_container').getElementsByClassName('postbody')[0].getElementsByTagName('b')[0].nextSibling.nodeValue.trim().replace(': ','');
  5929. var pmbtn = document.getElementById('bd').getElementsByClassName('forumline');
  5930. if (gifter != "An anonymous benefactor") {
  5931. pmbtn[0].getElementsByClassName('info_button')[0].href += '&username=' + gifter;
  5932. pmbtn[2].getElementsByClassName('info_button')[0].href += '&username=' + gifter;
  5933. pmbtn[0].getElementsByClassName('info_button')[0].getElementsByClassName('button_text')[0].innerHTML = 'PM Gifter';
  5934. pmbtn[2].getElementsByClassName('info_button')[0].getElementsByClassName('button_text')[0].innerHTML = 'PM Gifter';
  5935. }
  5936. }
  5937. }
  5938.  
  5939. /*
  5940. * Instant PM Viewer
  5941. */
  5942.  
  5943. function ugm_pmviewer() {
  5944. GM_addStyle('.notify_item.notify_private_messages {display: flex !important;}');
  5945. if ( $('.notify_item_link.notify_icon_sprite.notify_icon_private_message').length ) { $('.notify_item_link.notify_icon_sprite.notify_icon_private_message').html($('.notify_item_link.notify_icon_sprite.notify_icon_private_message').html().replace('Private ', '')); }
  5946. $('<a id="open_ipm" class="open_pm">[+]</a>').insertAfter('.notify_icon_private_message');
  5947. if ($('.notify_icon_private_message').length > 0) { var ipm_n = parseInt($('.notify_icon_private_message').html().match(/\d+/)) + 1; }
  5948.  
  5949. $('.open_pm').click(function(){
  5950. $('#div_ipm').remove();
  5951. $('<div id="div_ipm">Loading...</div>').insertAfter('#open_ipm');
  5952. GM_xmlhttpRequest({
  5953. method: "GET",
  5954. url: "http://www.gaiaonline.com/profile/privmsg.php",
  5955. onload: function(response) {
  5956. var parser = new DOMParser();
  5957. var innerDoc = parser.parseFromString(response.responseText,"text/html");
  5958. var tbody_ipm = innerDoc.getElementById('pm_content').getElementsByTagName('table')[2].getElementsByTagName('table')[0].getElementsByTagName('table')[0].getElementsByTagName('tr');
  5959. var li_ipm = "";
  5960. var i;
  5961. for ( i = 1 ; i < ipm_n ; i++ ) {
  5962. var pmtitle = tbody_ipm[i].getElementsByClassName('topictitle')[1].getElementsByTagName('strong')[0].innerHTML;
  5963. var pmtitlelink = tbody_ipm[i].getElementsByClassName('topictitle')[1].getAttribute('href');
  5964. var user = tbody_ipm[i].getElementsByClassName('name')[1].getElementsByTagName('strong')[0].innerHTML;
  5965. var userlink = tbody_ipm[i].getElementsByClassName('name')[1].getAttribute('href');
  5966. li_ipm += '"<a href="' + pmtitlelink + '">' + pmtitle + '</a>" from <a href="' + userlink + '">' + user + '</a>.<br/>';
  5967. }
  5968. $('#div_ipm').html(li_ipm);
  5969. $('<span id="close_ipm">x</span>').appendTo('#div_ipm');
  5970. $('#close_ipm').click(function(){ $('#div_ipm').remove(); });
  5971. }
  5972. });
  5973. });
  5974. }
  5975.  
  5976. /*
  5977. * Quick PM Reply
  5978. */
  5979.  
  5980. function ugm_pmqr(){
  5981.  
  5982. if ( $('.button_text:contains("Reply")').length ) {
  5983.  
  5984. $('.button_text:contains("Reply")').parent().addClass('replybtn');
  5985. $('<a class="pmqr_btn"></a>').insertAfter('.replybtn');
  5986. var replylink = $('.replybtn').attr('href');
  5987. GM_addStyle(' .pmqr_btn { cursor: pointer; background: rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/gaia_global/body/pm/btn_newpm_79x63.gif") repeat scroll right top; display: block; float: left; height: 21px; left: -3px; margin-right: -3px; position: relative; top: 5px; width: 19px; } ');
  5988.  
  5989. $('.pmqr_btn').click(function(){
  5990. if ( $('.reply_div').length ) { $('.reply_div').remove(); }
  5991. $('<div class="reply_div"><div class="reply_loader"></div></div>').insertAfter(this);
  5992. GM_xmlhttpRequest({
  5993. method: "GET",
  5994. url: 'http://www.gaiaonline.com' + replylink,
  5995. onload: function(response) {
  5996. var parser=new DOMParser();
  5997. var innerDoc=parser.parseFromString(response.responseText,"text/html");
  5998. var reply_content = innerDoc.getElementById('entry_form').outerHTML;
  5999.  
  6000. $(reply_content).appendTo('.reply_div');
  6001. $('.reply_loader').remove();
  6002. $('<a id="reply_close"></a>').appendTo('.reply_div');
  6003. $('#reply_close').click(function(){ $('.reply_div').remove(); });
  6004. }
  6005. });
  6006. });
  6007. }
  6008. }
  6009.  
  6010. /*
  6011. * Commas Fixes
  6012. */
  6013.  
  6014. function ugm_commas() {
  6015.  
  6016. // My Gaia - Wishlist Notice
  6017.  
  6018. if ( document.location.pathname.match(/^\/mygaia/) ) {
  6019. $('.icon.wishlist_item').each(function(){
  6020. var con = $(this).parent().html();
  6021. var num = con.match(/(\d*) gold/)[1];
  6022. var com = addCommas(num);
  6023. $(this).parent().html(con.replace(/\d* gold/, com + ' gold'));
  6024. });
  6025. }
  6026.  
  6027. // Inventory - Sellback
  6028.  
  6029. if ( document.location.pathname.match(/^\/inventory/) ) {
  6030.  
  6031. // Item Detail
  6032.  
  6033. waitForKeyElements ('#pricing p:contains("Sellback")',ugm_commas_isell);
  6034. function ugm_commas_isell(){
  6035. var con = $('#pricing p:contains("Sellback")').html();
  6036. var num = con.match(/(\d*)g/)[1];
  6037. var com = addCommas(num);
  6038. $('#pricing p:contains("Sellback")').html(con.replace(/\d*g/, com + 'g'));
  6039. }
  6040.  
  6041. // Sell Verification
  6042.  
  6043. waitForKeyElements ('#basic .basic_text .note',ugm_commas_isell2);
  6044. function ugm_commas_isell2(){
  6045. var con = document.getElementsByClassName('basic_text')[0].getElementsByClassName('item_name')[0].nextSibling.nodeValue;
  6046. var num = con.match(/(\d*) gold/)[1];
  6047. var com = addCommas(num);
  6048. document.getElementsByClassName('basic_text')[0].getElementsByClassName('item_name')[0].nextSibling.nodeValue = con.replace(/\d* gold/, com + ' gold');
  6049. }
  6050. }
  6051.  
  6052. // Gold Cash Shop - Price
  6053.  
  6054. if ( document.location.pathname.match(/^\/gaia\/shopping.php/) ) {
  6055.  
  6056. waitForKeyElements ('#modal #item_price span', ugm_commas_gshop);
  6057. function ugm_commas_gshop(){
  6058. $('#modal #item_price span').each(function(){
  6059. var con = $(this).html();
  6060. var num = con.match(/(\d*)/)[1];
  6061. var com = addCommas(num);
  6062. $(this).html(con.replace(/\d*/, com));
  6063. });
  6064. }
  6065. }
  6066. }
  6067.  
  6068. /*
  6069. * Clickable Trade Items
  6070. */
  6071.  
  6072. function ugm_cti(){
  6073. $('.item-container:not(.inTrade)').each(function(){
  6074. var itemid = $(this).attr('rel').replace(/\d+./,'');
  6075. $(this).wrap('<a href="http://www.gaiaonline.com/marketplace/itemdetail/' + itemid + '" target="_blank"></a>');
  6076. $(this).find('.item-title').css({'color': '#000'});
  6077. });
  6078. }
  6079.  
  6080. /*
  6081. * Inventory Sorter
  6082. */
  6083.  
  6084. function ugm_ipar(){
  6085.  
  6086. var thebar = $('#save_order').parent();
  6087. $(thebar).css({'width': '670px', 'top': '5px', 'left': '3px'});
  6088. $('#save_order').css({'float': 'right'});
  6089. $('.intro-col.text-area').empty();
  6090. $('<div id="invotips">'+
  6091. '<b>Drag the thumbnails</b> to arrange. '+
  6092. '<b>Shift or Ctrl + Click</b> to select multiple items. '+
  6093. '<b>Alt + Click</b> to split an item stack. '+
  6094. '<b>Drag an item</b> to save after using sort button.'+
  6095. '</div>').appendTo('.intro-col.text-area');
  6096. GM_addStyle('.ugm_iparbtn {margin-right: 10px !important; color: #333; }');
  6097. GM_addStyle('#invotips { font-size: 12px; margin-bottom: 10px; margin-top: -10px; padding-left: 5px; }');
  6098.  
  6099. waitForKeyElements('.main-inventory input', ipar_ready)
  6100.  
  6101. function ipar_ready(){
  6102.  
  6103. $('.ugm_iparbtn').remove();
  6104. $('<div id="sort_order">' +
  6105. '<button id="ugm_wishsort1" class="cta-button-md ugm_iparbtn gAutoTooltip top-center delay-0" title="Alphabatically arrange from A to Z"><span>A-Z</span></button>' +
  6106. '<button id="ugm_wishsort2" class="cta-button-md ugm_iparbtn gAutoTooltip top-center delay-0" title="Alphabatically arrange from Z to A"><span>Z-A</span></button>' +
  6107. '<button id="ugm_wishsort3" class="cta-button-md ugm_iparbtn gAutoTooltip top-center delay-0" title="Groups similar items"><span>Type (Beta)</span></button>' +
  6108. '</div>').appendTo(thebar);
  6109.  
  6110. // A-Z
  6111.  
  6112. $('#ugm_wishsort1').click(function() {
  6113.  
  6114. var ugm_wishlist_list = $('.main-inventory > div:visible > ul'),
  6115. ugm_wishlist_li = ugm_wishlist_list.children('li');
  6116.  
  6117. var alphabeticallyOrderedDivs = ugm_wishlist_li.sort(function (a, b) {
  6118. return String.prototype.localeCompare.call($(a).attr('title'), $(b).attr('title'));
  6119. });
  6120. $(ugm_wishlist_list).html(alphabeticallyOrderedDivs);
  6121.  
  6122. return false;
  6123.  
  6124. });
  6125.  
  6126.  
  6127. // Z-A
  6128.  
  6129. $('#ugm_wishsort2').click(function() {
  6130.  
  6131. var ugm_wishlist_list = $('.main-inventory > div:visible > ul'),
  6132. ugm_wishlist_li = ugm_wishlist_list.children('li');
  6133.  
  6134. var alphabeticallyOrderedDivs = ugm_wishlist_li.sort(function (a, b) {
  6135. return String.prototype.localeCompare.call($(b).attr('title'), $(a).attr('title'));
  6136. });
  6137.  
  6138. $(ugm_wishlist_list).html(alphabeticallyOrderedDivs);
  6139.  
  6140. return false;
  6141.  
  6142. });
  6143.  
  6144. // Type
  6145.  
  6146. $('#ugm_wishsort3').click(function() {
  6147.  
  6148. var ugm_wishlist_list = $('.main-inventory > div:visible > ul'),
  6149. ugm_wishlist_li = ugm_wishlist_list.children('li');
  6150.  
  6151. var alphabeticallyOrderedDivs = ugm_wishlist_li.sort(function (a, b) {
  6152. return String.prototype.localeCompare.call($(a).attr('title').replace(/ \(\d+\)/,'').split(' ').splice(-1), $(b).attr('title').replace(/ \(\d+\)/,'').split(' ').splice(-1));
  6153. });
  6154.  
  6155. $(ugm_wishlist_list).html(alphabeticallyOrderedDivs);
  6156.  
  6157. return false;
  6158.  
  6159. });
  6160. }
  6161. }
  6162.  
  6163. /*
  6164. * Friends List Upgrade
  6165. */
  6166.  
  6167. function ugm_flu(){
  6168.  
  6169. // CSS for MyGaia
  6170.  
  6171. addGlobalStyle('.mygaia-friends > li {z-index:unset !important; cursor: pointer}');
  6172. addGlobalStyle('.mygaia-friends .udmu_div {background: transparent; height: 100px; width: 122px; position:absolute; top:60px; left: 0px; z-index: 3; display:none;}');
  6173. addGlobalStyle('.mygaia-friends li:hover .udmu_div {display:block;}');
  6174. addGlobalStyle('.mygaia-friends .udmu_ul {margin-left: 0 !important; position: relative; width: 100%;}');
  6175. addGlobalStyle('.mygaia-friends .udmu_li {background:#f7f9ff; border: 1px solid #a3b5c9; box-shadow:0 0 1px 2px #e0ebfc inset; display: inline; float: left; font-size: 11px; height: 18px; left: 0 !important; list-style: outside none none; margin: 0 0 -1px !important; position: relative; width: 70px !important;}');
  6176. addGlobalStyle('.mygaia-friends .udmu_li a {text-align: left !important; font-weight: normal !important; cursor:pointer; color: #333 !important; display: block; height: 100%; line-height: 18px; position: relative; text-decoration: none !important; text-indent: 6px; width: 100%;}');
  6177. addGlobalStyle('.mygaia-friends .udmu_li:hover {background: #edf0f4 !important;}');
  6178.  
  6179. $('.mygaia-friends li').each(function (){
  6180. var user_id = $(this).find('.user_name').find('a').attr('href').split("/")[5];
  6181. var user_dd = $(this);
  6182. udmu(user_id,user_dd);
  6183. });
  6184.  
  6185. $('.mygaia-friends .udmu_li:contains("Profile")').remove();
  6186. $('.mygaia-friends .udmu_li:contains("Add")').remove();
  6187. $('.mygaia-friends .udmu_li:contains("Block")').remove();
  6188. $('.mygaia-friends .udmu_li:contains("Journal")').remove();
  6189. $('.mygaia-friends .udmu_li:contains("Gift")').remove();
  6190. $('.mygaia-friends .udmu_li:contains("Achieve")').remove();
  6191. $('.mygaia-friends .udmu_li:contains("Equipped")').remove();
  6192. $('.mygaia-friends .udmu_li:contains("Wishlist")').remove();
  6193. $('.mygaia-friends .udmu_li:contains("Trade")').remove();
  6194. $('.mygaia-friends .udmu_li:contains("Store")').remove();
  6195.  
  6196. }
  6197.  
  6198. function ugm_flu2(){
  6199.  
  6200. addGlobalStyle('.status.friend a {border-right: 1px solid #5e6fcc; padding-right: 5px;}');
  6201.  
  6202. $('.status.friend').each(function() {
  6203.  
  6204. $(this).html($(this).html().replace('Online','').replace('Offline','').replace('Visit posters website', 'Web').replace('View Equipped List', 'Equip').replace(/&nbsp;/g, ' '));
  6205. $(this).find('a:contains("Profile")').remove();
  6206. $(this).find('a:contains("Join Them")').remove();
  6207. $(this).find('a:contains("Text")').remove();
  6208. $(this).find('span').remove();
  6209.  
  6210. });
  6211.  
  6212. }
  6213.  
  6214. /*
  6215. * Game Item Qty Sorter
  6216. */
  6217.  
  6218. function ugm_giqs(){
  6219.  
  6220. var thetable = $('.vend_rows_ex'),
  6221. therows = thetable.children('tr');
  6222. addGlobalStyle('#header_quantity {color:#3e53a2; font-weight:bold; text-decoration:underline; cursor: pointer;}');
  6223.  
  6224. function listingrebuild(){
  6225.  
  6226. $('.vend_rows_ex tr').each(function() {
  6227. $(this).removeClass('vend_rows_ex_rowA');
  6228. $(this).removeClass('vend_rows_ex_rowB');
  6229. });
  6230. $('.vend_rows_ex tr:even').addClass('vend_rows_ex_rowA');
  6231. $('.vend_rows_ex tr:odd').addClass('vend_rows_ex_rowB');
  6232.  
  6233. }
  6234.  
  6235. $('#header_quantity').click(function(){
  6236.  
  6237. var qtysorted = therows.sort(function (a, b) {
  6238. return parseInt($(b).find('.vend_rows_ex_quantity_field').html()) - parseInt($(a).find('.vend_rows_ex_quantity_field').html());
  6239. });
  6240. $(thetable).html(qtysorted);
  6241. listingrebuild();
  6242.  
  6243. });
  6244.  
  6245. function giqs_qtyd() {
  6246.  
  6247. var qtysorted = therows.sort(function (a, b) { return parseInt($(b).find('.vend_rows_ex_quantity_field').html()) - parseInt($(a).find('.vend_rows_ex_quantity_field').html()); });
  6248. $(thetable).html(qtysorted);
  6249. listingrebuild();
  6250. $(this).one('click', giqs_qtya);
  6251.  
  6252. }
  6253.  
  6254. function giqs_qtya() {
  6255.  
  6256. var qtysorted = therows.sort(function (a, b) { return parseInt($(a).find('.vend_rows_ex_quantity_field').html()) - parseInt($(b).find('.vend_rows_ex_quantity_field').html()); });
  6257. $(thetable).html(qtysorted);
  6258. listingrebuild();
  6259. $(this).one('click', giqs_qtyd);
  6260.  
  6261. }
  6262.  
  6263. $('#header_quantity').one('click', giqs_qtyd);
  6264.  
  6265. }
  6266.  
  6267. /*
  6268. * Async Notification Fix
  6269. */
  6270.  
  6271. function ugm_anf(){
  6272.  
  6273. addGlobalStyle('#Message.notify {z-index:2;}');
  6274.  
  6275. }
  6276.  
  6277. /*
  6278. * Detailed Outfit Buy Page
  6279. */
  6280.  
  6281. function ugm_dobp_css(){
  6282.  
  6283. addGlobalStyle('#outfit_details { padding: 9px; background: #eee; border: 1px solid #000; }');
  6284. addGlobalStyle('.yui3-overlay-focused { width: 430px !important; }');
  6285. addGlobalStyle('span.cost {font-weight: bold;}');
  6286. addGlobalStyle('span.amount {float: right;}');
  6287. addGlobalStyle('span.created_by {font-weight: bold;}');
  6288. addGlobalStyle('span.created_by a {font-weight: normal !important; color: #000; float: right; }');
  6289. addGlobalStyle('span.average {font-weight: bold;}');
  6290. addGlobalStyle('span.average .amount {font-weight: normal !important; float: right;}');
  6291. addGlobalStyle('.row.verify span {display: none;}');
  6292. addGlobalStyle('.notice {background: #ffc0cb; border: 1px solid #ff0000; padding: 5px; border-radius: 5px; }');
  6293. addGlobalStyle('.notice span.note { color: #000 !important; font-weight: bold; }');
  6294. addGlobalStyle('#outfit_preview a {margin-top: 5px;}');
  6295. addGlobalStyle('#outfit_details span {font-size: 12px;}');
  6296. addGlobalStyle('.row label {font-size: 12px;}');
  6297.  
  6298. addGlobalStyle('.itemlist .foo { margin: 4px; }');
  6299. addGlobalStyle('.itemlist li img { background: #eee; border: 1px solid #999; }');
  6300. addGlobalStyle('.itemlist span { font-size: 12px; background: #eee; border-top: 1px solid #999; border-right: 1px solid #999; border-bottom: 1px solid #999; padding: 0 3px; }');
  6301. addGlobalStyle('.itemlist a { color: #000; }');
  6302. addGlobalStyle('.itemlist img { cursor: pointer; }');
  6303. }
  6304.  
  6305. function ugm_dobp(){
  6306.  
  6307. function commaSeparateNumber(val){
  6308. while (/(\d+)(\d{3})/.test(val.toString())){
  6309. val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');
  6310. }
  6311. return val;
  6312. }
  6313.  
  6314. waitForKeyElements('#outfit_equiplist', dobp_ready);
  6315. function dobp_ready() {
  6316.  
  6317. $('<div id="outfit_total" style="margin-left:5px;"><strong>Total: </strong><a></a></div>').appendTo('.itemlist');
  6318. $('<a id="vovbtn" class="follow gray-button cta-button-sm"><span>View Real Value</span></a>').insertAfter('#outfit_preview a');
  6319.  
  6320. $('.itemlist li').each(function(){
  6321. var thethis = $(this);
  6322. $(thethis).find('img').wrap( '<a href="' + $(thethis).find('a').attr('href') + '" title="' + $(thethis).find('a').attr('title') +'" class="outfit_imglink"></a>');
  6323. });
  6324.  
  6325. $('#vovbtn').click(function(){
  6326.  
  6327. var oitems = document.getElementsByClassName('itemlist')[0].getElementsByTagName('li');
  6328. var k = 0;
  6329. var price = 0;
  6330.  
  6331. $('.itemlist li').each(function(){
  6332. var thethis = $(this);
  6333. $(thethis).find('span a').html('Loading...');
  6334. });
  6335.  
  6336. function timed_olbp () {
  6337. setTimeout(function () {
  6338. GM_xmlhttpRequest({
  6339. method: "GET",
  6340. url: oitems[k].getElementsByClassName('outfit_imglink')[0].href,
  6341. onload: function(response) {
  6342. var parser = new DOMParser();
  6343. var innerDoc = parser.parseFromString(response.responseText,"text/html");
  6344. var strongs = innerDoc.getElementById('item_basicdata').getElementsByTagName('strong');
  6345. for ( var i = 0 ; i < strongs.length ; i++ ) {
  6346. var ttt = "Lowest Buy Now Price: ";
  6347. if (strongs[i].innerHTML.indexOf(ttt) != -1) {
  6348. var l = k - 1;
  6349. var lbp = strongs[i].parentNode.innerHTML.replace('<strong>Lowest Buy Now Price: </strong>','').replace(' gold', '');
  6350. var mul = document.getElementsByClassName('itemlist')[0].getElementsByTagName('li')[l].getElementsByTagName('span')[0].textContent.replace(/(^\d+)(.+$)/i,'$1').trim();
  6351. document.getElementsByClassName('itemlist')[0].getElementsByTagName('li')[l].getElementsByTagName('span')[0].getElementsByTagName('a')[0].innerHTML = strongs[i].parentNode.innerHTML.replace('Lowest Buy Now Price: ','').replace(' gold', '');
  6352. price += parseFloat(lbp.replace(/,/g, '')) * parseFloat(mul) || 0;
  6353. document.getElementById('outfit_total').getElementsByTagName('a')[0].innerHTML = commaSeparateNumber(price);
  6354. }
  6355. }
  6356. }
  6357. });
  6358.  
  6359. if ( !$('.itemlist').length ){
  6360. return false;
  6361. }
  6362.  
  6363. k++;
  6364. if (k < oitems.length) {
  6365. timed_olbp();
  6366. }
  6367. }, 3000)
  6368. }
  6369. timed_olbp();
  6370. return false;
  6371. });
  6372. }
  6373. }
  6374.  
  6375. /*
  6376. * Forum Search Cleanup
  6377. */
  6378.  
  6379. function ugm_fsdc(){
  6380.  
  6381. addGlobalStyle('optgroup[label~=MISC] option { display: none; }');
  6382. addGlobalStyle('optgroup[label~=MISC] option[value~=hot-topics-archive] { display: block !important; }');
  6383. addGlobalStyle('optgroup[label~=MISC] option[value~=test-forum] { display: block !important; }');
  6384. addGlobalStyle('optgroup[label~=MISC] option[value~=memorable-threads] { display: block !important; }');
  6385. addGlobalStyle('optgroup[label~=MISC] option[value~=gaia-polls] { display: block !important; }');
  6386. addGlobalStyle('optgroup[label~=MISC] option[value~=forum-sticky-archive] { display: block !important; }');
  6387. addGlobalStyle('optgroup[label~=Hot] { background: #95596a; color: #fff; }');
  6388. addGlobalStyle('optgroup[label~=Hot] option { background: #874359; color: #fff; }');
  6389. addGlobalStyle('optgroup[label~=Online] { background: #8495d2; color: #fff; }');
  6390. addGlobalStyle('optgroup[label~=Online] option { background: #7d8cbd; color: #fff; }');
  6391. addGlobalStyle('optgroup[label~=Community] { background: #8ebe8e; color: #fff; }');
  6392. addGlobalStyle('optgroup[label~=Community] option { background: #8ab48a; color: #fff; }');
  6393. addGlobalStyle('optgroup[label~=Gaming] { background: #9577d3; color: #fff; }');
  6394. addGlobalStyle('optgroup[label~=Gaming] option { background: #9074c8; color: #fff; }');
  6395. addGlobalStyle('optgroup[label~=Entertainment] { background: #bf6cc4; color: #fff; }');
  6396. addGlobalStyle('optgroup[label~=Entertainment] option { background: #ac63b1; color: #fff; }');
  6397. addGlobalStyle('optgroup[label~=Corner] { background: #c0588b; color: #fff; }');
  6398. addGlobalStyle('optgroup[label~=Corner] option { background: #b85684; color: #fff; }');
  6399. addGlobalStyle('optgroup[label~=MISC] { background: #e2b960; color: #fff; }');
  6400. addGlobalStyle('optgroup[label~=MISC] option { background: #d1ac5d; color: #fff; }');
  6401. }
  6402.  
  6403. /*
  6404. * Page Numbers Input
  6405. */
  6406.  
  6407. function ugm_pni_forums(){
  6408.  
  6409. $('<div class="pnif_search pnidiv">' +
  6410. '<input type="text" placeholder="Jump">' +
  6411. '</div>').appendTo('[id="forum_hd_topic_pagelinks"]');
  6412.  
  6413. $('.pnif_search input').ForceNumericOnly();
  6414.  
  6415. $('.pnif_search input').keypress(function (e) {
  6416. var key = e.which;
  6417. if(key == 13){
  6418. var num = (parseFloat($(this).val()) - 1) * 40 + 1;
  6419. var url = $('.page_current').attr('href').replace(/(\d+)(?!.*\d)/,'');
  6420. if ($.isNumeric(num)) {
  6421. window.location.href = url + num;
  6422. }
  6423. }
  6424. });
  6425.  
  6426. }
  6427.  
  6428. function ugm_pni_search(){
  6429.  
  6430. $('<div class="pnis_search pnidiv">' +
  6431. '<input type="text" placeholder="Jump">' +
  6432. '</div>').appendTo('.pagination');
  6433.  
  6434. $('.pnis_search input').ForceNumericOnly();
  6435.  
  6436. $('.pnis_search input').keypress(function (e) {
  6437. var key = e.which;
  6438. if(key == 13){
  6439. var num = parseFloat($(this).val());
  6440. var url = window.location.href.replace(/(forum_sort=recent).*$/,'$1');
  6441. if ($.isNumeric(num)) {
  6442. window.location.href = url + '&p=' + num;
  6443. }
  6444. }
  6445. });
  6446.  
  6447. }
  6448.  
  6449. function ugm_pni_myposts(){
  6450.  
  6451. $('<div class="pnim_search pnidiv">' +
  6452. '<input type="text" placeholder="Jump">' +
  6453. '</div>').appendTo('[id="forum_hd_topic_pagelinks"]');
  6454.  
  6455. $('.pnim_search input').ForceNumericOnly();
  6456.  
  6457. $('.pnim_search input').keypress(function (e) {
  6458. var key = e.which;
  6459. if(key == 13){
  6460. var num = (parseFloat($(this).val()) - 1) * 10 + 1;
  6461. var url = $('.page_current').attr('href').replace(/(\d+)(?!.*\d)/,'');
  6462. if ($.isNumeric(num)) {
  6463. window.location.href = url + num;
  6464. }
  6465. }
  6466. });
  6467.  
  6468. }
  6469.  
  6470. function ugm_pni_mytopics(){
  6471.  
  6472. $('<div class="pnit_search pnidiv">' +
  6473. '<input type="text" placeholder="Jump">' +
  6474. '</div>').appendTo('[id="forum_hd_topic_pagelinks"]');
  6475.  
  6476. $('.pnit_search input').ForceNumericOnly();
  6477.  
  6478. $('.pnit_search input').keypress(function (e) {
  6479. var key = e.which;
  6480. if(key == 13){
  6481. var num = (parseFloat($(this).val()) - 1) * 40 + 1;
  6482. var url = $('.page_current').attr('href').replace(/(\d+)(?!.*\d)/,'');
  6483. if ($.isNumeric(num)) {
  6484. window.location.href = url + num;
  6485. }
  6486. }
  6487. });
  6488.  
  6489. }
  6490.  
  6491. /*
  6492. * Real Vote Count
  6493. */
  6494.  
  6495. function ugm_rvc(){
  6496.  
  6497. addGlobalStyle('#like_dislike_votes { font-weight: normal !important; }');
  6498. var str = $('#like_dislike_score').attr('title');
  6499. var lik = $('#like_dislike_score').attr('title').replace(/(.*) (people|person) like.*$/,'$1');
  6500. var dis = $('#like_dislike_score').attr('title').replace(/.*<br\/>(.*) (people|person) dislike.*$/,'$1');
  6501.  
  6502. if (str.indexOf('fancy') <= -1) {
  6503. $('#like_dislike_score').html(lik);
  6504. $('#like_dislike_votes').html(dis + ' dislikes');
  6505.  
  6506. var wto;
  6507.  
  6508. $('#like_it').click(function(){
  6509. clearTimeout(wto);
  6510. wto = setTimeout(function() {
  6511. $('#like_dislike_score').html(parseFloat(lik) + 1);
  6512. $('#like_dislike_votes').html(dis + ' dislikes');
  6513. }, 1000);
  6514. });
  6515.  
  6516. $('#dislike_it').click(function(){
  6517. clearTimeout(wto);
  6518. wto = setTimeout(function() {
  6519. $('#like_dislike_votes').html((parseFloat(dis) + 1) + ' dislikes');
  6520. $('#like_dislike_score').html(lik);
  6521. }, 1000);
  6522. });
  6523.  
  6524. }
  6525.  
  6526. }
  6527.  
  6528. /*!
  6529. * Hide Lake Kindred Pets
  6530. */
  6531.  
  6532. function ugm_hlkp() {
  6533.  
  6534. addGlobalStyle('.avi-pet { display: none !important;}');
  6535. addGlobalStyle('.avi-pet-odd { display: none !important;}');
  6536.  
  6537. }
  6538.  
  6539. /*!
  6540. * Trash / Sell / Donate Max
  6541. */
  6542.  
  6543. function ugm_tsdm() {
  6544.  
  6545. waitForKeyElements('#sell_quantity', tsdm_ready);
  6546. function tsdm_ready(){
  6547. var max = document.getElementsByClassName('basic_text')[0].getElementsByClassName('sell_quantity')[0].nextSibling.nodeValue;
  6548. var num = max.match(/of (\d*)/)[1];
  6549. $('#sell_quantity').val(num);
  6550. }
  6551.  
  6552. }
  6553.  
  6554. /*!
  6555. * Wishlist Delete All
  6556. */
  6557.  
  6558. function ugm_wda() {
  6559.  
  6560. var chk = false;
  6561.  
  6562. $('<button id="ugm_delall" class="ugm_wishsortbtn gAutoTooltip top-center delay-0" title="Checks all delete checkbox">Delete All</button>').insertAfter('.description');
  6563. $('#ugm_delall').click(function(){
  6564.  
  6565. if (!chk) {
  6566. $('.wish_box').each(function(){
  6567. var del = $(this).find('input[name*="[delete]"]');
  6568. $(del).prop('checked', true);
  6569. });
  6570. chk = true;
  6571. return false;
  6572. }
  6573. else {
  6574. $('.wish_box').each(function(){
  6575. var del = $(this).find('input[name*="[delete]"]');
  6576. $(del).prop('checked', false);
  6577. });
  6578. chk = false;
  6579. return false;
  6580. }
  6581.  
  6582. });
  6583.  
  6584. }
  6585.  
  6586. /*!
  6587. * MyStore BBCode
  6588. */
  6589.  
  6590. function ugm_mystorebb() {
  6591.  
  6592. $('<button id="mystorebb" class="gAutoTooltip top-center delay-0" title="Generate the BBCode of your store.">Get BBCode</button>').insertAfter('#outfit_tabs');
  6593.  
  6594. $('#mystorebb').click(function() {
  6595.  
  6596. var limg = "";
  6597. var lnam = "";
  6598. var oimg = "";
  6599. var hed1 = "Linked Thumbnails";
  6600. var hed2 = "Linked Names";
  6601. var hed3 = "Thumbnails";
  6602.  
  6603. $('#vend_rows_sh_container tbody tr').each(function(){
  6604.  
  6605. var theid = $(this).find('.vend_rows_sh_item_field a:eq(0)').attr('href').match(/(\d+)/)[0];
  6606. var theim = $(this).find('.vend_rows_sh_item_field img:eq(0)').attr('src');
  6607. var thenm = $(this).find('.vend_rows_sh_item_field a:eq(1)').html();
  6608.  
  6609. limg += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + theid + "/][img]http:"+ theim + "[/img][/url]";
  6610. lnam += "[url=http://www.gaiaonline.com/marketplace/itemdetail/" + theid + "/]"+ thenm + "[/url]" + "\n";
  6611. oimg += "[img]http:"+ theim + "[/img]";
  6612.  
  6613. });
  6614.  
  6615. ugm_global_bbcodegen(limg, lnam, oimg, hed1, hed2, hed3);
  6616.  
  6617. return false;
  6618.  
  6619. });
  6620.  
  6621. }
  6622.  
  6623. /*!
  6624. * Avatar Builder Upgrade
  6625. */
  6626.  
  6627. function ugm_nab(){
  6628.  
  6629. addGlobalStyle('#bd { width: 940px !important; }');
  6630. addGlobalStyle('#page_title { background: #ebebeb; border-bottom: 1px solid #cccccc; color: #524853; margin-top: 0 !important; padding: 5px; text-align: center; width: 100% !important; }');
  6631. addGlobalStyle('#ghost_container { margin-top: 20px; }');
  6632. //addGlobalStyle('#view_ghost { background: url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") no-repeat 0 -205px, rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") no-repeat 30px -103px; padding: 8px 10px 10px; position: relative; top: 14px; }');
  6633. addGlobalStyle('#view_ghost { background: url("http://s.cdn.gaiaonline.com/images/gaia_global/buttons/cta_button_sprite2.png?v=4") repeat scroll right -70px, rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/gaia_global/buttons/cta_button_sprite2.png?v=4") repeat scroll 0 -1px; border-radius: 6px; font-size: 11px; padding: 3px 8px; position: relative; top: 8px; color: #333333 !important;}');
  6634. //addGlobalStyle('#pick_cont { background: rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") repeat scroll 0 38px; color: #ffffff; padding: 3px 50px 2px; margin-left: 106px !important;');
  6635. //addGlobalStyle('#alt_gender_container { background: rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") repeat scroll 0 38px; color: #ffffff; left: -5px !important; padding: 10px 43px 12px;}');
  6636. //addGlobalStyle('#allow_ghosting_container { background: rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") repeat scroll 0 38px; color: #ffffff; left: -10px !important; padding: 10px 43px 12px; ');
  6637. addGlobalStyle('#char_image { border-color: #d1d2d8 #8d8e9f #8d8e9f #d1d2d8; border-style: solid; border-width: 1px; margin: -86px auto 0; padding: 90px 7px 90px !important; width: 728px; box-shadow: 2px 2px 2px 0 #bcbdc7;} ');
  6638. //addGlobalStyle('#base_options { background: #55505f; border: 1px solid #999999; display: block; height: 200px !important; overflow-x: hidden; overflow-y: auto; padding: 15px 0px 15px 5px !important; width: 117px !important; white-space: normal !important; margin-left: 30px; }');
  6639. addGlobalStyle('#base_options { background: #55505f; display: block; height: 37px !important; margin: 0 auto; overflow: hidden; padding: 0px !important; width: 699px !important; }');
  6640. addGlobalStyle('#base_options br { display: none; }');
  6641. addGlobalStyle('#base_options img { background: linear-gradient(180deg, #ffffff, #e2e2e2); border-radius: 5px; padding: 0px 10px; width: 30px !important; }');
  6642. addGlobalStyle('#equipment { margin: 0 auto 70px !important; width: 750px !important; }');
  6643. addGlobalStyle('#equip_list { border: 1px solid #999999; height: 40px !important; margin-left: 3px; margin-top: -5px !important; margin-bottom: 5px !important; overflow-x: hidden; overflow-y: scroll; padding: 4px 0 28px 5px !important; width: 737px !important;');
  6644. addGlobalStyle('.equipped { border: none !important; background: transparent !important; }');
  6645. addGlobalStyle('#arrowR{ background: url("http://s.cdn.gaiaonline.com/images/avatar/AnimalBase_DressUp_sprites.png") -22px 0px; width:18px; height:37px; float:right; cursor:pointer; }');
  6646. addGlobalStyle('#arrowL{ background: url("http://s.cdn.gaiaonline.com/images/avatar/AnimalBase_DressUp_sprites.png") -4px 0px; width:18px; height:37px; float:left; cursor:pointer; }');
  6647. addGlobalStyle('#b_cont{width:727px; height:37px; margin: 0 auto 4px;}');
  6648. addGlobalStyle('#b_listcont {overflow:hidden; width: 691px; float:left; }');
  6649. addGlobalStyle('#base_options{ min-width:3419px; float:left; }');
  6650. addGlobalStyle('.base{ width:30px; height:30px; float:left; position:relative; margin-right: 12px; padding: 4px 10px !important; }');
  6651. addGlobalStyle('.section_header { display: none; }');
  6652. addGlobalStyle('#ghost_form { top: 17px; }');
  6653. addGlobalStyle('#bbmale, #bbfemale, #bbpaw, #item_marketdetail_link { background: rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/gaia_global/body/arrows/ic_hyperlink_arrow_15x15.png") no-repeat scroll 0 0; font-size: 11px; left: 231px; margin-right: 8px; padding: 1px 0 0 19px; position: relative; }');
  6654. addGlobalStyle('#item_marketdetail_link { left: 395px !important; }');
  6655. addGlobalStyle('#bpgg { background: #55505f; height: 40px; margin: -86px auto 0; position: relative; width: 728px; text-align: center; }');
  6656. addGlobalStyle('#savereset { background: rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") repeat scroll 0 38px; height: 37px; margin: 0 auto; position: relative; width: 727px; }');
  6657. addGlobalStyle('#pick_cont { border-radius: 5px; color: #333333; margin-left: -15px !important; top: -13px; font-size: 0px; }');
  6658. addGlobalStyle('#pose { background: url("http://i.imgur.com/VNczNFJ.png") -103px 3px no-repeat,linear-gradient(180deg, #ffffff, #e2e2e2) repeat !important; border-radius: 3px; height: 25px !important; margin-left: 11px; padding: 3px 0 3px 7px; position: relative; top: 4px; width: 47px !important;');
  6659. addGlobalStyle('#pose_img { display: inline-block; padding: 0 !important; opacity: 0;}');
  6660. addGlobalStyle('#alt_gender_container { background: url("http://i.imgur.com/VNczNFJ.png") no-repeat scroll 5px 3px, rgba(0, 0, 0, 0) linear-gradient(180deg, #ffffff, #e2e2e2) repeat scroll 0 0; border-radius: 2px; display: inline-block; height: 31px; left: 12px !important; top: -16px; width: 54px; font-size: 0px; }');
  6661. addGlobalStyle('#alt_gender_mode { left: 20px; position: relative; top: 9px; cursor: pointer; }');
  6662. addGlobalStyle('#allow_ghosting_container { background: url("http://i.imgur.com/VNczNFJ.png") no-repeat scroll -54px 3px, rgba(0, 0, 0, 0) linear-gradient(180deg, #ffffff, #e2e2e2) repeat scroll 0 0; border-radius: 2px; display: inline-block; font-size: 0; height: 31px; left: 24px !important; top: -16px; width: 54px; }');
  6663. addGlobalStyle('#ghost_mode { left: 20px; position: relative; top: 9px; cursor: pointer; }');
  6664. addGlobalStyle('#download { background: url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") no-repeat scroll 0 -205px, url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") no-repeat scroll 30px -2px, rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/mygaia/avatar_dressup_button_sprite.png") repeat scroll 0 -103px !important; border-radius: 2px; height: 26px; padding: 3px 4px 0 2px; top: 4px; width: 83px; left: 271px !important; }');
  6665. addGlobalStyle('#download span { background: none !important; }');
  6666. addGlobalStyle('#avibuilder_reset { color: #ffffff !important; left: 279px; position: relative; text-decoration: underline !important; top: 4px; }');
  6667. addGlobalStyle('#nakedundo { background: linear-gradient(180deg, #ffffff, #dbdbdb); height: 40px; margin: 0 auto; position: relative; width: 728px; }');
  6668. addGlobalStyle('#undo { float: right; margin: 12px 12px 0 0; }');
  6669. addGlobalStyle('#naked { background: url("http://s.cdn.gaiaonline.com/images/gaia_global/body/avatar/ic_unequip_14x14.gif") no-repeat 0 1px; float: left; margin: 12px 0 0 12px; padding-left: 20px; }');
  6670. addGlobalStyle('#current_base_container { font-size: 11px; left: 547px; top: 34px !important; width: 200px !important; height: 27px; text-align: right;}');
  6671. addGlobalStyle('#search { background: #d1d5e0 none repeat scroll 0 0; border-radius: 2px; margin-left: 2px; margin-top: -76px; padding: 11px; width: 562px; }');
  6672. addGlobalStyle('#page1 { border: 1px solid #999999; border-radius: 2px; height: 400px; margin-left: 3px; margin-top: -9px; overflow: auto; padding: 5px; width: 732px !important; }');
  6673. addGlobalStyle('#page1 div { background: #fff !important; margin: 2px; }');
  6674. addGlobalStyle('#ghost_form input[value="Ghost"] { background: url("http://s.cdn.gaiaonline.com/images/gaia_global/buttons/cta_button_sprite2.png?v=4") repeat scroll right -70px, rgba(0, 0, 0, 0) url("http://s.cdn.gaiaonline.com/images/gaia_global/buttons/cta_button_sprite2.png?v=4") repeat scroll 0 -1px; border: medium none; border-radius: 5px; color: #333333; font-size: 11px; height: 17px; padding: 1px; position: relative; top: -1px; width: 50px; cursor: pointer;}');
  6675.  
  6676. }
  6677.  
  6678. function ugm_nab2(){
  6679.  
  6680. // Base Picker
  6681.  
  6682. $('<div id="b_cont"><div id="arrowL"></div><div id="arrowR"></div><div id="b_listcont"></div></div>').insertBefore('#pick_cont');
  6683. $('#base_options').appendTo('#b_listcont');
  6684.  
  6685. var index = 0;
  6686. var endIndex = 4;
  6687.  
  6688. $('#arrowR').click(function() {
  6689. if(index < 3 ){
  6690. index++;
  6691. $('#base_options').animate({
  6692. marginLeft: "-=682px"
  6693. }, "fast");
  6694. }
  6695. else if (index < endIndex ){
  6696. index++;
  6697. $('#base_options').animate({
  6698. marginLeft: "-=494px"
  6699. }, "fast");
  6700. }
  6701. });
  6702.  
  6703. $('#arrowL').click(function() {
  6704. if(index > 3){
  6705. index--;
  6706. $('#base_options').animate({
  6707. marginLeft: "+=494px"
  6708. }, "fast");
  6709. }
  6710. else if(index > 0){
  6711. index--;
  6712. $('#base_options').animate({
  6713. marginLeft: "+=682px"
  6714. }, "fast");
  6715. }
  6716. });
  6717.  
  6718. // Save Reset
  6719.  
  6720. $('<div id="savereset"></div>').insertBefore('#char_image');
  6721. $('#download').appendTo('#savereset');
  6722. $('#avibuilder_reset').appendTo('#savereset');
  6723.  
  6724. // BG, Pose, Gender, Ghost
  6725.  
  6726. $('#pose_img').removeAttr('src');
  6727. $('<div id="bpgg"></div>').insertAfter('#char_image');
  6728. $('#pick_cont').appendTo('#bpgg');
  6729. $('#pose').appendTo('#bpgg');
  6730. $('#alt_gender_container').appendTo('#bpgg');
  6731. $('#allow_ghosting_container').appendTo('#bpgg');
  6732.  
  6733. var bbt = $('#bbmale').parent();
  6734. $(bbt).contents().filter(function() {
  6735. return this.nodeType===3;
  6736. }).remove();
  6737.  
  6738. $('#current_base_container').contents().filter(function() {
  6739. return this.nodeType===3;
  6740. }).remove();
  6741.  
  6742. // Naked Undo
  6743.  
  6744. $('<div id="nakedundo"></div>').insertAfter('#bpgg');
  6745. $('#undo').appendTo('#nakedundo');
  6746. $('#naked').appendTo('#nakedundo');
  6747.  
  6748. addGlobalStyle('#avi_controls { display: none; }');
  6749. }
  6750.  
  6751. /*!
  6752. * GaiaUpgrade Report
  6753. */
  6754.  
  6755. function ugm_gurep(){
  6756.  
  6757. $('button[name="action_preview"], button[name="action_submit"]').click(function(){
  6758. var t = $('#message').val();
  6759. if (t == "[mygaiaupgradesettings]") {
  6760.  
  6761. var c = "";
  6762.  
  6763. $('.main_sub_cb input:checkbox:checked').each(function(){
  6764. var n = $(this).parent().next().html();
  6765. var h = $(this).parent().parent().parent().parent().parent().prev().find('a').html();
  6766. c += "\n[" + h + "] " + n;
  6767. });
  6768.  
  6769. var w;
  6770. var p;
  6771.  
  6772. if ($('#ugm_wishnotifier_wishval').val() != ''){
  6773. w = "Enabled";
  6774. } else {
  6775. w = "Disabled";
  6776. }
  6777.  
  6778. if ($('#ugm_wishnotifier_idval').val() != ''){
  6779. p = "Enabled";
  6780. } else {
  6781. p = "Disabled";
  6782. }
  6783.  
  6784. var m = "[size=11][b]GaiaUpgrade Version:[/b] " + $(".main_sub_versions span").html().replace("Current version: ", "") + "\n";
  6785. m += "\n[b]Browser:[/b] " + navigator.userAgent + "\n";
  6786. m += "\n[b]Enabled Features:[/b]\n";
  6787. m += c;
  6788. m += "\n\n[b]Wishlist Notifier:[/b] " + w + "\n";
  6789. m += "\n[b]Price Notifier:[/b] " + p + "\n";
  6790. m += "[/size]";
  6791.  
  6792. $('#message').val(m);
  6793. }
  6794. });
  6795. }
  6796.  
  6797. /*!
  6798. * Disable Avatar Favorites
  6799. */
  6800.  
  6801. function ugm_daf() {
  6802.  
  6803. addGlobalStyle('.add_favorite { display: none;}');
  6804.  
  6805.  
  6806. }
Add Comment
Please, Sign In to add comment