Changes

modify skyrim version
Line 13: Line 13:  
   
 
   
 
*/
 
*/
 +
 +
 +
 +
function fixFirstBadEscapeCharacter(uri) {
 +
    var patt=/\.([0-9a-fA-F][0-9a-fA-F])/;
 +
    var escapeChar = patt.exec(uri);
 +
    if(escapeChar.length > 0){
 +
        var val = escapeChar[1];
 +
        var patt2=new RegExp("\." + val, 'g');
 +
        var ret = uri.replace(patt2, '%' + val);
 +
        return ret;
 +
    }
 +
    return uri;
 +
 +
}
 +
 +
function fixBadEscapeCharacters(uri) {
 +
    var patt=/\.[0-9a-fA-F][0-9a-fA-F]/;
 +
    var uri2 = uri;
 +
    var c = 0;
 +
    while(patt.test(uri2) && c < 15){
 +
        uri2 = fixFirstBadEscapeCharacter(uri2);
 +
        c++;
 +
    }
 +
    //return unescape(uri2);
 +
return uri2;
 +
}
 
   
 
   
 
// This function adds the default configuration and also custom  
 
// This function adds the default configuration and also custom  
Line 18: Line 45:  
BalloonConfig = function(balloon, set) {
 
BalloonConfig = function(balloon, set) {
 
   set = set || '';
 
   set = set || '';
 +
 +
 +
  //http://images3.wikia.nocookie.net/elderscrolls/images/e/e2/ElderScrolls_balloon.png
 +
  //http://images4.wikia.nocookie.net/elderscrolls/images/a/a4/ElderScrolls_balloon_ie.png
 +
  //http://images4.wikia.nocookie.net/elderscrolls/images/7/77/ElderScrolls_close.png
 +
  //http://images1.wikia.nocookie.net/elderscrolls/images/5/59/ElderScrolls_down_left.png
 +
  //http://images1.wikia.nocookie.net/elderscrolls/images/5/5f/ElderScrolls_down_right.png
 +
  //http://images1.wikia.nocookie.net/elderscrolls/images/c/c8/ElderScrolls_up_left.png
 +
  //http://images3.wikia.nocookie.net/elderscrolls/images/2/2b/ElderScrolls_up_right.png
 
   
 
   
 
   ////////////////////////////////////////////////////////////////////////////////////////
 
   ////////////////////////////////////////////////////////////////////////////////////////
Line 26: Line 62:  
   // values can be overriden in custom config cases (see below)                        //
 
   // values can be overriden in custom config cases (see below)                        //
 
   ////////////////////////////////////////////////////////////////////////////////////////
 
   ////////////////////////////////////////////////////////////////////////////////////////
   if (!balloon.configured || set == 'KancolleBubble') {                               //
+
   if (!balloon.configured || set == 'KancolleBubble') {                             //
 
     balloon.fontColor          = 'white';                                              //
 
     balloon.fontColor          = 'white';                                              //
 
     balloon.fontFamily        = 'Arial, sans-serif';                                  //
 
     balloon.fontFamily        = 'Arial, sans-serif';                                  //
     balloon.fontSize          = '12pt';                                                //
+
     balloon.fontSize          = '10pt';                                                //
     balloon.minWidth          = 100;                                                  //
+
     balloon.minWidth          = 150;                                                  //
     balloon.maxWidth          = 750;                                                  //
+
     balloon.maxWidth          = 700;                                                  //
     balloon.delayTime          = 350;                                                  //
+
     balloon.delayTime          = 300;                                                  //
 +
 
 +
 
 +
 
 +
 
 
     balloon.vOffset            = 10;                                                    //
 
     balloon.vOffset            = 10;                                                    //
 
     balloon.hOffset            = 10;                                                    //
 
     balloon.hOffset            = 10;                                                    //
 
     balloon.stem              = true;                                                  //
 
     balloon.stem              = true;                                                  //
     balloon.images            = 'http://images.wikia.nocookie.net/deadisland/images'; //
+
     balloon.images            = 'http://images3.wikia.nocookie.net/elderscrolls/images';//
     balloon.ieImage            = 'e/e9/Deadisland_balloon_ie.png';                     //
+
     balloon.ieImage            = 'a/a4/ElderScrolls_balloon_ie.png';                   //
     balloon.balloonImage      = '9/96/Deadisland_balloon.png';                         //
+
     balloon.balloonImage      = 'e/e2/ElderScrolls_balloon.png';                       //
     balloon.upLeftStem        = '8/82/Deadisland_up_left.png';                         //
+
     balloon.upLeftStem        = 'c/c8/ElderScrolls_up_left.png';                       //
     balloon.downLeftStem      = '2/24/Deadisland_down_left.png';                       //
+
     balloon.downLeftStem      = '5/59/ElderScrolls_down_left.png';                     //
     balloon.upRightStem        = '2/2c/Deadisland_up_right.png';                       //
+
     balloon.upRightStem        = '2/2b/ElderScrolls_up_right.png';                     //
     balloon.downRightStem      = '0/02/Deadisland_down_right.png';                     //
+
     balloon.downRightStem      = '5/5f/ElderScrolls_down_right.png';                   //
     balloon.closeButton        = 'a/a6/Deadisland_close.png';                           //
+
     balloon.closeButton        = '7/77/ElderScrolls_close.png';                         //
 
     balloon.closeButtonWidth  = 16;                                                    //
 
     balloon.closeButtonWidth  = 16;                                                    //
 
     balloon.allowAJAX          = true;                                                  //
 
     balloon.allowAJAX          = true;                                                  //
 
     balloon.allowIframes      = true;                                                  //
 
     balloon.allowIframes      = true;                                                  //
 
     balloon.trackCursor        = true;                                                  //
 
     balloon.trackCursor        = true;                                                  //
 +
balloon.allowScripts      = true;                                                  //
 
     balloon.shadow            = 20;                                                    //
 
     balloon.shadow            = 20;                                                    //
 
     balloon.padding            = 10;                                                    //
 
     balloon.padding            = 10;                                                    //
Line 54: Line 95:  
     balloon.vOffset            = 1;                                                    //
 
     balloon.vOffset            = 1;                                                    //
 
     balloon.hOffset            = 1;                                                    //
 
     balloon.hOffset            = 1;                                                    //
     balloon.opacity            = 0.95;                                                   //
+
     balloon.opacity            = 0.95;                                                 //
 +
 
 
     balloon.configured        = set || true;                                          //
 
     balloon.configured        = set || true;                                          //
 
   }                                                                                    //
 
   }                                                                                    //
Line 497: Line 539:  
   var wrapper = document.createElement('div');
 
   var wrapper = document.createElement('div');
 
   wrapper.id = 'contentWrapper';
 
   wrapper.id = 'contentWrapper';
   self.contents.appendChild(wrapper);
+
   wrapper.innerHTML = helpText;
+
 +
   if(self.tBalloonType == 'ajax'){
 +
    wrapper.setAttribute('class','WikiaArticle');
 +
    wrapper.setAttribute('style','width:100%; border:0px; padding:0px; margin:0px;');
 +
var tableBegin = '<table class="wikitable" style="width:100%; border:0px; padding:0px; margin:0px;">';
 +
tableBegin = tableBegin + '<tr><th style="text-align:center; background-color:#790700;"><a href="/wiki/' + self.tBalloonLink + '"><span style="color:#D5D4D4; font-weight:700; font-size:12pt;">Click Here To View The Full Article</span></a></th></tr>';
 +
    tableBegin = tableBegin + '<tr><td>';
 +
    var tableEnd = '</td></tr></table>';
 +
self.contents.appendChild(wrapper);
 +
wrapper.innerHTML = tableBegin + helpText + tableEnd;
 +
   } else {
 +
self.contents.appendChild(wrapper);
 +
wrapper.innerHTML = helpText;
 +
  }
 +
 
   
 
   
 
   // how and where to draw the balloon
 
   // how and where to draw the balloon
Line 1,226: Line 1,282:  
   
 
   
 
   // request the contents
 
   // request the contents
 +
  //var $tmpOverlayIcon = $('.overlayIcon');
 +
  //var $tmpOverlayIcon_children = $tmpOverlayIcon.children();
 +
  //var $tmpOverlayIcon_children_children = $tmpOverlayIcon_children.children();
 +
  //$tmpOverlayIcon.css('cursor','progress');
 +
  //$tmpOverlayIcon_children.css('cursor','progress');
 +
  //$tmpOverlayIcon_children_children.css('cursor','progress');
 
   this.currentHelpText = this.getContents(caption);
 
   this.currentHelpText = this.getContents(caption);
 
   this.loadedFromElement = false;
 
   this.loadedFromElement = false;
 +
  //$tmpOverlayIcon.css('cursor','pointer');
 +
  //$tmpOverlayIcon_children.css('cursor','pointer');
 +
  //$tmpOverlayIcon_children_children.css('cursor','pointer');
 
   
 
   
 
   return this.currentHelpText;;
 
   return this.currentHelpText;;
Line 1,488: Line 1,553:  
}
 
}
 
   
 
   
+
 
 
Box.prototype.addCloseButton = function () {
 
Box.prototype.addCloseButton = function () {
 
   var self = currentBalloonClass;
 
   var self = currentBalloonClass;
Line 1,497: Line 1,562:  
   var closeButton = document.getElementById('closeButton');
 
   var closeButton = document.getElementById('closeButton');
 
   
 
   
+
 
 
   if (!closeButton) {
 
   if (!closeButton) {
 
     closeButton = new Image;
 
     closeButton = new Image;
Line 1,528: Line 1,593:  
version: 2.3.0
 
version: 2.3.0
 
*/
 
*/
 +
if(typeof YAHOO2=="undefined"){var YAHOO2={}}YAHOO2.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO2;for(j=(d[0]=="YAHOO2")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}return o};YAHOO2.log=function(msg,cat,src){var l=YAHOO2.widget.Logger;if(l&&l.log){return l.log(msg,cat,src)}else{return false}};YAHOO2.register=function(name,mainClass,data){var mods=YAHOO2.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]}}var m=mods[name],v=data.version,b=data.build,ls=YAHOO2.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m)}if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b}else{YAHOO2.log("mainClass is undefined for module "+name,"warn")}};YAHOO2.env=YAHOO2.env||{modules:[],listeners:[]};YAHOO2.env.getVersion=function(name){return YAHOO2.env.modules[name]||null};YAHOO2.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1}m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1])}if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1])}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1])}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1])}}}}}return o}();(function(){YAHOO2.namespace("util","widget","example");if(typeof YAHOO2_config!="undefined"){var l=YAHOO2_config.listener,ls=YAHOO2.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break}}if(unique){ls.push(l)}}}})();YAHOO2.lang={isArray:function(o){if(o){var l=YAHOO2.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length)}return false},isBoolean:function(o){return typeof o==='boolean'},isFunction:function(o){return typeof o==='function'},isNull:function(o){return o===null},isNumber:function(o){return typeof o==='number'&&isFinite(o)},isObject:function(o){return(o&&(typeof o==='object'||YAHOO2.lang.isFunction(o)))||false},isString:function(o){return typeof o==='string'},isUndefined:function(o){return typeof o==='undefined'},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop)}return!YAHOO2.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop]},_IEEnumFix:function(r,s){if(YAHOO2.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO2.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO2.lang.extend failed, please check that "+"all dependencies are included.");}var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc}if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i]}YAHOO2.lang._IEEnumFix(subc.prototype,overrides)}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]]}}else{for(p in s){if(override||!r[p]){r[p]=s[p]}}YAHOO2.lang._IEEnumFix(r,s)}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i])}YAHOO2.lang.augmentObject.apply(this,a)},dump:function(o,d){var l=YAHOO2.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o}else if(l.isFunction(o)){return FUN}d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ)}else{s.push(o[i])}s.push(COMMA)}if(s.length>1){s.pop()}s.push("]")}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ)}else{s.push(o[i])}s.push(COMMA)}}if(s.length>1){s.pop()}s.push("}")}return s.join("")},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO2.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break}j=s.indexOf(RBRACE,i);if(i+1>=j){break}token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k)}v=o[key];if(f){v=f(key,v,meta)}if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10))}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4)}if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10))}else{v=v.toString()}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token}s=s.substring(0,i)+v+s.substring(j+1)}for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g")}return s},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"")}catch(e){return s}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO2.lang.augmentObject(o,a[i],true)}return o},isValue:function(o){var l=YAHOO2.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o))}};YAHOO2.util.Lang=YAHOO2.lang;YAHOO2.lang.augment=YAHOO2.lang.augmentProto;YAHOO2.augment=YAHOO2.lang.augmentProto;YAHOO2.extend=YAHOO2.lang.extend;YAHOO2.register("yahoo",YAHOO2,{version:"2.3.0",build:"442"});(function(){var Y=YAHOO2.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO2.env.ua.opera,isSafari=YAHOO2.env.ua.webkit,isGecko=YAHOO2.env.ua.gecko,isIE=YAHOO2.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property}if(propertyCache[property]){return propertyCache[property]}var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())}propertyCache[property]=converted;return converted};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re}return re};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat'}var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)]}return el.style[property]||value}}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity}catch(e){try{val=el.filters('alpha').opacity}catch(e){}}return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value)}}}else{getStyle=function(el,property){return el.style[property]}}if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO2.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1}}break;case'float':property='styleFloat';default:el.style[property]=val}}}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat'}el.style[property]=val}}var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node))};YAHOO2.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el}if(YAHOO2.lang.isString(el)){return document.getElementById(el)}if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i])}return c}return el},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property)};return Y.Dom.batch(el,f,Y.Dom,true)},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val)};Y.Dom.batch(el,f,Y.Dom,true)},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false}var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)]}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true}parentNode=parentNode.offsetParent}}if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop}}parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName)){if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop}parentNode=parentNode.parentNode}return pos};return Y.Dom.batch(el,f,Y.Dom,true)},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0]};return Y.Dom.batch(el,f,Y.Dom,true)},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1]};return Y.Dom.batch(el,f,Y.Dom,true)},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative'}var pageXY=this.getXY(el);if(pageXY===false){return false}var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft}if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop}if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px'}if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px'}if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true)}}};Y.Dom.batch(el,f,Y.Dom,true)},setX:function(el,x){Y.Dom.setXY(el,[x,null])},setY:function(el,y){Y.Dom.setXY(el,[null,y])},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false}var region=Y.Region.getRegion(el);return region};return Y.Dom.batch(el,f,Y.Dom,true)},getClientWidth:function(){return Y.Dom.getViewportWidth()},getClientHeight:function(){return Y.Dom.getViewportHeight()},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[]}var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i])}}}return nodes},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className)};return Y.Dom.batch(el,f,Y.Dom,true)},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false}el.className=YAHOO2.lang.trim([el.className,className].join(' '));return true};return Y.Dom.batch(el,f,Y.Dom,true)},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false}var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className)}el.className=YAHOO2.lang.trim(el.className);return true};return Y.Dom.batch(el,f,Y.Dom,true)},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false}var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true}el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName)}el.className=YAHOO2.lang.trim(el.className);return true};return Y.Dom.batch(el,f,Y.Dom,true)},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id}var id=prefix+id_counter++;if(el){el.id=id}return id};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments)},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false}var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node)}else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16)}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack})}return false};return Y.Dom.batch(needle,f,Y.Dom,true)},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true}}return false}return this.isAncestor(document.documentElement,el)};return Y.Dom.batch(el,f,Y.Dom,true)},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[]}var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i])}}}return nodes},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false}var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o)}var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o)}return collection},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight}return height},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth}return width},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node}}return null},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null}var method=function(el){return Y.Dom.hasClass(el,className)};return Y.Dom.getAncestorBy(node,method)},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null}var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase()};return Y.Dom.getAncestorBy(node,method)},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node}}return null},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null}return Y.Dom.getPreviousSiblingBy(node)},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node}}return null},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null}return Y.Dom.getNextSiblingBy(node)},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method)},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null}return Y.Dom.getFirstChildBy(node)},getLastChildBy:function(node,method){if(!node){return null}var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method)},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node)},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node}return false});return children},getChildren:function(node){node=Y.Dom.get(node);if(!node){}return Y.Dom.getChildrenBy(node)},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft)},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop)},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null}return referenceNode.parentNode.insertBefore(newNode,referenceNode)},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null}if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}else{return referenceNode.parentNode.appendChild(newNode)}}}})();YAHOO2.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l};YAHOO2.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom)};YAHOO2.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO2.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO2.util.Region(t,r,b,l)}else{return null}};YAHOO2.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO2.util.Region(t,r,b,l)};YAHOO2.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}")};YAHOO2.util.Region.getRegion=function(el){var p=YAHOO2.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO2.util.Region(t,r,b,l)};YAHOO2.util.Point=function(x,y){if(YAHOO2.lang.isArray(x)){y=x[1];x=x[0]}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y};YAHOO2.util.Point.prototype=new YAHOO2.util.Region();YAHOO2.register("dom",YAHOO2.util.Dom,{version:"2.3.0",build:"442"});
 +
 +
 +
 +
 
   
 
   
