Index: /trunk/web/addons/toga/host_view.php
===================================================================
--- /trunk/web/addons/toga/host_view.php	(revision 188)
+++ /trunk/web/addons/toga/host_view.php	(revision 189)
@@ -6,4 +6,34 @@
 //$tpl->prepare();
 
+function datetimeToEpoch( $datetime ) {
+
+        //printf("datetime = %s\n", $datetime );
+        $datetime_fields = explode( ' ', $datetime );
+
+        $date = $datetime_fields[0];
+        $time = $datetime_fields[1];
+
+        $date_fields = explode( '-', $date );
+
+        $days = $date_fields[0];
+        $months = $date_fields[1];
+        $years = $date_fields[2];
+
+        //printf( "days = %s months = %s years = %s\n", $days, $months, $years );
+
+        $time_fields = explode( ':', $time );
+
+        $hours = $time_fields[0];
+        $minutes = $time_fields[1];
+        $seconds = $time_fields[2];
+
+        //printf( "hours = %s minutes = %s seconds = %s\n", $hours, $minutes, $seconds );
+
+        $timestamp = mktime( $hours, $minutes, $seconds, $months, $days, $years );
+
+        //printf( "timestamp = %s\n", $timestamp );
+
+        return $timestamp;
+}
 
 function makeHostView() {
@@ -24,4 +54,11 @@
 	$tpl->assign("sort",$sort);
 	$tpl->assign("range",$range);
+
+	if( !is_numeric( $period_start ) ) {
+		$period_start = datetimeToEpoch( $period_start );
+	}
+	if( !is_numeric( $period_stop ) ) {
+		$period_stop = datetimeToEpoch( $period_stop );
+	}
 
 	if($hosts_up)
Index: /trunk/web/addons/toga/index.php
===================================================================
--- /trunk/web/addons/toga/index.php	(revision 188)
+++ /trunk/web/addons/toga/index.php	(revision 189)
@@ -59,4 +59,9 @@
 //if( isset($id) && ($id!='')) $filter[id]=$id;
 
+function epochToDatetime( $epoch ) {
+
+        return strftime( "%d-%m-%Y %H:%M:%S", $epoch );
+}
+
 function makeHeader() {
 
@@ -69,4 +74,5 @@
 	global $default_refresh, $filterorder, $view;
 	global $TARCHD, $period_start, $period_stop, $h, $id;
+	global $job_start, $job_stop;
 	
 	if( isset($default_metric) and !isset($m) )
@@ -223,9 +229,60 @@
 	}
 
-	if( $view == "search" ) {
+	$m = $metricname;
+
+
+	$tpl->gotoBlock( "_ROOT" );
+	$tpl->assignGlobal("view", $view);
+
+	if( array_key_exists( "id", $filter ) or isset($hostname) ) {
+
+		//print_r( $context_metrics );
+
+		if( !isset( $hostname ) ) {
+
+			if (is_array($context_metrics) ) {
+				$metric_menu = "<B>Metric</B>&nbsp;&nbsp;"
+					."<SELECT NAME=\"m\" OnChange=\"".$form_name.".submit();\">\n";
+
+				sort($context_metrics);
+				foreach( $context_metrics as $k ) {
+					$url = rawurlencode($k);
+					$metric_menu .= "<OPTION VALUE=\"$url\" ";
+					if ($k == $metricname )
+						$metric_menu .= "SELECTED";
+					$metric_menu .= ">$k\n";
+				}
+				$metric_menu .= "</SELECT>\n";
+
+			}
+		}
+
+		$tpl->assign("metric_menu", $metric_menu );
+
+		if( $view == "search" or $view == "host" ) {
+			$tpl->newBlock("timeperiod");
+			if( is_numeric( $period_start ) ) {
+				$period_start = epochToDatetime( $period_start );
+			}
+			if( is_numeric( $period_stop ) ) {
+				$period_stop = epochToDatetime( $period_stop );
+			}
+			$tpl->assign("period_start", $period_start );
+			$tpl->assign("period_stop", $period_stop );
+			$tpl->assign("hostname", $hostname );
+
+			if( $view == "host" ) {
+				$tpl->newBlock("hostview");
+				$tpl->assign("job_start", $job_start );
+				$tpl->assign("job_stop", $job_stop );
+			}
+		} 
+
+	}
+
+	if( $view == "search" or $view == "host" ) {
 
 		$node_menu .= "<B>&gt;</B>\n";
 		$node_menu .= "<B>Jobarchive</B> ";
-		$tpl->assign("view", "search" );
 		$form_name = "archive_search_form";
 		$tpl->assignGlobal("form_name", $form_name );
@@ -234,32 +291,5 @@
 		$form_name = "toga_form";
 		$tpl->assignGlobal("form_name", $form_name );
-		$tpl->assign("view", "overview" );
-	}
-
-	$tpl->assign("node_menu", $node_menu);
-
-	if( array_key_exists( "id", $filter ) ) {
-
-		//print_r( $context_metrics );
-
-		if (is_array($context_metrics) ) {
-			$metric_menu = "<B>Metric</B>&nbsp;&nbsp;"
-				."<SELECT NAME=\"m\" OnChange=\"".$form_name.".submit();\">\n";
-
-			sort($context_metrics);
-			foreach( $context_metrics as $k ) {
-				$url = rawurlencode($k);
-				$metric_menu .= "<OPTION VALUE=\"$url\" ";
-				if ($k == $metricname )
-					$metric_menu .= "SELECTED";
-				$metric_menu .= ">$k\n";
-			}
-			$metric_menu .= "</SELECT>\n";
-
-		}
-
-		$tpl->assign("metric_menu", $metric_menu );
-	}
-	$m = $metricname;
+	}
 
 	if( $TARCHD ) {
@@ -267,6 +297,8 @@
 		$tpl->assignGlobal( "cluster_url", rawurlencode($clustername) );
 		$tpl->assignGlobal( "cluster", $clustername );
-		$tpl->gotoBlock( "_ROOT" );
-	}
+	}
+	$tpl->gotoBlock( "_ROOT" );
+	$tpl->assignGlobal( "cluster", $clustername );
+	$tpl->assign("node_menu", $node_menu);
 
 	# Make sure that no data is cached..
