<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -28,6 +28,8 @@ class ApplicationController &lt; ActionController::Base
 
   helper_method :buildUserLink
 
+  helper_method :activeEmergencies?
+
   before_filter :login_required
 	before_filter :update_last_online
 	
@@ -251,7 +253,12 @@ class ApplicationController &lt; ActionController::Base
   	
   	Logmessage.create(:logtime =&gt; Time.now.to_i, :severity =&gt; 0, :errorcode =&gt; &quot;LOG&quot;, :logmsg =&gt; logmsg)
   end
-  
+ 
+  def activeEmergencies?
+    return false if Emergency.find_by_active(true).blank?
+    return true
+  end
+ 
   public :permission?, :block
   
 end</diff>
      <filename>app/controllers/application_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,11 @@
 	&lt;div id=&quot;maintop&quot;&gt;
 		&lt;div id=&quot;top&quot;&gt;
 			&lt;img src=&quot;/images/layout/top.png&quot; alt=&quot;ScopePort&quot; id=&quot;toplogo&quot;&gt;
+      &lt;div id=&quot;emergency-list&quot;&gt;
+      &lt;% if activeEmergencies? %&gt;
+        &lt;%= link_to &quot;Active emergencies!&quot;, :controller =&gt; &quot;emergencies&quot; %&gt;
+      &lt;% end %&gt;
+      &lt;/div&gt;
       &lt;% unless @first_admin %&gt;
 			  &lt;% if admin? %&gt;
 			  &lt;div id=&quot;logmsg&quot;&gt;
@@ -21,12 +26,12 @@
   			&lt;/div&gt;
   			&lt;% end %&gt;
 			  &lt;div id=&quot;bigredbutton-activate&quot;&gt;
-  				&lt;a onclick=&quot;bigRedButtonSlide()&quot; title=&quot;Declare emergency!&quot;&gt;
+  				&lt;a onclick=&quot;bigRedButtonSlide()&quot; title=&quot;Declare emergency!&quot; id=&quot;bigredbutton-activator&quot;&gt;
   					!
   				&lt;/a&gt;
   			&lt;/div&gt;
   			&lt;div id=&quot;bigredbutton&quot; style=&quot;display: none;&quot;&gt;
-  				&lt;%= link_to &quot;Declare emergency!&quot;, :controller =&gt; &quot;emergencies&quot;, :action =&gt; &quot;declare&quot; %&gt;
+  				&lt;span id=&quot;bigredbutton-pulse&quot;&gt;&lt;%= link_to &quot;Declare emergency!&quot;, :controller =&gt; &quot;emergencies&quot;, :action =&gt; &quot;new&quot; %&gt;&lt;/span&gt;
   			&lt;/div&gt;
   			&lt;div id=&quot;usermenu&quot;&gt;
   				&lt;div id=&quot;usermenuwelcome&quot;&gt;
@@ -99,6 +104,10 @@
 		&lt;div id=&quot;flash-error&quot; style=&quot;display: none;&quot;&gt;&lt;%= flash[:error] %&gt;&lt;/div&gt;
 		
 		&lt;script type=&quot;text/javascript&quot;&gt;
+      &lt;% if activeEmergencies? %&gt;
+        //Effect.Pulsate(&quot;toplogo&quot;, { pulses: 9999, duration: 9999/0.7 });
+      &lt;% end %&gt;
+
 			noticediv = document.getElementById(&quot;flash-notice&quot;).innerHTML;
 			errordiv = document.getElementById(&quot;flash-error&quot;).innerHTML;
 			if(noticediv != &quot;&quot;)</diff>
      <filename>app/views/layouts/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -104,3 +104,24 @@ function updateForm (fields) {
 			elements[7].value = cf.service_state;
 	}
 }