if(typeof YAHOO2=="undefined"){var YAHOO2={}}YAHOO2.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO2;for(j=(d[0]=="YAHOO2")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}return o};YAHOO2.log=function(msg,cat,src){var l=YAHOO2.widget.Logger;if(l&&l.log){return l.log(msg,cat,src)}else{return false}};YAHOO2.register=function(name,mainClass,data){var mods=YAHOO2.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]}}var m=mods[name],v=data.version,b=data.build,ls=YAHOO2.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m)}if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b}else{YAHOO2.log("mainClass is undefined for module "+name,"warn")}};YAHOO2.env=YAHOO2.env||{modules:[],listeners:[]};YAHOO2.env.getVersion=function(name){return YAHOO2.env.modules[name]||null};YAHOO2.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1}m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1])}if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1])}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1])}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1])}}}}}return o}();(function(){YAHOO2.namespace("util","widget","example");if(typeof YAHOO2_config!="undefined"){var l=YAHOO2_config.listener,ls=YAHOO2.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break}}if(unique){ls.push(l)}}}})();YAHOO2.lang={isArray:function(o){if(o){var l=YAHOO2.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length)}return false},isBoolean:function(o){return typeof o==='boolean'},isFunction:function(o){return typeof o==='function'},isNull:function(o){return o===null},isNumber:function(o){return typeof o==='number'&&isFinite(o)},isObject:function(o){return(o&&(typeof o==='object'||YAHOO2.lang.isFunction(o)))||false},isString:function(o){return typeof o==='string'},isUndefined:function(o){return typeof o==='undefined'},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop)}return!YAHOO2.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop]},_IEEnumFix:function(r,s){if(YAHOO2.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO2.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO2.lang.extend failed, please check that "+"all dependencies are included.");}var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc}if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i]}YAHOO2.lang._IEEnumFix(subc.prototype,overrides)}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]]}}else{for(p in s){if(override||!r[p]){r[p]=s[p]}}YAHOO2.lang._IEEnumFix(r,s)}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i])}YAHOO2.lang.augmentObject.apply(this,a)},dump:function(o,d){var l=YAHOO2.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o}else if(l.isFunction(o)){return FUN}d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ)}else{s.push(o[i])}s.push(COMMA)}if(s.length>1){s.pop()}s.push("]")}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ)}else{s.push(o[i])}s.push(COMMA)}}if(s.length>1){s.pop()}s.push("}")}return s.join("")},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO2.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break}j=s.indexOf(RBRACE,i);if(i+1>=j){break}token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k)}v=o[key];if(f){v=f(key,v,meta)}if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10))}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4)}if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10))}else{v=v.toString()}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token}s=s.substring(0,i)+v+s.substring(j+1)}for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g")}return s},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"")}catch(e){return s}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO2.lang.augmentObject(o,a[i],true)}return o},isValue:function(o){var l=YAHOO2.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o))}};YAHOO2.util.Lang=YAHOO2.lang;YAHOO2.lang.augment=YAHOO2.lang.augmentProto;YAHOO2.augment=YAHOO2.lang.augmentProto;YAHOO2.extend=YAHOO2.lang.extend;YAHOO2.register("yahoo",YAHOO2,{version:"2.3.0",build:"442"});(function(){var Y=YAHOO2.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO2.env.ua.opera,isSafari=YAHOO2.env.ua.webkit,isGecko=YAHOO2.env.ua.gecko,isIE=YAHOO2.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property}if(propertyCache[property]){return propertyCache[property]}var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())}propertyCache[property]=converted;return converted};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re}return re};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat'}var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)]}return el.style[property]||value}}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity}catch(e){try{val=el.filters('alpha').opacity}catch(e){}}return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value)}}}else{getStyle=function(el,property){return el.style[property]}}if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO2.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1}}break;case'float':property='styleFloat';default:el.style[property]=val}}}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat'}el.style[property]=val}}var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node))};YAHOO2.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el}if(YAHOO2.lang.isString(el)){return document.getElementById(el)}if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i])}return c}return el},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property)};return Y.Dom.batch(el,f,Y.Dom,true)},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val)};Y.Dom.batch(el,f,Y.Dom,true)},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false}var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)]}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true}parentNode=parentNode.offsetParent}}if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop}}parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName)){if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop}parentNode=parentNode.parentNode}return pos};return Y.Dom.batch(el,f,Y.Dom,true)},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0]};return Y.Dom.batch(el,f,Y.Dom,true)},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1]};return Y.Dom.batch(el,f,Y.Dom,true)},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative'}var pageXY=this.getXY(el);if(pageXY===false){return false}var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft}if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop}if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px'}if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px'}if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true)}}};Y.Dom.batch(el,f,Y.Dom,true)},setX:function(el,x){Y.Dom.setXY(el,[x,null])},setY:function(el,y){Y.Dom.setXY(el,[null,y])},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false}var region=Y.Region.getRegion(el);return region};return Y.Dom.batch(el,f,Y.Dom,true)},getClientWidth:function(){return Y.Dom.getViewportWidth()},getClientHeight:function(){return Y.Dom.getViewportHeight()},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[]}var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i])}}}return nodes},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className)};return Y.Dom.batch(el,f,Y.Dom,true)},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false}el.className=YAHOO2.lang.trim([el.className,className].join(' '));return true};return Y.Dom.batch(el,f,Y.Dom,true)},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false}var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className)}el.className=YAHOO2.lang.trim(el.className);return true};return Y.Dom.batch(el,f,Y.Dom,true)},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false}var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true}el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName)}el.className=YAHOO2.lang.trim(el.className);return true};return Y.Dom.batch(el,f,Y.Dom,true)},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id}var id=prefix+id_counter++;if(el){el.id=id}return id};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments)},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false}var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node)}else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16)}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack})}return false};return Y.Dom.batch(needle,f,Y.Dom,true)},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true}}return false}return this.isAncestor(document.documentElement,el)};return Y.Dom.batch(el,f,Y.Dom,true)},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[]}var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i])}}}return nodes},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false}var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o)}var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o)}return collection},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight}return height},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth}return width},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node}}return null},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null}var method=function(el){return Y.Dom.hasClass(el,className)};return Y.Dom.getAncestorBy(node,method)},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null}var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase()};return Y.Dom.getAncestorBy(node,method)},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node}}return null},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null}return Y.Dom.getPreviousSiblingBy(node)},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node}}return null},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null}return Y.Dom.getNextSiblingBy(node)},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method)},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null}return Y.Dom.getFirstChildBy(node)},getLastChildBy:function(node,method){if(!node){return null}var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method)},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node)},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node}return false});return children},getChildren:function(node){node=Y.Dom.get(node);if(!node){}return Y.Dom.getChildrenBy(node)},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft)},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop)},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null}return referenceNode.parentNode.insertBefore(newNode,referenceNode)},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null}if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}else{return referenceNode.parentNode.appendChild(newNode)}}}})();YAHOO2.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l};YAHOO2.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom)};YAHOO2.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO2.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO2.util.Region(t,r,b,l)}else{return null}};YAHOO2.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO2.util.Region(t,r,b,l)};YAHOO2.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}")};YAHOO2.util.Region.getRegion=function(el){var p=YAHOO2.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO2.util.Region(t,r,b,l)};YAHOO2.util.Point=function(x,y){if(YAHOO2.lang.isArray(x)){y=x[1];x=x[0]}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y};YAHOO2.util.Point.prototype=new YAHOO2.util.Region();YAHOO2.register("dom",YAHOO2.util.Dom,{version:"2.3.0",build:"442"});
+
 
 
   
 
   
 
   
 
   
 
//////////////////////////////////////////////////////////////////
 
