$(function(){

	
			
	if(hasCSS()){ //If CSS is on, do the following	
					
	
	//Live Preview code from www.learningjquery.com/2006/11/really-simple-live-comment-preview   
	$('#comment_textarea').one('focus',function() {
		$('#comment_textarea').parent().after('<div id="preview-box"><div class="comment-by">Live Comment Preview</div><div id="live-preview"></div></div>');
	  });
	  	var $comment = ''; // that's two single quotation-marks at the end
	  $('#comment_textarea').keyup(function() {
		$comment = $(this).val();
		$comment = $comment.replace(/\n/g, "<br />").replace(/\n\n+/g, '<br /><br />').replace(/(<\/?)script/g,"$1noscript");
		$('#live-preview').html( $comment );
	  });
	
	}

}); 

