
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - ++resource++plonetruegallery-portlet.js - */
// http://www.brickstobits.com/portal_javascripts/++resource++plonetruegallery-portlet.js?original=1
(function($){
function set_controls_position(container){var width=container.find('img').width();var left=(width/2)-43;container.find('div.gallery-portlet-controls').css("left",left)}
function get_image(link){var container=link.parent().parent().parent();var controls=container.find('div.gallery-portlet-controls');var next=controls.find('span.next a');var prev=controls.find('span.prev a');var img=container.find('img');$.ajax({url:'@@get-image-for-gallery-portlet',data:link.attr('href').split('?')[1],type:'GET',dataType:'json',success: function(data,results){img.fadeOut("slow", function(){img.attr('src',data.src);img.parent().attr('href',data['image-link']);next.attr('href',next.attr('href').split('?')[0]+'?'+data['next-url']);prev.attr('href',prev.attr('href').split('?')[0]+'?'+data['prev-url']);set_controls_position(container);img.fadeIn("slow")})}})}
var timeout_id=0;
function perform_play(portlet){portlet.find('span.next a').trigger('click');timeout_id=setTimeout(function(){perform_play(portlet)},5000)}
function play(portlet){portlet.addClass('timed');portlet.find('span.play-pause').addClass('timed');timeout_id=setTimeout(function(){perform_play(portlet)},5000)}
function pause(portlet){portlet.removeClass('timed');portlet.find('span.play-pause').removeClass('timed');clearTimeout(timeout_id)}
$(document).ready(function(){$('dl.portletGallery span.next a,dl.portletGallery span.prev a').click(function(){get_image($(this));return false});$('dl.portletGallery span.play-pause').css({'display':'inline'});var portlets=$('dl.portletGallery');portlets.addClass('applied-portlet-gallery');portlets.each(function(){var portlet=$(this);set_controls_position(portlet);if(portlet.hasClass('timed')){play(portlet)}else{pause(portlet)}});$('dl.portletGallery span.play-pause a').click(function(){var portlet=$(this).parent().parent().parent();if(portlet.hasClass('timed')){pause(portlet)}else{play(portlet)}
return false});$('dl.portletGallery').hover(
function(){var controls=$(this).find('div.gallery-portlet-controls');controls.fadeIn()},
function(){var controls=$(this).find('div.gallery-portlet-controls');controls.fadeOut()})})})(jQuery);

/* - qcomments.js - */
// http://www.brickstobits.com/portal_javascripts/qcomments.js?original=1
function render_abuse_report_form(comment_id){jq('form.report_abuse').bind("submit", function(event){event.preventDefault()});var render_button='input#input-render-abuse-cancel-'+comment_id;jq(render_button).attr('disabled','disabled');var form='span#span-reply-form-'+comment_id;jq(form).slideToggle(500);var holder='span#span-reply-form-holder-'+comment_id;var cancel_button=holder+' input#input-report-abuse-cancel';var qq=jq(cancel_button);jq(cancel_button).attr('comment_id',comment_id)}
function remove_abuse_report_form(comment_id,html){jq('form.report_abuse').bind("submit", function(event){event.preventDefault()});var form='span#span-reply-form-'+comment_id;jq(form).fadeOut();var render_button='input#input-render-abuse-cancel-'+comment_id;jq(render_button).attr('disabled','');if(html!=undefined){var holder='span#span-abuse-count-holder-'+comment_id;jq(holder).append(html)}}
kukit.actionsGlobalRegistry.register("remove_abuse_report_form", function(oper){var comment_id=oper.parms.comment_id;var html=oper.parms.html
remove_abuse_report_form(comment_id,html)});kukit.commandsGlobalRegistry.registerFromAction('remove_abuse_report_form',kukit.cr.makeSelectorCommand);
