diff --git a/inc/html.php b/inc/html.php
index d03815f002fee22995708d99c0aa22dffd08f013..b559b84bb3172841216d2c5e92ff82dc9e6fc161 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -224,7 +224,7 @@ function html_btn($name,$id,$akey,$params,$method='get'){
     $params['id'] = $id;
   }
  
-  $ret .= '<form class="button" method="'.$method.'" action="'.$script.'" onsubmit="return svchk()">';
+  $ret .= '<form class="button" method="'.$method.'" action="'.$script.'">';
   
   reset($params);
   while (list($key, $val) = each($params)) {
@@ -885,7 +885,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
 
   
 ?>
-  <form name="editform" method="post" action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>" onsubmit="return svchk()">
+  <form name="editform" method="post" action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>">
   <input type="hidden" name="id"   value="<?php echo $ID?>" />
   <input type="hidden" name="rev"  value="<?php echo $REV?>" />
   <input type="hidden" name="date" value="<?php echo $DATE?>" />
@@ -911,42 +911,26 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
     <tr>
       <td colspan="3">
         <div id="spell_result"></div>
-        <textarea name="wikitext" id="wikitext" <?php echo $ro?> cols="80" rows="10" class="edit" onchange="textChanged = true;" onkeyup="summaryCheck();" tabindex="1"><?php echo "\n".formText($text)?></textarea>
+        <textarea name="wikitext" id="wikitext" <?php echo $ro?> cols="80" rows="10" class="edit" tabindex="1"><?php echo "\n".formText($text)?></textarea>
       </td>
     </tr>
     <tr id="wikieditbar">
       <td>
       <?php if($wr){?>
-        <input class="button" type="submit" name="do" value="<?php echo $lang['btn_save']?>" accesskey="s" title="[ALT+S]" onclick="textChanged=false" onkeypress="textChanged=false" tabindex="4" />
-        <input class="button" type="submit" name="do" value="<?php echo $lang['btn_preview']?>" accesskey="p" title="[ALT+P]" onclick="textChanged=false" onkeypress="textChanged=false" tabindex="5" />
+        <input class="button" id="edbtn_save" type="submit" name="do" value="<?php echo $lang['btn_save']?>" accesskey="s" title="[ALT+S]" tabindex="4" />
+        <input class="button" id="edbtn_preview" type="submit" name="do" value="<?php echo $lang['btn_preview']?>" accesskey="p" title="[ALT+P]" tabindex="5" />
         <input class="button" type="submit" name="do" value="<?php echo $lang['btn_cancel']?>" tabindex="5" />
       <?php } ?>
       </td>
       <td>
       <?php if($wr){ ?>
         <?php echo $lang['summary']?>:
-        <input type="text" class="edit" name="summary" id="summary" size="50" onkeyup="summaryCheck();" value="<?php echo formText($SUM)?>" tabindex="2" />
+        <input type="text" class="edit" name="summary" id="summary" size="50" value="<?php echo formText($SUM)?>" tabindex="2" />
         <?php html_minoredit()?>
       <?php }?>
       </td>
       <td align="right">
         <div id="sizectl"></div>
-
-        <script language="javascript" type="text/javascript" charset="utf-8">
-          //showSizeCtl();
-          <?php if($wr){ ?>
-            init_locktimer(<?php echo $conf['locktime']-60?>,'<?php echo $lang['willexpire']?>');
-
-            //initToolbar('toolbar','wikitext',toolbar);
-
-            //initialize spellchecker
-            <?php if($conf['spellchecker']){ ?>
-//              ajax_spell.init('<?php echo $lang['spell_start']?>','<?php echo $lang['spell_stop']?>','<?php echo $lang['spell_wait']?>','<?php echo $lang['spell_noerr']?>','<?php echo $lang['spell_nosug']?>','<?php echo $lang['spell_change']?>');
-            <?php } ?>
-
-            document.editform.wikitext.focus();
-          <?php } ?>
-        </script>
       </td>
     </tr>
   </table>
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 037bb24d647988eb44d6e407b42a0a7fef710db2..73ef58767a9a4a775a08343410b5dd5e96ccb5a2 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -503,7 +503,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
             $link['pre']    = '<span class="curid">';
             $link['suf']    = '</span>';
         }