+
+function bigRedButtonSlide(){
+  document.getElementById('bigredbutton').style.display = &quot;&quot;;
+  document.getElementById('bigredbutton-activator').style.display = &quot;none&quot;;
+  Effect.Pulsate('bigredbutton-pulse', { pulses: 9999, duration: 9999 });
+}
+
+function appendToList(x){
+  var container = document.getElementById(&quot;emergency-chat-list&quot;);
+  var newElement = document.createElement(&quot;li&quot;);
+  newElement.innerHTML = x;
+  container.insertBefore(newElement, container.lastChild);
+}
+
+function scrollToBottom(x){
+  var scroll = document.getElementById(&quot;autoscroll&quot;);
+  if(scroll.checked){
+    var el = document.getElementById(x);
+    el.scrollTop = el.scrollHeight;
+  }
+}</diff>
      <filename>public/javascripts/scopeport.js</filename>
    </modified>
    <modified>
      <diff>@@ -187,7 +187,7 @@ dd {
 
 #navigation {
 	height: 40px;
-	padding-top: 80px;
+	padding-top: 60px;
 }
 
 .navlink {
@@ -294,6 +294,17 @@ dd {
 	border: 0px;
 }
 
+#emergency-list {
+  height: 19px;
+  width: 200px;
+  margin: 0px auto;
+  text-align: center;
+  position: relative;
+  top: 5px;
+  font-size: 13px;
+  font-weight: bold;
+}
+
 #container {
 	width: 960px;
 	height: 100%;</diff>
      <filename>public/stylesheets/core.css</filename>
    </modified>
    <modified>
      <diff>@@ -514,3 +514,77 @@
 #conversations-clear {
   margin-top: 15px;
 }
+
+/*
+ * Emergencies
+ */
+
+#emergency-new-receivers {
+  margin-top: 10px;
+  margin-bottom: 20px;
+}
+
+#emergencies-list {
+  margin-top: 15px;
+}
+
+#emergency-description {
+  margin-top: 10px;
+}
+
+.emergency-section h2 {
+  font-size: 12px;
+}
+
+.emergency-section p {
+  margin: 0px;
+  margin-bottom: 2px;
+}
+
+#emergency-chat {
+  margin-top: 10px;
+}
+
+#emergency-chat-top {
+  float: right;
+  padding-right: 5px;
+}
+
+#emergency-chat-list {
+  width: 905px;
+  height: 150px;
+  overflow: auto;
+  border-left: 1px dotted #000000;
+  margin: 0px;
+  padding: 0px;
+  margin-top: 5px;
+  margin-bottom: 5px;
+  padding-left: 3px;
+  padding-right: 5px;
+  padding-bottom: 3px;
+  list-style-type: none;
+}
+
+#emergency-chat-message-field {
+  width: 849px;
+}
+
+#emergency-chat-submit-field {
+  width: 50px;
+}
+
+.emergency-chat-message-date {
+  color: #BBBBBB;
+}
+
+.emergency-chat-message-username {
+  font-weight: bold;
+}
+
+.emergency-chat-message-message {
+  font-style: italic;
+}
+
+#emergency-close {
+  margin-top: 15px;
+}</diff>
      <filename>public/stylesheets/sections.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>596951fb9ba7ed1c35031d8d650121ec54ece5c6</id>
    </parent>
  </parents>
  <author>
    <name>lennartkoopmann</name>
    <login>lennartkoopmann</login>
    <email>lennart@scopeport.org</email>
  </author>
  <url>http://github.com/lennartkoopmann/scopeport-web-interface/commit/c77c7ddc0b714658b071ee30ec7eeb832b2823e1</url>
  <id>c77c7ddc0b714658b071ee30ec7eeb832b2823e1</id>
  <committed-date>2009-07-21T18:37:12-07:00</committed-date>
  <authored-date>2009-07-21T18:37:12-07:00</authored-date>
  <message>New module: Emergencies</message>
  <tree>f62840f9bea30e779c0e90a8f3a53737603a562d</tree>
  <committer>
    <name>lennartkoopmann</name>
    <login>lennartkoopmann</login>
    <email>lennart@scopeport.org</email>
  </committer>
</commit>
