Index: wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php
===================================================================
--- wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php	(revision 3693)
+++ wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php	(working copy)
@@ -1,133 +1,133 @@
-<?php
-/**
- * $RCSfile: tinyspell.php,v $
- * $Revision: 1.1 $
- * $Date: 2006/03/14 17:33:47 $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
- */
-
-	require_once("config.php");
-
-	$id = sanitize($_POST['id'], "loose");
-
-	if (!$spellCheckerConfig['enabled']) {
-		header('Content-type: text/xml; charset=utf-8');
-		echo '<?xml version="1.0" encoding="utf-8" ?><res id="' . $id . '" error="true" msg="You must enable the spellchecker by modifying the config.php file." />';
-		die;
-	}
-
-	// Basic config
-	$defaultLanguage = $spellCheckerConfig['default.language'];
-	$defaultMode = $spellCheckerConfig['default.mode'];
-
-	// Normaly not required to configure
-	$defaultSpelling = $spellCheckerConfig['default.spelling'];
-	$defaultJargon = $spellCheckerConfig['default.jargon'];
-	$defaultEncoding = $spellCheckerConfig['default.encoding'];
-	$outputType = "xml"; // Do not change
-
-	// Get input parameters.
-
-	$check = $_POST['check'];
-	$cmd = sanitize($_POST['cmd']);
-	$lang = sanitize($_POST['lang'], "strict");
-	$mode = sanitize($_POST['mode'], "strict");
-	$spelling = sanitize($_POST['spelling'], "strict");
-	$jargon = sanitize($_POST['jargon'], "strict");
-	$encoding = sanitize($_POST['encoding'], "strict");
-	$sg = sanitize($_POST['sg'], "bool");
-	$words = array();
-
-	$validRequest = true;
-
-	if (empty($check))
-		$validRequest = false;
-
-	if (empty($lang))
-		$lang = $defaultLanguage;
-
-	if (empty($mode))
-		$mode = $defaultMode;
-
-	if (empty($spelling))
-		$spelling = $defaultSpelling;
-
-	if (empty($jargon))
-		$jargon = $defaultJargon;
-
-	if (empty($encoding))
-		$encoding = $defaultEncoding;
-
-	function sanitize($str, $type="strict") {
-		switch ($type) {
-			case "strict":
-				$str = preg_replace("/[^a-zA-Z0-9_\-]/i", "", $str);
-			break;
-			case "loose":
-				$str = preg_replace("/</i", "&gt;", $str);
-				$str = preg_replace("/>/i", "&lt;", $str);
-			break;
-			case "bool":
-				if ($str == "true" || $str == true)
-					$str = true;
-				else
-					$str = false;
-			break;
-		}
-
-		return $str;
-	}
-
-	$result = array();
-	$tinyspell = new $spellCheckerConfig['class']($spellCheckerConfig, $lang, $mode, $spelling, $jargon, $encoding);
-
-	if (count($tinyspell->errorMsg) == 0) {
-		switch($cmd) {
-			case "spell":
-				// Space for non-exec version and \n for the exec version.
-				$words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY);
-				$result = $tinyspell->checkWords($words);
-			break;
-			case "suggest":
-				$result = $tinyspell->getSuggestion($check);
-			break;
-			default:
-				// Just use this for now.
-				$tinyspell->errorMsg[] = "No command.";
-				$outputType = $outputType . "error";
-			break;
-		}
-	} else
-		$outputType = $outputType . "error";
-
-	if (!$result)
-		$result = array();
-
-	// Output data
-	switch($outputType) {
-		case "xml":
-			header('Content-type: text/xml; charset=utf-8');
-			echo '<?xml version="1.0" encoding="utf-8" ?>';
-			echo "\n";
-			if (count($result) == 0)
-				echo '<res id="' . $id . '" cmd="'. $cmd .'" />';
-			else
-				echo '<res id="' . $id . '" cmd="'. $cmd .'">'. utf8_encode(implode(" ", $result)) .'</res>';
-
-		break;
-		case "xmlerror";
-			header('Content-type: text/xml; charset=utf-8');
-			echo '<?xml version="1.0" encoding="utf-8" ?>';
-			echo "\n";
-			echo '<res id="' . $id . '" cmd="'. $cmd .'" error="true" msg="'. implode(" ", $tinyspell->errorMsg) .'" />';
-		break;
-		case "html":
-			var_dump($result);
-		break;
-		case "htmlerror":
-			echo "Error";
-		break;
-	}
-?> 
+<?php
+/**
+ * $RCSfile: tinyspell.php,v $
+ * $Revision: 1.1 $
+ * $Date: 2006/03/14 17:33:47 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+	require_once("config.php");
+
+	$id = sanitize($_POST['id'], "loose");
+
+	if (!$spellCheckerConfig['enabled']) {
+		header('Content-type: text/xml; charset=utf-8');
+		echo '<?xml version="1.0" encoding="utf-8" ?><res id="' . $id . '" error="true" msg="You must enable the spellchecker by modifying the config.php file." />';
+		die;
+	}
+
+	// Basic config
+	$defaultLanguage = $spellCheckerConfig['default.language'];
+	$defaultMode = $spellCheckerConfig['default.mode'];
+
+	// Normaly not required to configure
+	$defaultSpelling = $spellCheckerConfig['default.spelling'];
+	$defaultJargon = $spellCheckerConfig['default.jargon'];
+	$defaultEncoding = $spellCheckerConfig['default.encoding'];
+	$outputType = "xml"; // Do not change
+
+	// Get input parameters.
+
+	$check = $_POST['check'];
+	$cmd = sanitize($_POST['cmd']);
+	$lang = sanitize($_POST['lang'], "strict");
+	$mode = sanitize($_POST['mode'], "strict");
+	$spelling = sanitize($_POST['spelling'], "strict");
+	$jargon = sanitize($_POST['jargon'], "strict");
+	$encoding = sanitize($_POST['encoding'], "strict");
+	$sg = sanitize($_POST['sg'], "bool");
+	$words = array();
+
+	$validRequest = true;
+
+	if (empty($check))
+		$validRequest = false;
+
+	if (empty($lang))
+		$lang = $defaultLanguage;
+
+	if (empty($mode))
+		$mode = $defaultMode;
+
+	if (empty($spelling))
+		$spelling = $defaultSpelling;
+
+	if (empty($jargon))
+		$jargon = $defaultJargon;
+
+	if (empty($encoding))
+		$encoding = $defaultEncoding;
+
+	function sanitize($str, $type="strict") {
+		switch ($type) {
+			case "strict":
+				$str = preg_replace("/[^a-zA-Z0-9_\-]/i", "", $str);
+			break;
+			case "loose":
+				$str = preg_replace("/</i", "&gt;", $str);
+				$str = preg_replace("/>/i", "&lt;", $str);
+			break;
+			case "bool":
+				if ($str == "true" || $str == true)
+					$str = true;
+				else
+					$str = false;
+			break;
+		}
+
+		return $str;
+	}
+
+	$result = array();
+	$tinyspell = new $spellCheckerConfig['class']($spellCheckerConfig, $lang, $mode, $spelling, $jargon, $encoding);
+
+	if (count($tinyspell->errorMsg) == 0) {
+		switch($cmd) {
+			case "spell":
+				// Space for non-exec version and \n for the exec version.
+				$words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY);
+				$result = $tinyspell->checkWords($words);
+			break;
+			case "suggest":
+				$result = $tinyspell->getSuggestion($check);
+			break;
+			default:
+				// Just use this for now.
+				$tinyspell->errorMsg[] = "No command.";
+				$outputType = $outputType . "error";
+			break;
+		}
+	} else
+		$outputType = $outputType . "error";
+
+	if (!$result)
+		$result = array();
+
+	// Output data
+	switch($outputType) {
+		case "xml":
+			header('Content-type: text/xml; charset=utf-8');
+			echo '<?xml version="1.0" encoding="utf-8" ?>';
+			echo "\n";
+			if (count($result) == 0)
+				echo '<res id="' . $id . '" cmd="'. $cmd .'" />';
+			else
+				echo '<res id="' . $id . '" cmd="'. $cmd .'">'. utf8_encode(implode(" ", $result)) .'</res>';
+
+		break;
+		case "xmlerror";
+			header('Content-type: text/xml; charset=utf-8');
+			echo '<?xml version="1.0" encoding="utf-8" ?>';
+			echo "\n";
+			echo '<res id="' . $id . '" cmd="'. $cmd .'" error="true" msg="'. implode(" ", $tinyspell->errorMsg) .'" />';
+		break;
+		case "html":
+			var_dump($result);
+		break;
+		case "htmlerror":
+			echo "Error";
+		break;
+	}
+?> 
Index: wp-includes/js/tinymce/plugins/spellchecker/config.php
===================================================================
--- wp-includes/js/tinymce/plugins/spellchecker/config.php	(revision 3693)
+++ wp-includes/js/tinymce/plugins/spellchecker/config.php	(working copy)
@@ -1,29 +1,29 @@
-<?php
-	$spellCheckerConfig = array();
-
-	// General settings
-	$spellCheckerConfig['enabled'] = true;
-
-	// Pspell shell specific settings
-	$spellCheckerConfig['tinypspellshell.aspell'] = '/usr/bin/aspell';
-	$spellCheckerConfig['tinypspellshell.tmp'] = '/tmp';
-
-	// Default settings
-	$spellCheckerConfig['default.language'] = 'en';
-	$spellCheckerConfig['default.mode'] = PSPELL_FAST;
-
-	// Normaly not required to configure
-	$spellCheckerConfig['default.spelling'] = "";
-	$spellCheckerConfig['default.jargon'] = "";
-	$spellCheckerConfig['default.encoding'] = "";
-
-	// Spellchecker class use
-	if ( function_exists('pspell_new') )
-		require_once("classes/TinyPspell.class.php"); // Internal PHP version
-
-	elseif ( file_exists($spellCheckerConfig['tinypspellshell.aspell']) )
-		require_once("classes/TinyPspellShell.class.php"); // Command line pspell
-
-	else
-		require_once("classes/TinyGoogleSpell.class.php"); // Google web service
-?>
+<?php
+	$spellCheckerConfig = array();
+
+	// General settings
+	$spellCheckerConfig['enabled'] = true;
+
+	// Pspell shell specific settings
+	$spellCheckerConfig['tinypspellshell.aspell'] = '/usr/bin/aspell';
+	$spellCheckerConfig['tinypspellshell.tmp'] = '/tmp';
+
+	// Default settings
+	$spellCheckerConfig['default.language'] = 'en';
+	$spellCheckerConfig['default.mode'] = PSPELL_FAST;
+
+	// Normaly not required to configure
+	$spellCheckerConfig['default.spelling'] = "";
+	$spellCheckerConfig['default.jargon'] = "";
+	$spellCheckerConfig['default.encoding'] = "";
+
+	// Spellchecker class use
+	if ( function_exists('pspell_new') )
+		require_once("classes/TinyPspell.class.php"); // Internal PHP version
+
+	elseif ( file_exists($spellCheckerConfig['tinypspellshell.aspell']) )
+		require_once("classes/TinyPspellShell.class.php"); // Command line pspell
+
+	else
+		require_once("classes/TinyGoogleSpell.class.php"); // Google web service
+?>
Index: wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php
===================================================================
--- wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php	(revision 3693)
+++ wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php	(working copy)
@@ -1,100 +1,100 @@
-<?php
-/* * 
- * Tiny Spelling Interface for TinyMCE Spell Checking.
- *
- * Copyright © 2006 Moxiecode Systems AB
- *
- */
-
-class TinyPspellShell {
-	var $lang;
-	var $mode;
-	var $string;
-	var $error;
-	var $errorMsg;
-
-	var $cmd;
-	var $tmpfile;
-
-	var $jargon;
-	var $spelling;
-	var $encoding;
-
-	function TinyPspellShell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
-		$this->lang = $lang;
-		$this->mode = $mode;
-		$this->error = false;
-		$this->errorMsg = array();
-
-		$this->tmpfile = tempnam($config['tinypspellshell.tmp'], "tinyspell");
-    	$this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang;
-	}
-
-	// Returns array with bad words or false if failed.
-	function checkWords($wordArray) {
-		if ($fh = fopen($this->tmpfile, "w")) {
-			fwrite($fh, "!\n");
-			foreach($wordArray as $key => $value)
-				fwrite($fh, "^" . $value . "\n");
-
-			fclose($fh);
-		} else {
-			$this->errorMsg[] = "PSpell not found.";
-			return array();
-		}
-
-		$data = shell_exec($this->cmd);
-		$returnData = array();
-		$dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
-
-		foreach($dataArr as $dstr) {
-			$matches = array();
-
-			// Skip this line.
-			if (strpos($dstr, "@") === 0)
-				continue;
-
-			preg_match("/\& (.*) .* .*: .*/i", $dstr, $matches);
-
-			if (!empty($matches[1]))
-				$returnData[] = $matches[1];
-		}
-
-		return $returnData;
-	}
-
-	// Returns array with suggestions or false if failed.
-	function getSuggestion($word) {
-		if ($fh = fopen($this->tmpfile, "w")) {
-			fwrite($fh, "!\n");
-			fwrite($fh, "^$word\n");
-			fclose($fh);
-		} else
-			die("Error opening tmp file.");
-
-		$data = shell_exec($this->cmd);
-		$returnData = array();
-		$dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
-
-		foreach($dataArr as $dstr) {
-			$matches = array();
-
-			// Skip this line.
-			if (strpos($dstr, "@") === 0)
-				continue;
-
-			preg_match("/\& .* .* .*: (.*)/i", $dstr, $matches);
-
-			if (!empty($matches[1])) {
-				// For some reason, the exec version seems to add commas?
-				$returnData[] = str_replace(",", "", $matches[1]);
-			}
-		}
-		return $returnData;
-	}
-}
-
-// Setup classname, should be the same as the name of the spellchecker class
-$spellCheckerConfig['class'] = "TinyPspellShell";
-
+<?php
+/* * 
+ * Tiny Spelling Interface for TinyMCE Spell Checking.
+ *
+ * Copyright © 2006 Moxiecode Systems AB
+ *
+ */
+
+class TinyPspellShell {
+	var $lang;
+	var $mode;
+	var $string;
+	var $error;
+	var $errorMsg;
+
+	var $cmd;
+	var $tmpfile;
+
+	var $jargon;
+	var $spelling;
+	var $encoding;
+
+	function TinyPspellShell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
+		$this->lang = $lang;
+		$this->mode = $mode;
+		$this->error = false;
+		$this->errorMsg = array();
+
+		$this->tmpfile = tempnam($config['tinypspellshell.tmp'], "tinyspell");
+    	$this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang;
+	}
+
+	// Returns array with bad words or false if failed.
+	function checkWords($wordArray) {
+		if ($fh = fopen($this->tmpfile, "w")) {
+			fwrite($fh, "!\n");
+			foreach($wordArray as $key => $value)
+				fwrite($fh, "^" . $value . "\n");
+
+			fclose($fh);
+		} else {
+			$this->errorMsg[] = "PSpell not found.";
+			return array();
+		}
+
+		$data = shell_exec($this->cmd);
+		$returnData = array();
+		$dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
+
+		foreach($dataArr as $dstr) {
+			$matches = array();
+
+			// Skip this line.
+			if (strpos($dstr, "@") === 0)
+				continue;
+
+			preg_match("/\& (.*) .* .*: .*/i", $dstr, $matches);
+
+			if (!empty($matches[1]))
+				$returnData[] = $matches[1];
+		}
+
+		return $returnData;
+	}
+
+	// Returns array with suggestions or false if failed.
+	function getSuggestion($word) {
+		if ($fh = fopen($this->tmpfile, "w")) {
+			fwrite($fh, "!\n");
+			fwrite($fh, "^$word\n");
+			fclose($fh);
+		} else
+			die("Error opening tmp file.");
+
+		$data = shell_exec($this->cmd);
+		$returnData = array();
+		$dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
+
+		foreach($dataArr as $dstr) {
+			$matches = array();
+
+			// Skip this line.
+			if (strpos($dstr, "@") === 0)
+				continue;
+
+			preg_match("/\& .* .* .*: (.*)/i", $dstr, $matches);
+
+			if (!empty($matches[1])) {
+				// For some reason, the exec version seems to add commas?
+				$returnData[] = str_replace(",", "", $matches[1]);
+			}
+		}
+		return $returnData;
+	}
+}
+
+// Setup classname, should be the same as the name of the spellchecker class
+$spellCheckerConfig['class'] = "TinyPspellShell";
+
 ?>