-        $link['more']   = 'onclick="return svchk()" onkeypress="return svchk()"';
+        $link['more']   = '';
         $link['class']  = $class;
         $link['url']    = wl($id);
         $link['name']   = $name;
@@ -545,7 +545,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $link['style']  = '';
         $link['pre']    = '';
         $link['suf']    = '';
-        $link['more']   = 'onclick="return svchk()" onkeypress="return svchk()"';
+        $link['more']   = '';
         $link['class']  = $class;
         $link['url']    = $url;
         $link['name']   = $name;
@@ -565,7 +565,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $link['target'] = $conf['target']['interwiki'];
         $link['pre']    = '';
         $link['suf']    = '';
-        $link['more']   = 'onclick="return svchk()" onkeypress="return svchk()"';
+        $link['more']   = '';
         $link['name']   = $this->_getLinkTitle($name, $wikiUri, $isImage);
 
         if ( !$isImage ) {
@@ -703,7 +703,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $link['style']  = '';
         $link['pre']    = '';
         $link['suf']    = '';
-        $link['more']   = 'onclick="return svchk()" onkeypress="return svchk()"';
+        $link['more']   = '';
         $link['target'] = $conf['target']['media'];
 
         $link['title']  = $this->_xmlEntities($src);
@@ -746,7 +746,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         $link['style']  = '';
         $link['pre']    = '';
         $link['suf']    = '';
-        $link['more']   = 'onclick="return svchk()" onkeypress="return svchk()"';
+        $link['more']   = '';
         $link['target'] = $conf['target']['media'];
 
         $link['title']  = $this->_xmlEntities($src);
diff --git a/inc/template.php b/inc/template.php
index 8c84515c2fa87ac9e04d325b66d263b8154dcb76..9d0d3ef9a5e761c455caaf7ebf82adc7e82c103d 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -225,42 +225,55 @@ function tpl_metaheaders(){
   ptln('<script language="javascript" type="text/javascript" charset="utf-8" src="'.
        DOKU_BASE.'lib/scripts/domTT.js"></script>',$it);
 
-  // add size control
-  ptln('<script language="javascript" type="text/javascript" charset="utf-8">',$it);
-  ptln("addEvent(window,'onload',function(){initSizeCtl('sizectl','wikitext')});",$it+2);
-  ptln('</script>',$it);
 
 
   // editing functions
-  if(($ACT=='edit' || $ACT=='preview') && $INFO['writable']){
-    // load toolbar functions
-    ptln('<script language="javascript" type="text/javascript" charset="utf-8" src="'.
-         DOKU_BASE.'lib/scripts/edit.js"></script>',$it);
+  if($ACT=='edit' || $ACT=='preview'){
+    // add size control
+    ptln('<script language="javascript" type="text/javascript" charset="utf-8">',$it);
+    ptln("addEvent(window,'onload',function(){initSizeCtl('sizectl','wikitext')});",$it+2);
+    ptln('</script>',$it);
 
-    // load spellchecker functions if wanted
-    if($conf['spellchecker']){
+    if($INFO['writable']){
+      // load toolbar functions
       ptln('<script language="javascript" type="text/javascript" charset="utf-8" src="'.
-           DOKU_BASE.'lib/scripts/spellcheck.js"></script>',$it+2);
-    }
+           DOKU_BASE.'lib/scripts/edit.js"></script>',$it);
 
-    ptln('<script language="javascript" type="text/javascript" charset="utf-8">',$it);
-
-    // add toolbar
-    require_once(DOKU_INC.'inc/toolbar.php');
-    toolbar_JSdefines('toolbar');
-    ptln("addEvent(window,'onload',function(){initToolbar('toolbar','wikitext',toolbar);});",$it+2);
-
-    // add spellchecker
-    if($conf['spellchecker']){
-      //init here
-      ptln("addEvent(window,'onload',function(){ ajax_spell.init('".$lang['spell_start']."','".
-                                                                    $lang['spell_stop']."','".
-                                                                    $lang['spell_wait']."','".
-                                                                    $lang['spell_noerr']."','".
-                                                                    $lang['spell_nosug']."','".
-                                                                    $lang['spell_change']."'); });");
+      // load spellchecker functions if wanted
+      if($conf['spellchecker']){
+        ptln('<script language="javascript" type="text/javascript" charset="utf-8" src="'.
+             DOKU_BASE.'lib/scripts/spellcheck.js"></script>',$it+2);
+      }
+ 
+      ptln('<script language="javascript" type="text/javascript" charset="utf-8">',$it);
+
+      // add toolbar
+      require_once(DOKU_INC.'inc/toolbar.php');
+      toolbar_JSdefines('toolbar');
+      ptln("addEvent(window,'onload',function(){initToolbar('toolbar','wikitext',toolbar);});",$it+2);
+
+      // add pageleave check
+      ptln("addEvent(window,'onload',function(){initChangeCheck('".
+           str_replace('\\\\n','\\n',addslashes($lang['notsavedyet']))."');});",$it);
+
+      // add lock timer
+      ptln("addEvent(window,'onload',function(){init_locktimer(".
+           ($conf['locktime']-60).",'".
+           str_replace('\\\\n','\\n',addslashes($lang['willexpire']))."');});",$it);
+
+      // add spellchecker
+      if($conf['spellchecker']){
+        //init here
+        ptln("addEvent(window,'onload',function(){ ajax_spell.init('".
+                                       $lang['spell_start']."','".
+                                       $lang['spell_stop']."','".
+                                       $lang['spell_wait']."','".
+                                       $lang['spell_noerr']."','".
+                                       $lang['spell_nosug']."','".
+                                       $lang['spell_change']."'); });");
+      }
+      ptln('</script>',$it);
     }
-    ptln('</script>',$it);
   }
 
   // plugin stylesheets and Scripts
@@ -270,13 +283,12 @@ function tpl_metaheaders(){
 /**
  * Print a link
  *
- * Just builds a link but adds additional JavaScript needed for
- * the unsaved data check needed in the edit form.
+ * Just builds a link.
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 function tpl_link($url,$name,$more=''){
-  print '<a href="'.$url.'" onclick="return svchk()" onkeypress="return svchk()"';
+  print '<a href="'.$url.'" ';
   if ($more) print ' '.$more;
   print ">$name</a>";
 }
@@ -522,7 +534,7 @@ function tpl_searchform(){
   global $lang;
   global $ACT;
   
-  print '<form action="'.wl().'" accept-charset="utf-8" class="search" name="search" onsubmit="return svchk()">';
+  print '<form action="'.wl().'" accept-charset="utf-8" class="search" name="search">';
   print '<input type="hidden" name="do" value="search" />';
   print '<input type="text" ';
   
diff --git a/lib/images/toolbar/bold.png b/lib/images/toolbar/bold.png
index 6ec336262a9e6487182ff12d66f8c1419348472a..7ebe99ee926f1bd73fac1200598de09ecdd87a12 100644
Binary files a/lib/images/toolbar/bold.png and b/lib/images/toolbar/bold.png differ
diff --git a/lib/images/toolbar/chars.png b/lib/images/toolbar/chars.png
index 83cdadd755809565ff66f5b2fef3172eb39903e1..10f9107c02a67b76fb3eb65f7be6ddea64c84cc6 100644
Binary files a/lib/images/toolbar/chars.png and b/lib/images/toolbar/chars.png differ
diff --git a/lib/images/toolbar/h1.png b/lib/images/toolbar/h1.png
index ffee5c159fb8180920a04249b72fc64b31450cd5..9e4d221c753afe7024267145f8f59a3c65aa514f 100644
Binary files a/lib/images/toolbar/h1.png and b/lib/images/toolbar/h1.png differ
diff --git a/lib/images/toolbar/h2.png b/lib/images/toolbar/h2.png
index a2cc7f253ad4cdc5187d58d9b7654432ad839991..4d3cc51e91b0efea4182576b70f95fc7592f0218 100644
Binary files a/lib/images/toolbar/h2.png and b/lib/images/toolbar/h2.png differ
diff --git a/lib/images/toolbar/h3.png b/lib/images/toolbar/h3.png
index accdaf652d31f49e58c9d1422801c358d5531f63..20419c5a08398142fb0feecebe97b2099bb11b58 100644
Binary files a/lib/images/toolbar/h3.png and b/lib/images/toolbar/h3.png differ
diff --git a/lib/images/toolbar/h4.png b/lib/images/toolbar/h4.png
index 8e57676885b7c73609f18d7007cdf5b7c65115b4..a57c4c8c32bb59c6122e6d15d679e14b43ad3838 100644
Binary files a/lib/images/toolbar/h4.png and b/lib/images/toolbar/h4.png differ
diff --git a/lib/images/toolbar/h5.png b/lib/images/toolbar/h5.png
index 8fe10e99f0b159fa3cd6756c95ff7a6f3aee018a..161fab3560cc82583b3beae0d44ad02e396eb468 100644
Binary files a/lib/images/toolbar/h5.png and b/lib/images/toolbar/h5.png differ
diff --git a/lib/images/toolbar/hr.png b/lib/images/toolbar/hr.png
index 6d68d66aafc2ec82c3c615cf54b61f62976f97e0..f86a8ec9428680e20892aa2ae7a96756de66877e 100644
Binary files a/lib/images/toolbar/hr.png and b/lib/images/toolbar/hr.png differ
diff --git a/lib/images/toolbar/image.png b/lib/images/toolbar/image.png
index d1416fae90fefa907aa45b6eda2bdf9995753957..ca284eeaff6ae9aecfe86ec45981fd76f225fd35 100644
Binary files a/lib/images/toolbar/image.png and b/lib/images/toolbar/image.png differ
diff --git a/lib/images/toolbar/italic.png b/lib/images/toolbar/italic.png
index ab8943b458cfc69285fdbd7eb5b6d7ae49ffb6cd..324e7c03659ef06877a5f4df023a72fcda44e91e 100644
Binary files a/lib/images/toolbar/italic.png and b/lib/images/toolbar/italic.png differ
diff --git a/lib/images/toolbar/link.png b/lib/images/toolbar/link.png
index 453f0d3f1263b636d8733c3ce59fa5b63ae2a73c..f2a444d96224b3ad620bae462e4591525bec8cec 100644
Binary files a/lib/images/toolbar/link.png and b/lib/images/toolbar/link.png differ
diff --git a/lib/images/toolbar/linkextern.png b/lib/images/toolbar/linkextern.png
index 780c335334d8201a0bc7bd4b0e0409ea5f0d5f9c..75afd3dc22e71a9b06a66a09153386ad05bbbb0b 100644
Binary files a/lib/images/toolbar/linkextern.png and b/lib/images/toolbar/linkextern.png differ
diff --git a/lib/images/toolbar/mono.png b/lib/images/toolbar/mono.png
index dd398411ec1cfdfe9e59af03098fa3994a3bf0b6..178cec9f248d65a24f9295f4788749f20b16121b 100644
Binary files a/lib/images/toolbar/mono.png and b/lib/images/toolbar/mono.png differ
diff --git a/lib/images/toolbar/ol.png b/lib/images/toolbar/ol.png
index 91ce32b9d8108a07c9ae2d589f55a2ea213233a7..3162fa21dcbfd454de07bcd8e4bd6af398e1d4ac 100644
Binary files a/lib/images/toolbar/ol.png and b/lib/images/toolbar/ol.png differ
diff --git a/lib/images/toolbar/sig.png b/lib/images/toolbar/sig.png
index e4aa2943c06090d7e7ffddee2eee8a63056b2199..ef997b7cd56ade07014c7bd7ed0609e67af27c20 100644
Binary files a/lib/images/toolbar/sig.png and b/lib/images/toolbar/sig.png differ
diff --git a/lib/images/toolbar/smiley.png b/lib/images/toolbar/smiley.png
index dee8a962ab4b541bb475d7b975d56df7c2a3e5ef..f5d3a0a94116c9acd388a63a5dcede9497c39961 100644
Binary files a/lib/images/toolbar/smiley.png and b/lib/images/toolbar/smiley.png differ
diff --git a/lib/images/toolbar/spellcheck.png b/lib/images/toolbar/spellcheck.png
index 9aecbad4bd47b0a0c91b980676a14e8e0be93d24..8e62ad2d63974a9d998949c7e06ad529b6b8019b 100644
Binary files a/lib/images/toolbar/spellcheck.png and b/lib/images/toolbar/spellcheck.png differ
diff --git a/lib/images/toolbar/strike.png b/lib/images/toolbar/strike.png
index f6dd97647fe836e046867db7e1405e0c383d5f8f..203aacc2b06d35936485b5cdcad376b864590aa2 100644
Binary files a/lib/images/toolbar/strike.png and b/lib/images/toolbar/strike.png differ
diff --git a/lib/images/toolbar/ul.png b/lib/images/toolbar/ul.png
index 4331bc6c28d331da96dc2cebab008f562ab06893..471171db4a05adafad54981d0c5b3c18cc360989 100644
Binary files a/lib/images/toolbar/ul.png and b/lib/images/toolbar/ul.png differ
diff --git a/lib/images/toolbar/underline.png b/lib/images/toolbar/underline.png
index ee5e0d9fd537365d5a2556dded62503d9d9c39b7..bf9665a680d1522b9cde56577b200b5b0e8653dd 100644
Binary files a/lib/images/toolbar/underline.png and b/lib/images/toolbar/underline.png differ
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js
index 641124c8f9bd9f19c5089c731a81361ef1d4f44a..43e6843b074ea3821499928a64ed32b7105f56d2 100644
--- a/lib/scripts/edit.js
+++ b/lib/scripts/edit.js
@@ -21,7 +21,7 @@ function createToolButton(icon,label,key,id){
     btn.title = label;
     if(key){
         btn.title += ' [ALT+'+key.toUpperCase()+']';
-        btn.accesskey = key;
+        btn.accessKey = key;
     }
 
     // set IDs if given
@@ -127,6 +127,7 @@ function showPicker(pickerid,btn){
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 function initToolbar(tbid,edid,tb){
+		if(!document.getElementById) return;
     var toolbar = document.getElementById(tbid);
     var cnt = tb.length;
     for(i=0; i<cnt; i++){
@@ -306,3 +307,106 @@ function insertAtCarret(edid,value){
   if (field.createTextRange) field.caretPos = document.selection.createRange().duplicate();
 }
 
+
+/**
+ * global var used for not saved yet warning
+ */
+var textChanged = false;
+
+/**
+ * Check for changes before leaving the page
+ */
+function changeCheck(msg){
+  if(textChanged){
+    return confirm(msg);
+  }else{
+    return true;
+  }
+}
+
+/**
+ * Add changeCheck to all Links and Forms (except those with a
+ * JSnocheck class), add handlers to monitor changes
+ *
+ * Sets focus to the editbox as well
+ */
+function initChangeCheck(msg){
+		if(!document.getElementById) return;
+		// add change check for links
+		var links = document.getElementsByTagName('a');
+		for(var i=0; i < links.length; i++){
+				if(links[i].className.indexOf('JSnocheck') == -1){
+						links[i].onclick = function(){return changeCheck(msg);};
+						links[i].onkeypress = function(){return changeCheck(msg);};
+				}
+		}
+		// add change check for forms
+    var forms = document.forms;
+    for(i=0; i < forms.length; i++){
+				if(forms[i].className.indexOf('JSnocheck') == -1){
+		        forms[i].onsubmit = function(){return changeCheck(msg);};
+				}
+    }
+
+		// reset change memory var on submit
+		var btn_save        = document.getElementById('edbtn_save');
+		btn_save.onclick    = function(){ textChanged = false; };
+		btn_save.onkeypress = function(){ textChanged = false; };
+		var btn_prev        = document.getElementById('edbtn_preview');
+		btn_prev.onclick    = function(){ textChanged = false; };
+		btn_prev.onkeypress = function(){ textChanged = false; };
+
+		// add change memory setter
+		var edit_text   = document.getElementById('wikitext');
+		edit_text.onchange = function(){
+				textChanged = true; //global var
+				summaryCheck();
+		}
+		edit_text.onkeyup  = summaryCheck;
+		var summary = document.getElementById('summary');
+		summary.onchange = summaryCheck;
+		summary.onkeyup  = summaryCheck;
+
+		// set focus
+		edit_text.focus();
+}
+
+/**
+ * Checks if a summary was entered - if not the style is changed
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function summaryCheck(){
+    var sum = document.getElementById('summary');
+    if(sum.value == ''){
+      	sum.className='missing';
+    }else{
+      	sum.className='edit';
+    }
+}
+
+
+/**
+ * global variable for the locktimer
+ */
+var locktimerID;
+
+/**
+ * This starts a timer to remind the user of an expiring lock
+ * Accepts the delay in seconds and a text to display.
+ */
+function init_locktimer(delay,txt){
+  txt = escapeQuotes(txt);
+  locktimerID = self.setTimeout("locktimer('"+txt+"')", delay*1000);
+}
+
+/**
+ * This stops the timer and displays a message about the expiring lock
+ */
+function locktimer(txt){
+  clearTimeout(locktimerID);
+  alert(txt);
+}
+
+
+
diff --git a/lib/scripts/script.js b/lib/scripts/script.js
index 490394dfbcde29854768ad610c9a8edd79b7720d..44409c712e8ba3c00f9234d34d711555e7036da3 100644
--- a/lib/scripts/script.js
+++ b/lib/scripts/script.js
@@ -131,102 +131,16 @@ function hideLoadBar(){
   }
 }
 
-/**
- * Checks if a summary was entered - if not the style is changed
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function summaryCheck(){
-  if(document.getElementById){
-    var sum = document.getElementById('summary');
-    if(sum.value == ''){
-      sum.className='missing';
-    }else{
-      sum.className='edit';
-    }
-  }
-}
-
-/**
- * This function generates the actual toolbar buttons with localized text
- * we use it to avoid creating the toolbar where javascript is not enabled
- * @deprecated
- */
-function formatButton(imageFile, speedTip, tagOpen, tagClose, sampleText, accessKey) {
-  speedTip=escapeQuotes(speedTip);
-  tagOpen=escapeQuotes(tagOpen);
-  tagClose=escapeQuotes(tagClose);
-  sampleText=escapeQuotes(sampleText);
-
-  document.write("<a ");
-  if(accessKey){
-    document.write("accesskey=\""+accessKey+"\" ");
-    speedTip = speedTip+' [ALT+'+accessKey.toUpperCase()+']';
-  }
-  document.write("href=\"javascript:insertTags");
-  document.write("('"+tagOpen+"','"+tagClose+"','"+sampleText+"');\">");
-
-  document.write("<img width=\"24\" height=\"24\" src=\""+
-                DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+
-                speedTip+"\" title=\""+speedTip+"\">");
-  document.write("</a>");
-  return;
-}
-
-/**
- * This function generates the actual toolbar buttons with localized text
- * we use it to avoid creating the toolbar where javascript is not enabled
- * @deprecated
- */
-function insertButton(imageFile, speedTip, value, accessKey) {
-  speedTip=escapeQuotes(speedTip);
-  value=escapeQuotes(value);
-
-  document.write("<a ");
-  if(accessKey){
-    document.write("accesskey=\""+accessKey+"\" ");
-    speedTip = speedTip+' [ALT+'+accessKey.toUpperCase()+']';
-  }
-  document.write("href=\"javascript:insertAtCarret");
-  document.write("(document.editform.wikitext,'"+value+"');\">");
-
-  document.write("<img width=\"24\" height=\"24\" src=\""+
-                DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+
-                speedTip+"\" title=\""+speedTip+"\">");
-  document.write("</a>");
-  return;
-}
-
-/**
- * This adds a button for the MediaSelection Popup
- * @deprecated
- */
-function mediaButton(imageFile, speedTip, accessKey, namespace) {
-  speedTip=escapeQuotes(speedTip);
-  document.write("<a ");
-  if(accessKey){
-    document.write("accesskey=\""+accessKey+"\" ");
-  }
-  document.write("href=\"javascript:void(window.open('"+DOKU_BASE+"lib/exe/media.php?ns="+
-                 namespace+"','mediaselect','width=600,height=320,left=70,top=50,scrollbars=yes,resizable=yes'));\">");
-  document.write("<img width=\"24\" height=\"24\" src=\""+
-                 DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+
-                 speedTip+"\" title=\""+speedTip+"\">");
-  document.write("</a>");
-  return;
-}
-
 /*
  * Insert the selected filename and close the window
  *
  * @see http://www.alexking.org/index.php?content=software/javascript/content.php
  */
 function mediaSelect(file){
-  insertAtCarret(opener.document.editform.wikitext,'{{'+file+'}}');
+	opener.insertAtCarret('wikitext','{{'+file+'}}');
   window.close(); 
 }
 
-
 /**
  * For the upload Dialog. Prefills the wikiname.
  */
@@ -274,42 +188,6 @@ function toggleToc() {
   }
 }
 
-
-/**
- * global var used for not saved yet warning
- */
-var textChanged = false;
-
-function svchk(){
-  if(textChanged){
-    return confirm(notSavedYet);
-  }else{
-    return true;
-  }
-}
-
-/**
- * global variable for the locktimer
- */
-var locktimerID;
-
-/**
- * This starts a timer to remind the user of an expiring lock
- * Accepts the delay in seconds and a text to display.
- */
-function init_locktimer(delay,txt){
-  txt = escapeQuotes(txt);
-  locktimerID = self.setTimeout("locktimer('"+txt+"')", delay*1000);
-}
-
-/**
- * This stops the timer and displays a message about the expiring lock
- */
-function locktimer(txt){
-  clearTimeout(locktimerID);
-  alert(txt);
-}
-
 /*
  * This sets a cookie by JavaScript
  *
@@ -424,6 +302,8 @@ function fnt(id, e, evt) {
  * Add the edit window size controls
  */
 function initSizeCtl(ctlid,edid){
+		if(!document.getElementById) return;
+
     var ctl      = document.getElementById(ctlid);
     var textarea = document.getElementById(edid);
 
diff --git a/lib/scripts/spellcheck.js b/lib/scripts/spellcheck.js
index d47430c31f07ea9c10736488808ee24537b37b07..308b3dd1fc0b4a4b1680979cc6eeca72583a9f56 100644
--- a/lib/scripts/spellcheck.js
+++ b/lib/scripts/spellcheck.js
@@ -171,25 +171,25 @@ function ajax_spell_class(){
       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.buttonObj.accessKey = '';
         ajax_spell.imageObj.src = DOKU_BASE+'lib/images/toolbar/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.buttonObj.accessKey = '';
         ajax_spell.imageObj.src = DOKU_BASE+'lib/images/toolbar/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.buttonObj.accessKey = '';
         ajax_spell.imageObj.src = DOKU_BASE+'lib/images/toolbar/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.buttonObj.accessKey = 'k';
         ajax_spell.imageObj.src = DOKU_BASE+'lib/images/toolbar/spellcheck.png';
         break;
     }
diff --git a/lib/tpl/default/design.css b/lib/tpl/default/design.css
index 7bc6085f26d13379380c72d25e54873a185baf16..7b84ea614f53b39935a25a040751c1370a727cc6 100644
--- a/lib/tpl/default/design.css
+++ b/lib/tpl/default/design.css
@@ -637,6 +637,10 @@ div.search_quickhits {
     opacity: 1;
 }
 
+#sizectl img {
+	cursor: pointer;
+}
+
 /* ---- Admin --- */
 
 div.acladmin label {