diff --git a/blocks/mrbs/block_mrbs.php b/blocks/mrbs/block_mrbs.php
index a79becd..93f2158 100644
--- a/blocks/mrbs/block_mrbs.php
+++ b/blocks/mrbs/block_mrbs.php
@@ -5,7 +5,7 @@ class block_mrbs extends block_base {
     function init() {
         $this->title = get_string('blockname','block_mrbs');
         $this->content_type = BLOCK_TYPE_TEXT;
-        $this->version = 2009060100;
+        $this->version = 2009061900;
         $this->cron=300;
     }
     function has_config() {return true;}
@@ -25,9 +25,9 @@ class block_mrbs extends block_base {
         $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
 //        $context = get_context_instance(CONTEXT_BLOCK, $this->instance->id));
 //        Not sure which context to use... Should this be defined site level or course level?
-//        Defining as Site level        
-        if ( has_capability('block/mrbs:viewmrbs', $context) or has_capability('block/mrbs:editmrbs', $context) or has_capability('block/mrbs:administermrbs', $context)) {         
-        
+//        Defining as Site level
+        if ( has_capability('block/mrbs:viewmrbs', $context) or has_capability('block/mrbs:editmrbs', $context) or has_capability('block/mrbs:administermrbs', $context)) {
+
             if (isset($CFG->block_mrbs_serverpath)) {
 			    $serverpath = $CFG->block_mrbs_serverpath;
 			    }
@@ -36,11 +36,11 @@ class block_mrbs extends block_base {
 				}
             $go = get_string('accessmrbs', 'block_mrbs');
             if ($cfg_mrbs->newwindow) {
-                $this->content->text = '<a href="'.$serverpath.'/index.php" target="_blank">' . 
+                $this->content->text = '<a href="'.$serverpath.'/index.php" target="_blank">' .
                 '<img src="' . $CFG->pixpath . '/f/web.gif" height="16" width="16" alt="" /> &nbsp;' . $go . ' </a>';
                 $this->content->footer = '';
             } else {
-                $this->content->text = '<a href="'.$serverpath.'/index.php">' . 
+                $this->content->text = '<a href="'.$serverpath.'/index.php">' .
                 '<img src="' . $CFG->pixpath . '/f/web.gif" height="16" width="16" alt="" /> &nbsp;' . $go . ' </a>';
                 $this->content->footer = '';
             }
@@ -51,7 +51,7 @@ class block_mrbs extends block_base {
     function cron(){
         global $CFG;
         include($CFG->dirroot.'/blocks/mrbs/import.php');
-        
+
         //doesn't seem to update this automatically?
         $mrbsblock=get_record('block','name','mrbs');
         $mrbsblock->lastcron=mktime();
diff --git a/blocks/mrbs/db/access.php b/blocks/mrbs/db/access.php
index 325149e..e414bcd 100644
--- a/blocks/mrbs/db/access.php
+++ b/blocks/mrbs/db/access.php
@@ -86,6 +86,15 @@ $block_mrbs_capabilities = array(
         'legacy' => array(
             'admin' => CAP_ALLOW
         )
+    ),
+
+    'block/mrbs:doublebook' => array(
+
+        'captype' => 'write',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'admin' => CAP_ALLOW
+        )
     )
 
 );
diff --git a/blocks/mrbs/lang/en_utf8/block_mrbs.php b/blocks/mrbs/lang/en_utf8/block_mrbs.php
index 1bfab24..d2d19df 100644
--- a/blocks/mrbs/lang/en_utf8/block_mrbs.php
+++ b/blocks/mrbs/lang/en_utf8/block_mrbs.php
@@ -132,6 +132,11 @@ $string['delete_user']        = 'Delete this user';
 $string['deleteentry']        = 'Delete Entry';
 $string['deletefollowing']    = 'This will delete the following bookings';
 $string['deleteseries']       = 'Delete Series';
+$string['dontshowoccupied']   = 'Don\'t show occupied rooms';
+$string['doublebookebody']    = 'The user $a->user has double booked your room, $a->room, at $a->time on $a->date.\nThis clashes with your booking for $a->oldbooking. The user has booked the room for $a->newbooking.\nIf this is not a problem, no action is required. However, if you weren\'t expecting this, please contact the user to resolve the conflict.\n\nThis message has been sent automatically by the online room booking system, if you think you have recieved this in error please contact $a->admin';
+$string['doublebookesubject'] = 'Double Booking Notification';
+$string['doublebookefailsubject'] = 'Double Booking Notification Faliure';
+$string['doublebookefailbody'] = 'The following message failed to send to $a:\n';
 $string['duration']           = 'Duration';
 $string['edit_user']          = 'Edit user';
 $string['editarea']           = 'Edit Area';
@@ -160,6 +165,7 @@ $string['gototoday']          = 'Go To Today';
 $string['highlight_line']     = 'Highlight this line';
 $string['hours']              = 'hours';
 $string['hybrid']            = 'hybrid';
+$string['idontcare']        = 'I don\'t care, double book the room(s)';
 $string['importedbooking']    = 'Imported Booking';
 $string['importedbookingmoved']    = 'Imported Booking (Edited)';
 $string['importlog']    = 'MRBS Import log';
diff --git a/blocks/mrbs/web/edit_entry.php b/blocks/mrbs/web/edit_entry.php
index 8108e2b..27b486b 100644
--- a/blocks/mrbs/web/edit_entry.php
+++ b/blocks/mrbs/web/edit_entry.php
@@ -440,7 +440,10 @@ this.document.writeln("</td></tr>");
         $room_names[$i] = $row[1];
    	}
   ?>
-  </select></td><td><?php echo get_string('ctrl_click','block_mrbs') ?></td></tr></table>
+  </select></td><td><?php echo get_string('ctrl_click','block_mrbs') ?></td></tr>
+  <tr><td><?php echo get_string('dontshowoccupied', 'block_mrbs') ?><input name="nooccupied" id="nooccupied" type="checkbox" checked="checked" onclick="updateFreeRooms()" /></td><td></td></tr>
+
+  </table>
     </td></tr>
 
 <TR><TD CLASS=CR><B><?php echo get_string('type','block_mrbs')?></B></TD>
@@ -470,7 +473,7 @@ Request equipment from: Premises<input type="checkbox" name="premises" value="TR
 <?php if(has_capability("block/mrbs:forcebook",get_context_instance(CONTEXT_SYSTEM))){
     echo'<b>Forceably book (automatically move other bookings):<input type="checkbox" name="forcebook" value="TRUE"';
     if ($force)echo '"CHECKED"';
-    echo' onClick="updateFreeRooms()">';
+    echo' onClick="document.getElementById(\'nooccupied\').checked=!this.checked; updateFreeRooms();">';
 }?>
 
 
diff --git a/blocks/mrbs/web/edit_entry_handler.php b/blocks/mrbs/web/edit_entry_handler.php
index dbdd213..8a071ca 100644
--- a/blocks/mrbs/web/edit_entry_handler.php
+++ b/blocks/mrbs/web/edit_entry_handler.php
@@ -228,8 +228,40 @@ foreach ( $rooms as $room_id ) {
          $forcemoveoutput.=mrbsForceMove($room_id,$starttime,$endtime,$name,$id);
          //do this so that it thinks no clashes were found
          $tmp='';
-    }else{
-    $err .= mrbsCheckFree($room_id, $starttime, $endtime-1, $ignore_id, 0);
+    } else if($doublebook and has_capability('block/mrbs:doublebook', get_context_instance(CONTEXT_SYSTEM))) {
+        $sql = 'SELECT entry.id AS entryid,
+                entry.name as entryname,
+                entry.create_by,
+                room.room_name,
+                entry.start_time,
+              FROM '.$CFG->prefix.'mrbs_entry as entry
+                join '.$CFG->prefix.'mrbs_room as room on entry.room_id = room.id
+             WHERE room.id = '.$room_id.'
+             AND ((entry.start_time>='.$starttime.' AND entry.end_time<'.$endtime.')
+             OR (entry.start_time<'.$starttime.' AND entry.end_time>'.$starttime.')
+             OR (entry.start_time<'.$endtime.' AND entry.end_time>='.$endtime.'))';
+        if($clashingbookings = get_records_sql($sql)) {
+            foreach($clashingbookings as $clashingbooking) {
+                $oldbookinguser = get_record('user', 'username', $clashingbooking->create_by);
+                $langvars->user = $USER->firstname.' '.$USER->lastname;
+                $langvars->room = $clashingbooking->room_name;
+                $langvars->time = to_hr_time($clashingbooking->start_time);
+                $langvars->date = userdate($clashingbooking->start_time, '%A %d/%m/%Y');
+                $langvars->oldbooking = $clashingbooking->entryname;
+                $langvars->newbooking = $name;
+                $langvars->admin = $mrbs_admin.' ('.$mrbs_admin_email.')';
+
+                // Send emails to user with existing booking
+                if(!email_to_user($oldbookinguser, $USER, get_string('doublebookesubject', 'block_mrbs'), get_string('doublebookebody', 'block_mrbs', $langvars))) {
+                    email_to_user(get_record('user', 'email', $mrbs_admin_email), $USER, get_string('doublebookefailsubject', 'block_mrbs'), get_string('doublebookefailbody', 'block_mrbs', $oldbookinguser->username).get_string('doublebookebody', 'block_mrbs', $langvars));
+                }
+            }
+
+        }
+
+    } else {
+        // If the user hasn't confirmed they want to double book, check the room is free.
+        $err .= mrbsCheckFree($room_id, $starttime, $endtime-1, $ignore_id, 0);
     }
 } # end foreach rooms
 
@@ -345,8 +377,41 @@ if(strlen($err))
         echo get_string('conflict','block_mrbs');
         echo "<UL>";
     }
-
     echo $err;
+    if(has_capability('block/mrbs:doublebook', get_context_instance(CONTEXT_SYSTEM))) {
+        echo '<form method="post" action="'.$CFG->wwwroot.'/blocks/mrbs/web/edit_entry_handler.php">';
+        echo '<input type="hidden" name="name" value="'.$name.'" />';
+        echo '<input type="hidden" name="description" value="'.$description.'" />';
+        echo '<input type="hidden" name="day" value="'.$day.'" />';
+        echo '<input type="hidden" name="month" value="'.$month.'" />';
+        echo '<input type="hidden" name="year" value="'.$year.'" />';
+        echo '<input type="hidden" name="area" value="'.$area.'" />';
+        echo '<input type="hidden" name="create_by" value="'.$create_by.'" />';
+        echo '<input type="hidden" name="id" value="'.$id.'" />';
+        echo '<input type="hidden" name="rep_type" value="'.$rep_type.'" />';
+        echo '<input type="hidden" name="rep_end_month" value="'.$rep_end_month.'" />';
+        echo '<input type="hidden" name="rep_end_day" value="'.$rep_end_day.'" />';
+        echo '<input type="hidden" name="rep_end_year" value="'.$rep_end_year.'" />';
+        echo '<input type="hidden" name="rep_num_weeks" value="'.$rep_num_weeks.'" />';
+        echo '<input type="hidden" name="rep_day" value="'.$rep_day.'" />';
+        echo '<input type="hidden" name="rep_opt" value="'.$rep_opt.'" />';
+        echo '<input type="hidden" name="rep_enddate" value="'.$rep_enddate.'" />';
+        echo '<input type="hidden" name="premises" value="'.$premises.'" />';
+        echo '<input type="hidden" name="itav" value="'.$itav.'" />';
+        echo '<input type="hidden" name="hour" value="'.$hour.'" />';
+        echo '<input type="hidden" name="minute" value="'.$minute.'" />';
+        echo '<input type="hidden" name="period" value="'.$period.'" />';
+        echo '<input type="hidden" name="duration" value="'.$duration.'" />';
+        echo '<input type="hidden" name="dur_units" value="'.$dur_units.'" />';
+        echo '<input type="hidden" name="type" value="'.$type.'" />';
+        foreach ($rooms as $room) {
+            echo '<input type="hidden" name="rooms[]" value="'.$room.'" />';
+        }
+        echo '<input type="hidden" name="doublebook" value="1" />';
+        echo '<input type="submit" name="submit" value="'.get_string('idontcare', 'block_mrbs').'" />';
+        echo '</form>';
+    }
+
 
     if(!isset($hide_title))
         echo "</UL>";
diff --git a/blocks/mrbs/web/force_book.php b/blocks/mrbs/web/force_book.php
index e597948..45f2f78 100644
--- a/blocks/mrbs/web/force_book.php
+++ b/blocks/mrbs/web/force_book.php
@@ -108,15 +108,4 @@ function mrbsForceMove($room_id, $starttime, $endtime,$name,$id=null){
     }
     return $output;
 }
