if (!window.SyntaxHighlighter) SyntaxHighlighter = function () {
	var k = {
		defaults: {
			'class-name': '',
			'first-line': 1,
			'highlight': null,
			'smart-tabs': false,
			'tab-size': 4,
			'ruler': true,
			'gutter': true,
			'toolbar': true,
			'collapse': false,
			'auto-links': true,
			'light': false,
			'wrap-lines': true,
			'run-script': false
		},
		config: {
			clipboardSwf: 'http://www.rip-zone.ru/images/code/clipboard.swf',
			toolbarItemWidth: 16,
			toolbarItemHeight: 16,
			bloggerMode: false,
			stripBrs: false,
			tagName: 'pre',
			strings: {
				expandSource: 'Развернуть код',
				viewSource: 'Посмотреть код',
				runScript: 'Запустить код',
				copyToClipboard: 'Копировать в буфер обмена',
				copyToClipboardConfirmation: 'Код успешно скопирован!',
				print: 'Печать',
				help: 'Описание',
				alert: 'Подсветка синтаксиса',
				noBrush: 'Не могу найти шаблон для: ',
				brushNotHtmlScript: 'Шаблон не сконфигурирован для опции: ',
				aboutDialog: '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>About SyntaxHighlighter</title></head><body style=\"font-family:Verdana,\"Times New Roman\",Times,serif;background-color:#fff;color:#000;font-size:1em;text-align:center;\"><div style=\"text-align:center;margin-top:3em;\"><div style=\"font-family:Geneva,Arial,Helvetica,sans-serif;font-size:xx-large;\">Подсветка синтаксиса</div><div style=\"font-size:.75em;margin-bottom:4em;\"><div>Версия 2.0.287 (Май 16.05.2011)</div><div><a href=\"http://alexgorbatchev.com\" target=\"_blank\" style=\"color:#0099FF;text-decoration:none;\">http://alexgorbatchev.com</a></div><div><a href=\"http://uSite.su\" target=\"_blank\" style=\"color:#0099FF;text-decoration:none;\">http://uSite.su</a></div></div><div>JavaScript подсветка синтаксиса.</div><div>Copyright 2004-2011 Alex Gorbatchev.</div><div>Перевод от <b>W-webber</b></div></div></body></html>'
			},
			debug: false
		},
		vars: {
			discoveredBrushes: null,
			spaceWidth: 7,
			printFrame: null,
			highlighters: {}
		},
		brushes: {},
		regexLib: {
			multiLineCComments: /\/\*[\s\S]*?\*\//gm,
			singleLineCComments: /\/\/.*$/gm,
			singleLinePerlComments: /#.*$/gm,
			doubleQuotedString: /"(?:\.|(\\\")|[^\""\n])*"/g,
			singleQuotedString: /'(?:\.|(\\\')|[^\''\n])*'/g,
			multiLineDoubleQuotedString: /"(?:\.|(\\\")|[^\""])*"/g,
			multiLineSingleQuotedString: /'(?:\.|(\\\')|[^\''])*'/g,
			url: /\w+:\/\/[\w-.\/?%&=]*/g,
			phpScriptTags: {
				left: /(&lt;|<)\?=?/g,
				right: /\?(&gt;|>)/g
			},
			aspScriptTags: {
				left: /(&lt;|<)%=?/g,
				right: /%(&gt;|>)/g
			},
			scriptScriptTags: {
				left: /(&lt;|<)\s*script.*?(&gt;|>)/gi,
				right: /(&lt;|<)\/\s*script\s*(&gt;|>)/gi
			}
		},
		toolbar: {
			create: function (a) {
				var b = document.createElement('DIV'),
				items = k.toolbar.items;
				b.className = 'toolbar';
				for (var c in items) {
					var constructor = items[c],
					command = new constructor(a),
					element = command.create();
					a.toolbarCommands[c] = command;
					if (element == null) continue;
					if (typeof(element) == 'string') element = k.toolbar.createButton(element, a.id, c);
					element.className += 'item ' + c;/*
					element.onclick = function(fnc){
						return function(){
							return fnc() && false;
						};
					}(command.execute);*/
					b.appendChild(element)
				}
				return b
			},
			createButton: function (b, c, d) {
				var a = document.createElement('a'),
				style = a.style,
				config = k.config,
				width = config.toolbarItemWidth,
				height = config.toolbarItemHeight;
				a.href = '#' + d;
				a.title = b;
/*				a.highlighterId = c;
				a.commandName = d;*/
				a.innerHTML = b;
				if (!isNaN(width)){style.width = width + 'px'}
				if (!isNaN(height)){style.height = height + 'px'}
				a.onclick = function (f) {
					try {
						k.toolbar.executeCommand(this, f || window.event, c/*this.highlighterId*/, d/*this.commandName*/)
					} catch(e) {
						k.utils.alert(e.message)
					}
					return false
				};
				return a
			},
			executeCommand: function (a, b, c, d, e) {
				var f = k.vars.highlighters[c],
					command;
				if (f == null || (command = f.toolbarCommands[d]) == null) return null;
				return command.execute(a, b, e)
			},
			items: {
				expandSource: function (e) {
					this.create = function () {
						if (e.getParam('collapse') != true) return;
						return k.config.strings.expandSource
					};
					this.execute = function (a, b, c) {
						var d = e.div;
						a.parentNode.removeChild(a);
						d.className = d.className.replace('collapsed', '')
					}
				},
				runScript: function (e) {
					this.create = function () {
						if (e.getParam('run-script') != true) return;
						return k.config.strings.runScript
					};
					this.execute = function (a, b, c) {
						var f = document.createElement('div'),
							brush = e.getParam("brush");
						
						f.innerHTML = e.originalCode;
						var d = $(f).text();
						if(brush == 'js'){
							try {
								eval(d)
							} catch(error) {
								alert(error)
							}
						} else if(brush == 'html'){
							var wnd = window.open('');
							wnd.document.write(d);
							wnd.document.close();
						}
					}
				},
				viewSource: function (e) {
					this.create = function () {
						return k.config.strings.viewSource
					};
					this.execute = function (a, b, c) {
						var d = k.utils.fixInputString(e.originalCode),
						wnd = k.utils.popup('', '_blank', 750, 400, 'location=0,resizable=1,menubar=0,scrollbars=1');
						d = k.utils.unindent(d);
						wnd.document.write('<pre>' + d + '</pre>');
						wnd.document.close()
					}
				},
				copyToClipboard: function (f) {
					var g, flashSwf, highlighterId = f.id;
					this.create = function () {
						var d = k.config;
						if (d.clipboardSwf == null) return null;
						function params(a) {
							var b = '';
							for (var c in a) b += "<param name='" + c + "' value='" + a[c] + "'/>";
							return b
						};
						function attributes(a) {
							var b = '';
							for (var c in a) b += "" + c + "='" + a[c] + "'";
							return b
						};
						var e = {
							width: d.toolbarItemWidth,
							height: d.toolbarItemHeight,
							id: highlighterId + '_clipboard',
							type: 'application/x-shockwave-flash',
							title: k.config.strings.copyToClipboard
						},
						args2 = {
							allowScriptAccess: 'always',
							wmode: 'transparent',
							flashVars: 'highlighterId=' + highlighterId,
							menu: 'false'
						},
						swf = d.clipboardSwf,
						html;
						if (/msie/i.test(navigator.userAgent)) {
							html = '<object' + attributes({
								classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
								codebase: 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'
							}) + attributes(e) + '>' + params(args2) + params({
								movie: swf
							}) + '</object>'
						} else {
							html = '<embed ' + attributes(e) + attributes(args2) + attributes({
								src: swf
							}) + '/>'
						}
						g = document.createElement('div');
						g.innerHTML = html;
						return g
					};
					this.execute = function (a, b, c) {
						var d = c.command;
						switch (d) {
						case 'get':
							var e = k.utils.unindent(k.utils.fixInputString(f.originalCode).replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&'));
							if (window.clipboardData) window.clipboardData.setData('text', e);
							else return k.utils.unindent(e);
						case 'ok':
							k.utils.alert(k.config.strings.copyToClipboardConfirmation);
							break;
						case 'error':
							k.utils.alert(c.message);
							break
						}
					}
				},
				printSource: function (h) {
					this.create = function () {
						return k.config.strings.print
					};
					this.execute = function (d, e, f) {
						var g = document.createElement('IFRAME'),
						doc = null;
						if (k.vars.printFrame != null) document.body.removeChild(k.vars.printFrame);
						k.vars.printFrame = g;
						g.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
						document.body.appendChild(g);
						doc = g.contentWindow.document;
						copyStyles(doc, window.document);
						doc.write('<div class="' + h.div.className.replace('collapsed', '') + 'printing">' + h.div.innerHTML + '</div>');
						doc.close();
						g.contentWindow.focus();
						g.contentWindow.print();
						function copyStyles(a, b) {
							var c = b.getElementsByTagName('link');
							for (var i = 0; i < c.length; i++) if (c[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(c[i].href)) a.write('<link type="text/css" rel="stylesheet" href="' + c[i].href + '"></link>')
						}
					}
				},
				about: function (d) {
					this.create = function () {
						return k.config.strings.help
					};
					this.execute = function (a, b) {
						var c = k.utils.popup('', '_blank', 500, 250, 'scrollbars=0'),
						doc = c.document;
						doc.write(k.config.strings.aboutDialog);
						doc.close();
						c.focus()
					}
				}
			}
		},
		utils: {
			guid: function (a) {
				return a + Math.round(Math.random() * 1000000).toString()
			},
			merge: function (a, b) {
				var c = {},
				name;
				for (name in a) c[name] = a[name];
				for (name in b) c[name] = b[name];
				return c
			},
			toBoolean: function (a) {
				switch (a) {
				case "true":
					return true;
				case "false":
					return false
				}
				return a
			},
			popup: function (a, b, c, d, e) {
				var x = (screen.width - c) / 2,
				y = (screen.height - d) / 2;
				e += ', left=' + x + ', top=' + y + ', width=' + c + ', height=' + d;
				e = e.replace(/^,/, '');
				var f = window.open(a, b, e);
				f.focus();
				return f
			},
			addEvent: function (a, b, c) {
				if (a.attachEvent) {
					a['e' + b + c] = c;
					a[b + c] = function () {
						a['e' + b + c](window.event)
					};
					a.attachEvent('on' + b, a[b + c])
				} else {
					a.addEventListener(b, c, false)
				}
			},
			alert: function (a) {
				_uWnd.alert(a, 'Подсветка Синтаксиса', {
					w: 230,
					h: 80,
					tm: 3000
				})
			},
			findBrush: function (a, b) {
				var c = k.vars.discoveredBrushes,
				result = null;
				if (c == null) {
					c = {};
					for (var d in k.brushes) {
						var e = k.brushes[d].aliases;
						if (e == null) continue;
						for (var i = 0; i < e.length; i++) c[e[i]] = d
					}
					k.vars.discoveredBrushes = c
				}
				result = k.brushes[c[a]];
				if (result == null && b != false) k.utils.alert(k.config.strings.noBrush + a);
				return result
			},
			eachLine: function (a, b) {
				var c = a.split('\n');
				for (var i = 0; i < c.length; i++) c[i] = b(c[i]);
				return c.join('\n')
			},
			createRuler: function () {
				var a = document.createElement('div'),
				ruler = document.createElement('div'),
				showEvery = 10,
				i = 1;
				while (i <= 150) {
					if (i % showEvery === 0) {
						a.innerHTML += i;
						i += (i + '').length
					} else {
						a.innerHTML += '&middot;';
						i++
					}
				}
				ruler.className = 'ruler line';
				ruler.appendChild(a);
				return ruler
			},
			trimFirstAndLastLines: function (a) {
				return a.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, '')
			},
			parseParams: function (a) {
				var b, result = {},
				arrayRegex = new XRegExp("^\\[(?<values>(.*?))\\]$"),
				regex = new XRegExp("(?<name>[\\w-]+)" + "\\s*:\\s*" + "(?<value>" + "[\\w-%#]+|" + "\\[.*?\\]|" + '".*?"|' + "'.*?'" + ")\\s*;?", "g");
				while ((b = regex.exec(a)) != null) {
					var c = b.value.replace(/^['"]|['"]$/g, '');
					if (c != null && arrayRegex.test(c)) {
						var m = arrayRegex.exec(c);
						c = m.values.length > 0 ? m.values.split(/\s*,\s*/) : []
					}
					result[b.name] = c
				}
				return result
			},
			decorate: function (c, d) {
				if (c == null || c.length == 0 || c == '\n') return c;
				c = c;
				c = c.replace(/ {2,}/g, function (m) {
					var a = '';
					for (var i = 0; i < m.length - 1; i++) a += '&nbsp;';
					return a + ''
				});
				if (d != null) c = k.utils.eachLine(c, function (a) {
					if (a.length == 0) return '';
					var b = '';
					a = a.replace(/^(&nbsp;|\s)+/, function (s) {
						b = s;
						return ''
					});
					if (a.length == 0) return b;
					return b + '<code class="' + d + '">' + a + '</code>'
				});
				return c
			},
			padNumber: function (a, b) {
				var c = a.toString();
				while (c.length < b) c = '0' + c;
				return c
			},
			measureSpace: function () {
				var a = document.createElement('div'),
				span,
				result = 0,
				body = document.body,
				id = k.utils.guid('measureSpace'),
				divOpen = '<div class="',
				closeDiv = '</div>',
				closeSpan = '</span>';
				a.innerHTML = divOpen + 'syntaxhighlighter">' + divOpen + 'lines">' + divOpen + 'line">' + divOpen + 'content' + '"><span class="block"><span id="' + id + '">&nbsp;' + closeSpan + closeSpan + closeDiv + closeDiv + closeDiv + closeDiv;
				body.appendChild(a);
				span = document.getElementById(id);
				if (/opera/i.test(navigator.userAgent)) {
					var b = window.getComputedStyle(span, null);
					result = parseInt(b.getPropertyValue("width"), 10)
				} else {
					result = span.offsetWidth
				}
				body.removeChild(a);
				return result
			},
			processTabs: function (a, b) {
				return a.replace(/\t/g, '&#9;')
			},
			processSmartTabs: function (d, e) {
				var f = d.split('\n'),
				tab = '\t',
				spaces = '';
				for (var i = 0; i < 50; i++) spaces += '                    ';
				function insertSpaces(a, b, c) {
					return a.substr(0, b) + spaces.substr(0, c) + a.substr(b + 1, a.length)
				};
				d = k.utils.eachLine(d, function (a) {
					if (a.indexOf(tab) == -1) return a;
					var b = 0;
					while ((b = a.indexOf(tab)) != -1) {
						var c = e - b % e;
						a = insertSpaces(a, b, c)
					}
					return a
				});
				return d
			},
			fixInputString: function (a) {
				var b = /<br\s*\/?>|&lt;br\s*\/?&gt;/gi;
				if (k.config.bloggerMode == true) a = a.replace(b, '\n');
				if (k.config.stripBrs == true) a = a.replace(b, '');
				return a
			},
			trim: function (a) {
				return a.replace(/\s*$/g, '').replace(/^\s*/, '')
			},
			unindent: function (a) {
				var b = k.utils.fixInputString(a).split('\n'),
				indents = new Array(),
				regex = /^\s*/,
				min = 1000;
				for (var i = 0; i < b.length && min > 0; i++) {
					var c = b[i];
					if (k.utils.trim(c).length == 0) continue;
					var d = regex.exec(c);
					if (d == null) return a;
					min = Math.min(d[0].length, min)
				}
				if (min > 0) for (var i = 0; i < b.length; i++) b[i] = b[i].substr(min);
				return b.join('\n')
			},
			matchesSortCallback: function (a, b) {
				if (a.index < b.index) return - 1;
				else if (a.index > b.index) return 1;
				else {
					if (a.length < b.length) return - 1;
					else if (a.length > b.length) return 1
				}
				return 0
			},
			getMatches: function (c, d) {
				function defaultAdd(a, b) {
					return [new k.Match(a[0], a.index, b.css)]
				};
				var e = 0,
				match = null,
				result = [],
				func = d.func ? d.func: defaultAdd;
				while ((match = d.regex.exec(c)) != null) result = result.concat(func(match, d));
				return result
			},
			processUrls: function (a) {
				return a.replace(k.regexLib.url, function (m) {
					return '<a href="' + m + '">' + m + '</a>'
				})
			}
		},
		highlight: function (c, d) {
			function toArray(a) {
				var b = [];
				for (var i = 0; i < a.length; i++) b.push(a[i]);
				return b
			};
			var e = d ? [d] : toArray(document.getElementsByTagName(k.config.tagName)),
			propertyName = 'innerHTML',
			highlighter = null;
			if (e.length === 0) return;
			for (var i = 0; i < e.length; i++) {
				var f = e[i],
				params = k.utils.parseParams(f.className),
				brushName;
				params = k.utils.merge(c, params);
				brushName = params['brush'];
				if (brushName == null) continue;
				if (params['html-script'] == 'true') {
					highlighter = new k.HtmlScript(brushName)
				} else {
					var g = k.utils.findBrush(brushName);
					if (g) highlighter = new g();
					else continue
				}
				highlighter.highlight(f[propertyName], params);
				var h = highlighter.div;
				if (k.config.debug) {
					h = document.createElement('textarea');
					h.value = highlighter.div.innerHTML;
					h.style.width = '70em';
					h.style.height = '30em'
				}
				f.parentNode.replaceChild(h, f);
				
				var linesBlock = $('div.lines-block div.line', h);
				$('div.numbers-block code', h).each(function(i){
					$(this).css('height', parseInt(linesBlock.eq(i).height(), 10) + 'px');
				});

			}
		},
		all: function (a) {
			k.highlight(a)
		}
	};
	k.Match = function (a, b, c) {
		this.value = a;
		this.index = b;
		this.length = a.length;
		this.css = c
	};
	k.Match.prototype.toString = function () {
		return this.value
	};
	k.HtmlScript = function (d) {
		var e = k.utils.findBrush(d),
		xmlBrush = new k.brushes.Xml(),
		bracketsRegex = null;
		if (e == null) return;
		e = new e();
		this.xmlBrush = xmlBrush;
		if (e.htmlScript == null) {
			k.utils.alert(k.config.strings.brushNotHtmlScript + d);
			return
		}
		xmlBrush.regexList.push({
			regex: e.htmlScript.code,
			func: process
		});
		function offsetMatches(a, b) {
			for (var j = 0; j < a.length; j++) a[j].index += b
		}
		function process(a, b) {
			var c = a.code,
			matches = [],
			regexList = e.regexList,
			offset = a.index + a.left.length,
			htmlScript = e.htmlScript,
			result;
			for (var i = 0; i < regexList.length; i++) {
				result = k.utils.getMatches(c, regexList[i]);
				offsetMatches(result, offset);
				matches = matches.concat(result)
			}
			if (htmlScript.left != null && a.left != null) {
				result = k.utils.getMatches(a.left, htmlScript.left);
				offsetMatches(result, a.index);
				matches = matches.concat(result)
			}
			if (htmlScript.right != null && a.right != null) {
				result = k.utils.getMatches(a.right, htmlScript.right);
				offsetMatches(result, a.index + a[0].lastIndexOf(a.right));
				matches = matches.concat(result)
			}
			return matches
		}
	};
	k.HtmlScript.prototype.highlight = function (a, b) {
		this.xmlBrush.highlight(a, b);
		this.div = this.xmlBrush.div
	};
	k.Highlighter = function () {};
	k.Highlighter.prototype = {
		getParam: function (a, b) {
			var c = this.params[a];
			return k.utils.toBoolean(c == null ? b: c)
		},
		create: function (a) {
			return document.createElement(a)
		},
		findMatches: function (a, b) {
			var c = [];
			if (a != null) for (var i = 0; i < a.length; i++) c = c.concat(k.utils.getMatches(b, a[i]));
			c = c.sort(k.utils.matchesSortCallback);
			return c
		},
		removeNestedMatches: function () {
			var a = this.matches;
			for (var i = 0; i < a.length; i++) {
				if (a[i] === null) continue;
				var b = a[i],
				itemIEndPos = b.index + b.length;
				for (var j = i + 1; j < a.length && a[i] !== null; j++) {
					var c = a[j];
					if (c === null) continue;
					else if (c.index > itemIEndPos) break;
					else if (c.index == b.index && c.length > b.length) this.matches[i] = null;
					else if (c.index >= b.index && c.index < itemIEndPos) this.matches[j] = null
				}
			}
		},
		createDisplayLines: function (a) {
			var b = a.split(/\n/g),
				firstLine = parseInt(this.getParam('first-line'), 10),
				padLength = (firstLine + b.length).toString().length,
				highlightedLines = this.getParam('highlight', []),
				numbers = '';
			a = '';
			for (var i = 0, bLength = b.length; i < bLength; ++i) {
				var c = b[i],
					indent = /^(&nbsp;|\s)+/.exec(c),
					lineClass = 'line alt' + (1 + (i % 2)),
					lineNumber = k.utils.padNumber(firstLine + i, padLength),
					highlighted = highlightedLines.indexOf((firstLine + i).toString()) != -1,
					spaces = null;
				if (indent != null) {
					spaces = indent[0].toString();
					var d = 0,
						_spaces = spaces.replace(/&nbsp;/g, ' ').replace(/\t/g, function () {
							d++;
							return ''
						});
					c = c.substr(spaces.length);
					spaces = spaces.replace(/&nbsp;/g, ' ');
					if (k.vars.spaceWidth === null) k.vars.spaceWidth = k.utils.measureSpace();
					indent = k.vars.spaceWidth * _spaces.length + k.vars.spaceWidth * 8 * d - 1
				} else {
					indent = 0
				}
				c = k.utils.trim(c);
				if (!c.length) c = '&nbsp;';
				if (highlighted) lineClass += ' highlighted';
				numbers += '<code class="number" unselectable="on">' + lineNumber + '.</code>';
				a += '<div class="' + lineClass + '">' +
						'<span class="content">' +
							(spaces != null ? '<code class="spaces">' + spaces.replace(/\t/g, '&#9;').replace(/\s/g, '&nbsp;') + '</code>': '') +
							'<span class="block"'+/*' style="margin-left: ' + indent + 'px !important;"'+*/'>' + c + '</span>' +
						'</span>' +
					'</div>';
			}
			return '<div class="lines-block">' + a + '</div>' + '<div class="numbers-block">' + numbers + '</div>'
		},
		processMatches: function (a, b) {
			var c = 0,
			result = '',
			decorate = k.utils.decorate;
			for (var i = 0; i < b.length; i++) {
				var d = b[i];
				if (d === null || d.length === 0) continue;
				result += decorate(a.substr(c, d.index - c), 'plain') + decorate(d.value, d.css);
				c = d.index + d.length
			}
			result += decorate(a.substr(c), 'plain');
			return result
		},
		highlight: function (a, b) {
			var c = k.config,
				vars = k.vars,
				div, divClassName, tabSize, important = 'important';
			this.params = {};
			this.div = null;
			this.lines = null;
			this.code = null;
			this.bar = null;
			this.toolbarCommands = {};
			this.id = k.utils.guid('highlighter_');
			vars.highlighters[this.id] = this;
			if (a === null) a = '';
			if (vars.spaceWidth === null) vars.spaceWidth = k.utils.measureSpace();
			this.params = k.utils.merge(k.defaults, b || {});
			if (this.getParam('light') == true) this.params.toolbar = this.params.gutter = false;
			this.div = div = this.create('DIV');
			this.lines = this.create('DIV');
			this.lines.className = 'lines';
			className = 'syntaxhighlighter';
			div.id = this.id;
			if (this.getParam('collapse')) className += ' collapsed';
			if (this.getParam('gutter') == false) className += ' nogutter';
			if (this.getParam('wrap-lines') == false) this.lines.className += ' no-wrap';
			className += ' ' + this.getParam('class-name');
			div.className = className;
			this.originalCode = a;
			this.code = k.utils.trimFirstAndLastLines(a).replace(/\r/g, ' ');
			tabSize = this.getParam('tab-size');
			this.code = k.utils.unindent(this.code);
			if (this.getParam('toolbar')) {
				this.bar = this.create('DIV');
				this.bar.className = 'bar';
				this.bar.appendChild(k.toolbar.create(this));
				div.appendChild(this.bar);
				var d = this.bar;
				function hide() {
					d.className = d.className.replace('show', '')
				}
				div.onmouseover = function () {
					hide();
					d.className += ' show'
				};
				div.onmouseout = function () {
					hide()
				}
			}
			if (this.getParam('ruler')) div.appendChild(k.utils.createRuler());
			div.appendChild(this.lines);
			this.matches = this.findMatches(this.regexList, this.code);
			this.removeNestedMatches();
			a = this.processMatches(this.code, this.matches);
			a = this.createDisplayLines(k.utils.trim(a));
			if (this.getParam('auto-links')) a = k.utils.processUrls(a);
			this.lines.innerHTML = a;
		},
		getKeywords: function (a) {
			a = a.replace(/^\s+|\s+$/g, '').replace(/\s+/g, '\\b|\\b');
			return '\\b' + a + '\\b'
		},
		forHtmlScript: function (a) {
			this.htmlScript = {
				left: {
					regex: a.left,
					css: 'script'
				},
				right: {
					regex: a.right,
					css: 'script'
				},
				code: new XRegExp("(?<left>" + a.left.source + ")" + "(?<code>.*?)" + "(?<right>" + a.right.source + ")", "sgi")
			}
		}
	};
	return k
} ();
if (!Array.indexOf) Array.prototype.indexOf = function (a, b) {
	b = Math.max(b || 0, 0);
	for (var i = b, length = this.length; i < length; ++i) if (this[i] == a) return i;
	return - 1
};
if (!window.XRegExp) { (function () {
		var d = {
			exec: RegExp.prototype.exec,
			match: String.prototype.match,
			replace: String.prototype.replace,
			split: String.prototype.split
		},
		lib = {
			part: /(?:[^\\([#\s.]+|\\(?!k<[\w$]+>|[pP]{[^}]+})[\S\s]?|\((?=\?(?!#|<[\w$]+>)))+|(\()(?:\?(?:(#)[^)]*\)|<([$\w]+)>))?|\\(?:k<([\w$]+)>|[pP]{([^}]+)})|(\[\^?)|([\S\s])/g,
			replaceVar: /(?:[^$]+|\$(?![1-9$&`']|{[$\w]+}))+|\$(?:([1-9]\d*|[$&`'])|{([$\w]+)})/g,
			extended: /^(?:\s+|#.*)+/,
			quantifier: /^(?:[?*+]|{\d+(?:,\d*)?})/,
			classLeft: /&&\[\^?/g,
			classRight: /]/g
		},
		indexOf = function (a, b, c) {
			for (var i = c || 0; i < a.length; i++) if (a[i] === b) return i;
			return - 1
		},
		brokenExecUndef = /()??/.exec("")[1] !== undefined,
		plugins = {};
		XRegExp = function (a, b) {
			if (a instanceof RegExp) {
				if (b !== undefined) throw TypeError("can't supply flags when constructing one RegExp from another");
				return a.addFlags()
			}
			var b = b || "",
			singleline = b.indexOf("s") > -1,
			extended = b.indexOf("x") > -1,
			hasNamedCapture = false,
			captureNames = [],
			output = [],
			part = lib.part,
			match,
			cc,
			len,
			index,
			regex;
			part.lastIndex = 0;
			while (match = d.exec.call(part, a)) {
				if (match[2]) {
					if (!lib.quantifier.test(a.slice(part.lastIndex))) output.push("(?:)")
				} else if (match[1]) {
					captureNames.push(match[3] || null);
					if (match[3]) hasNamedCapture = true;
					output.push("(")
				} else if (match[4]) {
					index = indexOf(captureNames, match[4]);
					output.push(index > -1 ? "\\" + (index + 1) + (isNaN(a.charAt(part.lastIndex)) ? "": "(?:)") : match[0])
				} else if (match[5]) {
					output.push(plugins.unicode ? plugins.unicode.get(match[5], match[0].charAt(1) === "P") : match[0])
				} else if (match[6]) {
					if (a.charAt(part.lastIndex) === "]") {
						output.push(match[6] === "[" ? "(?!)": "[\\S\\s]");
						part.lastIndex++
					} else {
						cc = XRegExp.matchRecursive("&&" + a.slice(match.index), lib.classLeft, lib.classRight, "", {
							escapeChar: "\\"
						})[0];
						output.push(match[6] + cc + "]");
						part.lastIndex += cc.length + 1
					}
				} else if (match[7]) {
					if (singleline && match[7] === ".") {
						output.push("[\\S\\s]")
					} else if (extended && lib.extended.test(match[7])) {
						len = d.exec.call(lib.extended, a.slice(part.lastIndex - 1))[0].length;
						if (!lib.quantifier.test(a.slice(part.lastIndex - 1 + len))) output.push("(?:)");
						part.lastIndex += len - 1
					} else {
						output.push(match[7])
					}
				} else {
					output.push(match[0])
				}
			}
			regex = RegExp(output.join(""), d.replace.call(b, /[sx]+/g, ""));
			regex._x = {
				source: a,
				captureNames: hasNamedCapture ? captureNames: null
			};
			return regex
		};
		XRegExp.addPlugin = function (a, o) {
			plugins[a] = o
		};
		RegExp.prototype.exec = function (a) {
			var b = d.exec.call(this, a),
			name,
			i,
			r2;
			if (b) {
				if (brokenExecUndef && b.length > 1) {
					r2 = new RegExp("^" + this.source + "$(?!\\s)", this.getNativeFlags());
					d.replace.call(b[0], r2, function () {
						for (i = 1; i < arguments.length - 2; i++) {
							if (arguments[i] === undefined) b[i] = undefined
						}
					})
				}
				if (this._x && this._x.captureNames) {
					for (i = 1; i < b.length; i++) {
						name = this._x.captureNames[i - 1];
						if (name) b[name] = b[i]
					}
				}
				if (this.global && this.lastIndex > (b.index + b[0].length)) this.lastIndex--
			}
			return b
		}
	})()
}
RegExp.prototype.getNativeFlags = function () {
	return (this.global ? "g": "") + (this.ignoreCase ? "i": "") + (this.multiline ? "m": "") + (this.extended ? "x": "") + (this.sticky ? "y": "")
};
RegExp.prototype.addFlags = function (a) {
	var b = new XRegExp(this.source, (a || "") + this.getNativeFlags());
	if (this._x) {
		b._x = {
			source: this._x.source,
			captureNames: this._x.captureNames ? this._x.captureNames.slice(0) : null
		}
	}
	return b
};
RegExp.prototype.call = function (a, b) {
	return this.exec(b)
};
RegExp.prototype.apply = function (a, b) {
	return this.exec(b[0])
};
XRegExp.cache = function (a, b) {
	var c = "/" + a + "/" + (b || "");
	return XRegExp.cache[c] || (XRegExp.cache[c] = new XRegExp(a, b))
};
XRegExp.escape = function (a) {
	return a.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, "\\$&")
};
XRegExp.matchRecursive = function (a, b, c, d, e) {
	var e = e || {},
	escapeChar = e.escapeChar,
	vN = e.valueNames,
	d = d || "",
	global = d.indexOf("g") > -1,
	ignoreCase = d.indexOf("i") > -1,
	multiline = d.indexOf("m") > -1,
	sticky = d.indexOf("y") > -1,
	d = d.replace(/y/g, ""),
	b = b instanceof RegExp ? (b.global ? b: b.addFlags("g")) : new XRegExp(b, "g" + d),
	c = c instanceof RegExp ? (c.global ? c: c.addFlags("g")) : new XRegExp(c, "g" + d),
	output = [],
	openTokens = 0,
	delimStart = 0,
	delimEnd = 0,
	lastOuterEnd = 0,
	outerStart,
	innerStart,
	leftMatch,
	rightMatch,
	escaped,
	esc;
	if (escapeChar) {
		if (escapeChar.length > 1) throw SyntaxError("can't supply more than one escape character");
		if (multiline) throw TypeError("can't supply escape character when using the multiline flag");
		escaped = XRegExp.escape(escapeChar);
		esc = new RegExp("^(?:" + escaped + "[\\S\\s]|(?:(?!" + b.source + "|" + c.source + ")[^" + escaped + "])+)+", ignoreCase ? "i": "")
	}
	while (true) {
		b.lastIndex = c.lastIndex = delimEnd + (escapeChar ? (esc.exec(a.slice(delimEnd)) || [""])[0].length: 0);
		leftMatch = b.exec(a);
		rightMatch = c.exec(a);
		if (leftMatch && rightMatch) {
			if (leftMatch.index <= rightMatch.index) rightMatch = null;
			else leftMatch = null
		}
		if (leftMatch || rightMatch) {
			delimStart = (leftMatch || rightMatch).index;
			delimEnd = (leftMatch ? b: c).lastIndex
		} else if (!openTokens) {
			break
		}
		if (sticky && !openTokens && delimStart > lastOuterEnd) break;
		if (leftMatch) {
			if (!openTokens++) {
				outerStart = delimStart;
				innerStart = delimEnd
			}
		} else if (rightMatch && openTokens) {
			if (!--openTokens) {
				if (vN) {
					if (vN[0] && outerStart > lastOuterEnd) output.push([vN[0], a.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart]);
					if (vN[1]) output.push([vN[1], a.slice(outerStart, innerStart), outerStart, innerStart]);
					if (vN[2]) output.push([vN[2], a.slice(innerStart, delimStart), innerStart, delimStart]);
					if (vN[3]) output.push([vN[3], a.slice(delimStart, delimEnd), delimStart, delimEnd])
				} else {
					output.push(a.slice(innerStart, delimStart))
				}
				lastOuterEnd = delimEnd;
				if (!global) break
			}
		} else {
			b.lastIndex = c.lastIndex = 0;
			throw Error("subject data contains unbalanced delimiters")
		}
		if (delimStart === delimEnd) delimEnd++
	}
	if (global && !sticky && vN && vN[0] && a.length > lastOuterEnd) output.push([vN[0], a.slice(lastOuterEnd), lastOuterEnd, a.length]);
	b.lastIndex = c.lastIndex = 0;
	return output
};
