var DOKU_BASE   = '/';var DOKU_TPL    = '/lib/tpl/nekro/';var alertText   = 'Bitte geben Sie den zu formatierenden Text ein.\nDieser wird am Ende des Dokuments eingefügt.';var notSavedYet = 'Nicht gespeicherte Änderungen gehen verloren!\nWeitermachen?';var reallyDel   = 'Eintrag wirklich löschen?';LANG = {"keepopen":"Fenster nach Auswahl nicht schlie\u00dfen","hidedetails":"Details ausblenden"};


/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/helpers.js XXXXXXXXXX */

/**
 *  $Id: helpers.js 156 2006-12-23 08:48:25Z wingedfox $
 *  $HeadURL: https://svn.debugger.ru/repos/jslibs/BrowserExtensions/trunk/helpers.js $
 *
 *  File contains differrent helper functions
 * 
 * @author Ilya Lebedev <ilya@lebedev.net>
 * @license LGPL
 * @version $Rev: 156 $
 */
//-----------------------------------------------------------------------------
//  Variable/property checks
//-----------------------------------------------------------------------------
/**
 *  Checks if property is undefined
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isUndefined (prop /* :Object */) /* :Boolean */ {
  return (typeof prop == 'undefined');
}
/**
 *  Checks if property is function
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isFunction (prop /* :Object */) /* :Boolean */ {
  return (typeof prop == 'function');
}
/**
 *  Checks if property is string
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isString (prop /* :Object */) /* :Boolean */ {
  return (typeof prop == 'string');
}
/**
 *  Checks if property is number
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isNumber (prop /* :Object */) /* :Boolean */ {
  return (typeof prop == 'number');
}
/**
 *  Checks if property is the calculable number
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isNumeric (prop /* :Object */) /* :Boolean */ {
  return isNumber(prop)&&!isNaN(prop)&&isFinite(prop);
}
/**
 *  Checks if property is array
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isArray (prop /* :Object */) /* :Boolean */ {
  return (prop instanceof Array);
}
/**
 *  Checks if property is regexp
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isRegExp (prop /* :Object */) /* :Boolean */ {
  return (prop instanceof RegExp);
}
/**
 *  Checks if property is a boolean value
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isBoolean (prop /* :Object */) /* :Boolean */ {
  return ('boolean' == typeof prop);
}
/**
 *  Checks if property is a scalar value (value that could be used as the hash key)
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isScalar (prop /* :Object */) /* :Boolean */ {
  return isNumeric(prop)||isString(prop);
}
/**
 *  Checks if property is empty
 *
 *  @param {Object} prop value to check
 *  @return {Boolean} true if matched
 *  @scope public
 */
function isEmpty (prop /* :Object */) /* :Boolean */ {
  if (isBoolean(prop)) return false;
  if (isRegExp(prop) && new RegExp("").toString() == prop.toString()) return true;
  if (isString(prop) || isNumber(prop)) return !prop;
  if (Boolean(prop)&&false != prop) {
    for (var i in prop) if(prop.hasOwnProperty(i)) return false
  }
  return true;
}

/*
*  Checks if property is derived from prototype, applies method if it is not exists
*
*  @param string property name
*  @return bool true if prototyped
*  @access public
*/
if ('undefined' == typeof Object.hasOwnProperty) {
  Object.prototype.hasOwnProperty = function (prop) {
    return !('undefined' == typeof this[prop] || this.constructor && this.constructor.prototype[prop] && this[prop] === this.constructor.prototype[prop]);
  }
}


/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/helpers.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/events.js XXXXXXXXXX */

// written by Dean Edwards, 2005
// with input from Tino Zijdel

// http://dean.edwards.name/weblog/2005/10/add-event/

function addEvent(element, type, handler) {
    // assign each event handler a unique ID
    if (!handler.$$guid) handler.$$guid = addEvent.guid++;
    // create a hash table of event types for the element
    if (!element.events) element.events = {};
    // create a hash table of event handlers for each element/event pair
    var handlers = element.events[type];
    if (!handlers) {
        handlers = element.events[type] = {};
        // store the existing event handler (if there is one)
        if (element["on" + type]) {
            handlers[0] = element["on" + type];
        }
    }
    // store the event handler in the hash table
    handlers[handler.$$guid] = handler;
    // assign a global event handler to do all the work
    element["on" + type] = handleEvent;
};
// a counter used to create unique IDs
addEvent.guid = 1;

function removeEvent(element, type, handler) {
    // delete the event handler from the hash table
    if (element.events && element.events[type]) {
        delete element.events[type][handler.$$guid];
    }
};

function handleEvent(event) {
    var returnValue = true;
    // grab the event object (IE uses a global event object)
    event = event || fixEvent(window.event);
    // get a reference to the hash table of event handlers
    var handlers = this.events[event.type];
    // execute each event handler
    for (var i in handlers) {
        if (!handlers.hasOwnProperty(i)) continue;
        this.$$handleEvent = handlers[i];
        if (this.$$handleEvent(event) === false) {
            returnValue = false;
        }
    }
    return returnValue;
};

function fixEvent(event) {
    // add W3C standard event methods
    event.preventDefault = fixEvent.preventDefault;
    event.stopPropagation = fixEvent.stopPropagation;
    // fix target
    event.target = event.srcElement;
    return event;
};
fixEvent.preventDefault = function() {
    this.returnValue = false;
};
fixEvent.stopPropagation = function() {
    this.cancelBubble = true;
};


/**
 * Pseudo event handler to be fired after the DOM was parsed or
 * on window load at last.
 *
 * @author based upon some code by Dean Edwards
 * @author Dean Edwards
 * @link   http://dean.edwards.name/weblog/2006/06/again/
 */
