CodeHighlighter.addStyle("ruby",{
	comment : {
		exp  : /#[^\n]*/
	},
	brackets : {
		exp  : /\(|\)|\[|\]|\{|\}/
	},
	string : {
		exp  : /'[^']*'|"[^"]*"/
	},
	keywords : {
		exp  : /\b(do|end|self|class|def|if|module|yield|then|else|for|until|unless|while|elsif|case|when|break|retry|redo|rescue|require|raise)\b/
	},
	constants : {
	  exp  : /\b(true|false|__[A-Z][^\W]+|[A-Z]\w+)\b/
	},
	symbol : {
	  exp  : /:[^\W]+/
	},
	instance : {
	  exp  : /@+[^\W]+/
	},
	method : {
	  exp  : /[^\w]*\.(\w*)[!?]*/
	}
});


CodeHighlighter.addStyle("css", {
	comment : {
		exp  : /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
	},
	keywords : {
		exp  : /@\w[\w\s]*/
	},
	selectors : {
		exp  : "([\\w-:\\[.#][^{};>]*)(?={)"
	},
	properties : {
		exp  : "([\\w-]+)(?=\\s*:)"
	},
	units : {
		exp  : /([0-9])(em|en|px|%|pt)\b/,
		replacement : "$1<span class=\"$0\">$2</span>"
	},
	urls : {
		exp  : /url\([^\)]*\)/
	}
 });


CodeHighlighter.addStyle("html", {
	comment : {
		exp: /&lt;!\s*(--([^-]|[\r\n]|-[^-])*--\s*)&gt;/
	},
	tag : {
		exp: /(&lt;\/?)([a-zA-Z]+\s?)/, 
		replacement: "$1<span class=\"$0\">$2</span>"
	},
	string : {
		exp  : /'[^']*'|"[^"]*"/
	},
	attribute : {
		exp: /\b([a-zA-Z-:]+)(=)/, 
		replacement: "<span class=\"$0\">$1</span>$2"
	},
	doctype : {
		exp: /&lt;!DOCTYPE([^&]|&[^g]|&g[^t])*&gt;/
	}
});


CodeHighlighter.addStyle("javascript",{
	comment : {
		exp  : /(\/\/[^\n]*(\n|$))|(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)/
	},
	brackets : {
		exp  : /\(|\)/
	},
	regex : {
         exp : /\/(.*?)[g|s|m]?\/[;|\n]/
  },
	string : {
		exp  : /'(?:\.|(\\\')|[^\''])*'|"(?:\.|(\\\")|[^\""])*"/
	},
	keywords : {
		exp  : /\b(arguments|break|case|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|typeof|var|void|while|with)\b/
	},
	global : {
		exp  : /\b(toString|valueOf|window|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/
	}
});



CodeHighlighter.addStyle("chat", {
  line: {
	  exp: /([a-zA-Z]+)\s*[-|:]\s*(.+?)\n/,
	  replacement: "<p class=\"line\"><span class=\"person\">$1:</span> $2</p>"
	}
});


CodeHighlighter.addStyle("objc",{
	imp : {
		exp  : /^@(interface|protocol|implementation)\b/
	},
	brackets : {
		exp  : /\(|\)|\[|\]|\{|\}/
	},
	string : {
		exp  : /@"[^"]*"/
	},
	keywords : {
		exp  : /\b(do|end|self|class|def|if|module|yield|then|else|for|until|unless|while|elsif|case|when|break|retry|redo|rescue|require|raise)\b/
	},
	constants : {
	  exp  : /\b(true|false|__[A-Z][^\W]+|[A-Z]\w+)\b/
	},
	symbol : {
	  exp  : /:[^\W]+/
	},
	instance : {
	  exp  : /@+[^\W]+/
	},
	method : {
	  exp  : /[^\w]*\.(\w*)[!?]*/
	}
});

///////////////////////////////////////////////////////////////////

document.observe("dom:loaded", function() {
  if(Prototype.Browser.WebKit) {
    document.body.className = 'safari';
  }
  
  $$('#sbody span.pullquote').each(function(quote) {
    var oldquote = quote;
    var newquote = $($blockquote($p(quote.innerHTML)));
    newquote.addClassName('pullquote');
    quote.parentNode.appendChild(newquote);
  });

	var selection;
  if(window.getSelection)
    selection = window.getSelection();
  else if(document.selection)
    selection = document.selection.createRange();
	


});
