Index: trunk/calendar_new/xsl/viewMonth.xsl
===================================================================
--- trunk/calendar_new/xsl/viewMonth.xsl	(revision 420)
+++ trunk/calendar_new/xsl/viewMonth.xsl	(revision 429)
@@ -4,32 +4,35 @@
 <xsl:variable name="today" select="today" />
 <div id="day">
-        <div id="{$today}"></div>
+	<div id="{$today}"></div>
 </div>
 <div width="100%" class="title" align="left" ><label id="l_date"></label><br/><br/>
-<table class="table_common" width="100%" cellpadding="0" cellspacing="0" border="0">
-	<tr class="td_common" height="100%" width="1%">
+	<table class="table_common" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
+		<tbody>
+			<tr class="td_common" width="1%">
 
-			<table class="table_common" height="100%" width="100%" cellpadding="0" cellspacing="0">
-				<tr id="tr_week">
-					<xsl:for-each select="dayofweek">
-						<xsl:variable name="dayName" select="dayname" />
-						<td id="weekHeader_{$dayName}" class="td_header" height="1%">
-							<xsl:value-of select='$dayName' />
-						</td>
-					</xsl:for-each>
-				</tr>
-				<xsl:for-each select="/retorno/workWeek">
+				<table class="table_common" height="100%" width="100%" cellpadding="0" cellspacing="0">
+					<tr id="tr_week">
+						<xsl:for-each select="dayofweek">
+							<xsl:variable name="dayName" select="dayname" />
+							<td id="weekHeader_{$dayName}" class="td_header" height="1%">
+								<xsl:value-of select='$dayName' />
+							</td>
+						</xsl:for-each>
+					</tr>
+					<xsl:for-each select="/retorno/workWeek">
 						<tr>
 							<xsl:for-each select="workday">
 								<xsl:variable name="day" select="id" />
 								<td class="td_day" id="{$day}">
+									<xsl:value-of select='substring($day,5,2)' />
 								</td>
 							</xsl:for-each>
 						</tr>
-				</xsl:for-each>
+					</xsl:for-each>
 
-			</table>	
-	</tr>
-</table>	
+				</table>	
+			</tr>
+		</tbody>
+	</table>	
 </div>
 <div id="returnEvents">
Index: trunk/calendar_new/xsl/viewDay.xsl
===================================================================
--- trunk/calendar_new/xsl/viewDay.xsl	(revision 420)
+++ trunk/calendar_new/xsl/viewDay.xsl	(revision 429)
@@ -7,5 +7,5 @@
 </div>
 <div width="100%" class="title" align="left" ><label id="l_date"></label><br/><br/>
-<table class="table_common" height="50%" width="800" cellpadding="0" cellspacing="0">
+<table class="table_common" height="50%" width="100%" cellpadding="0" cellspacing="0">
 <xsl:for-each select="workday">
 	<tr>
Index: trunk/calendar_new/inc/class.uicalendar.inc.php
===================================================================
--- trunk/calendar_new/inc/class.uicalendar.inc.php	(revision 420)
+++ trunk/calendar_new/inc/class.uicalendar.inc.php	(revision 429)
@@ -107,8 +107,8 @@
 			$retorno .= "</workday>";
 		}
-		$currentWeekDay = date('w', mktime());
+		$currentWeekDay = date('w', $dayViewTime);
 
 		for($i = $this->workweekstarts; $i <= $this->workweekends; $i++){
-			$retorno.= "<workweek><dayid>".date("Ydm", time() - (($currentWeekDay-$i)*60*60*24))."</dayid><dayofweek>".$this->daysofweek[$i]."</dayofweek></workweek>";
+			$retorno.= "<workweek><dayid>".date("Ydm", $dayViewTime - (($currentWeekDay-$i)*60*60*24))."</dayid><dayofweek>".$this->daysofweek[$i]."</dayofweek></workweek>";
 		 }
 
@@ -136,11 +136,11 @@
 		for ($i=1;$i<=date('t');$i+=7){
 			$retorno.= "<workWeek>";
-			$retorno.= "<workday><id>".date('Y').$i.date('m')."0000</id></workday>";
-			$retorno.= "<workday><id>".date('Y').($i+1).date('m')."0000</id></workday>";
-			$retorno.= "<workday><id>".date('Y').($i+2).date('m')."0000</id></workday>";
-			$retorno.= "<workday><id>".date('Y').($i+3).date('m')."0000</id></workday>";
-			$retorno.= "<workday><id>".date('Y').($i+4).date('m')."0000</id></workday>";
-			$retorno.= "<workday><id>".date('Y').($i+5).date('m')."0000</id></workday>";
-			$retorno.= "<workday><id>".(date('Y').$i+6).date('m')."0000</id></workday>";
+			$retorno.= "<workday><id>".date('Y').($i<10?"0":"").$i.date('m')."0000</id></workday>";
+			$retorno.= "<workday><id>".date('Y').($i<9?"0":"").($i+1).date('m')."0000</id></workday>";
+			$retorno.= "<workday><id>".date('Y').($i<8?"0":"").($i+2).date('m')."0000</id></workday>";
+			$retorno.= "<workday><id>".date('Y').($i<7?"0":"").($i+3).date('m')."0000</id></workday>";
+			$retorno.= "<workday><id>".date('Y').($i<6?"0":"").($i+4).date('m')."0000</id></workday>";
+			$retorno.= "<workday><id>".date('Y').($i<5?"0":"").($i+5).date('m')."0000</id></workday>";
+			$retorno.= "<workday><id>".(date('Y').($i<4?"0":"").$i+6).date('m')."0000</id></workday>";
 			$retorno.= "</workWeek>";
 		}