-
-function to_hr_time($time){
-    $cfg_mrbs = get_config('block/mrbs');
-    if ($cfg_mrbs->enable_periods){
-        $periods=explode("\n",$cfg_mrbs->periods);
-        $period=intval(date('i',$time));
-        return trim($periods[$period]);
-    }else{
-        return date('G:i',$time);
-    }
-}
 ?>
\ No newline at end of file
diff --git a/blocks/mrbs/web/functions.php b/blocks/mrbs/web/functions.php
index 76336e7..82018ba 100644
--- a/blocks/mrbs/web/functions.php
+++ b/blocks/mrbs/web/functions.php
@@ -32,9 +32,9 @@ function print_header_mrbs($day=NULL, $month=NULL, $year=NULL, $area=NULL) //if
     $navigation = build_navigation($navlinks);
     print_header("$site->shortname: $strmrbs: $pagetitle", $strmrbs, $navigation,
                  '', '', true, '', user_login_string($site));
-    
-    
-	# If we dont know the right date then make it up 
+
+
+	# If we dont know the right date then make it up
 	if(!$day)
 		$day   = date("d");
 	if(!$month)
@@ -50,7 +50,7 @@ function print_header_mrbs($day=NULL, $month=NULL, $year=NULL, $area=NULL) //if
 	}
 	else
 	{
-		
+
 		header("Content-Type: text/html; charset=".get_string('charset','block_mrbs'));
 	}
 