Index: /trunk/web/addons/toga/search.php
===================================================================
--- /trunk/web/addons/toga/search.php	(revision 188)
+++ /trunk/web/addons/toga/search.php	(revision 189)
@@ -165,9 +165,4 @@
 
 	return $timestamp;
-}
-
-function epochToDatetime( $epoch ) {
-
-	return strftime( "%d-%m-%Y %H:%M:%S", $epoch );
 }
 
@@ -446,6 +441,10 @@
 				//printf("start = %s stop = %s\n", $start, $stop );
 
+		                $tpl->gotoBlock( "timeperiod" );
+
 				$tpl->assign("period_start", epochToDatetime( $period_start ) );
 				$tpl->assign("period_stop", epochToDatetime( $period_stop ) );
+
+		                $tpl->gotoBlock( "_ROOT" );
 
 				$hosts_up = array();
Index: /trunk/web/addons/toga/templates/header.tpl
===================================================================
--- /trunk/web/addons/toga/templates/header.tpl	(revision 188)
+++ /trunk/web/addons/toga/templates/header.tpl	(revision 189)
@@ -6,8 +6,20 @@
 <META http-equiv="refresh" content="{refresh}{redirect}" >
 <LINK rel="stylesheet" href="./styles.css" type="text/css">
+<SCRIPT LANGUAGE="javascript" SRC="ts_picker.js"></SCRIPT>
+<SCRIPT LANGUAGE="javascript">
+
+        function setPeriodTimestamps() {
+
+                document.{form_name}.period_start.value = document.{form_name}.period_start_pick.value;
+                document.{form_name}.period_stop.value = document.{form_name}.period_stop_pick.value;
+        }
+
+</SCRIPT>
 </HEAD>
 <BODY BGCOLOR="#FFFFFF">
 
-<FORM ACTION="./?c={cluster}&view={view}" METHOD="GET" NAME="{form_name}">
+<FORM ACTION="./" METHOD="GET" NAME="{form_name}">
+<INPUT TYPE="HIDDEN" NAME="c" VALUE="{cluster}">
+<INPUT TYPE="HIDDEN" NAME="view" VALUE="{view}">
 <TABLE WIDTH="100%">
 <TR>
@@ -35,5 +47,28 @@
      {metric_menu} &nbsp;&nbsp;
      {range_menu}&nbsp;&nbsp;
