{*
	/**************************************************************************\
	* Simple Groupware 0.700                                                   *
	* http://www.simple-groupware.de                                           *
	* Copyright (C) 2002-2011 by Thomas Bley                                   *
	* ------------------------------------------------------------------------ *
	*  This program is free software; you can redistribute it and/or           *
	*  modify it under the terms of the GNU General Public License Version 2   *
	*  as published by the Free Software Foundation; only version 2            *
	*  of the License, no later version.                                       *
	*                                                                          *
	*  This program is distributed in the hope that it will be useful,         *
	*  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
	*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
	*  GNU General Public License for more details.                            *
	*                                                                          *
	*  You should have received a copy of the GNU General Public License       *
	*  Version 2 along with this program; if not, write to the Free Software   *
	*  Foundation, Inc., 59 Temple Place - Suite 330, Boston,                  *
	*  MA  02111-1307, USA.                                                    *
	\**************************************************************************/
*}
<html{if $sync} manifest="?manifest"{/if}>
<head>
  <title>{$sys.app_title} - {t}Offline sync{/t}</title>
{* You are not allowed to remove or alter the copyright. *}
<!-- 
	This website is brought to you by Simple Groupware
	Simple Groupware is an open source Groupware and Web Application Framework created by Thomas Bley and licensed under GNU GPL v2.
	Simple Groupware is copyright 2002-2011 by Thomas Bley.	Extensions and translations are copyright of their respective owners.
	More information and documentation at http://www.simple-groupware.de/
-->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="generator" content="Simple Groupware 0.700" />
  <link media="all" href="images_php?css_style={$sys.style}&browser={$sys.browser.name}&{$smarty.const.CORE_VERSION}" rel="stylesheet" type="text/css" />
  <script>
    var iframe = 0;
	var sys = {};
	var sync = {if $sync}1{else}0{/if};
    {literal}
	function update_status() {
	  if (navigator.onLine) {
	    show("back");
	    show("sync");
	    show("log");
	  } else {
	    hide("back");
	    hide("sync");
	    hide("log");
	  }
	  set_html("status", "{t}Status{/t}: " + (navigator.onLine ? "<b>{t}online{/t}</b>" : "<b>{t}offline{/t}</b>"));
	}
	function change_size(id, size) {	
	  var obj = getObj(id);
  	  if (obj.offsetHeight + size > 0) obj.style.height = (obj.offsetHeight + size) + "px";
	  if (!obj.contentWindow) return;
	  var val = "";
	  if (size<0) val = "none";
	  try {
	    var obj2 = obj.contentWindow.document.getElementsByTagName("thead");
	    if (obj2.length==0) return;
    	for (var i2=0; i2<obj2.length; i2++) {
		  if (obj2[i2].id=="tfields") obj2[i2].style.display=val;
		}
	  } catch (e) {}
	}
    {/literal}
  </script>
  <script type="text/javascript" src="ext/js/functions.js?{$smarty.const.CORE_VERSION}"></script>
  <style>body {ldelim}margin:10px;{rdelim}</style>
</head>
<body onload="update_status();">
  <div style="border-bottom: 1px solid black; letter-spacing: 2px; font-size: 18px; font-weight: bold;">{$sys.app_title} - {t}Offline sync{/t}</div>
  <br>
  <div id="back"><a href="index.php">Back</a><br><br></div>
  <div id="status"></div>
  <div id="log"><a id="sync" href="?sync">{t}Start synchronization{/t}</a></div>
  {literal}
  <script>
	if (!window.applicationCache) {
	  set_html("log", "{t}Browser not supported{/t} (HTML5 offline resources, e.g. Firefox 3.0)");
	} else if (sync) {
	  var cache = window.applicationCache;
	  cache.addEventListener("checking", function() { if (navigator.onLine) set_html("log", "{t}Downloading update list{/t} ..."); }, false);
	  cache.addEventListener("downloading", function() { set_html("log", "{t}Please wait ...{/t} "); }, false);
	  cache.addEventListener("progress", function() { append_html("log", "#"); }, false);
	  cache.addEventListener("cached", function() { set_html("log", "{t}Finished{/t}. {t}You can go offline now.{/t}"); }, false);
	  cache.addEventListener("noupdate", function() { set_html("log", "{t}Finished{/t} {t}You can go offline now.{/t}"); }, false);
	  cache.addEventListener("error", function() { if (navigator.onLine) append_html("log", " {t}Error{/t}"); }, false);
	}
	document.body.addEventListener("offline", update_status, false);
	document.body.addEventListener("online", update_status, false);
  </script>
  {/literal}
  <div>&nbsp;</div>
  <div style="margin-bottom:6px;"><b>{t}Folders{/t}:</b></div>
  {foreach key=key item=row from=$rows}
	<a href="{$row.url}" target="iframe_{$key}" onclick="showhide('iframe_{$key}'); showhide('buttons_{$key}');">{$row.path}</a> 
	{if $row.view neq "display"}<small>({$row.view})</small>{/if} &nbsp;
	<span id="buttons_{$key}" style="display:none;">
	  <a href="#" onclick="change_size('iframe_{$key}',60); return false;"> + </a>/
	  <a href="#" onclick="change_size('iframe_{$key}',-60); return false;"> &ndash;&nbsp;</a>
	</span><br>
	<table cellpadding="0" cellspacing="0" style="width:100%;"><tr><td style="padding-bottom:4px;">
	  <iframe name="iframe_{$key}" id="iframe_{$key}" style="width:100%; height:350px; border:0px; margin-top:5px; margin-bottom:9px; display:none;"></iframe>
	</td></tr></table>
  {foreachelse}
    {t}No entries found.{/t} ({t}Offline folders{/t})<br>
  {/foreach}
  <br>
  <span style="float:right;">{"{t}m/d/y g:i:s a{/t}"|sys_date}</span>
  {* You are not allowed to remove, alter or hide the copyright. *}
  <div style="border-top: 1px solid black;">  
    <a href="http://www.simple-groupware.de" class="lnotice" target="_blank" onmouseover="set_html(this,'Powered by Simple Groupware, Copyright (C) 2002-2011 by Thomas Bley.');" onmouseout="set_html(this,'Powered by Simple Groupware.');">Powered by Simple Groupware.</a>
  </div>
</body>
</html>