/*
   This JavaScript code was generated by Jemplate, the JavaScript
   Template Toolkit. Any changes made to this file will be lost the next
   time the templates are compiled.

   Copyright 2006-2008 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
    throw('Jemplate.js must be loaded before any Jemplate template files');

Jemplate.templateMap['Components/Elements/Submit.htm'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '\n<!--// Button Start //-->\n<';
//line 3 "Components/Elements/Submit.htm"
output += stash.get(['href', 0, 'defined', 0]) ? 'a' : 'button';
output += ' ';
//line 3 "Components/Elements/Submit.htm"
if (stash.get('id')) {
output += ' id="';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('id');
output += '_text"';
}

output += ' class="x-btn ';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('class');
output += '" ';
//line 3 "Components/Elements/Submit.htm"
if (stash.get('name')) {
output += 'name="';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('name');
output += '"';
}

output += ' ';
//line 3 "Components/Elements/Submit.htm"
if (stash.get('href')) {
output += 'href="';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('href');
output += '"';
}

output += ' ';
//line 3 "Components/Elements/Submit.htm"
if (!(stash.get('href'))) {
output += ' type="';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('type') || 'submit';
output += '" ';
}

output += ' ';
//line 3 "Components/Elements/Submit.htm"
if (stash.get('mousedown')) {
output += 'onmousedown=\'';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('mousedown');
output += '\'';
}

output += ' ';
//line 3 "Components/Elements/Submit.htm"
if (stash.get('onClick')) {
output += 'onclick="';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('onClick');
output += '" ';
}

output += ' ';
//line 3 "Components/Elements/Submit.htm"
if (stash.get('value')) {
output += 'value="';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('value');
output += '" ';
}

output += ' ';
//line 3 "Components/Elements/Submit.htm"
if (stash.get('style')) {
output += 'style="';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('style');
output += '"';
}

output += ' >';
//line 3 "Components/Elements/Submit.htm"
output += stash.get('content') || stash.get('text');
output += '</';
//line 3 "Components/Elements/Submit.htm"
output += stash.get(['href', 0, 'defined', 0]) ? 'a' : 'button';
output += '>\n<!--// Button End //-->';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['FileManager/Details/Object.htm'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<div id="quick-share">\n    <span class="title singular" style="display: none">';
//line 2 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += ' teilen mit </span>\n    <span class="title plural" style="display: none">Auswahl teilen mit</span>\n    <form id="quick-share-form" action="">\n        <input id="quick-share-parent" name="parent" type="hidden" value="';
//line 5 "FileManager/Details/Object.htm"
output += stash.get('sharingId');
output += '" />\n        <input id="quick-share-entity-id" name="entity_id" type="hidden" value="" />        \n        <input id="quick-share-input" name="entity" type="text" autocomplete="off" value="Name oder E-Mail eingeben...">\n        <div id="quick-share-submit">';
//line 8 "FileManager/Details/Object.htm"

// WRAPPER
output += (function() {
    var output = '';
output += 'Teilen';;
    return context.include('Components/Elements/Submit.htm', { 'content': output });
})();

output += '</div>\n    </form>\n    <div id="quick-share-choices" class="autocomplete" style="display:none"></div>\n</div>\n\n<div id="shared-on" class="all_nodes">\n    <span class="title singular" style="display: none">';
//line 14 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += ' teilen auf</span>\n    <span class="title plural" style="display: none">Auswahl teilen auf</span>\n    <ul id="share-on-sites">\n    \n    </ul>\n    <div class="clear"></div>\n</div>\n\n';
//line 43 "FileManager/Details/Object.htm"
if (stash.get(['obj', 0, 'canChangePerms', 0]) && stash.get('sharingId')) {
output += '\n    <div id="shared-with" class="shared">\n        <span id="shared-with-title-shared" class="title fixed" style="display:none">\n            ';
//line 25 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += ' ist geteilt mit:\n        </span>\n        \n        <span id="shared-with-title-private" class="title" style="display:none">\n            Diese ';
//line 29 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += '-Daten sind privat.\n        </span>\n       \n        <span id="shared-with-indicator">Lädt ...</span>\n        \n        <ul id="shared-list" class="shared-list" style="display:none"></ul>\n        \n        ';
//line 41 "FileManager/Details/Object.htm"
if (stash.get('members')) {
output += '\n            <span id="members-title" class="title">\n                Teamspace Mitglieder:\n            </span>\n            <ul id="members-list" class="shared-list"></ul> \n        ';
}

output += '\n    </div>\n';
}

output += '\n \n\n<script type="text/javascript">\n	\n	(function(){\n	\n		var selectedIds = Selection.selectedIds();\n		\n		// Show singular or plural text depending on the number of objects being considered\n		$(\'info_details\').select( selectedIds.length > 1 ? \'.plural\' : \'.singular\' ).invoke(\'show\');\n		\n		$(\'info_right_text\').update(\'<img class="icon small sharedwhite left" src="/Assets/Default/Images/x.gif" width="16" height="16" style="margin-right:5px">\' + Locale[\'detailsObjectTitle\']);\n\n		var ul = $(\'share-on-sites\'), li, \n		tpl = new Template(\'<a title="#{alt}" style="background-image:url(/Assets/Default/Images/Icons/Small/#{src})"></a>\');\n		\n		function resize(event){\n			var div = $(\'shared-with\'), height = 0;\n\n			if(div && div.hasClassName(\'shared\')){\n				$$(\'#header, #info_header_details, #quick-share\').each(function(x){\n					height += x.getHeight();\n				});\n				\n				/* \n				   For what ever reason IE does not like checking for #shared-on and will throw a paddy, \n				   so to keep things simple i\'m defining its height myself.\n				   \n				   Note: there is also another arse of a bug with IE\'s resize overally\n				   http://noteslog.com/post/how-to-fix-the-resize-event-in-ie/\n				   http://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer				   \n				*/\n				height = (windowSize().height - height) - 54;\n				\n				div.setStyle({\'height\': height + \'px\'}); // We take 15 off for margin/padding reasons\n			} else {\n				// div#shared-with can no be seen in the DOM lets stop observing this\n				Event.stopObserving(window, \'resize\', resize);\n			}\n		}\n		\n		Menu.buildActions(Menu.actionsFor({menu:\'sharing\', require:true, targets:selectedIds }), selectedIds).each(function(action) {\n			li = new Element(\'li\').insert(tpl.evaluate({\n				alt:action.alt,\n				src:action.icon\n			}));\n		\n			li.observe(\'click\', function(){eval(action.code)});\n			ul.insert(li);\n		});\n		\n		if ($(\'shared-with\')) { // Not present for multi-node selections	\n			';
//line 116 "FileManager/Details/Object.htm"
if (stash.get('sharingData')) {
output += '\n				Action.detailsTreeInit({\n					elem: \'shared-list\',\n					nsId: \'';
//line 99 "FileManager/Details/Object.htm"
output += stash.get('sharingId');
output += '\',\n					data: Selection.detailsInfoData().sharingData,\n					nonEmptyMessage: $(\'shared-with-title-shared\'),\n					emptyMessage:    $(\'shared-with-title-private\'),\n					loadingMessage:  $(\'shared-with-indicator\')\n				});\n			';
}
else {
output += '\n				// Initialise if the selection does not change for a second\n				Selection.executeDelayed(function() {\n					Action.detailsTreeInit({\n						elem: \'shared-list\',\n						nsId: \'';
//line 110 "FileManager/Details/Object.htm"
output += stash.get('sharingId');
output += '\',\n						nonEmptyMessage: $(\'shared-with-title-shared\'),\n						emptyMessage:    $(\'shared-with-title-private\'),\n						loadingMessage:  $(\'shared-with-indicator\')\n					});\n				}, 1000);\n			';
}

output += '\n		\n			';
//line 125 "FileManager/Details/Object.htm"
if (stash.get('members')) {
output += '		\n				Action.detailsTreeInit({\n					elem: \'members-list\',\n					nsId: \'';
//line 121 "FileManager/Details/Object.htm"
output += stash.get(['members', 0, 'id', 0]);
output += '\',\n					data: Selection.detailsInfoData().members,\n					emptyMessage: $(\'shared-with-title-private\')\n				});\n			';
}

output += '\n		}\n		\n		function updateAutoCheck(){\n			var auto = $(\'quick-share-choices\'), input = $(\'quick-share-input\');\n			auto.addClassName(\'keepVisable\'); 						// Add class that keeps the custom message li visable while hiding everything else\n			$(\'body\').observe(\'click\', function(event){				// We click blur to remove it\n				if(event.element().up(\'div\') !== auto){				// but only when it\'s not on the autocomplete list\n					auto.removeClassName(\'keepVisable\').hide();\n					this.stopObserving(\'click\', arguments.callee);\n				}\n			});\n		}\n		\n		if($(\'quick-share-input\')){\n			// Quick share may not be there so lets check first!\n			Action.quickCreateInit({\n				form:     $(\'quick-share-form\'),\n				input:    $(\'quick-share-input\'),\n				idIn:     $(\'quick-share-entity-id\'),\n				choices:  $(\'quick-share-choices\'),\n				loadMessage: Locale[\'Updating_Sharing\'],\n				afterUpdateElement: updateAutoCheck,\n				onSuccess: function(transport){\n					function check(){\n						var first = $(\'quick-share-choices\').down(\'ul>li:first\');\n						if( first.hasClassName(\'custom-message\') ){\n							 updateAutoCheck();\n						} else {\n							$(\'quick-share-choices\').removeClassName(\'keepVisable\');\n						}\n					}\n					\n					check.defer();\n				}\n			});\n					\n			function quickShare (event){\n				$(\'quick-share-choices\').removeClassName(\'keepVisable\');\n			}\n			\n			// Observe the submit of the form and remove the keepVisable class\n			$(\'quick-share-form\').stopObserving(\'submit\', quickShare).observe(\'submit\', quickShare);\n		}\n		\n		// We stop overserving before we attempt to observe just to make sure we don\'t double observe.\n		$(\'info_right\').stopObserving(\'click\').observe(\'click\', function(event){\n			if( event.findElement(\'li.custom-message\') ){\n				// we really ought to use MenuManager to call this\n				var targets = selectedIds.first() ? null : [cwd.id];\n				Action.DialogAction({\n					page:\'/Pages/Share?\',\n					width: 475, minHeight: 330,\n					target:targets,\n					onComplete: function(){\n						// Set "Share with" value to the same as quick shares\n						var tpl = new Template(\'<a id="user_#{id}" class="entry left"><span class="cross"></span>#{name}<input id="user_#{id}_#{user_var}" name="#{user_var}" value="#{id}" type="hidden" /></a>\'),\n						id = $F(\'quick-share-entity-id\'), input = $F(\'quick-share-input\'), value;\n\n						value = tpl.evaluate({\'id\':id, \'name\':input, user_var:\'recipient\'});\n						\n						if(!id) $(\'to-hidden\').setValue(input);\n						\n						$(\'autocomplete_input\').insert({before: value});\n						$(\'share-message\').focus();\n					}\n				});\n				// Remove the force visable class\n				$(\'quick-share-choices\').removeClassName(\'keepVisable\');\n			} else if ( event.findElement(\'div#quick-share-submit\') ){\n				$(\'quick-share-choices\').removeClassName(\'keepVisable\');\n			}\n		});\n		\n		Event.stopObserving(window, \'resize\', resize);	// Stop Observing then\n		Event.observe(window, \'resize\', resize);		// Observe the window resize event for this\n		resize(); // Setup the current size info\n				\n	})();\n	\n</script>';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['FileManager/Info/DownloadComplete.htm'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<div id="info_download_complete" class="info_alert closeable">\n    <div class="icons icon_tick">\n        Die ausgewählten Dateien wurden erfolgreich auf Ihren Computer heruntergeladen. \n    </div>        \n    <div class="clear"></div>\n</div>';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['FileManager/Info/UploadComplete.htm'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<div id="info_upload_complete" class="info_alert closeable">\n    <div class="icons icon_tick">\n    	';
//line 27 "FileManager/Info/UploadComplete.htm"
if (stash.get(['uploadedTo', 0, 'id', 0]) == stash.get(['cwd', 0, 'id', 0])) {
output += '\n        	';
//line 10 "FileManager/Info/UploadComplete.htm"
if (stash.get('uploadedFiles') > 1) {
output += '\n            	';
//line 5 "FileManager/Info/UploadComplete.htm"
output += stash.get('uploadedFiles');
output += ' Objekte wurden in diesen Ordner hochgeladen.\n            ';
}
else if (stash.get('fileName')) {
output += '\n                ';
//line 7 "FileManager/Info/UploadComplete.htm"
output += stash.get('fileName');
output += ' wurde in diesen Ordner hochgeladen.\n            ';
}
else {
output += '\n                Ein Objekt wurde in diesen Ordner hochgeladen.\n            ';
}

output += '\n            ';
//line 17 "FileManager/Info/UploadComplete.htm"
if (stash.get('selectedFiles') < stash.get('uploadedFiles') && stash.get(['cwd', 0, 'pages', 0]) > 1) {
output += '\n            	';
//line 16 "FileManager/Info/UploadComplete.htm"
if (stash.get('uploadedFiles') > 1) {
output += '\n            		Sie müssen eventuell die Pfeile unten auf dem Bildschirm benutzen, um sie anzuordnen.\n				';
}
else {
output += '\n            		Benutzen Sie zum Anordnen die Pfeile unten auf dem Bildschirm.\n                ';
}

output += '\n            ';
}

output += '        \n        ';
}
else {
output += '\n        	';
//line 19 "FileManager/Info/UploadComplete.htm"

// CAPTURE
(function() {
        var output = '';
        output += '<a href="#';
//line 19 "FileManager/Info/UploadComplete.htm"
output += stash.get(['uploadedTo', 0, 'uri', 0]) || stash.get(['uploadedTo', 0, 'id', 0]);
output += '">';
//line 19 "FileManager/Info/UploadComplete.htm"
output += stash.get(['uploadedTo', 0, 'name', 0]);
output += '</a>';
        stash.set('destination', output);
})();

output += '\n        	';
//line 26 "FileManager/Info/UploadComplete.htm"
if (stash.get('uploadedFiles') > 1) {
output += '\n            	';
//line 21 "FileManager/Info/UploadComplete.htm"
output += stash.get('uploadedFiles');
output += ' Objekte wurden nach ';
//line 21 "FileManager/Info/UploadComplete.htm"
output += stash.get('destination');
output += ' hochgeladen.\n            ';
}
else if (stash.get('fileName')) {
output += '\n                ';
//line 23 "FileManager/Info/UploadComplete.htm"
output += stash.get('fileName');
output += ' wurde nach ';
//line 23 "FileManager/Info/UploadComplete.htm"
output += stash.get('destination');
output += ' hochgeladen.\n            ';
}
else {
output += '\n                Ein Objekt wurde hochgeladen nach ';
//line 25 "FileManager/Info/UploadComplete.htm"
output += stash.get('destination');
output += '.\n            ';
}

output += '\n        ';
}

output += '\n    </div>\n        \n    ';
//line 42 "FileManager/Info/UploadComplete.htm"
if (stash.get('clientProductName')) {
output += '\n        <div class="icons icon_client left">\n            ';
//line 34 "FileManager/Info/UploadComplete.htm"

// CAPTURE
(function() {
        var output = '';
        output += '\n                <a href="/Pages/PreSales/WindowsClient.htm" target="_blank">';
//line 33 "FileManager/Info/UploadComplete.htm"
output += stash.get('clientProductName');
output += '</a>\n            ';
        stash.set('clientSoftware', output);
})();

output += '\n            \n            ';
//line 38 "FileManager/Info/UploadComplete.htm"

// CAPTURE
(function() {
        var output = '';
        output += '\n                <a href="/Pages/ClientDownload" target="_top">Jetzt herunterladen</a>\n            ';
        stash.set('downloadNow', output);
})();

output += '\n        \n            <b>Tipp:</b> Installieren Sie ';
//line 40 "FileManager/Info/UploadComplete.htm"
output += stash.get('clientSoftware');
output += ', um die Änderungen an Ihren Dateien auf Ihrem Computer automatisch in Ihrem Online Speicherplatz zu übernehmen. ';
//line 40 "FileManager/Info/UploadComplete.htm"
output += stash.get('downloadNow');
output += '            \n        </div>\n    ';
}

output += '	\n    <div class="clear"></div>\n</div>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