\ No newline at end of file
Index: wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
===================================================================
--- wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php	(revision 3693)
+++ wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php	(working copy)
@@ -1,73 +1,73 @@
-<?php
-/* * 
- * Tiny Spelling Interface for TinyMCE Spell Checking.
- *
- * Copyright © 2006 Moxiecode Systems AB
- */
-
-require_once("HttpClient.class.php");
-
-class TinyGoogleSpell {
-	var $lang;
-
-	function TinyGoogleSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
-		$this->lang = $lang;
-	}
-
-	// Returns array with bad words or false if failed.
-	function checkWords($word_array) {
-		$words = array();
-		$wordstr = implode(' ', $word_array);
-
-		$matches = $this->_getMatches($wordstr);
-
-		for ($i=0; $i<count($matches); $i++)
-			$words[] = substr($wordstr, $matches[$i][1], $matches[$i][2]);
-
-		return $words;
-	}
-
-	// Returns array with suggestions or false if failed.
-	function getSuggestion($word) {
-		$sug = array();
-
-		$matches = $this->_getMatches($word);
-
-		if (count($matches) > 0)
-			$sug = explode("\t", $matches[0][4]);
-
-		return $sug;
-	}
-
-	function _getMatches($word_list) {
-		$xml = "";
-
-		// Setup HTTP Client
-		$client = new HttpClient('www.google.com');
-		$client->setUserAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR');
-		$client->setHandleRedirects(false);
-		$client->setDebug(false);
-
-		// Setup XML request
-		$xml .= '<?xml version="1.0" encoding="utf-8" ?>';
-		$xml .= '<spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1">';
-		$xml .= '<text>' . htmlentities($word_list) . '</text></spellrequest>';
-
-		// Execute HTTP Post to Google
-		if (!$client->post('/tbproxy/spell?lang=' . $this->lang, $xml)) {
-			$this->errorMsg[] = 'An error occurred: ' . $client->getError();
-			return array();
-		}
-
-		// Grab and parse content
-		$xml = $client->getContent();
-		preg_match_all('/<c o="([^"]*)" l="([^"]*)" s="([^"]*)">([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER);
-
-		return $matches;
-	}
-}
-
-// Setup classname, should be the same as the name of the spellchecker class
-$spellCheckerConfig['class'] = "TinyGoogleSpell";
-
-?>
+<?php
+/* * 
+ * Tiny Spelling Interface for TinyMCE Spell Checking.
+ *
+ * Copyright © 2006 Moxiecode Systems AB
+ */
+
+require_once("HttpClient.class.php");
+
+class TinyGoogleSpell {
+	var $lang;
+
+	function TinyGoogleSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
+		$this->lang = $lang;
+	}
+
+	// Returns array with bad words or false if failed.
+	function checkWords($word_array) {
+		$words = array();
+		$wordstr = implode(' ', $word_array);
+
+		$matches = $this->_getMatches($wordstr);
+
+		for ($i=0; $i<count($matches); $i++)
+			$words[] = substr($wordstr, $matches[$i][1], $matches[$i][2]);
+
+		return $words;
+	}
+
+	// Returns array with suggestions or false if failed.
+	function getSuggestion($word) {
+		$sug = array();
+
+		$matches = $this->_getMatches($word);
+
+		if (count($matches) > 0)
+			$sug = explode("\t", $matches[0][4]);
+
+		return $sug;
+	}
+
+	function _getMatches($word_list) {
+		$xml = "";
+
+		// Setup HTTP Client
+		$client = new HttpClient('www.google.com');
+		$client->setUserAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR');
+		$client->setHandleRedirects(false);
+		$client->setDebug(false);
+
+		// Setup XML request
+		$xml .= '<?xml version="1.0" encoding="utf-8" ?>';
+		$xml .= '<spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1">';
+		$xml .= '<text>' . htmlentities($word_list) . '</text></spellrequest>';
+
+		// Execute HTTP Post to Google
+		if (!$client->post('/tbproxy/spell?lang=' . $this->lang, $xml)) {
+			$this->errorMsg[] = 'An error occurred: ' . $client->getError();
+			return array();
+		}
+
+		// Grab and parse content
+		$xml = $client->getContent();
+		preg_match_all('/<c o="([^"]*)" l="([^"]*)" s="([^"]*)">([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER);
+
+		return $matches;
+	}
+}
+
+// Setup classname, should be the same as the name of the spellchecker class
+$spellCheckerConfig['class'] = "TinyGoogleSpell";
+
+?>
Index: wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php
===================================================================
--- wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php	(revision 3693)
+++ wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php	(working copy)
@@ -1,64 +1,64 @@
-<?php
-/* * 
- * Tiny Spelling Interface for TinyMCE Spell Checking.
- *
- * Copyright © 2006 Moxiecode Systems AB
- *
- */
-
-class TinyPSpell {
-	var $lang;
-	var $mode;
-	var $string;
-	var $plink;
-	var $errorMsg;
-
-	var $jargon;
-	var $spelling;
-	var $encoding;
-
-	function TinyPSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
-		$this->lang = $lang;
-		$this->mode = $mode;
-		$this->plink = false;
-		$this->errorMsg = array();
-
-		if (!function_exists("pspell_new")) {
-			$this->errorMsg[] = "PSpell not found.";
-			return;
-		}
-
-		$this->plink = pspell_new($this->lang, $this->spelling, $this->jargon, $this->encoding, $this->mode);
-	}
-
-	// Returns array with bad words or false if failed.
-	function checkWords($wordArray) {
-		if (!$this->plink) {
-			$this->errorMsg[] = "No PSpell link found for checkWords.";
-			return array();
-		}
-
-		$wordError = array();
-		foreach($wordArray as $word) {
-			if(!pspell_check($this->plink, trim($word)))
-				$wordError[] = $word;
-		}
-
-		return $wordError;
-	}
-
-	// Returns array with suggestions or false if failed.
-	function getSuggestion($word) {
-		if (!$this->plink) {
-			$this->errorMsg[] = "No PSpell link found for getSuggestion.";
-			return array();
-		}
-
-		return pspell_suggest($this->plink, $word);
-	}
-}
-
-// Setup classname, should be the same as the name of the spellchecker class
-$spellCheckerConfig['class'] = "TinyPspell";
-
+<?php
+/* * 
+ * Tiny Spelling Interface for TinyMCE Spell Checking.
+ *
+ * Copyright © 2006 Moxiecode Systems AB
+ *
+ */
+
+class TinyPSpell {
+	var $lang;
+	var $mode;
+	var $string;
+	var $plink;
+	var $errorMsg;
+
+	var $jargon;
+	var $spelling;
+	var $encoding;
+
+	function TinyPSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
+		$this->lang = $lang;
+		$this->mode = $mode;
+		$this->plink = false;
+		$this->errorMsg = array();
+
+		if (!function_exists("pspell_new")) {
+			$this->errorMsg[] = "PSpell not found.";
+			return;
+		}
+
+		$this->plink = pspell_new($this->lang, $this->spelling, $this->jargon, $this->encoding, $this->mode);
+	}
+
+	// Returns array with bad words or false if failed.
+	function checkWords($wordArray) {
+		if (!$this->plink) {
+			$this->errorMsg[] = "No PSpell link found for checkWords.";
+			return array();
+		}
+
+		$wordError = array();
+		foreach($wordArray as $word) {
+			if(!pspell_check($this->plink, trim($word)))
+				$wordError[] = $word;
+		}
+
+		return $wordError;
+	}
+
+	// Returns array with suggestions or false if failed.
+	function getSuggestion($word) {
+		if (!$this->plink) {
+			$this->errorMsg[] = "No PSpell link found for getSuggestion.";
+			return array();
+		}
+
+		return pspell_suggest($this->plink, $word);
+	}
+}
+
+// Setup classname, should be the same as the name of the spellchecker class
+$spellCheckerConfig['class'] = "TinyPspell";
+
 ?>