-     {sort_menu}
+     {sort_menu}&nbsp;&nbsp;
+<!-- START BLOCK : timeperiod -->
+    <INPUT TYPE="HIDDEN" NAME="period_start" VALUE="{period_start}">
+    <INPUT TYPE="HIDDEN" NAME="period_stop" VALUE="{period_stop}">
+    <INPUT TYPE="HIDDEN" NAME="h" VALUE="{hostname}">
+    <BR><BR><B>Graph timeperiod/ from
+    <INPUT TYPE="text" NAME="period_start_pick" VALUE="{period_start}" ALT="Start time" DISABLED="TRUE">
+    <a href="javascript:show_calendar('document.{form_name}.period_start_pick', document.{form_name}.period_start_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
+    <img src="cal.gif" width="16" height="16" border="0"></a>
+    <a href="#" onClick="javascript: document.{form_name}.period_start_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
+    <IMG SRC="redcross.jpg" BORDER=0></A>
+    to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{period_stop}" ALT="Stop time" DISABLED="TRUE">
+    <a href="javascript:show_calendar('document.{form_name}.period_stop_pick', document.{form_name}.period_stop_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
+    <img src="cal.gif" width="16" height="16" border="0"></a>
+    <a href="#" onClick="javascript: document.{form_name}.period_stop_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
+    </B>
+    <IMG SRC="redcross.jpg" BORDER=0></A>
+
+<!-- START BLOCK : hostview -->
+    <INPUT TYPE="HIDDEN" NAME="job_start" VALUE="{job_start}">
+    <INPUT TYPE="HIDDEN" NAME="job_stop" VALUE="{job_stop}">
+<!-- END BLOCK : hostview -->
+    <INPUT TYPE="submit" onClick="setPeriodTimestamps();" VALUE="Refresh graphs">
+<!-- END BLOCK : timeperiod -->
      </TD>
      <TD>
Index: /trunk/web/addons/toga/templates/search.tpl
===================================================================
--- /trunk/web/addons/toga/templates/search.tpl	(revision 188)
+++ /trunk/web/addons/toga/templates/search.tpl	(revision 189)
@@ -1,5 +1,4 @@
 <CENTER>
 
-<SCRIPT LANGUAGE="javascript" SRC="ts_picker.js"></SCRIPT>
 <SCRIPT LANGUAGE="javascript">
 function setSort( sortbyval ) {
@@ -50,15 +49,9 @@
 	}
 
-	function setPeriodTimestamps() {
-
-		document.archive_search_form.period_start.value = document.archive_search_form.period_start_pick.value; 
-		document.archive_search_form.period_stop.value = document.archive_search_form.period_stop_pick.value;
-	}
-
 </SCRIPT>
 
-<FORM NAME="archive_search_form" ACTION="./">
-
-<INPUT TYPE="hidden" NAME="view" VALUE="search">
+<!-- <FORM NAME="archive_search_form" ACTION="./"> -->
+
+<!-- <INPUT TYPE="hidden" NAME="view" VALUE="search"> -->
 
 <BR><BR>
@@ -258,20 +251,4 @@
    Columns&nbsp;&nbsp;{cols_menu}
    </FONT><BR>
-<FONT SIZE="-1">
-    <INPUT TYPE="HIDDEN" NAME="period_start" VALUE="{period_start}">
-    <INPUT TYPE="HIDDEN" NAME="period_stop" VALUE="{period_stop}">
-    Graph timeperiod from 
-    <INPUT TYPE="text" NAME="period_start_pick" VALUE="{period_start}" ALT="Start time" DISABLED="TRUE">
-    <a href="javascript:show_calendar('document.archive_search_form.period_start_pick', document.archive_search_form.period_start_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
-    <img src="cal.gif" width="16" height="16" border="0"></a> 
-    <a href="#" onClick="javascript: document.archive_search_form.period_start_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
-    <IMG SRC="redcross.jpg" BORDER=0></A>
-    to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{period_stop}" ALT="Stop time" DISABLED="TRUE">
-    <a href="javascript:show_calendar('document.archive_search_form.period_stop_pick', document.archive_search_form.period_stop_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
-    <img src="cal.gif" width="16" height="16" border="0"></a> 
-    <a href="#" onClick="javascript: document.archive_search_form.period_stop_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
-    <IMG SRC="redcross.jpg" BORDER=0></A>
-    <INPUT TYPE="submit" onClick="setPeriodTimestamps();" VALUE="Refresh graphs">
-   </FONT>
   </TD>
 </TR>