//////////////////////////////////////////////////////////////////
//              Dead Island Wiki Popups
+
//              Elder Scrolls Wiki Popups
 +
 
 
// Popup Code Source: http://gmod.org/wiki/Popup_Balloons
 
// Popup Code Source: http://gmod.org/wiki/Popup_Balloons
 
// Wikia Additions: http://deadisland.wikia.com/wiki/User:Jgjake2
 
// Wikia Additions: http://deadisland.wikia.com/wiki/User:Jgjake2
 
//////////////////////////////////////////////////////////////////
 
//////////////////////////////////////////////////////////////////
/*
+
 
 
var hasClass = (function () {
 
var hasClass = (function () {
 
var reCache = {};
 
var reCache = {};
Line 1,544: Line 1,615:  
};
 
};
 
})();
 
})();
*/
+
 
 
// white balloon with default configuration
 
// white balloon with default configuration
 
var balloon    = new Balloon;
 
var balloon    = new Balloon;
 
BalloonConfig(balloon,'GBubble');
 
BalloonConfig(balloon,'GBubble');
 
   
 
   
// Dead Island Config
+
// Elder Scrolls Config
var KancolleBalloon   = new Balloon;
+
 
BalloonConfig(KancolleBalloon,'KancolleBubble');
+
var kancolleBubble   = new Balloon;
 +