\ No newline at end of file
Index: wp-content/themes/default/functions.php
===================================================================
--- wp-content/themes/default/functions.php	(revision 3693)
+++ wp-content/themes/default/functions.php	(working copy)
@@ -1,395 +1,395 @@
-<?php
-
-function kubrick_head() {
-	$head = "<style type='text/css'>\n<!--";
-	$output = '';
-	if ( kubrick_header_image() ) {
-		$url =  kubrick_header_image_url() ;
-		$output .= "#header { background: url('$url') no-repeat bottom center; }\n";
-	}
-	if ( false !== ( $color = kubrick_header_color() ) ) {
-		$output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n";
-	}
-	if ( false !== ( $display = kubrick_header_display() ) ) {
-		$output .= "#headerimg { display: $display }\n";
-	}
-	$foot = "--></style>\n";
-	if ( '' != $output )
-		echo $head . $output . $foot;
-}
-
-add_action('wp_head', 'kubrick_head');
-
-function kubrick_header_image() {
-	return apply_filters('kubrick_header_image', get_settings('kubrick_header_image'));
-}
-
-function kubrick_upper_color() {
-	if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
-		parse_str(substr($url, strpos($url, '?') + 1), $q);
-		return $q['upper'];
-	} else
-		return '69aee7';
-}
-
-function kubrick_lower_color() {
-	if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
-		parse_str(substr($url, strpos($url, '?') + 1), $q);
-		return $q['lower'];
-	} else
-		return '4180b6';
-}
-
-function kubrick_header_image_url() {
-	if ( $image = kubrick_header_image() )
-		$url = get_template_directory_uri() . '/images/' . $image;
-	else
-		$url = get_template_directory_uri() . '/images/kubrickheader.jpg';
-
-	return $url;
-}
-
-function kubrick_header_color() {
-	return apply_filters('kubrick_header_color', get_settings('kubrick_header_color'));
-}
-
-function kubrick_header_color_string() {
-	$color = kubrick_header_color();
-	if ( false === $color )
-		return 'white';
-
-	return $color;
-}
-
-function kubrick_header_display() {
-	return apply_filters('kubrick_header_display', get_settings('kubrick_header_display'));
-}
-
-function kubrick_header_display_string() {
-	$display = kubrick_header_display();
-	return $display ? $display : 'inline';
-}
-
-add_action('admin_menu', 'kubrick_add_theme_page');
-
-function kubrick_add_theme_page() {
-	if ( $_GET['page'] == basename(__FILE__) ) {
-		if ( 'save' == $_REQUEST['action'] ) {
-			if ( isset($_REQUEST['njform']) ) {
-				if ( isset($_REQUEST['defaults']) ) {
-					delete_option('kubrick_header_image');
-					delete_option('kubrick_header_color');
-					delete_option('kubrick_header_display');
-				} else {
-					if ( '' == $_REQUEST['njfontcolor'] )
-						delete_option('kubrick_header_color');
-					else
-						update_option('kubrick_header_color', $_REQUEST['njfontcolor']);
-
-					if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) {
-						$uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0];
-						$lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0];
-						update_option('kubrick_header_image', "header-img.php?upper=$uc&amp;lower=$lc");
-					}
-
-					if ( isset($_REQUEST['toggledisplay']) ) {
-						if ( false === get_settings('kubrick_header_display') )
-							update_option('kubrick_header_display', 'none');
-						else
-							delete_option('kubrick_header_display');
-					}
-				}
-			} else {
-
-				if ( isset($_REQUEST['headerimage']) ) {
-					if ( '' == $_REQUEST['headerimage'] )
-						delete_option('kubrick_header_image');
-					else
-						update_option('kubrick_header_image', $_REQUEST['headerimage']);
-				}
-
-				if ( isset($_REQUEST['fontcolor']) ) {
-					if ( '' == $_REQUEST['fontcolor'] )
-						delete_option('kubrick_header_color');
-					else
-						update_option('kubrick_header_color', $_REQUEST['fontcolor']);
-				}
-
-				if ( isset($_REQUEST['fontdisplay']) ) {
-					if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] )
-						delete_option('kubrick_header_display');
-					else
-						update_option('kubrick_header_display', 'none');
-				}
-			}
-			//print_r($_REQUEST);
-			header("Location: themes.php?page=functions.php&saved=true");
-			die;
-		}
-		add_action('admin_head', 'kubrick_theme_page_head');
-	}
-	add_theme_page('Customize Header', 'Header Image and Color', 'edit_themes', basename(__FILE__), 'kubrick_theme_page');
-}
-
-function kubrick_theme_page_head() {
-?>
-<script type="text/javascript" src="../wp-includes/js/colorpicker.js"></script>
-<script type='text/javascript'>
-	function pickColor(color) {
-		ColorPicker_targetInput.value = color;
-		kUpdate(ColorPicker_targetInput.id);
-	}
-	function PopupWindow_populate(contents) {
-		contents += '<br /><p style="text-align:center;margin-top:0px;"><input type="button" value="Close Color Picker" onclick="cp.hidePopup(\'prettyplease\')"></input></p>';
-		this.contents = contents;
-		this.populated = false;
-	}
-	function PopupWindow_hidePopup(magicword) {
-		if ( magicword != 'prettyplease' )
-			return false;
-		if (this.divName != null) {
-			if (this.use_gebi) {
-				document.getElementById(this.divName).style.visibility = "hidden";
-			}
-			else if (this.use_css) {
-				document.all[this.divName].style.visibility = "hidden";
-			}
-			else if (this.use_layers) {
-				document.layers[this.divName].visibility = "hidden";
-			}
-		}
-		else {
-			if (this.popupWindow && !this.popupWindow.closed) {
-				this.popupWindow.close();
-				this.popupWindow = null;
-			}
-		}
-		return false;
-	}
-	function colorSelect(t,p) {
-		if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" )
-			cp.hidePopup('prettyplease');
-		else {
-			cp.p = p;
-			cp.select(t,p);
-		}
-	}
-	function PopupWindow_setSize(width,height) {
-		this.width = 162;
-		this.height = 210;
-	}
-
-	var cp = new ColorPicker();
-	function advUpdate(val, obj) {
-		document.getElementById(obj).value = val;
-		kUpdate(obj);
-	}
-	function kUpdate(oid) {
-		if ( 'uppercolor' == oid || 'lowercolor' == oid ) {
-			uc = document.getElementById('uppercolor').value.replace('#', '');
-			lc = document.getElementById('lowercolor').value.replace('#', '');
-			hi = document.getElementById('headerimage');
-			hi.value = 'header-img.php?upper='+uc+'&lower='+lc;
-			document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/'+hi.value+'") center no-repeat';
-			document.getElementById('advuppercolor').value = '#'+uc;
-			document.getElementById('advlowercolor').value = '#'+lc;
-		}
-		if ( 'fontcolor' == oid ) {
-			document.getElementById('header').style.color = document.getElementById('fontcolor').value;
-			document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value;
-		}
-		if ( 'fontdisplay' == oid ) {
-			document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
-		}
-	}
-	function toggleDisplay() {
-		td = document.getElementById('fontdisplay');
-		td.value = ( td.value == 'none' ) ? 'inline' : 'none';
-		kUpdate('fontdisplay');
-	}
-	function toggleAdvanced() {
-		a = document.getElementById('jsAdvanced');
-		if ( a.style.display == 'none' )
-			a.style.display = 'block';
-		else
-			a.style.display = 'none';
-	}
-	function kDefaults() {
-		document.getElementById('headerimage').value = '';
-		document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#69aee7';
-		document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#4180b6';
-		document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/kubrickheader.jpg") center no-repeat';
-		document.getElementById('header').style.color = '#FFFFFF';
-		document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '';
-		document.getElementById('fontdisplay').value = 'inline';
-		document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
-	}
-	function kRevert() {
-		document.getElementById('headerimage').value = '<?php echo kubrick_header_image(); ?>';
-		document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo kubrick_upper_color(); ?>';
-		document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo kubrick_lower_color(); ?>';
-		document.getElementById('header').style.background = 'url("<?php echo kubrick_header_image_url(); ?>") center no-repeat';
-		document.getElementById('header').style.color = '';
-		document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo kubrick_header_color_string(); ?>';
-		document.getElementById('fontdisplay').value = '<?php echo kubrick_header_display_string(); ?>';
-		document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
-	}
-	function kInit() {
-		document.getElementById('jsForm').style.display = 'block';
-		document.getElementById('nonJsForm').style.display = 'none';
-	}
-	addLoadEvent(kInit);
-</script>
-<style type='text/css'>
-	#headwrap {
-		text-align: center;
-	}
-	#kubrick-header {
-		font-size: 80%;
-	}
-	#kubrick-header .hibrowser {
-		width: 780px;
-		height: 260px;
-		overflow: scroll;
-	}
-	#kubrick-header #hitarget {
-		display: none;
-	}
-	#kubrick-header #header h1 {
-		font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
-		font-weight: bold;
-		font-size: 4em;
-		text-align: center;
-		padding-top: 70px;
-		margin: 0;
-	}
-
-	#kubrick-header #header .description {
-		font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
-		font-size: 1.2em;
-		text-align: center;
-	}
-	#kubrick-header #header {
-		text-decoration: none;
-		color: <?php echo kubrick_header_color_string(); ?>;
-		padding: 0;
-		margin: 0;
-		height: 200px;
-		text-align: center;
-		background: url('<?php echo kubrick_header_image_url(); ?>') center no-repeat;
-	}
-	#kubrick-header #headerimg {
-		margin: 0;
-		height: 200px;
-		width: 100%;
-		display: <?php echo kubrick_header_display_string(); ?>;
-	}
-	#jsForm {
-		display: none;
-		text-align: center;
-	}
-	#jsForm input.submit, #jsForm input.button, #jsAdvanced input.button {
-		padding: 0px;
-		margin: 0px;
-	}
-	#advanced {
-		text-align: center;
-		width: 620px;
-	}
-	html>body #advanced {
-		text-align: center;
-		position: relative;
-		left: 50%;
-		margin-left: -380px;
-	}
-	#jsAdvanced {
-		text-align: right;
-	}
-	#nonJsForm {
-		position: relative;
-		text-align: left;
-		margin-left: -370px;
-		left: 50%;
-	}
-	#nonJsForm label {
-		padding-top: 6px;
-		padding-right: 5px;
-		float: left;
-		width: 100px;
-		text-align: right;
-	}
-	.defbutton {
-		font-weight: bold;
-	}
-	.zerosize {
-		width: 0px;
-		height: 0px;
-		overflow: hidden;
-	}
-	#colorPickerDiv a, #colorPickerDiv a:hover {
-		padding: 1px;
-		text-decoration: none;
-		border-bottom: 0px;
-	}
-</style>
-<?php
-}
-
-function kubrick_theme_page() {
-	if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>Options saved.</strong></p></div>';
-?>
-<div class='wrap'>
-	<div id="kubrick-header">
-		<h2>Header Image and Color</h2>
-		<div id="headwrap">
-			<div id="header">
-				<div id="headerimg">
-					<h1><?php bloginfo('name'); ?></h1>
-					<div class="description"><?php bloginfo('description'); ?></div>
-				</div>
-			</div>
-		</div>
-		<br />
-		<div id="nonJsForm">
-			<form method="POST">
-				<div class="zerosize"><input type="submit" name="defaultsubmit" value="Save" /></div>
-				<label for="njfontcolor">Font Color:</label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo kubrick_header_color(); ?>" /> Any CSS color (<code>red</code> or <code>#FF0000</code> or <code>rgb(255, 0, 0)</code>)<br />
-				<label for="njuppercolor">Upper Color:</label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo kubrick_upper_color(); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br />
-				<label for="njlowercolor">Lower Color:</label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo kubrick_lower_color(); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br />
-				<input type="hidden" name="hi" id="hi" value="<?php echo kubrick_header_image(); ?>" />
-				<label> </label><input type="submit" name="toggledisplay" id="toggledisplay" value="Toggle Text" />
-				<input type="submit" name="defaults" value="Use Defaults" />
-				<input type="submit" class="defbutton" name="submitform" value="&nbsp;&nbsp;Save&nbsp;&nbsp;" />
-				<input type="hidden" name="action" value="save" />
-				<input type="hidden" name="njform" value="true" />
-			</form>
-		</div>
-		<div id="jsForm">
-			<form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
-				<input type="button" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="Font Color"></input>
-				<input type="button" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="Upper Color"></input>
-				<input type="button" onclick="tgt=document.getElementById('lowercolor');colorSelect(tgt,'pick3');return false;" name="pick3" id="pick3" value="Lower Color"></input>
-				<input type="button" name="revert" value="Revert" onclick="kRevert()" />
-				<input type="button" value="Advanced" onclick="toggleAdvanced()" />
-				<input type="submit" name="submitform" class="defbutton" value="Save" onclick="cp.hidePopup('prettyplease')" />
-				<input type="hidden" name="action" value="save" />
-				<input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo kubrick_header_display(); ?>" />
-				<input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo kubrick_header_color(); ?>" />
-				<input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo kubrick_upper_color(); ?>" />
-				<input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo kubrick_lower_color(); ?>" />
-				<input type="hidden" name="headerimage" id="headerimage" value="<?php echo kubrick_header_image(); ?>" />
-			</form>
-			<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div>
-			<div id="advanced">
-				<form id="jsAdvanced" style="display:none;">
-					<label for="advfontcolor">Font Color (CSS): </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo kubrick_header_color(); ?>" /><br />
-					<label for="advuppercolor">Upper Color (HEX): </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo kubrick_upper_color(); ?>" /><br />
-					<label for="advlowercolor">Lower Color (HEX): </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo kubrick_lower_color(); ?>" /><br />
-					<input type="button" name="default" value="Select Default Colors" onclick="kDefaults()" /><br />
-					<input type="button" onclick="toggleDisplay();return false;" name="pick" id="pick" value="Toggle Text Display"></input><br />
-				</form>
-			</div>
-		</div>
-	</div>
-</div>
-<?php } ?>
+<?php
+
+function kubrick_head() {
+	$head = "<style type='text/css'>\n<!--";
+	$output = '';
+	if ( kubrick_header_image() ) {
+		$url =  kubrick_header_image_url() ;
+		$output .= "#header { background: url('$url') no-repeat bottom center; }\n";
+	}
+	if ( false !== ( $color = kubrick_header_color() ) ) {
+		$output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n";
+	}
+	if ( false !== ( $display = kubrick_header_display() ) ) {
+		$output .= "#headerimg { display: $display }\n";
+	}
+	$foot = "--></style>\n";
+	if ( '' != $output )
+		echo $head . $output . $foot;
+}
+
+add_action('wp_head', 'kubrick_head');
+
+function kubrick_header_image() {
+	return apply_filters('kubrick_header_image', get_settings('kubrick_header_image'));
+}
+
+function kubrick_upper_color() {
+	if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
+		parse_str(substr($url, strpos($url, '?') + 1), $q);
+		return $q['upper'];
+	} else
+		return '69aee7';
+}
+
+function kubrick_lower_color() {
+	if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
+		parse_str(substr($url, strpos($url, '?') + 1), $q);
+		return $q['lower'];
+	} else
+		return '4180b6';
+}
+
+function kubrick_header_image_url() {
+	if ( $image = kubrick_header_image() )
+		$url = get_template_directory_uri() . '/images/' . $image;
+	else
+		$url = get_template_directory_uri() . '/images/kubrickheader.jpg';
+
+	return $url;
+}
+
+function kubrick_header_color() {
+	return apply_filters('kubrick_header_color', get_settings('kubrick_header_color'));
+}
+
+function kubrick_header_color_string() {
+	$color = kubrick_header_color();
+	if ( false === $color )
+		return 'white';
+
+	return $color;
+}
+
+function kubrick_header_display() {
+	return apply_filters('kubrick_header_display', get_settings('kubrick_header_display'));
+}
+
+function kubrick_header_display_string() {
+	$display = kubrick_header_display();
+	return $display ? $display : 'inline';
+}
+
+add_action('admin_menu', 'kubrick_add_theme_page');
+
+function kubrick_add_theme_page() {
+	if ( $_GET['page'] == basename(__FILE__) ) {
+		if ( 'save' == $_REQUEST['action'] ) {
+			if ( isset($_REQUEST['njform']) ) {
+				if ( isset($_REQUEST['defaults']) ) {
+					delete_option('kubrick_header_image');
+					delete_option('kubrick_header_color');
+					delete_option('kubrick_header_display');
+				} else {
+					if ( '' == $_REQUEST['njfontcolor'] )
+						delete_option('kubrick_header_color');
+					else
+						update_option('kubrick_header_color', $_REQUEST['njfontcolor']);
+
+					if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) {
+						$uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0];
+						$lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0];
+						update_option('kubrick_header_image', "header-img.php?upper=$uc&amp;lower=$lc");
+					}
+
+					if ( isset($_REQUEST['toggledisplay']) ) {
+						if ( false === get_settings('kubrick_header_display') )
+							update_option('kubrick_header_display', 'none');
+						else
+							delete_option('kubrick_header_display');
+					}
+				}
+			} else {
+
+				if ( isset($_REQUEST['headerimage']) ) {
+					if ( '' == $_REQUEST['headerimage'] )
+						delete_option('kubrick_header_image');
+					else
+						update_option('kubrick_header_image', $_REQUEST['headerimage']);
+				}
+
+				if ( isset($_REQUEST['fontcolor']) ) {
+					if ( '' == $_REQUEST['fontcolor'] )
+						delete_option('kubrick_header_color');
+					else
+						update_option('kubrick_header_color', $_REQUEST['fontcolor']);
+				}
+
+				if ( isset($_REQUEST['fontdisplay']) ) {
+					if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] )
+						delete_option('kubrick_header_display');
+					else
+						update_option('kubrick_header_display', 'none');
+				}
+			}
+			//print_r($_REQUEST);
+			header("Location: themes.php?page=functions.php&saved=true");
+			die;
+		}
+		add_action('admin_head', 'kubrick_theme_page_head');
+	}
+	add_theme_page('Customize Header', 'Header Image and Color', 'edit_themes', basename(__FILE__), 'kubrick_theme_page');
+}
+
+function kubrick_theme_page_head() {
+?>
+<script type="text/javascript" src="../wp-includes/js/colorpicker.js"></script>
+<script type='text/javascript'>
+	function pickColor(color) {
+		ColorPicker_targetInput.value = color;
+		kUpdate(ColorPicker_targetInput.id);
+	}
+	function PopupWindow_populate(contents) {
+		contents += '<br /><p style="text-align:center;margin-top:0px;"><input type="button" value="Close Color Picker" onclick="cp.hidePopup(\'prettyplease\')"></input></p>';
+		this.contents = contents;
+		this.populated = false;
+	}
+	function PopupWindow_hidePopup(magicword) {
+		if ( magicword != 'prettyplease' )
+			return false;
+		if (this.divName != null) {
+			if (this.use_gebi) {
+				document.getElementById(this.divName).style.visibility = "hidden";
+			}
+			else if (this.use_css) {
+				document.all[this.divName].style.visibility = "hidden";
+			}
+			else if (this.use_layers) {
+				document.layers[this.divName].visibility = "hidden";
+			}
+		}
+		else {
+			if (this.popupWindow && !this.popupWindow.closed) {
+				this.popupWindow.close();
+				this.popupWindow = null;
+			}
+		}
+		return false;
+	}
+	function colorSelect(t,p) {
+		if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" )
+			cp.hidePopup('prettyplease');
+		else {
+			cp.p = p;
+			cp.select(t,p);
+		}
+	}
+	function PopupWindow_setSize(width,height) {
+		this.width = 162;
+		this.height = 210;
+	}
+
+	var cp = new ColorPicker();
+	function advUpdate(val, obj) {
+		document.getElementById(obj).value = val;
+		kUpdate(obj);
+	}
+	function kUpdate(oid) {
+		if ( 'uppercolor' == oid || 'lowercolor' == oid ) {
+			uc = document.getElementById('uppercolor').value.replace('#', '');
+			lc = document.getElementById('lowercolor').value.replace('#', '');
+			hi = document.getElementById('headerimage');
+			hi.value = 'header-img.php?upper='+uc+'&lower='+lc;
+			document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/'+hi.value+'") center no-repeat';
+			document.getElementById('advuppercolor').value = '#'+uc;
+			document.getElementById('advlowercolor').value = '#'+lc;
+		}
+		if ( 'fontcolor' == oid ) {
+			document.getElementById('header').style.color = document.getElementById('fontcolor').value;
+			document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value;
+		}
+		if ( 'fontdisplay' == oid ) {
+			document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
+		}
+	}
+	function toggleDisplay() {
+		td = document.getElementById('fontdisplay');
+		td.value = ( td.value == 'none' ) ? 'inline' : 'none';
+		kUpdate('fontdisplay');
+	}
+	function toggleAdvanced() {
+		a = document.getElementById('jsAdvanced');
+		if ( a.style.display == 'none' )
+			a.style.display = 'block';
+		else
+			a.style.display = 'none';
+	}
+	function kDefaults() {
+		document.getElementById('headerimage').value = '';
+		document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#69aee7';
+		document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#4180b6';
+		document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/kubrickheader.jpg") center no-repeat';
+		document.getElementById('header').style.color = '#FFFFFF';
+		document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '';
+		document.getElementById('fontdisplay').value = 'inline';
+		document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
+	}
+	function kRevert() {
+		document.getElementById('headerimage').value = '<?php echo kubrick_header_image(); ?>';
+		document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo kubrick_upper_color(); ?>';
+		document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo kubrick_lower_color(); ?>';
+		document.getElementById('header').style.background = 'url("<?php echo kubrick_header_image_url(); ?>") center no-repeat';
+		document.getElementById('header').style.color = '';
+		document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo kubrick_header_color_string(); ?>';
+		document.getElementById('fontdisplay').value = '<?php echo kubrick_header_display_string(); ?>';
+		document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
+	}
+	function kInit() {
+		document.getElementById('jsForm').style.display = 'block';
+		document.getElementById('nonJsForm').style.display = 'none';
+	}
+	addLoadEvent(kInit);
+</script>
+<style type='text/css'>
+	#headwrap {
+		text-align: center;
+	}
+	#kubrick-header {
+		font-size: 80%;
+	}
+	#kubrick-header .hibrowser {
+		width: 780px;
+		height: 260px;
+		overflow: scroll;
+	}
+	#kubrick-header #hitarget {
+		display: none;
+	}
+	#kubrick-header #header h1 {
+		font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
+		font-weight: bold;
+		font-size: 4em;
+		text-align: center;
+		padding-top: 70px;
+		margin: 0;
+	}
+
+	#kubrick-header #header .description {
+		font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
+		font-size: 1.2em;
+		text-align: center;
+	}
+	#kubrick-header #header {
+		text-decoration: none;
+		color: <?php echo kubrick_header_color_string(); ?>;
+		padding: 0;
+		margin: 0;
+		height: 200px;
+		text-align: center;
+		background: url('<?php echo kubrick_header_image_url(); ?>') center no-repeat;
+	}
+	#kubrick-header #headerimg {
+		margin: 0;
+		height: 200px;
+		width: 100%;
+		display: <?php echo kubrick_header_display_string(); ?>;
+	}
+	#jsForm {
+		display: none;
+		text-align: center;
+	}
+	#jsForm input.submit, #jsForm input.button, #jsAdvanced input.button {
+		padding: 0px;
+		margin: 0px;
+	}
+	#advanced {
+		text-align: center;
+		width: 620px;
+	}
+	html>body #advanced {
+		text-align: center;
+		position: relative;
+		left: 50%;
+		margin-left: -380px;
+	}
+	#jsAdvanced {
+		text-align: right;
+	}
+	#nonJsForm {
+		position: relative;
+		text-align: left;
+		margin-left: -370px;
+		left: 50%;
+	}
+	#nonJsForm label {
+		padding-top: 6px;
+		padding-right: 5px;
+		float: left;
+		width: 100px;
+		text-align: right;
+	}
+	.defbutton {
+		font-weight: bold;
+	}
+	.zerosize {
+		width: 0px;
+		height: 0px;
+		overflow: hidden;
+	}
+	#colorPickerDiv a, #colorPickerDiv a:hover {
+		padding: 1px;
+		text-decoration: none;
+		border-bottom: 0px;
+	}
+</style>
+<?php
+}
+
+function kubrick_theme_page() {
+	if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>Options saved.</strong></p></div>';
+?>
+<div class='wrap'>
+	<div id="kubrick-header">
+		<h2>Header Image and Color</h2>
+		<div id="headwrap">
+			<div id="header">
+				<div id="headerimg">
+					<h1><?php bloginfo('name'); ?></h1>
+					<div class="description"><?php bloginfo('description'); ?></div>
+				</div>
+			</div>
+		</div>
+		<br />
+		<div id="nonJsForm">
+			<form method="POST">
+				<div class="zerosize"><input type="submit" name="defaultsubmit" value="Save" /></div>
+				<label for="njfontcolor">Font Color:</label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo kubrick_header_color(); ?>" /> Any CSS color (<code>red</code> or <code>#FF0000</code> or <code>rgb(255, 0, 0)</code>)<br />
+				<label for="njuppercolor">Upper Color:</label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo kubrick_upper_color(); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br />
+				<label for="njlowercolor">Lower Color:</label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo kubrick_lower_color(); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br />
+				<input type="hidden" name="hi" id="hi" value="<?php echo kubrick_header_image(); ?>" />
+				<label> </label><input type="submit" name="toggledisplay" id="toggledisplay" value="Toggle Text" />
+				<input type="submit" name="defaults" value="Use Defaults" />
+				<input type="submit" class="defbutton" name="submitform" value="&nbsp;&nbsp;Save&nbsp;&nbsp;" />
+				<input type="hidden" name="action" value="save" />
+				<input type="hidden" name="njform" value="true" />
+			</form>
+		</div>
+		<div id="jsForm">
+			<form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
+				<input type="button" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="Font Color"></input>
+				<input type="button" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="Upper Color"></input>
+				<input type="button" onclick="tgt=document.getElementById('lowercolor');colorSelect(tgt,'pick3');return false;" name="pick3" id="pick3" value="Lower Color"></input>
+				<input type="button" name="revert" value="Revert" onclick="kRevert()" />
+				<input type="button" value="Advanced" onclick="toggleAdvanced()" />
+				<input type="submit" name="submitform" class="defbutton" value="Save" onclick="cp.hidePopup('prettyplease')" />
+				<input type="hidden" name="action" value="save" />
+				<input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo kubrick_header_display(); ?>" />
+				<input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo kubrick_header_color(); ?>" />
+				<input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo kubrick_upper_color(); ?>" />
+				<input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo kubrick_lower_color(); ?>" />
+				<input type="hidden" name="headerimage" id="headerimage" value="<?php echo kubrick_header_image(); ?>" />
+			</form>
+			<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div>
+			<div id="advanced">
+				<form id="jsAdvanced" style="display:none;">
+					<label for="advfontcolor">Font Color (CSS): </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo kubrick_header_color(); ?>" /><br />
+					<label for="advuppercolor">Upper Color (HEX): </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo kubrick_upper_color(); ?>" /><br />
+					<label for="advlowercolor">Lower Color (HEX): </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo kubrick_lower_color(); ?>" /><br />
+					<input type="button" name="default" value="Select Default Colors" onclick="kDefaults()" /><br />
+					<input type="button" onclick="toggleDisplay();return false;" name="pick" id="pick" value="Toggle Text Display"></input><br />
+				</form>
+			</div>
+		</div>
+	</div>
+</div>
+<?php } ?>
Index: wp-content/themes/default/images/header-img.php
===================================================================
--- wp-content/themes/default/images/header-img.php	(revision 3693)
+++ wp-content/themes/default/images/header-img.php	(working copy)
@@ -1,77 +1,77 @@
-<?php
-
-$img = 'kubrickheader.jpg';
-
-// If we don't have image processing support, redirect.
-if ( ! function_exists('imagecreatefromjpeg') )
-	die(header("Location: kubrickheader.jpg"));
-
-// Assign and validate the color values
-$default = false;
-$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
-foreach ( $vars as $var => $subvars ) {
-	if ( isset($_GET[$var]) ) {
-		foreach ( $subvars as $index => $subvar ) {
-			$length = strlen($_GET[$var]) / 3;
-			$v = substr($_GET[$var], $index * $length, $length);
-			if ( $length == 1 ) $v = '' . $v . $v;
-			$$subvar = hexdec( $v );
-			if ( $$subvar < 0 || $$subvar > 255 )
-				$default = true;
-		}
-	} else {
-		$default = true;
-	}
-}
-
-if ( $default )
-	list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );
-
-// Create the image
-$im = imagecreatefromjpeg($img);
-
-// Get the background color, define the rectangle height
-$white = imagecolorat( $im, 15, 15 );
-$h = 182;
-
-// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )
-$corners = array(
-	0 => array ( 25, 734 ),
-	1 => array ( 23, 736 ),
-	2 => array ( 22, 737 ),
-	3 => array ( 21, 738 ),
-	4 => array ( 21, 738 ),
-	177 => array ( 21, 738 ),
-	178 => array ( 21, 738 ),
-	179 => array ( 22, 737 ),
-	180 => array ( 23, 736 ),
-	181 => array ( 25, 734 ),
-	);
-
-// Blank out the blue thing
-for ( $i = 0; $i < $h; $i++ ) {
-	$x1 = 19;
-	$x2 = 740;
-	imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
-}
-
-// Draw a new color thing
-for ( $i = 0; $i < $h; $i++ ) {
-	$x1 = 20;
-	$x2 = 739;
-	$r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1;
-	$g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1;
-	$b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1;
-	$color = imagecolorallocate( $im, $r, $g, $b );
-	if ( array_key_exists($i, $corners) ) {
-		imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
-		list ( $x1, $x2 ) = $corners[$i];
-	}
-	imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );
-}
-
-//die;
-header("Content-Type: image/jpeg");
-imagejpeg($im, '', 92);
-imagedestroy($im);
-?>
+<?php
+
+$img = 'kubrickheader.jpg';
+
+// If we don't have image processing support, redirect.
+if ( ! function_exists('imagecreatefromjpeg') )
+	die(header("Location: kubrickheader.jpg"));
+
+// Assign and validate the color values
+$default = false;
+$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
+foreach ( $vars as $var => $subvars ) {
+	if ( isset($_GET[$var]) ) {
+		foreach ( $subvars as $index => $subvar ) {
+			$length = strlen($_GET[$var]) / 3;
+			$v = substr($_GET[$var], $index * $length, $length);
+			if ( $length == 1 ) $v = '' . $v . $v;
+			$$subvar = hexdec( $v );
+			if ( $$subvar < 0 || $$subvar > 255 )
+				$default = true;
+		}
+	} else {
+		$default = true;
+	}
+}
+
+if ( $default )
+	list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );
+
+// Create the image
+$im = imagecreatefromjpeg($img);
+
+// Get the background color, define the rectangle height
+$white = imagecolorat( $im, 15, 15 );
+$h = 182;
+
+// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )
+$corners = array(
+	0 => array ( 25, 734 ),
+	1 => array ( 23, 736 ),
+	2 => array ( 22, 737 ),
+	3 => array ( 21, 738 ),
+	4 => array ( 21, 738 ),
+	177 => array ( 21, 738 ),
+	178 => array ( 21, 738 ),
+	179 => array ( 22, 737 ),
+	180 => array ( 23, 736 ),
+	181 => array ( 25, 734 ),
+	);
+
+// Blank out the blue thing
+for ( $i = 0; $i < $h; $i++ ) {
+	$x1 = 19;
+	$x2 = 740;
+	imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
+}
+
+// Draw a new color thing
+for ( $i = 0; $i < $h; $i++ ) {
+	$x1 = 20;
+	$x2 = 739;
+	$r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1;
+	$g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1;
+	$b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1;
+	$color = imagecolorallocate( $im, $r, $g, $b );
+	if ( array_key_exists($i, $corners) ) {
+		imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
+		list ( $x1, $x2 ) = $corners[$i];
+	}
+	imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );
+}
+
+//die;
+header("Content-Type: image/jpeg");
+imagejpeg($im, '', 92);
+imagedestroy($im);
+?>
Index: wp-content/index.php
===================================================================
--- wp-content/index.php	(revision 3693)
+++ wp-content/index.php	(working copy)
@@ -1,3 +1,3 @@
-<?php
-// Silence is golden.
+<?php
+// Silence is golden.
 ?>
