anchor.diff:  }
   </script><%
   } %>
  +<script type="text/javascript">
  +var ua = navigator.userAgent.toLowerCase() ;
  +var isIE7   = ua.indexOf("msie 7") != -1 ;
  +var isGecko = ua.indexOf("gecko") != -1 ;
  +var isMac   = ua.indexOf("mac") != -1 ;
  +
  +function setEditorSize() {
  +	var oTextArea = document.getElementById("text") ;
  +	if (oTextArea) {
  +		var offsetH = (isMac && isGecko) ? 270 : (isIE7) ? 260 : 250 ;
  +		var winH = (window.innerHeight) ? window.innerHeight : (document.body && document.body.offsetHeight) ? document.body.offsetHeight - 4 : document.body.clientHeight ;
  +		if (winH > 400) {
  +			oTextArea.style.height = (winH - offsetH) + "px" ;
  +		}
  +	}
  +}
  +setEditorSize() ;
  +if (window.attachEvent) {
  +	window.attachEvent("onresize",    function(){ setEditorSize(); }) ;
  +} else if (window.addEventListener) {
  +	window.addEventListener("resize", function(){ setEditorSize(); }, true) ;
  +}
  +
  +var oSessionTimer ;
  +var sessionTimeOutMs = <%= session.getMaxInactiveInterval() * 1000 %> ;
  +var firstVarningTimeMs = 300000 ;<% /* 5 minutes */ %>
  +var secondCountTimeS = 60 ;<% /* Count every second for the last minute */ %>
  +var timeLoaded = (new Date()).getTime() ;
  +var hasQuickRefresh = false ;
  +var oMessageDiv ;
  +try {
  +	oMessageDiv = document.getElementById("messageDiv") ;
  +} catch(e) {}
  +
  +function initSessionChecker() {
  +	try {
  +		oSessionTimer = setInterval("sessionChecker()", 10000) ;
  +	} catch(e) {}
  +}
  +function sessionChecker() {
  +	try {
  +		var timeNow = (new Date()).getTime() ;<% /*
  +		//var mess = "timeLoaded: " + timeLoaded + ", timeNow: " + timeNow + ", diff: " + (timeNow - timeLoaded) ;
  +		//mess += ", (sessionTimeOutMs - firstVarningTimeMs): " + (sessionTimeOutMs - firstVarningTimeMs) ;*/ %>
  +		if ((timeNow - timeLoaded) > (sessionTimeOutMs - firstVarningTimeMs)) {
  +			var timeLeft = Math.round(-((timeNow - timeLoaded) - sessionTimeOutMs)/1000) ;<%
  +			//mess += " - timeLeft: " + timeLeft ;%>
  +			if (!hasQuickRefresh && timeLeft <= secondCountTimeS + 10) {
  +				hasQuickRefresh = true ;
  +				clearInterval(oSessionTimer) ;
  +				oSessionTimer = setInterval("sessionChecker()", 1000) ;
  +			}
  +			if (timeLeft >= secondCountTimeS) {
  +				oMessageDiv.innerHTML = <%= isSwe ?
  +						"'<b>Varning!<b/> Din sessionstid går ut om ' + Math.ceil(timeLeft/60) + ' minuter. Spara dina ändringar!'" :
  +						"'<b>Warning!<b/> Your session time will expire in ' + Math.ceil(timeLeft/60) + ' minutes. Please save your changes!'" %> ;
  +			} else if (timeLeft > 0) {
  +				oMessageDiv.innerHTML = <%= isSwe ?
  +						"'<b>Varning!<b/> Din sessionstid går ut om ' + timeLeft + ' sekunder. Spara dina ändringar!'" :
  +						"'<b>Warning!<b/> Your session time will expire in ' + timeLeft + ' seconds. Please save your changes!'" %> ;
  +			} else {
  +				clearInterval(oSessionTimer) ;
  +				oMessageDiv.innerHTML = <%= isSwe ?
  +						"'<b>Varning!<b/> Din sessionstid har gått ut. Öppna ett annat fönster och logga in - återvänd sedan och spara dina ändringar!'" :
  +						"'<b>Warning!<b/> Your session time has expired. Open another window and login - then return to this window and save your changes.'" %> ;
  +			}
  +			oMessageDiv.style.display = "block" ;
  +		}<%
  +		//document.getElementById("theLabel").innerHTML = mess ;%>
  +	} catch(e) {}
  +}
  +if (window.attachEvent) {
  +	window.attachEvent("onload",    function(){ initSessionChecker(); }) ;
  +} else if (window.addEventListener) {
  +	window.addEventListener("load", function(){ initSessionChecker(); }, true) ;
  +}
  +</script>
  +
   
   </body>
   </html>
  
positive.code: 
  #gui_mid()
  <div id="theLabel"><%= StringEscapeUtils.escapeHtml( textEditPage.getLabel() ) %></div>
  
  <table border="0" cellspacing="0" cellpadding="2" width="720" align="center">
  </vel:velocity>
  <tr>
  
negative.code: 				}, 500);
  			}
  		} catch (e) {}
  }
  </script>
          <% } %>
  