@@ -63,7 +63,7 @@ function print_header_mrbs($day=NULL, $month=NULL, $year=NULL, $area=NULL) //if
                       "http://www.w3.org/TR/html4/loose.dtd">
 <HTML>
   <HEAD>
-*  
+*
 */
 
 ?>
@@ -83,8 +83,8 @@ function ChangeOptionDays(formObj, prefix, updatefreerooms, roomsearch){
     week[5]="<?php print_string('fri','calendar'); ?>";
     week[6]="<?php print_string('sat','calendar'); ?>";
     week[0]="<?php print_string('sun','calendar'); ?>";
-     
-     
+
+
   var DaysObject = eval("formObj." + prefix + "day");
     var currentDay = DaysObject.selectedIndex;
   var MonthObject = eval("formObj." + prefix + "month");
@@ -110,7 +110,7 @@ function ChangeOptionDays(formObj, prefix, updatefreerooms, roomsearch){
       i.setTime(i.getTime() + 86400000);
   }
    DaysObject.selectedIndex = currentDay;
-   
+
     if(updatefreerooms){
         updateFreeRooms();
     }
@@ -150,7 +150,7 @@ function ChangeOptionDays(formObj, prefix, updatefreerooms, roomsearch){
    if (!empty($area))
         echo "
                     <INPUT TYPE=HIDDEN NAME=area VALUE=$area>\n"
- 
+
 ?>
 	            <SCRIPT LANGUAGE="JavaScript">
                     <!--
@@ -290,10 +290,10 @@ function genDateSelector($prefix, $day, $month, $year, $updatefreerooms=false, $
 	if($day   == 0) $day = date("d");
 	if($month == 0) $month = date("m");
 	if($year  == 0) $year = date("Y");
-	
+
 	echo "
                   <SELECT NAME=\"${prefix}day\" ";if($updatefreerooms){echo"onChange=\"updateFreeRooms()\"";} if($roomsearch){echo"onChange=\"RoomSearch()\"";} echo">";
-	
+
 	for($i = 1; $i <= 31; $i++)
 		echo "
                     <OPTION " . ($i == $day ? " SELECTED" : "") . ">$i</OPTION>";
@@ -304,9 +304,9 @@ function genDateSelector($prefix, $day, $month, $year, $updatefreerooms=false, $
                   <SELECT NAME=\"${prefix}month\" onchange=\"ChangeOptionDays(this.form,'$prefix'";if($updatefreerooms){echo",true";} if($roomsearch){echo",false,true";} echo")\">";
 
 	for($i = 1; $i <= 12; $i++)
-	{  
+	{
 		$m = userdate(mktime(0, 0, 0, $i, 1, $year)+date('Z', mktime(0,0,0,$i,1,$year)),'%b','0');
-		
+
 		print "
                     <OPTION VALUE=\"$i\"" . ($i == $month ? " SELECTED" : "") . ">$m";
 	}
@@ -563,14 +563,14 @@ function is_dst ( $month, $day, $year, $hour="-1" )
 
 	if( $hour != -1  && $hour > 3)
 		return( -1 );
-	
+
 	# entering DST
-	if( !date( "I", mktime(12, 0, 0, $month, $day-1, $year)) && 
+	if( !date( "I", mktime(12, 0, 0, $month, $day-1, $year)) &&
 	    date( "I", mktime(12, 0, 0, $month, $day, $year)))
-		return( 0 ); 
+		return( 0 );
 
 	# leaving DST
-	elseif( date( "I", mktime(12, 0, 0, $month, $day-1, $year)) && 
+	elseif( date( "I", mktime(12, 0, 0, $month, $day-1, $year)) &&
 	    !date( "I", mktime(12, 0, 0, $month, $day, $year)))
 		return( 1 );
 	else
@@ -581,7 +581,7 @@ function is_dst ( $month, $day, $year, $hour="-1" )
 # of 3600 seconds (1 hour) in either direction
 function cross_dst ( $start, $end )
 {
-	
+
 	# entering DST
 	if( !date( "I", $start) &&  date( "I", $end))
 		$modification = -3600;
@@ -690,7 +690,7 @@ function notifyAdminOnBooking($new_entry , $new_id)
     global $rep_opt, $rep_num_weeks;
     global $tbl_room, $tbl_area, $tbl_entry, $tbl_users, $tbl_repeat;
     global $mail_previous, $auth;
-    
+
     //
     // $recipients = '';
     $id_table = ($rep_type > 0) ? "rep" : "e";
@@ -757,7 +757,7 @@ function notifyAdminOnBooking($new_entry , $new_id)
                user is deleted from your user database, this will prevent all
                mails to admins when this user previously booked entries will
                be changed, as no user name will match the booker name */
-               
+
             $sql = "SELECT email FROM ";
             $sql .= $CFG->prefix.'user WHERE username=';
             $sql .= "'";
@@ -818,19 +818,19 @@ function notifyAdminOnBooking($new_entry , $new_id)
         $body .= "\n" . get_string('namebooker','block_mrbs') . ": ";
         $body .= compareEntries(removeMailUnicode($name),
             removeMailUnicode($mail_previous['namebooker']), $new_entry). "\n";
-        
+
         // Description:
         $body .= get_string('description') . ": ";
         $body .= compareEntries(removeMailUnicode($description),
             removeMailUnicode($mail_previous['description']), $new_entry) . "\n";
-        
+
         // Room:
         $body .= get_string('room','block_mrbs') . ": " .
             compareEntries(removeMailUnicode($area_name),
             removeMailUnicode($mail_previous['area_name']), $new_entry);
         $body .= " - " . compareEntries(removeMailUnicode($room_name),
             removeMailUnicode($mail_previous['room_name']), $new_entry) . "\n";
-        
+
         // Start time
         if ( $enable_periods )
         {
@@ -846,12 +846,12 @@ function notifyAdminOnBooking($new_entry , $new_id)
             $body .= get_string('start_date','block_mrbs') . ": " .
                 compareEntries($start_date, $mail_previous['start_date'], $new_entry) . "\n";
         }
-        
+
         // Duration
         $body .= get_string('duration','block_mrbs') . ": " .
             compareEntries($duration, $mail_previous['duration'], $new_entry);
         $body .= " " . compareEntries($dur_units, $mail_previous['dur_units'], $new_entry) . "\n";
-        
+
         // End time
         if ( $enable_periods )
         {
@@ -869,7 +869,7 @@ function notifyAdminOnBooking($new_entry , $new_id)
             $body .= get_string('end_date','block_mrbs') . ": " .
                 compareEntries($end_date, $mail_previous['end_date'], $new_entry) . "\n";
         }
-        
+
         // Type of booking
         $body .= get_string('type','block_mrbs') . ": ";
         if ($new_entry)
@@ -881,15 +881,15 @@ function notifyAdminOnBooking($new_entry , $new_id)
             $temp = $mail_previous['type'];
             $body .= compareEntries($typel[$type], $typel[$temp], $new_entry);
         }
-        
+
         // Created by
         $body .= "\n" . get_string('createdby','block_mrbs') . ": " .
             compareEntries($create_by, $mail_previous['createdby'], $new_entry) . "\n";
-        
+
         // Last updated
         $body .= get_string('lastmodified') . ": " .
             compareEntries(getMailTimeDateString(time()), $mail_previous['updated'], $new_entry);
-        
+
         // Repeat Type
         $body .= "\n" . get_string('rep_type','block_mrbs');
         if ($new_entry)
@@ -902,7 +902,7 @@ function notifyAdminOnBooking($new_entry , $new_id)
             $body .=  ": " . compareEntries(get_string('rep_type_'.$rep_type,'block_mrbs'),
                 get_string('rep_type_'.$temp,'block_mrbs'), $new_entry);
         }
-        
+
         // Details if a series
         if ($rep_type > 0)
         {
@@ -921,7 +921,7 @@ function notifyAdminOnBooking($new_entry , $new_id)
         $body .= "\n" . get_string('rep_num_weeks','block_mrbs');
         $body .=  ": " . compareEntries($rep_num_weeks, $mail_previous["rep_num_weeks"], $new_entry);
         }
-    
+
         if($opt || $mail_previous["rep_opt"])
         {
         $body .= "\n" . get_string('rep_rep_day','block_mrbs');
@@ -936,19 +936,19 @@ function notifyAdminOnBooking($new_entry , $new_id)
             else
             {
                 $temp = userdate($rep_enddate, '%A %d %B %Y');
-                $body .=  ": " . 
+                $body .=  ": " .
                     compareEntries($temp, $mail_previous['rep_end_date'], $new_entry) . "\n";
             }
         }
     $body .= "\n";
     }
-    
+
     array_unique($recipientlist);
 
     $result=1;
     if (!$fromuser=get_user_by_email(MAIL_FROM)) {
         $result=0;
-    } 
+    }
     foreach ($recipientlist as $recip) {
         $recipuser = get_user_by_email($recip);
         if (($recipuser) && ($result)) {
@@ -1076,7 +1076,7 @@ function notifyAdminOnDelete($mail_previous)
            $body .= "\n" . get_string('rep_num_weeks','block_mrbs');
            $body .=  ": " . $mail_previous["rep_num_weeks"];
         }
-   
+
         if($mail_previous["rep_opt"])
         {
            $body .= "\n" . get_string('rep_rep_day','block_mrbs');
@@ -1088,13 +1088,13 @@ function notifyAdminOnDelete($mail_previous)
     }
     $body .= "\n";
     // End of mail details
-    
+
     array_unique($recipientlist);
 
     $result=1;
     if (!$fromuser=get_user_by_email(MAIL_FROM)) {
         $result=0;
-    } 
+    }
     foreach ($recipientlist as $recip) {
         $recipuser = get_user_by_email($recip);
         if (($recipuser) && ($result)) {
@@ -1137,7 +1137,7 @@ function getPreviousEntryData($id, $series)
             a.area_name,
             e.type,
             e.room_id,
-            e.repeat_id, 
+            e.repeat_id,
             e.timestamp,
             (e.end_time - e.start_time) AS tbl_e_duration,
             e.start_time AS tbl_e_start_time,
@@ -1214,7 +1214,7 @@ function getPreviousEntryData($id, $series)
             // so that user see what he expects to see
             $mail_previous['duration'] = $row['tbl_r_duration'] -
                 cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
-        
+
         $mail_previous['rep_opt'] = "";
         switch($row['rep_type'])
         {
@@ -1236,9 +1236,9 @@ function getPreviousEntryData($id, $series)
             {
                 $mail_previous['rep_num_weeks'] = "";
             }
-            
+
             break;
-        
+
         default:
             $rep_day = array(0, 0, 0, 0, 0, 0, 0);
         }
@@ -1248,7 +1248,7 @@ function getPreviousEntryData($id, $series)
         if ($rep_day[$wday])
             $mail_previous['rep_opt'] .= day_name($wday) . " ";
         }
-        
+
         $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
         }
         toPeriodString($mail_previous['start_period'],
@@ -1283,7 +1283,7 @@ function getPreviousEntryData($id, $series)
             // so that user see what he expects to see
             $mail_previous['duration'] = $row['tbl_r_duration'] -
                 cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
-            
+
         $mail_previous['rep_opt'] = "";
         switch($row['rep_type'])
         {
@@ -1305,9 +1305,9 @@ function getPreviousEntryData($id, $series)
             {
                 $mail_previous['rep_num_weeks'] = "";
             }
-            
+
             break;
-        
+
         default:
             $rep_day = array(0, 0, 0, 0, 0, 0, 0);
         }
@@ -1317,7 +1317,7 @@ function getPreviousEntryData($id, $series)
         if ($rep_day[$wday])
             $mail_previous['rep_opt'] .= day_name($wday) . " ";
         }
-        
+
         $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
         }
         toTimeString($mail_previous['duration'], $mail_previous['dur_units']);
@@ -1360,7 +1360,7 @@ function unHtmlEntities($string)
     return strtr($string, $trans_tbl);
 }
 
-function get_user_by_email ($email) 
+function get_user_by_email ($email)
 {
     if ($recipient_user=get_complete_user_data('email',$email)) {
         return $recipient_user;
@@ -1370,4 +1370,22 @@ function get_user_by_email ($email)
 }
 // }}}
 
+/**
+ * Convert a unix time to a human readable time. Gives period output if periods are enabled.
+ *
+ * @param int $time     Unix timestamp
+ * @return string       Name of the period or time in Hours:Minutes format
+ *
+ */
+function to_hr_time($time){
+    $cfg_mrbs = get_config('block/mrbs');
+    if ($cfg_mrbs->enable_periods){
+        $periods=explode("\n",$cfg_mrbs->periods);
+        $period=intval(date('i',$time));
+        return trim($periods[$period]);
+    }else{
+        return date('G:i',$time);
+    }
+}
+
 ?>
diff --git a/blocks/mrbs/web/updatefreerooms.js b/blocks/mrbs/web/updatefreerooms.js
index 04d5231..afd8328 100644
--- a/blocks/mrbs/web/updatefreerooms.js
+++ b/blocks/mrbs/web/updatefreerooms.js
@@ -1,5 +1,4 @@
 function updateFreeRooms(){
-//check for force book- if ticked we should be able to select any room
 
     dayInput=document.getElementsByName('day');
     day=dayInput[2].selectedIndex + 1;
@@ -25,14 +24,9 @@ function updateFreeRooms(){
     //currentroom is put onto edit_entry.php server-side
     searchstring="?day="+day+"&month="+month+"&year="+year+"&period="+period+"&duration="+duration+"&dur_units="+dur_units+"&area="+area+"&currentroom="+currentroom;
 
-    if(canforcebook){
-        forcebookInput=document.getElementsByName('forcebook');
-        if(forcebookInput[0].checked){
-            areasInput=document.getElementsByName('areas');
-            area=areasInput[0].options[areasInput[0].selectedIndex].value;
-
-            searchstring="?area="+area;
-        }
+    nooccupiedInput=document.getElementById('nooccupied');
+    if(!nooccupiedInput.checked){
+        searchstring="?area="+area;
     }
 
 