window.fireoninit = function() {
  // quit if this function has already been called
  if (arguments.callee.done) return;
  // flag this function so we don't do the same thing twice
  arguments.callee.done = true;
  // kill the timer
  if (_timer) {
     clearInterval(_timer);
     _timer = null;
  }

  if (typeof window.oninit == 'function') {
        window.oninit();
  }
};

/**
 * Run the fireoninit function as soon as possible after
 * the DOM was loaded, using different methods for different
 * Browsers
 *
 * @author Dean Edwards
 * @link   http://dean.edwards.name/weblog/2006/06/again/
 */
  // for Mozilla
  if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", window.fireoninit, null);
  }

  // for Internet Explorer (using conditional comments)
  /*@cc_on @*/
  /*@if (@_win32)
    document.write("<scr" + "ipt id=\"__ie_init\" defer=\"true\" src=\"//:\"><\/script>");
    var script = document.getElementById("__ie_init");
    script.onreadystatechange = function() {
        if (this.readyState == "complete") {
            window.fireoninit(); // call the onload handler
        }
    };
  /*@end @*/

  // for Safari
  if (/WebKit/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            window.fireoninit(); // call the onload handler
        }
    }, 10);
  }

  // for other browsers
  window.onload = window.fireoninit;


/**
 * This is a pseudo Event that will be fired by the fireoninit
 * function above.
 *
 * Use addInitEvent to bind to this event!
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 * @see fireoninit()
 */
window.oninit = function(){};

/**
 * Bind a function to the window.init pseudo event
 *
 * @author Simon Willison
 * @see http://simon.incutio.com/archive/2004/05/26/addLoadEvent
 */
function addInitEvent(func) {
  var oldoninit = window.oninit;
  if (typeof window.oninit != 'function') {
    window.oninit = func;
  } else {
    window.oninit = function() {
      oldoninit();
      func();
    };
  }
}




/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/events.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/cookie.js XXXXXXXXXX */

/**
 * Handles the cookie used by several JavaScript functions
 *
 * Only a single cookie is written and read. You may only save
 * sime name-value pairs - no complex types!
 *
 * You should only use the getValue and setValue methods
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
DokuCookie = {
    data: Array(),
    name: 'DOKU_PREFS',

    /**
     * Save a value to the cookie
     *
     * @author Andreas Gohr <andi@splitbrain.org>
     */
    setValue: function(key,val){
        DokuCookie.init();
        DokuCookie.data[key] = val;

        // prepare expire date
        var now = new Date();
        DokuCookie.fixDate(now);
        now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000); //expire in a year

        //save the whole data array
        var text = '';
        for(var key in DokuCookie.data){
            if (!DokuCookie.data.hasOwnProperty(key)) continue;
            text += '#'+escape(key)+'#'+DokuCookie.data[key];
        }
        DokuCookie.setCookie(DokuCookie.name,text.substr(1),now,DOKU_BASE);
    },

    /**
     * Get a Value from the Cookie
     *
     * @author Andreas Gohr <andi@splitbrain.org>
     */
    getValue: function(key){
        DokuCookie.init();
        return DokuCookie.data[key];
    },

    /**
     * Loads the current set cookie
     *
     * @author Andreas Gohr <andi@splitbrain.org>
     */
    init: function(){
        if(DokuCookie.data.length) return;
        var text  = DokuCookie.getCookie(DokuCookie.name);
        if(text){
            var parts = text.split('#');
            for(var i=0; i<parts.length; i+=2){
                DokuCookie.data[unescape(parts[i])] = unescape(parts[i+1]);
            }
        }
    },

    /**
     * This sets a cookie by JavaScript
     *
     * @link http://www.webreference.com/js/column8/functions.html
     */
    setCookie: function(name, value, expires, path, domain, secure) {
        var curCookie = name + "=" + escape(value) +
            ((expires) ? "; expires=" + expires.toGMTString() : "") +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            ((secure) ? "; secure" : "");
        document.cookie = curCookie;
    },

    /**
     * This reads a cookie by JavaScript
     *
     * @link http://www.webreference.com/js/column8/functions.html
     */
    getCookie: function(name) {
        var dc = document.cookie;
        var prefix = name + "=";
        var begin = dc.indexOf("; " + prefix);
        if (begin == -1) {
            begin = dc.indexOf(prefix);
            if (begin !== 0){ return null; }
        } else {
            begin += 2;
        }
        var end = document.cookie.indexOf(";", begin);
        if (end == -1){
            end = dc.length;
        }
        return unescape(dc.substring(begin + prefix.length, end));
    },

    /**
     * This is needed for the cookie functions
     *
     * @link http://www.webreference.com/js/column8/functions.html
     */
    fixDate: function(date) {
        var base = new Date(0);
        var skew = base.getTime();
        if (skew > 0){
            date.setTime(date.getTime() - skew);
        }
    }
};


/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/cookie.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/script.js XXXXXXXXXX */

/**
 * Some of these scripts were taken from wikipedia.org and were modified for DokuWiki
 */

/**
 * Some browser detection
 */
var clientPC  = navigator.userAgent.toLowerCase(); // Get client info
var is_macos  = navigator.appVersion.indexOf('Mac') != -1;
var is_gecko  = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1) &&
                (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1));
var is_safari = ((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1));
var is_khtml  = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ));
if (clientPC.indexOf('opera')!=-1) {
    var is_opera = true;
    var is_opera_preseven = (window.opera && !document.childNodes);
    var is_opera_seven = (window.opera && document.childNodes);
}

/**
 * Rewrite the accesskey tooltips to be more browser and OS specific.
 *
 * Accesskey tooltips are still only a best-guess of what will work
 * on well known systems.
 *
 * @author Ben Coburn <btcoburn@silicodon.net>
 */