Index: trunk/calendar_new/js/drag_area.js
===================================================================
--- trunk/calendar_new/js/drag_area.js	(revision 420)
+++ trunk/calendar_new/js/drag_area.js	(revision 429)
@@ -81,6 +81,6 @@
 	
 	if(_button != 2 && _button != 3) {
-		if (this.resizing == 0){
-			if((parseInt(id) > 0) && (id.length == 12))
+		if((parseInt(id) > 0) && (id.length == 12))
+			if (this.resizing == 0){
 				calendar.dialog();
 		}else{
Index: trunk/calendar_new/js/calendar_functions.js
===================================================================
--- trunk/calendar_new/js/calendar_functions.js	(revision 420)
+++ trunk/calendar_new/js/calendar_functions.js	(revision 429)
@@ -74,16 +74,19 @@
 
 			if (viewType == "Week"){
-				this.previousView = document.getElementById('day').firstChild.id;
-				this.nextView = document.getElementById('day').firstChild.id;
-				var dayInt = parseInt(this.nextView.substr(4,2),10)+7;
-				this.nextView = this.nextView.substr(0,4)+(dayInt+7)+this.nextView.substr(6,2);
+				var previousWeek = new Date;
+				previousWeek.setTime(id2timeStamp(document.getElementById('day').firstChild.id)-(60*60*24*7*1000));
+				this.previousView = previousWeek.getYear()+1900+""+(previousWeek.getDate()<10?"0":"")+previousWeek.getDate()+""+(previousWeek.getMonth()+1<10?"0":"")+(previousWeek.getMonth()+1);	
+				var nextWeek = new Date;
+				nextWeek.setTime(id2timeStamp(document.getElementById('day').firstChild.id));
+				nextWeek.setDate(nextWeek.getDate()+7); 
+				this.nextView = nextWeek.getYear()+1900+""+(nextWeek.getDate()<10?"0":"")+nextWeek.getDate()+""+(nextWeek.getMonth()+1<10?"0":"")+(nextWeek.getMonth()+1);
 				}
 			if (viewType == "Day"){
-				this.nextView = document.getElementById('day').firstChild.id;
-				this.previousView = document.getElementById('day').firstChild.id;
-				var dayInt = parseInt(this.nextView.substr(4,2),10);
-				this.nextView = this.nextView.substr(0,4)+(dayInt+1)+this.nextView.substr(6,2);
-				var dayInt = parseInt(this.previousView.substr(4,2),10);   
-				this.previousView = this.previousView.substr(0,4)+(dayInt-1)+this.previousView.substr(6,2);
+				var previousDay = new Date;
+				previousDay.setTime(id2timeStamp(document.getElementById('day').firstChild.id)-(60*60*24*1000));
+				this.previousView = previousDay.getYear()+1900+""+(previousDay.getDate()<10?"0":"")+previousDay.getDate()+""+(previousDay.getMonth()+1<10?"0":"")+(previousDay.getMonth()+1);
+				var nextDay = new Date;
+				nextDay.setTime(id2timeStamp(document.getElementById('day').firstChild.id)+(60*60*24*1000));
+				this.nextView = nextDay.getYear()+1900+""+(nextDay.getDate()<10?"0":"")+nextDay.getDate()+""+(nextDay.getMonth()+1<10?"0":"")+(nextDay.getMonth()+1);
 			}
 			document.getElementById("l_date").innerHTML =  "<a href=\"javascript:calendar.getView('div_main','"+viewType+"','&time='+this.previousView);\">\<\<&nbsp;</a>";
Index: trunk/calendar_new/templates/default/main.css
===================================================================
--- trunk/calendar_new/templates/default/main.css	(revision 420)
+++ trunk/calendar_new/templates/default/main.css	(revision 429)
@@ -29,5 +29,5 @@
 /*	 height: 15px;*/
 	 color: darkblue;
-	 text-align:center;
+	 text-align:left;
 	 font-size: 0.8em;
 	 font-family:arial, verdana;