\ No newline at end of file
Index: wp-admin/post-new.php
===================================================================
--- wp-admin/post-new.php	(revision 3693)
+++ wp-admin/post-new.php	(working copy)
@@ -1,94 +1,94 @@
-<?php
-require_once('admin.php');
-$title = __('Create New Post');
-$parent_file = 'post-new.php';
-$editing = true;
-require_once ('./admin-header.php');
-
-if ( ! current_user_can('edit_posts') ) { ?>
-<div class="wrap">
-<p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />
-You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
-When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)'), get_settings('admin_email')); ?>
-</p>
-</div>
-<?php
-	include('admin-footer.php');
-	exit();
-}
-
-if ( isset($_GET['posted']) ) : ?>
-<div id="message" class="updated fade"><p><?php printf(__('Post saved. <a href="%s">View site &raquo;</a>'), get_bloginfo('home') . '/'); ?></p></div>
-<?php
-endif;
-
-if ( $drafts = get_users_drafts( $user_ID ) ) { ?>
-<div class="wrap">
-<p><strong><?php _e('Your Drafts:') ?></strong>
-<?php
-// Show drafts.
-	$num_drafts = count($drafts);
-	if ( $num_drafts > 15 ) $num_drafts = 15;
-	for ( $i = 0; $i < $num_drafts; $i++ ) {
-		$draft = $drafts[$i];
-		if ( 0 != $i )
-			echo ', ';
-		if ( empty($draft->post_title) )
-			$draft->post_title = sprintf(__('Post # %s'), $draft->ID);
-		echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
-	}
-
-	if ( 15 < count($drafts) ) { ?>
-		, <a href="edit.php"><?php echo sprintf(__('and %s more'), (count($drafts) - 15) ); ?> &raquo;</a>
-	<?php } ?>
-.</p>
-</div>
-<?php
-}
-
-// Show post form.
-$post = get_default_post_to_edit();
-include('edit-form-advanced.php');
-?>
-
-<?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?>
-<div class="wrap">
-<h3><?php _e('WordPress bookmarklet'); ?></h3>
-<p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p>
-<p>
-
-<?php
-if ($is_NS4 || $is_gecko) {
-?>
-<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_settings('blogname'))); ?></a> 
-<?php
-} else if ($is_winIE) {
-?>
-<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
-<script type="text/javascript">
-<!--
-function oneclickbookmarklet(blah) {
-window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=120, left=120, screenY=120, top=120");
-}
-// -->
-</script>
-<br />
-<br />
-<?php _e('One-click bookmarklet:') ?><br />
-<a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a> 
-<?php
-} else if ($is_opera) {
-?>
-<a href="javascript:location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
-<?php
-} else if ($is_macIE) {
-?>
-<a href="javascript:Q='';location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
-<?php
-}
-?>
-</p>
-</div>
-<?php } ?>
-
+<?php
+require_once('admin.php');
+$title = __('Create New Post');
+$parent_file = 'post-new.php';
+$editing = true;
+require_once ('./admin-header.php');
+
+if ( ! current_user_can('edit_posts') ) { ?>
+<div class="wrap">
+<p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />
+You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
+When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)'), get_settings('admin_email')); ?>
+</p>
+</div>
+<?php
+	include('admin-footer.php');
+	exit();
+}
+
+if ( isset($_GET['posted']) ) : ?>
+<div id="message" class="updated fade"><p><?php printf(__('Post saved. <a href="%s">View site &raquo;</a>'), get_bloginfo('home') . '/'); ?></p></div>
+<?php
+endif;
+
+if ( $drafts = get_users_drafts( $user_ID ) ) { ?>
+<div class="wrap">
+<p><strong><?php _e('Your Drafts:') ?></strong>
+<?php
+// Show drafts.
+	$num_drafts = count($drafts);
+	if ( $num_drafts > 15 ) $num_drafts = 15;
+	for ( $i = 0; $i < $num_drafts; $i++ ) {
+		$draft = $drafts[$i];
+		if ( 0 != $i )
+			echo ', ';
+		if ( empty($draft->post_title) )
+			$draft->post_title = sprintf(__('Post # %s'), $draft->ID);
+		echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
+	}
+
+	if ( 15 < count($drafts) ) { ?>
+		, <a href="edit.php"><?php echo sprintf(__('and %s more'), (count($drafts) - 15) ); ?> &raquo;</a>
+	<?php } ?>
+.</p>
+</div>
+<?php
+}
+
+// Show post form.
+$post = get_default_post_to_edit();
+include('edit-form-advanced.php');
+?>
+
+<?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?>
+<div class="wrap">
+<h3><?php _e('WordPress bookmarklet'); ?></h3>
+<p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p>
+<p>
+
+<?php
+if ($is_NS4 || $is_gecko) {
+?>
+<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_settings('blogname'))); ?></a> 
+<?php
+} else if ($is_winIE) {
+?>
+<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
+<script type="text/javascript">
+<!--
+function oneclickbookmarklet(blah) {
+window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=120, left=120, screenY=120, top=120");
+}
+// -->
+</script>
+<br />
+<br />
+<?php _e('One-click bookmarklet:') ?><br />
+<a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a> 
+<?php
+} else if ($is_opera) {
+?>
+<a href="javascript:location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
+<?php
+} else if ($is_macIE) {
+?>
+<a href="javascript:Q='';location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
+<?php
+}
+?>
+</p>
+</div>
+<?php } ?>
+
 <?php include('admin-footer.php'); ?>
\ No newline at end of file