function updateAccessKeyTooltip() {
  // determin tooltip text (order matters)
  var tip = 'ALT+'; //default
  if (is_macos) { tip = 'CTRL+'; }
  if (is_opera) { tip = 'SHIFT+ESC '; }
  // add other cases here...

  // do tooltip update
  if (tip=='ALT+') { return; }
  var exp = /\[ALT\+/i;
  var rep = '['+tip;

  var elements = document.getElementsByTagName('a');
  for (var i=0; i<elements.length; i++) {
    if (elements[i].accessKey.length==1 && elements[i].title.length>0) {
      elements[i].title = elements[i].title.replace(exp, rep);
    }
  }

  elements = document.getElementsByTagName('input');
  for (var i=0; i<elements.length; i++) {
    if (elements[i].accessKey.length==1 && elements[i].title.length>0) {
      elements[i].title = elements[i].title.replace(exp, rep);
    }
  }

  elements = document.getElementsByTagName('button');
  for (var i=0; i<elements.length; i++) {
    if (elements[i].accessKey.length==1 && elements[i].title.length>0) {
      elements[i].title = elements[i].title.replace(exp, rep);
    }
  }
}

/**
 * Handy shortcut to document.getElementById
 *
 * This function was taken from the prototype library
 *
 * @link http://prototype.conio.net/
 */
function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

/**
 * Simple function to check if a global var is defined
 *
 * @author Kae Verens
 * @link http://verens.com/archives/2005/07/25/isset-for-javascript/#comment-2835
 */
function isset(varname){
  return(typeof(window[varname])!='undefined');
}

/**
 * Select elements by their class name
 *
 * @author Dustin Diaz <dustin [at] dustindiaz [dot] com>
 * @link   http://www.dustindiaz.com/getelementsbyclass/
 */
function getElementsByClass(searchClass,node,tag) {
    var classElements = new Array();
    if ( node == null )
        node = document;
    if ( tag == null )
        tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
    for (i = 0, j = 0; i < elsLen; i++) {
        if ( pattern.test(els[i].className) ) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}

/**
 * Get the X offset of the top left corner of the given object
 *
 * @link http://www.quirksmode.org/index.html?/js/findpos.html
 */
function findPosX(object){
  var curleft = 0;
  var obj = $(object);
  if (obj.offsetParent){
    while (obj.offsetParent){
      curleft += obj.offsetLeft;
      obj = obj.offsetParent;
    }
  }
  else if (obj.x){
    curleft += obj.x;
  }
  return curleft;
} //end findPosX function

/**
 * Get the Y offset of the top left corner of the given object
 *
 * @link http://www.quirksmode.org/index.html?/js/findpos.html
 */
function findPosY(object){
  var curtop = 0;
  var obj = $(object);
  if (obj.offsetParent){
    while (obj.offsetParent){
      curtop += obj.offsetTop;
      obj = obj.offsetParent;
    }
  }
  else if (obj.y){
    curtop += obj.y;
  }
  return curtop;
} //end findPosY function

/**
 * Escape special chars in JavaScript
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function jsEscape(text){
    var re=new RegExp("\\\\","g");
    text=text.replace(re,"\\\\");
    re=new RegExp("'","g");
    text=text.replace(re,"\\'");
    re=new RegExp('"',"g");
    text=text.replace(re,'&quot;');
    re=new RegExp("\\\\\\\\n","g");
    text=text.replace(re,"\\n");
    return text;
}

/**
 * This function escapes some special chars
 * @deprecated by above function
 */
function escapeQuotes(text) {
  var re=new RegExp("'","g");
  text=text.replace(re,"\\'");
  re=new RegExp('"',"g");
  text=text.replace(re,'&quot;');
  re=new RegExp("\\n","g");
  text=text.replace(re,"\\n");
  return text;
}

/**
 * Adds a node as the first childenode to the given parent
 *
 * @see appendChild()
 */
function prependChild(parent,element) {
    if(!parent.firstChild){
        parent.appendChild(element);
    }else{
        parent.insertBefore(element,parent.firstChild);
    }
}

/**
 * Prints a animated gif to show the search is performed
 *
 * Because we need to modify the DOM here before the document is loaded
 * and parsed completely we have to rely on document.write()
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function showLoadBar(){

  document.write('<img src="'+DOKU_BASE+'lib/images/loading.gif" '+
                 'width="150" height="12" alt="..." />');

  /* this does not work reliable in IE
  obj = $(id);

  if(obj){
    obj.innerHTML = '<img src="'+DOKU_BASE+'lib/images/loading.gif" '+
                    'width="150" height="12" alt="..." />';
    obj.style.display="block";
  }
  */
}

/**
 * Disables the animated gif to show the search is done
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function hideLoadBar(id){
  obj = $(id);
  if(obj) obj.style.display="none";
}

/**
 * Adds the toggle switch to the TOC
 */
function addTocToggle() {
    if(!document.getElementById) return;
    var header = $('toc__header');
    if(!header) return;

    var obj          = document.createElement('span');
    obj.id           = 'toc__toggle';
    obj.innerHTML    = '<span>&minus;</span>';
    obj.className    = 'toc_close';
    obj.style.cursor = 'pointer';

    prependChild(header,obj);
    obj.parentNode.onclick = toggleToc;
    try {
       obj.parentNode.style.cursor = 'pointer';
       obj.parentNode.style.cursor = 'hand';
    }catch(e){}
}

/**
 * This toggles the visibility of the Table of Contents
 */
function toggleToc() {
  var toc = $('toc__inside');
  var obj = $('toc__toggle');
  if(toc.style.display == 'none') {
    toc.style.display   = '';
    obj.innerHTML       = '<span>&minus;</span>';
    obj.className       = 'toc_close';
  } else {
    toc.style.display   = 'none';
    obj.innerHTML       = '<span>+</span>';
    obj.className       = 'toc_open';
  }
}

/**
 * This enables/disables checkboxes for acl-administration
 *
 * @author Frank Schubert <frank@schokilade.de>
 */
function checkAclLevel(){
  if(document.getElementById) {
    var scope = $('acl_scope').value;

    //check for namespace
    if( (scope.indexOf(":*") > 0) || (scope == "*") ){
      document.getElementsByName('acl_checkbox[4]')[0].disabled=false;
      document.getElementsByName('acl_checkbox[8]')[0].disabled=false;
    }else{
      document.getElementsByName('acl_checkbox[4]')[0].checked=false;
      document.getElementsByName('acl_checkbox[8]')[0].checked=false;

      document.getElementsByName('acl_checkbox[4]')[0].disabled=true;
      document.getElementsByName('acl_checkbox[8]')[0].disabled=true;
    }
  }
}

/**
 * Display an insitu footnote popup
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 * @author Chris Smith <chris@jalakai.co.uk>
 */
function footnote(e){
    var obj = e.target;
    var id = obj.id.substr(5);

    // get or create the footnote popup div
    var fndiv = $('insitu__fn');
    if(!fndiv){
        fndiv = document.createElement('div');
        fndiv.id        = 'insitu__fn';
        fndiv.className = 'insitu-footnote JSpopup dokuwiki';

        // autoclose on mouseout - ignoring bubbled up events
        addEvent(fndiv,'mouseout',function(e){
            if(e.target != fndiv){
                e.stopPropagation();
                return;
            }
            // check if the element was really left
            if(e.pageX){        // Mozilla
                var bx1 = findPosX(fndiv);
                var bx2 = bx1 + fndiv.offsetWidth;
                var by1 = findPosY(fndiv);
                var by2 = by1 + fndiv.offsetHeight;
                var x = e.pageX;
                var y = e.pageY;
                if(x > bx1 && x < bx2 && y > by1 && y < by2){
                    // we're still inside boundaries
                    e.stopPropagation();
                    return;
                }
            }else{              // IE
                if(e.offsetX > 0 && e.offsetX < fndiv.offsetWidth-1 &&
                   e.offsetY > 0 && e.offsetY < fndiv.offsetHeight-1){
                    // we're still inside boundaries
                    e.stopPropagation();
                    return;
                }
            }
            // okay, hide it
            fndiv.style.display='none';
        });
        document.body.appendChild(fndiv);
    }

    // locate the footnote anchor element
    var a = $( "fn__"+id );
    if (!a){ return; }

    // anchor parent is the footnote container, get its innerHTML
    var content = new String (a.parentNode.innerHTML);

    // strip the leading content anchors and their comma separators
    content = content.replace(/<a\s.*?href=\".*\#fnt__\d+\".*?<\/a>/gi, '');
    content = content.replace(/^\s+(,\s+)+/,'');

    // prefix ids on any elements with "insitu__" to ensure they remain unique
    content = content.replace(/\bid=\"(.*?)\"/gi,'id="insitu__$1');

    // now put the content into the wrapper
    fndiv.innerHTML = content;

    // position the div and make it visible
    var x; var y;
    if(e.pageX){        // Mozilla
        x = e.pageX;
        y = e.pageY;
    }else{              // IE
        x = e.offsetX;
        y = e.offsetY;
    }
    fndiv.style.position = 'absolute';
    fndiv.style.left = (x+2)+'px';
    fndiv.style.top  = (y+2)+'px';
    fndiv.style.display = '';
}

/**
 * Add the event handlers to footnotes
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
addInitEvent(function(){
    var elems = getElementsByClass('fn_top',null,'a');
    for(var i=0; i<elems.length; i++){
        addEvent(elems[i],'mouseover',function(e){footnote(e);});
    }
});

/**
 * Add the edit window size controls
 */
function initSizeCtl(ctlid,edid){
    if(!document.getElementById){ return; }

    var ctl      = $(ctlid);
    var textarea = $(edid);
    if(!ctl || !textarea) return;

    var hgt = DokuCookie.getValue('sizeCtl');
    if(hgt){
      textarea.style.height = hgt;
    }else{
      textarea.style.height = '300px';
    }

    var l = document.createElement('img');
    var s = document.createElement('img');
    var w = document.createElement('img');
    l.src = DOKU_BASE+'lib/images/larger.gif';
    s.src = DOKU_BASE+'lib/images/smaller.gif';
    w.src = DOKU_BASE+'lib/images/wrap.gif';
    addEvent(l,'click',function(){sizeCtl(edid,100);});
    addEvent(s,'click',function(){sizeCtl(edid,-100);});
    addEvent(w,'click',function(){toggleWrap(edid);});
    ctl.appendChild(l);
    ctl.appendChild(s);
    ctl.appendChild(w);
}

/**
 * This sets the vertical size of the editbox
 */
function sizeCtl(edid,val){
  var textarea = $(edid);
  var height = parseInt(textarea.style.height.substr(0,textarea.style.height.length-2));
  height += val;
  textarea.style.height = height+'px';

  DokuCookie.setValue('sizeCtl',textarea.style.height);
}

/**
 * Toggle the wrapping mode of a textarea
 *
 * @author Fluffy Convict <fluffyconvict@hotmail.com>
 * @link   http://news.hping.org/comp.lang.javascript.archive/12265.html
 * @author <shutdown@flashmail.com>
 * @link   https://bugzilla.mozilla.org/show_bug.cgi?id=302710#c2
 */
function toggleWrap(edid){
    var txtarea = $(edid);
    var wrap = txtarea.getAttribute('wrap');
    if(wrap && wrap.toLowerCase() == 'off'){
        txtarea.setAttribute('wrap', 'soft');
    }else{
        txtarea.setAttribute('wrap', 'off');
    }
    // Fix display for mozilla
    var parNod = txtarea.parentNode;
    var nxtSib = txtarea.nextSibling;
    parNod.removeChild(txtarea);
    parNod.insertBefore(txtarea, nxtSib);
}

/**
 * Handler to close all open Popups
 */
function closePopups(){
  if(!document.getElementById){ return; }

  var divs = document.getElementsByTagName('div');
  for(var i=0; i < divs.length; i++){
    if(divs[i].className.indexOf('JSpopup') != -1){
            divs[i].style.display = 'none';
    }
  }
}

/**
 * Looks for an element with the ID scroll__here at scrolls to it
 */
function scrollToMarker(){
    var obj = $('scroll__here');
    if(obj) obj.scrollIntoView();
}

/**
 * Looks for an element with the ID focus__this at sets focus to it
 */
function focusMarker(){
    var obj = $('focus__this');
    if(obj) obj.focus();
}

/**
 * Remove messages
 */
function cleanMsgArea(){
    var elems = getElementsByClass('(success|info|error)',document,'div');
    if(elems){
        for(var i=0; i<elems.length; i++){
            elems[i].style.display = 'none';
        }
    }
}


/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/script.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/tw-sack.js XXXXXXXXXX */

/* Simple AJAX Code-Kit (SACK) */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence, see documentation or authors website for more details */

function sack(file){
  this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";
  this.requestFile = file;
  this.method = "POST";
  this.URLString = "";
  this.encodeURIString = true;
  this.execute = false;

  this.onLoading = function() { };
  this.onLoaded = function() { };
  this.onInteractive = function() { };
  this.onCompletion = function() { };
  this.afterCompletion = function() { };

  this.createAJAX = function() {
    try {
      this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (err) {
        this.xmlhttp = null;
      }
    }
    if(!this.xmlhttp && typeof XMLHttpRequest != "undefined"){
      this.xmlhttp = new XMLHttpRequest();
    }
    if (!this.xmlhttp){
      this.failed = true;
    }
  };

  this.setVar = function(name, value){
    if (this.URLString.length < 3){
      this.URLString = name + "=" + value;
    } else {
      this.URLString += "&" + name + "=" + value;
    }
  };

  this.encVar = function(name, value){
    var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value);
  return varString;
  };

  this.encodeURLString = function(string){
    varArray = string.split('&');
    for (i = 0; i < varArray.length; i++){
      urlVars = varArray[i].split('=');
      if (urlVars[0].indexOf('amp;') != -1){
        urlVars[0] = urlVars[0].substring(4);
      }
      varArray[i] = this.encVar(urlVars[0],urlVars[1]);
    }
  return varArray.join('&');
  };

  this.runResponse = function(){
    eval(this.response);
  };

  this.runAJAX = function(urlstring){
    this.responseStatus = new Array(2);
    if(this.failed && this.AjaxFailedAlert){
      alert(this.AjaxFailedAlert);
    } else {
      if (urlstring){
        if (this.URLString.length){
          this.URLString = this.URLString + "&" + urlstring;
        } else {
          this.URLString = urlstring;
        }
      }
      if (this.encodeURIString){
        var timeval = new Date().getTime();
        this.URLString = this.encodeURLString(this.URLString);
        this.setVar("rndval", timeval);
      }
      if (this.element) { this.elementObj = document.getElementById(this.element); }
      if (this.xmlhttp) {
        var self = this;
        if (this.method == "GET") {
          var totalurlstring = this.requestFile + "?" + this.URLString;
          this.xmlhttp.open(this.method, totalurlstring, true);
        } else {
          this.xmlhttp.open(this.method, this.requestFile, true);
        }
        if (this.method == "POST"){
          try {
             this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
          } catch (e) {}
        }

        this.xmlhttp.onreadystatechange = function() {
          switch (self.xmlhttp.readyState){
            case 1:
              self.onLoading();
            break;
            case 2:
              self.onLoaded();
            break;
            case 3:
              self.onInteractive();
            break;
            case 4:
              self.response = self.xmlhttp.responseText;
              self.responseXML = self.xmlhttp.responseXML;
              self.responseStatus[0] = self.xmlhttp.status;
              self.responseStatus[1] = self.xmlhttp.statusText;
              self.onCompletion();
              if(self.execute){ self.runResponse(); }
              if (self.elementObj) {
                var elemNodeName = self.elementObj.nodeName;
                elemNodeName.toLowerCase();
                if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){
                  self.elementObj.value = self.response;
                } else {
                  self.elementObj.innerHTML = self.response;
                }
              }
              self.afterCompletion();
              self.URLString = "";
            break;
          }
        };
        this.xmlhttp.send(this.URLString);
      }
    }
  };
this.createAJAX();
}


/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/tw-sack.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/ajax.js XXXXXXXXXX */

/**
 * AJAX functions for the pagename quicksearch
 *
 * We're using a global object with self referencing methods
 * here to make callbacks work
 *
 * @license  GPL2 (http://www.gnu.org/licenses/gpl.html)
 * @author   Andreas Gohr <andi@splitbrain.org>
 */

//prepare class
function ajax_qsearch_class(){
  this.sack = null;
  this.inObj = null;
  this.outObj = null;
  this.timer = null;
}

//create global object and add functions
var ajax_qsearch = new ajax_qsearch_class();
ajax_qsearch.sack = new sack(DOKU_BASE + 'lib/exe/ajax.php');
ajax_qsearch.sack.AjaxFailedAlert = '';
ajax_qsearch.sack.encodeURIString = false;

ajax_qsearch.init = function(inID,outID){
  ajax_qsearch.inObj  = document.getElementById(inID);
  ajax_qsearch.outObj = document.getElementById(outID);

  // objects found?
  if(ajax_qsearch.inObj === null){ return; }
  if(ajax_qsearch.outObj === null){ return; }

  // attach eventhandler to search field
  addEvent(ajax_qsearch.inObj,'keyup',ajax_qsearch.call);

  // attach eventhandler to output field
  addEvent(ajax_qsearch.outObj,'click',function(){ ajax_qsearch.outObj.style.display='none'; });
};

ajax_qsearch.clear = function(){
  ajax_qsearch.outObj.style.display = 'none';
  ajax_qsearch.outObj.innerHTML = '';
  if(ajax_qsearch.timer !== null){
    window.clearTimeout(ajax_qsearch.timer);
    ajax_qsearch.timer = null;
  }
};

ajax_qsearch.exec = function(){
  ajax_qsearch.clear();
  var value = ajax_qsearch.inObj.value;
  if(value === ''){ return; }
  ajax_qsearch.sack.runAJAX('call=qsearch&q='+encodeURI(value));
};

ajax_qsearch.sack.onCompletion = function(){
  var data = ajax_qsearch.sack.response;
  if(data === ''){ return; }

  ajax_qsearch.outObj.innerHTML = data;
  ajax_qsearch.outObj.style.display = 'block';
};

ajax_qsearch.call = function(){
  ajax_qsearch.clear();
  ajax_qsearch.timer = window.setTimeout("ajax_qsearch.exec()",500);
};



/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/scripts/ajax.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/tpl/nekro/script.js XXXXXXXXXX */



/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/tpl/nekro/script.js XXXXXXXXXX */

addInitEvent(function(){ ajax_qsearch.init('qsearch__in','qsearch__out'); });
addInitEvent(function(){ addEvent(document,'click',closePopups); });
addInitEvent(function(){ addTocToggle(); });


/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/plugins/addnewpage/script.js XXXXXXXXXX */

/*USE : UTF8*/
function setName() {
	document.getElementById("editform").setAttribute("action","?id="+document.getElementById('np_cat').value+':'+document.getElementById('addnewpage_title').value);
}


/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/plugins/addnewpage/script.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/plugins/captcha/script.js XXXXXXXXXX */

/**
 * Autofill and hide the whole captcha stuff in the simple JS mode
 */
addInitEvent(function(){
    var code = $('plugin__captcha_code');
    if(!code) return;

    var box  = $('plugin__captcha');
    box.value=code.innerHTML;

    $('plugin__captcha_wrapper').style.display = 'none';
});


/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/plugins/captcha/script.js XXXXXXXXXX */



/* XXXXXXXXXX begin of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/plugins/spellcheck/script.js XXXXXXXXXX */

/**
 * DokuWiki Spellcheck AJAX clientside script
 *
 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
 * @author     Andreas Gohr <andi@splitbrain.org>
 */

/**
 * Licence info: This spellchecker is inspired by code by Garrison Locke available
 * at http://www.broken-notebook.com/spell_checker/index.php (licensed under the Terms
 * of an BSD license). The code in this file was nearly completly rewritten for DokuWiki
 * and is licensed under GPL version 2 (See COPYING for details).
 *
 * Original Copyright notice follows:
 *
 * Copyright (c) 2005, Garrison Locke
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   * Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation
 *     and/or other materials provided with the distribution.
 *   * Neither the name of the http://www.broken-notebook.com nor the names of its
 *     contributors may be used to endorse or promote products derived from this
 *     software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
 * OF SUCH DAMAGE.
 */

/*
 * Uses some general functions defined elsewhere. Here is a list:
 *
 * Defined in script.js:
 *
 *   findPosX()
 *   findPosY()
 *
 * Defined in events.js:
 *
 *   addEvent()
 *
 * Defined in edit.js:
 *
 *   createToolButton()
 */

/**
 * quotes single quotes
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function qquote(str){
  return str.split('\'').join('\\\'');
}

/**
 * AJAX Spellchecker Class
 *
 * Note to some function use a hardcoded instance named ajax_spell to make
 * references to object members. Used Object-IDs are hardcoded in the init()
 * method.
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 * @author Garrison Locke <http://www.broken-notebook.com>
 */
function ajax_spell_class(){
  this.inited = false;
  this.utf8ok = 1;
  this.handler = DOKU_BASE+'lib/plugins/spellcheck/spellcheck.php';
  // to hold the page objects (initialized with init())
  this.textboxObj = null;
  this.showboxObj = null;
  this.suggestObj = null;
  this.editbarObj = null;
  this.buttonObj = null;
  this.imageObj  = null;

  // hold translations
  this.txtStart = 'Check Spelling';
  this.txtStop  = 'Resume Editing';
  this.txtRun   = 'Checking...';
  this.txtNoErr = 'No Mistakes';
  this.txtNoSug = 'No Suggestions';
  this.txtChange= 'Change';

  this.timer = null;

  /**
   * Initializes everything
   *
   * Call after the page was setup. Hardcoded element IDs here.
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.init = function(txtStart,txtStop,txtRun,txtNoErr,txtNoSug,txtChange){
     // don't run twice
    if (this.inited){ return; }
    this.inited = true;

    // check for AJAX availability
    var ajax = new sack(this.handler);
    if(ajax.failed){ return; }

    // get Elements
    this.textboxObj = document.getElementById('wiki__text');
    this.editbarObj = document.getElementById('wiki__editbar');
    this.showboxObj = document.getElementById('spell__result');
    this.suggestObj = document.getElementById('spell__suggest');


    // set wordwrap style with browser propritary attributes
    if(is_gecko){
      this.showboxObj.style.whiteSpace = '-moz-pre-wrap'; // Mozilla, since 1999
    }else if(is_opera_preseven){
      this.showboxObj.style.whiteSpace = '-pre-wrap';     // Opera 4-6
    }else if(is_opera_seven){
      this.showboxObj.style.whiteSpace = '-o-pre-wrap';   // Opera 7
    }else{
      this.showboxObj.style['word-wrap']   = 'break-word';    //Internet Explorer 5.5+
    }
    // Which browser supports this?
    // this.showboxObj.style.whiteSpace = 'pre-wrap';      // css-3


    // set Translation Strings
    this.txtStart = txtStart;
    this.txtStop  = txtStop;
    this.txtRun   = txtRun;
    this.txtNoErr = txtNoErr;
    this.txtNoSug = txtNoSug;
    this.txtChange= txtChange;

    // create ToolBar Button with ID and add it to the toolbar with null action
    var toolbarObj = document.getElementById('tool__bar');
    this.buttonObj = createToolButton(DOKU_BASE+'lib/plugins/spellcheck/images/spellcheck.png',txtStart,'k','spell__check');
    this.buttonObj.onclick = function(){return false;};
    toolbarObj.appendChild(this.buttonObj);
    this.imageObj  = document.getElementById('spell__check_ico');

    // start UTF-8 compliance test - send an UTF-8 char and see what comes back
    ajax.AjaxFailedAlert = '';
    ajax.encodeURIString = false;
    ajax.onCompletion    = this.initReady;
    ajax.runAJAX('call=utf8test&data='+encodeURIComponent('ü'));

    // second part of initialisation is in initReady() function
  };

  /**
   * Eventhandler for click objects anywhere on the document
   *
   * Disables the suggestion box
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   * @author Garrison Locke <http://www.broken-notebook.com>
   */
  this.docClick = function(e){
    // what was clicked?
    try{
      target = window.event.srcElement;
    }catch(ex){
      target = e.target;
    }

    if (target.id != ajax_spell.suggestObj.id){
      ajax_spell.suggestObj.style.display = "none";
    }
  };

  /**
   * Changes the Spellchecker link according to the given mode
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.setState = function(state){
    switch (state){
      case 'stop':
        ajax_spell.buttonObj.onclick   = function(){ ajax_spell.resume(); return false; };
        ajax_spell.buttonObj.title     = ajax_spell.txtStop;
        ajax_spell.buttonObj.accessKey = '';
        ajax_spell.imageObj.src = DOKU_BASE+'lib/plugins/spellcheck/images/spellstop.png';
        break;
      case 'noerr':
        ajax_spell.buttonObj.onclick   = function(){ajax_spell.setState('start'); return false; };
        ajax_spell.buttonObj.title     = ajax_spell.txtNoErr;
        ajax_spell.buttonObj.accessKey = '';
        ajax_spell.imageObj.src = DOKU_BASE+'lib/plugins/spellcheck/images/spellnoerr.png';
        break;
      case 'run':
        ajax_spell.buttonObj.onclick   = function(){return false;};
        ajax_spell.buttonObj.title     = ajax_spell.txtRun;
        ajax_spell.buttonObj.accessKey = '';
        ajax_spell.imageObj.src = DOKU_BASE+'lib/plugins/spellcheck/images/spellwait.gif';
        break;
      default:
        ajax_spell.buttonObj.onclick   = function(){ ajax_spell.run(); return false; };
        ajax_spell.buttonObj.title     = ajax_spell.txtStart+' [ALT-K]';
        ajax_spell.buttonObj.accessKey = 'k';
        ajax_spell.imageObj.src = DOKU_BASE+'lib/plugins/spellcheck/images/spellcheck.png';
        break;
    }
  };

  /**
   * Replaces a word identified by id with its correction given in word
   *
   * @author Garrison Locke <http://www.broken-notebook.com>
   */
  this.correct = function (id, word){
    var obj = document.getElementById('spell__error'+id);
    obj.innerHTML = decodeURIComponent(word);
    obj.style.color = "#005500";
    this.suggestObj.style.display = "none";
  };

  /**
   * Opens a prompt to let the user change the word her self
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.ask = function(id){
    var word = document.getElementById('spell__error'+id).innerHTML;
    word = prompt(this.txtChange,word);
    if(word){
      this.correct(id,encodeURIComponent(word));
    }
  };

  /**
   * Displays the suggestions for a misspelled word
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   * @author Garrison Locke <http://www.broken-notebook.com>
   */
  this.suggest = function(){
    var args = this.suggest.arguments;
    if(!args[0]){ return; }
    var id   = args[0];

    // set position of the popup
    this.suggestObj.style.display = "none";
    var x = findPosX('spell__error'+id);
    var y = findPosY('spell__error'+id);

    // handle scrolling
    var scrollPos;
    if(is_opera){
      scrollPos = 0; //FIXME how to do this without browser sniffing?
    }else{
      scrollPos = this.showboxObj.scrollTop;
    }

    this.suggestObj.style.left = x+'px';
    this.suggestObj.style.top  = (y+16-scrollPos)+'px';

    // handle suggestions
    var text = '';
    if(args.length == 1){
      text += this.txtNoSug+'<br />';
    }else{
      for(var i=1; i<args.length; i++){
        text += '<a href="javascript:ajax_spell.correct('+id+',\''+
                qquote(args[i])+'\')">';
        text += args[i];
        text += '</a><br />';
      }
    }
    // add option for manual edit
    text += '<a href="javascript:ajax_spell.ask('+id+')">';
    text += '['+this.txtChange+']';
    text += '</a><br />';

    this.suggestObj.innerHTML = text;
    this.suggestObj.style.display = "block";
  };

  // --- Callbacks ---

  /**
   * Callback. Called after the object was initialized and UTF-8 tested
   * Inside the callback 'this' is the SACK object!!
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.initReady = function(){
    var data = this.response;

    //test for UTF-8 compliance (will fail for konqueror)
    if(data != 'ü'){
      ajax_spell.utf8ok = 0;
    }

    // register click event
    addEvent(document,'click',ajax_spell.docClick);

    // register focus event
    addEvent(ajax_spell.textboxObj,'focus',ajax_spell.setState);

    // get started
    ajax_spell.setState('start');
  };

  /**
   * Callback. Called after finishing spellcheck.
   * Inside the callback 'this' is the SACK object!!
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.start = function(){
    if(ajax_spell.timer !== null){
      window.clearTimeout(ajax_spell.timer);
      ajax_spell.timer = null;
    }else{
      // there is no timer set, we timed out already
      return;
    }

    var data  = this.response;
    var error = data.charAt(0);
        data  = data.substring(1);
    if(error == '1'){
      ajax_spell.setState('stop');

      // convert numeric entities back to UTF-8 if needed
      if(!ajax_spell.utf8ok){
        data = data.replace(/&#(\d+);/g,
                            function(whole,match1) {
                              return String.fromCharCode(+match1);
                            });
      }

      // replace textbox through div
      ajax_spell.showboxObj.innerHTML     = data;
      ajax_spell.showboxObj.style.width   = ajax_spell.textboxObj.style.width;
      ajax_spell.showboxObj.style.height  = ajax_spell.textboxObj.style.height;
      ajax_spell.textboxObj.style.display = 'none';
      ajax_spell.showboxObj.style.display = 'block';
    }else{
      if(error == '2'){
        alert(data);
      }
      ajax_spell.textboxObj.disabled = false;
      ajax_spell.editbarObj.style.visibility = 'visible';
      ajax_spell.setState('noerr');
    }
  };

  /**
   * Callback. Gets called by resume() - switches back to edit mode
   * Inside the callback 'this' is the SACK object!!
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.stop = function(){
    var data = this.response;

    // convert numeric entities back to UTF-8 if needed
    if(!ajax_spell.utf8ok){
      data = data.replace(/&#(\d+);/g,
                          function(whole,match1) {
                            return String.fromCharCode(+match1);
                          });
      // now remove &amp; protection
      data = data.replace(/&amp;/g,'&');
    }

    // replace div with textbox again
    ajax_spell.textboxObj.value         = data;
    ajax_spell.textboxObj.disabled      = false;
    ajax_spell.showboxObj.style.display = 'none';
    ajax_spell.textboxObj.style.display = 'block';
    ajax_spell.editbarObj.style.visibility = 'visible';
    ajax_spell.showboxObj.innerHTML     = '';
    ajax_spell.setState('start');
  };

  /**
   * Calback for the timeout handling
   *
   * Will be called when the aspell backend didn't return
   */
  this.timedOut = function(){
    if(ajax_spell.timer !== null){
      window.clearTimeout(ajax_spell.timer);
      ajax_spell.timer = null;

      ajax_spell.textboxObj.disabled      = false;
      ajax_spell.showboxObj.style.display = 'none';
      ajax_spell.textboxObj.style.display = 'block';
      ajax_spell.editbarObj.style.visibility = 'visible';
      ajax_spell.showboxObj.innerHTML     = '';
      ajax_spell.setState('start');

      window.alert('Error: The spell checker did not respond');
  }
  };

  // --- Callers ---

  /**
   * Starts the spellchecking by sending an AJAX request
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.run = function(){
    ajax_spell.setState('run');
    ajax_spell.textboxObj.disabled = true;
    ajax_spell.editbarObj.style.visibility = 'hidden';
    var ajax = new sack(ajax_spell.handler);
    ajax.AjaxFailedAlert = '';
    ajax.encodeURIString = false;
    ajax.onCompletion    = this.start;
    ajax.runAJAX('call=check&utf8='+ajax_spell.utf8ok+
                 '&data='+encodeURIComponent(ajax_spell.textboxObj.value));

    // abort after 13 seconds
    this.timer = window.setTimeout(ajax_spell.timedOut,13000);
  };

  /**
   * Rewrites the HTML back to text again using an AJAX request
   *
   * @author Andreas Gohr <andi@splitbrain.org>
   */
  this.resume = function(){
    ajax_spell.setState('run');
    var text = ajax_spell.showboxObj.innerHTML;
    if(text !== ''){
      var ajax = new sack(ajax_spell.handler);
      ajax.AjaxFailedAlert = '';
      ajax.encodeURIString = false;
      ajax.onCompletion    = ajax_spell.stop;
      ajax.runAJAX('call=resume&utf8='+ajax_spell.utf8ok+
                   '&data='+encodeURIComponent(text));
    }
  };

}

// create the global object
var ajax_spell = null;

addInitEvent(function(){
  if(toolbar && toolbar[0]){
    ajax_spell = new ajax_spell_class();

    ajax_spell.init(LANG['plugins']['spellcheck']['start'],
                    LANG['plugins']['spellcheck']['stop'],
                    LANG['plugins']['spellcheck']['wait'],
                    LANG['plugins']['spellcheck']['noerr'],
                    LANG['plugins']['spellcheck']['nosug'],
                    LANG['plugins']['spellcheck']['change']);
  }
});

//Setup VIM: ex: et ts=2 enc=utf-8 :


/* XXXXXXXXXX end of /is/htdocs/wp1014085_P9QIRRMJYJ/nekro/lib/plugins/spellcheck/script.js XXXXXXXXXX */

addInitEvent(function(){ updateAccessKeyTooltip(); });
addInitEvent(function(){ scrollToMarker(); });
addInitEvent(function(){ focusMarker(); });