BalloonConfig(kancolleBubble,'KancolleBubble');
 
   
 
   
 
// plain balloon tooltip
 
// plain balloon tooltip
Line 1,578: Line 1,650:  
function reInitBalloons() {
 
function reInitBalloons() {
 
BalloonConfig(balloon,'GBubble');
 
BalloonConfig(balloon,'GBubble');
BalloonConfig(KancolleBalloon,'KancolleBubble');
+
BalloonConfig(kancolleBubble,'KancolleBubble');
 +
 
 
BalloonConfig(tooltip,'GPlain');
 
BalloonConfig(tooltip,'GPlain');
 
BalloonConfig(fader,'GFade');
 
BalloonConfig(fader,'GFade');
Line 1,592: Line 1,665:  
}
 
}
 
   
 
   
function getElementsByClass(elementName, tagname, tclass){
+
function getElementsByClass2(elementName, tagname, tclass){
 
var itemsfound = new Array();
 
var itemsfound = new Array();
 
var elements = elementName.getElementsByTagName(tagname);
 
var elements = elementName.getElementsByTagName(tagname);
Line 1,604: Line 1,677:  
   
 
   
 
function removeByClass(tagname, className){
 
function removeByClass(tagname, className){
var spans = getElementsByClass(document, tagname, className);
+
var spans = getElementsByClass2(document, tagname, className);
 
for (x in spans){
 
for (x in spans){
 
spans[x].parentNode.removeChild(spans[x]);
 
spans[x].parentNode.removeChild(spans[x]);
Line 1,632: Line 1,705:  
// Otherwise it will be remove when an ajax popup is used.
 
// Otherwise it will be remove when an ajax popup is used.
 
function removeOnHoverClass(){
 
function removeOnHoverClass(){
var divs = getElementsByClass(document, 'div', 'removeOnHover');
+
var divs = getElementsByClass2(document, 'div', 'removeOnHover');
 
for (x in divs){
 
for (x in divs){
 
RemoveClassName(divs[x], 'removeOnHover');
 
RemoveClassName(divs[x], 'removeOnHover');
Line 1,665: Line 1,738:  
function firePopup(event, tBalloon) {
 
function firePopup(event, tBalloon) {
 
reInitBalloons();
 
reInitBalloons();
 +
 
// Set Up Balloon Type - ['ClassName', BalloonVar]
 
// Set Up Balloon Type - ['ClassName', BalloonVar]
 
var isSticky = hasClass(tBalloon, 'stickyBalloon') ? 1 : 0;
 
var isSticky = hasClass(tBalloon, 'stickyBalloon') ? 1 : 0;
var balloonType = KancolleBalloon;
+
var balloonType = kancolleBubble;
 
var balloonTypes = [
 
var balloonTypes = [
 
['classicBalloon', balloon],
 
['classicBalloon', balloon],
Line 1,704: Line 1,778:  
if(customDelay != null) balloonType.delayTime = customDelay[1];
 
if(customDelay != null) balloonType.delayTime = customDelay[1];
 
   
 
   
+
balloonType.tBalloonType = '';
if(hasClass(tBalloon, 'ajaxBalloon')){
+
balloonType.tBalloonLink = '';
balloonType.showTooltip(event,'url:http://kancolle.wikia.com/index.php?title=' + tBalloon.id.replace('\.2F','/') + '&action=render', isSticky);
+
 
removeUnwantedContent();
+
if(hasClass(tBalloon, 'clickAndHover')) {
createCollapseButtons();
+
var mouseOver = event.type.match('mouseover','i');
createNavigationBarToggleButton();
+
if (!mouseOver) {
 +
balloonType.showTooltip(event,'load:' + tBalloon.id + 'Popup', isSticky);
 +
} else {
 +
balloonType.showTooltip(event,'load:' + tBalloon.id + 'Popup2', isSticky);
 +
}
 +
} else if(hasClass(tBalloon, 'ajaxBalloon')){
 +
balloonType.tBalloonType = 'ajax';
 +
balloonType.tBalloonLink = unescape(tBalloon.id.replace('\.', '%'));
 +
//balloonType.tBalloonLink = tBalloon.id.replace('\.2F','/').replace('\.27','\'').replace('\.28','(').replace('\.29',')');
 +
//balloonType.showTooltip(event,'url:http://kancolle.wikia.com/index.php?title=' + tBalloon.id.replace('\.2F','/').replace('\.27','\'').replace('\.28','(').replace('\.29',')') + '&action=render', 1);
 +
balloonType.showTooltip(event,'url:http://kancolle.wikia.com/index.php?title=' + balloonType.tBalloonLink + '&action=render', 1);
 +
 
 +
 
 +
 
 
} else {
 
} else {
 
balloonType.showTooltip(event,'load:' + tBalloon.id + 'Popup', isSticky);
 
balloonType.showTooltip(event,'load:' + tBalloon.id + 'Popup', isSticky);
Line 1,715: Line 1,802:  
}
 
}
 
   
 
   
function makePopupBalloons(){
+
function makeMyLinefeedReal(imageElement) {
var balloons = getElementsByClass(document, 'span', 'kancollePopup');
+
var titleAttribute;
for (x in balloons){
+
titleAttribute = imageElement.title;
 +
//titleAttribute = titleAttribute.replace(/\[br\]/, String.fromCharCode(10));
 +
titleAttribute = titleAttribute.replace(/\[br\]/, "\r\n");
 +
imageElement.title = titleAttribute;
 +
}
 +
 +
function makeAllPopupBalloons(){
 +
makePopupBalloons(document);
 +
}
 +
 +
function makePopupBalloonsById(tId){
 +
var obj = document.getElementById(tId);
 +
makePopupBalloons(obj);
 +
}
 +
 +
function makePopupBalloons(obj){
 +
var balloons = getElementsByClass2(obj, 'span', 'kancolleBalloonPopup');
 +
 
 +
for (x in balloons){
 
// Remove the title attribute from any links inside the hover area
 
// Remove the title attribute from any links inside the hover area
 
var balloonLinks = balloons[x].getElementsByTagName('a');
 
var balloonLinks = balloons[x].getElementsByTagName('a');
 
for(var i=0;i<balloonLinks.length;i++) balloonLinks[i].setAttribute('title', '');
 
for(var i=0;i<balloonLinks.length;i++) balloonLinks[i].setAttribute('title', '');
 
// Add class "tt" if it doesn't already have it
 
// Add class "tt" if it doesn't already have it
AddClassName(balloons[x], 'tt', true); //if(!hasClass(balloons[x], 'tt')) AddClassName(balloons[x], 'tt', false);
+
//AddClassName(balloons[x], 'tt', true); //if(!hasClass(balloons[x], 'tt')) AddClassName(balloons[x], 'tt', false);
 
// Set popup to fire when clicked if clickBalloon is used. Otherwise it fires when hovered.
 
// Set popup to fire when clicked if clickBalloon is used. Otherwise it fires when hovered.
 
//if(hasClass(balloons[x], 'ajaxBalloon')) balloons[x].id = balloons[x].id.replace('\.2F','/');
 
//if(hasClass(balloons[x], 'ajaxBalloon')) balloons[x].id = balloons[x].id.replace('\.2F','/');
if(hasClass(balloons[x], 'clickBalloon')) balloons[x].onclick = function(event) { firePopup(event, this); };
+
makeMyLinefeedReal(balloons[x]);
 +
if(hasClass(balloons[x], 'clickAndHover')) {
 +
balloons[x].onclick = function(event) { firePopup(event, this); };
 +
balloons[x].onmouseover = function(event) { firePopup(event, this); };
 +
} else if(hasClass(balloons[x], 'clickBalloon')) balloons[x].onclick = function(event) { firePopup(event, this); };
 
else balloons[x].onmouseover = function(event) { firePopup(event, this); };
 
else balloons[x].onmouseover = function(event) { firePopup(event, this); };
if(hasClass(balloons[x], 'dblclicklinkBalloon')) balloons[x].onDblClick = function(event) { window.location.href = 'http://kancolle.wikia.com/index.php?title=' + this.id.replace('\.2F','/'); };
+
//if(hasClass(balloons[x], 'dblclicklinkBalloon')) balloons[x].onDblClick = function(event) { window.location.href = 'http://http://kancolle.wikia.com/index.php?title=' + this.id.replace('\.2F','/'); };
 
}
 
}
 
}
 
}
addOnloadHook(makePopupBalloons);
+
addOnloadHook(makeAllPopupBalloons);
 +
 +
// Collapsible tables are broken on the elder scrolls so I'm adding this till it is fixed
 +
 +
var hasClass = (function () {
 +
    var reCache = {};
 +
    return function (element, className) {
 +
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
 +
    };
 +
})();
 +
 +
/** Collapsible tables *********************************************************
 +
*
 +
*  Description: Allows tables to be collapsed, showing only the header. See
 +
*              [[Wikipedia:NavFrame]].
 +
*  Maintainers: [[User:R. Koot]]
 +
*/
 +
 +
function sortTableByDefault(){
 +
    var $sortableTables = $(".sortByDefault");
 +
    $sortableTables.each( function(i) {
 +
try {
 +
var sortableTables_th = $sortableTables[i].getElementsByTagName( "th" )[0];
 +
var sortableTables_sortHeader = getElementsByClass2(sortableTables_th, 'a', 'sortheader')[0];
 +
var sortableTables_sortHeader_Img = sortableTables_sortHeader.getElementsByTagName('img')[0];
 +
var imgSrcBefore = sortableTables_sortHeader_Img.src;
 +
$(sortableTables_sortHeader).removeAttr("onclick");
 +
$(sortableTables_sortHeader).bind('click', function() {
 +
ts_resortTable(this);
 +
changeSortImg(this);
 +
return false;
 +
});
 +
$(sortableTables_sortHeader).click();
 +
} catch(e){};
 +
    });
 +
}
 +
 +
function changeSortImg(sortHeader){
 +
    var sortHeader_Img = sortHeader.getElementsByTagName('img')[0];
 +
    if(sortHeader_Img.src.indexOf("sort_down.gif") >= 0){
 +
        $(sortHeader_Img).attr("src", "http://images3.wikia.nocookie.net/elderscrolls/images/7/7a/Sort_down.gif");
 +
    } else if(sortHeader_Img.src.indexOf("sort_up.gif") >= 0){
 +
        $(sortHeader_Img).attr("src", "http://images2.wikia.nocookie.net/elderscrolls/images/5/5b/Sort_up.gif");
 +
    }
 +
}
 +
addOnloadHook( sortTableByDefault );
 +
 +
$.fn.watch = function(props, callback, timeout){
 +
    if(!timeout)
 +
        timeout = 10;
 +
    return this.each(function(){
 +
        var el = $(this),
 +
            func = function(){ __check.call(this, el) },
 +
            data = { props: props.split(","),
 +
                        func: callback,
 +
                        vals: [] };
 +
        $.each(data.props, function(i) { data.vals[i] = el.css(data.props[i]); });
 +
        el.data(data);
 +
        if (typeof (this.onpropertychange) == "object"){
 +
            el.bind("propertychange", callback);
 +
        } else if ($.browser.mozilla){
 +
            el.bind("DOMAttrModified", callback);
 +
        } else {
 +
            setInterval(func, timeout);
 +
        }
 +
    });
 +
    function __check(el) {
 +
        var data = el.data(),
 +
            changed = false,
 +
            temp = "";
 +
        for(var i=0;i < data.props.length; i++) {
 +
            temp = el.css(data.props[i]);
 +
            if(data.vals[i] != temp){
 +
                data.vals[i] = temp;
 +
                changed = true;
 +
                break;
 +
            }
 +
        }
 +
        if(changed && data.func) {
 +
            data.func.call(el, data);
 +
        }
 +
    }
 +
}
 +
 +
 +
var autoCollapse = 2;
 +
var collapseCaption = "hide";
 +
var expandCaption = "show";
 +
 +
var collapseButtonClass = "collapsible2";
 +
var collapseButtonId = "collapseButton2Id";
 +
var collapsibleTableId = "collapsibleTable2Id";
 +
 +
function collapseTable2( tableIndex ){
 +
    var Button = document.getElementById( collapseButtonId + tableIndex );
 +
    var Table = document.getElementById( collapsibleTableId + tableIndex );
 +
 +
    var Button2 = document.getElementById( collapseButtonId + tableIndex + '_2');
 +
 +
    if ( !Table || !Button ) {
 +
        return false;
 +
    }
 +
 +
    var Rows = Table.rows;
 +
 +
    if ( Button.firstChild.data == collapseCaption ) {
 +
        for ( var i = 1; i < Rows.length; i++ ) {
 +
            Rows[i].style.display = "none";
 +
        }
 +
        Button.firstChild.data = expandCaption;
 +
        if(Button2) Button2.firstChild.data = expandCaption;
 +
    } else {
 +
        for ( var i = 1; i < Rows.length; i++ ) {
 +
            Rows[i].style.display = Rows[0].style.display;
 +
        }
 +
        Button.firstChild.data = collapseCaption;
 +
        if(Button2) Button2.firstChild.data = collapseCaption;
 +
    }
 +
}
 +
 +
function createCollapseButtons2(){
 +
    var tableIndex = 0;
 +
    var NavigationBoxes = new Object();
 +
    var Tables = document.getElementsByTagName( "table" );
 +
 +
    for ( var i = 0; i < Tables.length; i++ ) {
 +
        if ( hasClass( Tables[i], collapseButtonClass ) ) {
 +
 +
            /* only add button and increment count if there is a header row to work with */
 +
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
 +
            if (!HeaderRow) continue;
 +
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
 +
            if (!Header) continue;
 +
 +
            NavigationBoxes[ tableIndex ] = Tables[i];
 +
            Tables[i].setAttribute( "id", collapsibleTableId + tableIndex );
 +
 +
            var Button    = document.createElement( "span" );
 +
            var ButtonLink = document.createElement( "a" );
 +
            var ButtonText = document.createTextNode( collapseCaption );
 +
 +
            Button.className = "collapseButton";  //Styles are declared in Common.css
 +
 +
            ButtonLink.style.color = Header.style.color;
 +
            ButtonLink.setAttribute( "id", collapseButtonId + tableIndex );
 +
            //ButtonLink.setAttribute( "href", "#" );
 +
            //addHandler( ButtonLink,  "click", new Function( "evt", "collapseTable2(" + tableIndex + " );") );
 +
//javascript
 +
ButtonLink.setAttribute( "href", "javascript:collapseTable2(" + tableIndex + " );" );
 +
            ButtonLink.appendChild( ButtonText );
 +
 +
            Button.appendChild( document.createTextNode( "[" ) );
 +
            Button.appendChild( ButtonLink );
 +
            Button.appendChild( document.createTextNode( "]" ) );
 +
 +
            //Header.insertBefore( Button, Header.firstChild );
 +
Header.appendChild( Button );
 +
            tableIndex++;
 +
        }
 +
    }
 +
    var contentArea = document.getElementById( 'WikiaMainContent' );
 +
var secondButtonSpan = getElementsByClass2(contentArea, 'span', 'HideTableButton');
 +
 +
    for ( var i = 0; i < secondButtonSpan.length; i++ ) {
 +
        var buttonLink = secondButtonSpan[i].getElementsByTagName('a')[0];
 +
        if(buttonLink) {
 +
            //var buttonLink_title = buttonLink.title;
 +
            var buttonLink_title = secondButtonSpan[i].title;
 +
            secondButtonSpan[i].setAttribute( "title", '' );
 +
            if(!buttonLink_title) buttonLink_title = "0";
 +
            buttonLink.setAttribute( "id", collapseButtonId + buttonLink_title + '_2' );
 +
            buttonLink.setAttribute( "href", "javascript:collapseTable2(" + buttonLink_title + " );" );
 +
        }
 +
    }
 +
 +
    var hideOnShow = getElementsByClass2(contentArea, 'div', 'HideOnTableExpand');
 +
    for ( var i = 0; i < hideOnShow.length; i++ ) {
 +
        var divTitle = hideOnShow[i].title;
 +
        var tableId = collapsibleTableId + divTitle;
 +
        var $tableLastChild = $("#" + tableId + " tbody :last-child");
 +
        hideOnShow[i].setAttribute( "id", collapsibleTableId + divTitle + "_HideOnShow" );
 +
        hideOnShow[i].setAttribute( "title", "" );
 +
        //alert("Last Child HTML:" + $tableLastChild.html() + "  Table Last Child Type:" + $tableLastChild.get(0).tagName );
 +
        $tableLastChild.watch('style', function(){
 +
            //alert("Parent ID: " + this.parentNode.id);
 +
            var $tmpTableEl = $(this).parent().parent();
 +
            //alert("This style:" + $(this).css('display') + "  Table:" + $tmpTableEl.attr('id'));
 +
            //alert("Last Child Display: " + this.lastChild.style.display);
 +
            var $telem = $("#" + $tmpTableEl.attr('id') + "_HideOnShow");
 +
            if($(this).css('display') == "none"){
 +
                $telem.css('display', 'block');
 +
            } else {
 +
                $telem.css('display', 'none');
 +
            }
 +
        });
 +
    }
 +
 +
 +
    for ( var i = 0;  i < tableIndex; i++ ) {
 +
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
 +
            collapseTable2( i );
 +
        }
 +
        else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
 +
            var element = NavigationBoxes[i];
 +
            while (element = element.parentNode) {
 +
                if ( hasClass( element, "outercollapse" ) ) {
 +
                    collapseTable2 ( i );
 +
                    break;
 +
                }
 +
            }
 +
        }
 +
    }
 +
}
 +
 +
addOnloadHook( createCollapseButtons2 );
 +
 +
 +
 +
/***********************************************
 +
* Dynamic Ajax Loading
 +
* By jgjake2
 +
***********************************************/
 +
var rootdomain = "http://kancolle.wikia.com/index.php?title="
 +
var urlsuffex = "&action=render";
 +
var ajaxContainerId = "ajaxContentArea";
 +
var ajaxLoadingIcon = "http://images4.wikia.nocookie.net/elderscrolls/images/f/f3/AjaxLoading.gif";
 +
var ajaxLoadingIconId ="ajaxLoadingIcon";
 +
var apiRootdomain = "http://kancolle.wikia.com/api.php?action=parse&text=";
 +
var apiUrlsuffex = "&format=xml";
 +
 +
function isFullURI(uri) {
 +
var patt=/http\:\/\//i;
 +
if(patt.test(uri)) return true;
 +
return false;
 +
}
 +
 +
function fixFirstBadEscapeCharacter(uri) {
 +
    var patt=/\.([0-9a-fA-F][0-9a-fA-F])/;
 +
    var escapeChar = patt.exec(uri);
 +
    if(escapeChar.length > 0){
 +
        var val = escapeChar[1];
 +
        var patt2=new RegExp("\." + val, 'g');
 +
        var ret = uri.replace(patt2, '%' + val);
 +
        return ret;
 +
    }
 +
    return uri;
 +
 +
}
 +
 +
function fixBadEscapeCharacters(uri) {
 +
    var patt=/\.[0-9a-fA-F][0-9a-fA-F]/;
 +
    var uri2 = uri;
 +
    var c = 0;
 +
    while(patt.test(uri2) && c < 15){
 +
        uri2 = fixFirstBadEscapeCharacter(uri2);
 +
        c++;
 +
    }
 +
    //return unescape(uri2);
 +
return uri2;
 +
}
 +
 +
function ajaxpage(url, container) {
 +
    //var newurl = rootdomain + url.replace('\.2F','/').replace('\.27','\'').replace('\.28','(').replace('\.29',')') + urlsuffex;
 +
var page = unescape(fixBadEscapeCharacters(url));
 +
var newurl = rootdomain + page + urlsuffex;
 +
    $('#' + container).html('');
 +
jumpToAnchor('tableEnd');
 +
    $('#' + container).load(newurl);
 +
    //removeUnwantedContent();
 +
    //var fmbox = $('#' + container).find('.fmbox')[0];
 +
    //if(fmbox) $(fmbox).remove();
 +
}
 +
 +
function addAjaxLinks(){
 +
//fmbox
 +
    var $ajaxDivs = $(".ajaxLink");
 +
    //if($(ajaxDivs).length == 0) return;
 +
    $ajaxDivs.each( function(i) {
 +
        var ajaxDiv_Link = $(this).children("a")[0];
 +
        var tURL = $ajaxDivs[i].id;
 +
        ajaxDiv_Link.setAttribute('href', "javascript:ajaxpage('" + tURL + "', '" + ajaxContainerId + "');");
 +
 +
var ajaxDiv_Image = $(this).find('img')[0];
 +
var ajaxDiv_Image_Parent = $(ajaxDiv_Image).parent();
 +
var ajaxDiv_Image_Parent_Html = $(ajaxDiv_Image_Parent).html();
 +
var thref = "javascript:ajaxpage('" + tURL + "', '" + ajaxContainerId + "');";
 +
$(ajaxDiv_Image_Parent).html('<a href="' + thref + '">' + ajaxDiv_Image_Parent_Html + '</a>');
 +
    } );
 +
 +
    $('#' + ajaxLoadingIconId).css({'z-index' : '99', 'position' : 'relative', 'top' : '0px', 'left' : '0px', 'width' : '100%', 'height' : '200px'});
 +
    $('#' + ajaxLoadingIconId).html('<br><img src="' + ajaxLoadingIcon + '" height="30px" width="30px" style="display: block; margin-left: auto; margin-right: auto; margin-top: auto; margin-bottom: auto;"/>');
 +
 +
    $('#' + ajaxContainerId).ajaxStart(function() {
 +
        $('#' + ajaxLoadingIconId).show();
 +
    }).ajaxComplete(function() {
 +
        $('#' + ajaxLoadingIconId).hide();
 +
        makePopupBalloonsById(ajaxContainerId);
 +
    });
 +
 +
}
 +
 +
function addAjaxXmlLinks(){
 +
    var $ajaxDivs = $(".ajaxXmlLink");
 +
    //if($(ajaxDivs).length == 0) return;
 +
    $ajaxDivs.each( function(i) {
 +
        var ajaxDiv_Link = $(this).children("a")[0];
 +
        var tURL = unescape($ajaxDivs[i].id.replace('\.', '%'));
 +
//tURL = tURL.replace('\.2F','/').replace('\.27','\'').replace('\.28','(').replace('\.29',')');
 +
var highlightNumber = $ajaxDivs[i].title;
 +
var tmpText = "{{" + tURL + "|highlight=" + highlightNumber + "|AjaxXMLRequest=1}}";
 +
var newurl = apiRootdomain + tmpText + apiUrlsuffex;
 +
ajaxDiv_Link.setAttribute('href', "javascript:renderAjaxXmlPage('" + newurl + "', '" + ajaxContainerId + "');");
 +
    } );
 +
 +
    $('#' + ajaxLoadingIconId).css({'z-index' : '99', 'position' : 'relative', 'top' : '0px', 'left' : '0px', 'width' : '100%', 'height' : '200px'});
 +
    $('#' + ajaxLoadingIconId).html('<br><img src="' + ajaxLoadingIcon + '" height="30px" width="30px" style="display: block; margin-left: auto; margin-right: auto; margin-top: auto; margin-bottom: auto;"/>');
 +
 +
    $('#' + ajaxContainerId).ajaxStart(function() {
 +
        $('#' + ajaxLoadingIconId).show();
 +
    }).ajaxComplete(function() {
 +
        $('#' + ajaxLoadingIconId).hide();
 +
    });
 +
}
 +
 +
function jumpToAnchor(id) {
 +
//var new_position = $('#'+id).offset();
 +
//window.scrollTo(new_position.left,new_position.top);
 +
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 500);
 +
}
 +
 +
function renderAjaxXmlPage(turl, container) {
 +
    $('#' + container).html('');
 +
jumpToAnchor('tableEnd');
 +
$.ajax({
 +
type: "GET",
 +
url: turl,
 +
dataType: "xml",
 +
success: function(xml) {
 +
//alert($(xml).find("text").text());
 +
$('#' + container).html($(xml).find("text").text());
 +
            //var fmbox = $('#' + container).find('.fmbox')[0];
 +
            //if(fmbox) $(fmbox).remove();
 +
            //removeUnwantedContent();
 +
makePopupBalloonsById(container);
 +
}
 +
});
 +
}
 +
/*
 +
function removeFmboxFromContainer(){
 +
//removeOnAjax
 +
    var fmbox = $('#' + ajaxContainerId).find('.fmbox')[0];
 +
    if(fmbox) $(fmbox).remove();
 +
}
 +
*/
 +
 +
function removeUnwantedContent(){
 +
    var $content = $('#' + ajaxContainerId).find('.removeOnAjax');
 +
    if($content){
 +
        if($.isArray($content)) {
 +
            $content.each( function(i) {
 +
                $(this).remove();
 +
            });
 +
        } else {
 +
            $(content).remove();
 +
        }
 +
    }
 +
}
 +
 +
addOnloadHook(addAjaxLinks);
 +
addOnloadHook(addAjaxXmlLinks);
 +
 +
 +
// JQuery URL Parser plugin - https://github.com/allmarkedup/jQuery-URL-Parser
 +
// Written by Mark Perkins, mark@allmarkedup.com
 +
// License: http://unlicense.org/ (i.e. do what you want with it!)
 +
 +
(function($, undefined) {
 +
 +
    var tag2attr = {
 +
        a      : 'href',
 +
        img    : 'src',
 +
        form    : 'action',
 +
        base    : 'href',
 +
        script  : 'src',
 +
        iframe  : 'src',
 +
        link    : 'href'
 +
    },
 +
 +
key = ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"], // keys available to query
 +
 +
aliases = { "anchor" : "fragment" }, // aliases for backwards compatability
 +
 +
parser = {
 +
strict  : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
 +
loose  :  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
 +
},
 +
 +
querystring_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g, // supports both ampersand and semicolon-delimted query string key/value pairs
 +
 +
fragment_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g; // supports both ampersand and semicolon-delimted fragment key/value pairs
 +
 +
function parseUri( url, strictMode )
 +
{
 +
var str = decodeURI( url ),
 +
    res  = parser[ strictMode || false ? "strict" : "loose" ].exec( str ),
 +
    uri = { attr : {}, param : {}, seg : {} },
 +
    i  = 14;
 +
 +
while ( i-- )
 +
{
 +
uri.attr[ key[i] ] = res[i] || "";
 +
}
 +
 +
// build query and fragment parameters
 +
 +
uri.param['query'] = {};
 +
uri.param['fragment'] = {};
 +
 +
uri.attr['query'].replace( querystring_parser, function ( $0, $1, $2 ){
 +
if ($1)
 +
{
 +
uri.param['query'][$1] = $2;
 +
}
 +
});
 +
 +
uri.attr['fragment'].replace( fragment_parser, function ( $0, $1, $2 ){
 +
if ($1)
 +
{
 +
uri.param['fragment'][$1] = $2;
 +
}
 +
});
 +
 +
// split path and fragement into segments
 +
 +
        uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');
 +
 +
        uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');
 +
 +
        // compile a 'base' domain attribute
 +
 +
        uri.attr['base'] = uri.attr.host ? uri.attr.protocol+"://"+uri.attr.host + (uri.attr.port ? ":"+uri.attr.port : '') : '';
 +
 +
return uri;
 +
};
 +
 +
function getAttrName( elm )
 +
{
 +
var tn = elm.tagName;
 +
if ( tn !== undefined ) return tag2attr[tn.toLowerCase()];
 +
return tn;
 +
}
 +
 +
$.fn.url = function( strictMode )
 +
{
 +
    var url = '';
 +
 +
    if ( this.length )
 +
    {
 +
        url = $(this).attr( getAttrName(this[0]) ) || '';
 +
    }
 +
 +
        return $.url( url, strictMode );
 +
};
 +
 +
$.url = function( url, strictMode )
 +
{
 +
    if ( arguments.length === 1 && url === true )
 +
        {
 +
            strictMode = true;
 +
            url = undefined;
 +
        }
 +
 +
        strictMode = strictMode || false;
 +
        url = url || window.location.toString();
 +
 +
        return {
 +
 +
            data : parseUri(url, strictMode),
 +
 +
            // get various attributes from the URI
 +
            attr : function( attr )
 +
            {
 +
                attr = aliases[attr] || attr;
 +
                return attr !== undefined ? this.data.attr[attr] : this.data.attr;
 +
            },
 +
 +
            // return query string parameters
 +
            param : function( param )
 +
            {
 +
                return param !== undefined ? this.data.param.query[param] : this.data.param.query;
 +
            },
 +
 +
            // return fragment parameters
 +
            fparam : function( param )
 +
            {
 +
                return param !== undefined ? this.data.param.fragment[param] : this.data.param.fragment;
 +
            },
 +
 +
            // return path segments
 +
            segment : function( seg )
 +
            {
 +
                if ( seg === undefined )
 +
                {
 +
                    return this.data.seg.path;                   
 +
                }
 +
                else
 +
                {
 +
                    seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
 +
                    return this.data.seg.path[seg];                   
 +
                }
 +
            },
 +
 +
            // return fragment segments
 +
            fsegment : function( seg )
 +
            {
 +
                if ( seg === undefined )
 +
                {
 +
                    return this.data.seg.fragment;                   
 +
                }
 +
                else
 +
                {
 +
                    seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
 +
                    return this.data.seg.fragment[seg];                   
 +
                }
 +
            }
 +
 +
        };
 +
 +
};
 +
 +
})(jQuery);
 +
 +
 +
/////////////////////////////////////////
 +
//          Cookie Functions          //
 +
/////////////////////////////////////////
 +
 +
function setCookie(name,value,days) {
 +
    if (days) {
 +
        var date = new Date();
 +
        date.setTime(date.getTime()+(days*24*60*60*1000));
 +
        var expires = "; expires="+date.toGMTString();
 +
    }
 +
    else var expires = "";
 +
    document.cookie = name+"="+value+expires+"; path=/";
 +
}
 +
 +
function getCookie(name) {
 +
    var nameEQ = name + "=";
 +
    var ca = document.cookie.split(';');
 +
    for(var i=0;i < ca.length;i++) {
 +
        var c = ca[i];
 +
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
 +
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
 +
    }
 +
    return null;
 +
}
 +
 +
function deleteCookie(name) {
 +
    setCookie(name,"",-1);
 +
}
 +
 +
function testCookies(){
 +
    setCookie('test', 'none', '1');
 +
    //Set_Cookie( 'test', 'none', '', '/', '', '' );
 +
    if (getCookie('test')){
 +
        deleteCookie('test');
 +
        return true;
 +
    } else return false;
 +
}
 +
 +
/////////////////////////////////////////
 +
//        End Cookie Functions        //
 +
/////////////////////////////////////////
 +
 +
/////////////////////////////////////////
 +
//            Wiki Message            //
 +
/////////////////////////////////////////
 +
 +
 +
var WIKIMESSAGECONFIG = (function() {
 +
    var private = {
 +
        'MESSAGE_EXPIRE_TIME': '7', //In Days
 +
        'COOKIEID': 'jgjake2popupMessage',
 +
        'COOKIE_VALUE_PREFIX_CLOSED': 'Closed:',
 +
        'COOKIE_VALUE_PREFIX_NOTCLOSED': 'NotClosed:'
 +
    };
 +
 +
    return {
 +
        get: function(name) { return private[name]; }
 +
    };
 +
})();
 +
//alert('MY_CONST: ' + WIKIMESSAGECONFIG.get('MESSAGE_EXPIRE_TIME'));  // 1
 +
 +
function setMessageCookie(cookieId, value, exp){
 +
    setCookie(cookieId, value, exp);
 +
}
 +
 +
function addNewMessage(message, creationDate){
 +
    var today = new Date();
 +
    var messageExpire = new Date(creationDate);
 +
    messageExpire.setDate(creationDate.getDate()+WIKIMESSAGECONFIG.get('MESSAGE_EXPIRE_TIME'));
 +
    //alert('Today:' + today + '\r\n' + 'Expire:' + messageExpire);
 +
    if(messageExpire > today){
 +
        var cookieId = WIKIMESSAGECONFIG.get('COOKIEID');
 +
        var cookieVal = getCookie(cookieId);
 +
        if(cookieVal != null){
 +
            if(cookieVal.substring(0, WIKIMESSAGECONFIG.get('COOKIE_VALUE_PREFIX_CLOSED').length) == WIKIMESSAGECONFIG.get('COOKIE_VALUE_PREFIX_CLOSED')){
 +
                var tmpDate = new Date(cookieVal.substring(WIKIMESSAGECONFIG.get('COOKIE_VALUE_PREFIX_CLOSED').length, cookieVal.length));
 +
                if(tmpDate < creationDate){
 +
                    setMessageCookie(cookieId, WIKIMESSAGECONFIG.get('COOKIE_VALUE_PREFIX_NOTCLOSED') + creationDate, WIKIMESSAGECONFIG.get('MESSAGE_EXPIRE_TIME'));
 +
                    addNewMessageToPage(message);
 +
                    return;
 +
                } else return;
 +
            }
 +
        }
 +
        if(cookieVal == null || cookieVal == WIKIMESSAGECONFIG.get('COOKIE_VALUE_PREFIX_NOTCLOSED') + creationDate){
 +
            if(cookieVal == null) setMessageCookie(cookieId, WIKIMESSAGECONFIG.get('COOKIE_VALUE_PREFIX_NOTCLOSED') + creationDate, WIKIMESSAGECONFIG.get('MESSAGE_EXPIRE_TIME'));
 +
            addNewMessageToPage(message);
 +
        }
 +
    }
 +
}
 +
 +
function messageClosed(){
 +
    var today = new Date();
 +
    setMessageCookie(WIKIMESSAGECONFIG.get('COOKIEID'), WIKIMESSAGECONFIG.get('COOKIE_VALUE_PREFIX_CLOSED') + today, WIKIMESSAGECONFIG.get('MESSAGE_EXPIRE_TIME'));
 +
    $('#WikiaNotifications').remove();
 +
}
 +
 +
function addNewMessageToPage(message){
 +
    var footerDiv = $('#WikiaFooter div')[1];
 +
    var newMessage = document.createElement("ul");
 +
    newMessage.setAttribute('class', 'WikiaNotifications');
 +
    newMessage.setAttribute('id', 'WikiaNotifications');
 +
    var messageLink = '<a id="messageCloseLink" class="sprite close-notification"></a>';
 +
    var messageP = '<p>' + message + '</p>';
 +
    var messageDiv = '<div style="display: block; max-width:350px;" id="msg_590" data-type="5">' + messageLink + messageP + '</div>';
 +
    var messageLi = '<li>' + messageDiv + '</li>'
 +
    newMessage.innerHTML = messageLi;
 +
    footerDiv.appendChild(newMessage);
 +
    document.getElementById('messageCloseLink').addEventListener('click', messageClosed, false);
 +
}
 +
 +
function addMessageOnPages(pageNames, message, creationDate){
 +
    var url = $.url();
 +
    var currentPage = url.segment(-1);
 +
    for (x in pageNames){
 +
        if(currentPage == pageNames[x]){
 +
            addNewMessage(message, creationDate);
 +
            return;
 +
        }
 +
    }
 +
}
 +
 +
function addMessageOnPath(pathNames, message, creationDate){
 +
    var url = $.url();
 +
    var currentPage = url.attr('path');
 +
    for (x in pathNames){
 +
        if(currentPage == pathNames[x]){
 +
            addNewMessage(message, creationDate);
 +
            return;
 +
        }
 +
    }
 +
}
 +
 +
function addMessageToWiki(){
 +
    if(!testCookies()) return;
 +
    var pathNames = ['/wiki/InteractiveMap', '/wiki/User:Jgjake2', '/wiki/User_talk:Jgjake2'];
 +
    //var pageNames = ['InteractiveMap', 'User:Jgjake2', 'User_talk:Jgjake2'];
 +
    var message = '<span style="font-weight:800; font-size:120%;">Map Updates Are Coming Soon!</span><br>If you have any questions or requests, message me: <a href="/wiki/User_talk:Jgjake2">Jgjake2</a>';
 +
    var creationDate = new Date("January 5, 2012 06:52:00");
 +
    //addMessageOnPages(pageNames, message, creationDate);
 +
    addMessageOnPath(pathNames, message, creationDate);
 +
}
 +
//addOnloadHook(addMessageToWiki);
 +
 +
/////////////////////////////////////////
 +
//          End Wiki Message          //
 +
/////////////////////////////////////////
 +
 +
 +
// Add Syntax Highlighting
 +
// importScriptPage('User:Jgjake2/js/ElderScrolls/SyntaxHighlight.js', 'deadisland');
Anonymous user