diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index 350a968cc3..da2ae00a75 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,14 @@
+2009-01-26  Esteban Sanchez  <estebans@artica.es>
+
+	* include/functions_ui.php: print_alert_template_example() now
+	replaces also the value.
+
+	* godmode/alerts/configure_alert_template.php: Removed first render
+	example using javascript.
+
+	* godmode/alerts/alert_templates.php: Removed parameter replacement
+	since it's now done in the function.
+
 2009-01-24  Raul Mateos  <raulofpandora@gmail.com>
 
 	* install.php: Added code to show current console URL in step 3. 
diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php
index 8dcbcf5a2a..e45184d0f0 100644
--- a/pandora_console/godmode/alerts/alert_templates.php
+++ b/pandora_console/godmode/alerts/alert_templates.php
@@ -44,12 +44,7 @@ if (defined ('AJAX')) {
 		echo get_alert_templates_type_name ($template['type']);
 		
 		echo '<br />';
-		$example = print_alert_template_example ($template['id'], true);
-		
-		$example = str_replace ('<span id="value"></span>', $template['value'], $example);
-		$example = str_replace ('<span id="max"></span>', $template['max_value'], $example);
-		$example = str_replace ('<span id="min"></span>', $template['min_value'], $example);
-		echo $example;
+		echo print_alert_template_example ($template['id'], true);
 		
 		echo '<br />';
 		
diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php
index 439734ed2f..a23ac6f055 100644
--- a/pandora_console/godmode/alerts/configure_alert_template.php
+++ b/pandora_console/godmode/alerts/configure_alert_template.php
@@ -548,7 +548,6 @@ function render_example () {
 }
 
 $(document).ready (function () {
-	render_example ();
 	$("#text-time_from, #text-time_to").timeEntry ({
 		spinnerImage: 'images/time-entry.png',
 		spinnerSize: [20, 20, 0]
diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php
index d6af549c89..b648f5118d 100644
--- a/pandora_console/include/functions_ui.php
+++ b/pandora_console/include/functions_ui.php
@@ -323,48 +323,51 @@ function print_alert_template_example ($id_alert_template, $return = false) {
 	
 	$output .= '<img src="images/information.png" /> ';
 	$output .= '<span id="example">';
+	$template = get_alert_template ($id_alert_template);
 	
-	if ($id_alert_template) {
-		$template = get_alert_template ($id_alert_template);
+	switch ($template['type']) {
+	case 'equal':
+		/* Do not translate the HTML attributes */
+		$output .= __('The alert would fire when the value is <span id="value"></span>');
+		break;
+	case 'not_equal':
+		/* Do not translate the HTML attributes */
+		$output .= __('The alert would fire when the value is not <span id="value"></span>');
+		break;
+	case 'regex':
+		if ($template['matches_value'])
+			/* Do not translate the HTML attributes */
+			$output .= __('The alert would fire when the value matches <span id="value"></span>');
+		else
+			/* Do not translate the HTML attributes */
+			$output .= __('The alert would fire when the value doesn\'t match <span id="value"></span>');
+		$value = $template['value'];
+		break;
+	case 'max_min':
+		if ($template['matches_value'])
+			/* Do not translate the HTML attributes */
+			$output .= __('The alert would fire when the value is between <span id="min"></span> and <span id="max"></span>');
+		else
+			/* Do not translate the HTML attributes */
+			$output .= __('The alert would fire when the value is not between <span id="min"></span> and <span id="max"></span>');
+		break;
+	case 'max':
+		/* Do not translate the HTML attributes */
+		$output .= __('The alert would fire when the value is over <span id="max"></span>');
 		
-		switch ($template['type']) {
-		case 'not_equal':
-			/* Do not translate the HTML attributes */
-			$output .= __('The alert would fire when the value is <span id="value"></span>');
-			break;
-		case 'equal':
-			/* Do not translate the HTML attributes */
-			$output .= __('The alert would fire when the value is not <span id="value"></span>');
-			break;
-		case 'regex':
-			if ($template['matches_value'])
-				/* Do not translate the HTML attributes */
-				$output .= __('The alert would fire when the value matches <span id="value"></span>');
-			else
-				/* Do not translate the HTML attributes */
-				$output .= __('The alert would fire when the value doesn\'t match <span id="value"></span>');
-			$value = $template['value'];
-			break;
-		case 'max_min':
-			if ($template['matches_value'])
-				/* Do not translate the HTML attributes */
-				$output .= __('The alert would fire when the value is between <span id="min"></span> and <span id="max"></span>');
-			else
-				/* Do not translate the HTML attributes */
-				$output .= __('The alert would fire when the value is not between <span id="min"></span> and <span id="max"></span>');
-			break;
-		case 'max':
-			/* Do not translate the HTML attributes */
-			$output .= __('The alert would fire when the value is over <span id="max"></span>');
-			
-			break;
-		case 'min':
-			/* Do not translate the HTML attributes */
-			$output .= __('The alert would fire when the value is under <span id="min"></span>');
-			break;
-		}
+		break;
+	case 'min':
+		/* Do not translate the HTML attributes */
+		$output .= __('The alert would fire when the value is under <span id="min"></span>');
+		break;
 	}
 	
+	/* Replace span elements with real values. This is done in such way to avoid
+	 duplicating strings and make it easily modificable via Javascript. */
+	$output = str_replace ('<span id="value"></span>', $template['value'], $output);
+	$output = str_replace ('<span id="max"></span>', $template['max_value'], $output);
+	$output = str_replace ('<span id="min"></span>', $template['min_value'], $output);
+	
 	$output .= '</span>';
 	if ($return)
 		return $output;