/*
   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 {
//line 230 "FileManager/Details/Object.htm"
if (stash.get(['user', 0, 'canShare', 0])) {
output += '\n    <div id="quick-share">\n        <span class="title singular" style="display: none">Partager ce ';
//line 3 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += ' avec</span>\n        <span class="title plural" style="display: none">Partager la sélection avec</span>\n        <form id="quick-share-form" action="">\n            <input id="quick-share-parent" name="parent" type="hidden" value="';
//line 6 "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="Nom ou un e-mail">\n            <div id="quick-share-submit">';
//line 9 "FileManager/Details/Object.htm"

// WRAPPER
output += (function() {
    var output = '';
output += 'Valider';;
    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">Partager ce ';
//line 15 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += ' sur</span>\n        <span class="title plural" style="display: none">Partager la sélection sur</span>\n        <ul id="share-on-sites">\n        \n        </ul>\n        <div class="clear"></div>\n    </div>\n    \n    ';
//line 44 "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                Ce ';
//line 26 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += ' est partagé avec:\n            </span>\n            \n            <span id="shared-with-title-private" class="title" style="display:none">\n                Ce ';
//line 30 "FileManager/Details/Object.htm"
output += stash.get(['obj', 0, 'noun', 0]);
output += ' est privé.\n            </span>\n           \n            <span id="shared-with-indicator">En cours de chargement...</span>\n            \n            <ul id="shared-list" class="shared-list" style="display:none"></ul>\n            \n            ';
//line 42 "FileManager/Details/Object.htm"
if (stash.get('members')) {
output += '\n                <span id="members-title" class="title">\n                    Membres de l\'espace d\'équipe\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 117 "FileManager/Details/Object.htm"
if (stash.get('sharingData')) {
output += '\n                    Action.detailsTreeInit({\n                        elem: \'shared-list\',\n                        nsId: \'';
//line 100 "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 111 "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 126 "FileManager/Details/Object.htm"
if (stash.get('members')) {
output += '		\n                    Action.detailsTreeInit({\n                        elem: \'members-list\',\n                        nsId: \'';
//line 122 "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>\n';
}
else {
output += '    \n	<div class="container info_spacer" id="quick_add_friends">\n		<form method="post" target="_blank" action="/Pages/ResendVerificationEmail">    \n		<span class="title">Verify Your E-Mail Address</span>\n        <p>To share files from your ';
//line 211 "FileManager/Details/Object.htm"
output += stash.get(['BRAND', 0, 'longName', 0]);
output += ' account, you must first verify your e-mail address.</p>\n        <p>Click the link in the e-mail we sent when you opened your account then try sharing again.</p>\n        <p>If you cannot find the e-mail, you can resend it or obtain additional assistance using the button below.</p>\n            ';
//line 220 "FileManager/Details/Object.htm"

// WRAPPER
output += (function() {
    var output = '';
output += '\n                Verify your email\n            ';;
    return context.include('Components/Elements/Submit.htm', { 'id': 'verify_sharing', 'type': 'submit', 'style': 'margin-top:10px', 'content': output });
})();

output += '        \n		</form>        \n        <div class="clear"></div>        \n	</div>	\n    \n	<script type="text/javascript">\n		(function(){\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    </script>\n';
}

output += '\n';
    }
    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        Les fichiers sélectionnés ont été téléchargés sur votre ordinateur avec succès. \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 += ' ont été chargés dans ce dossier.\n            ';
}
else if (stash.get('fileName')) {
output += '\n                ';
//line 7 "FileManager/Info/UploadComplete.htm"
output += stash.get('fileName');
output += ' a été chargé dans ce dossier.\n            ';
}
else {
output += '\n                Un élément a été chargé dans ce dossier\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            		Vous devrez peut-être utiliser les flèches situées en bas de l\'écran pour les localiser.\n				';
}
else {
output += '\n            		Utilisez les flèches situées en bas de l\'écran pour le localiser.\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 += ' ont été chargés dans ';
//line 21 "FileManager/Info/UploadComplete.htm"
output += stash.get('destination');
output += '.\n            ';
}
else if (stash.get('fileName')) {
output += '\n                ';
//line 23 "FileManager/Info/UploadComplete.htm"
output += stash.get('fileName');
output += ' a été chargé dans ';
//line 23 "FileManager/Info/UploadComplete.htm"
output += stash.get('destination');
output += '.\n            ';
}
else {
output += '\n                Un élément a été chargé dans ';
//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">Télécharger dès Maintenant</a>\n            ';
        stash.set('downloadNow', output);
})();

output += '\n        \n            <b>Astuce:</b> Installez le ';
//line 40 "FileManager/Info/UploadComplete.htm"
output += stash.get('clientSoftware');
output += ' pour que les modifications que vous apportez aux fichiers de votre ordinateur soient automatiquement synchronisées avec votre espace de stockage. ';
//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;
}

