/*
// "K2" Component by JoomlaWorks for Joomla! 1.5.x - Version 1.0.2b
// Copyright (c) 2006 - 2009 JoomlaWorks Ltd. All rights reserved.
// Released under the GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
// More info at http://www.joomlaworks.gr
// Designed and developed by JoomlaWorks.
// *** Last update: May 12th, 2009 ***
*/
window.addEvent('domready', function(){

    // Comments
    if ($('comment-form')) {
        $('comment-form').addEvent('submit', function(e){
            new Event(e).stop();
            var log2 = $('formLog').empty().addClass('formLogLoading');
            this.send({
                update: log2,
                onComplete: function(res){
                    log2.removeClass('formLogLoading');
                    if (res.substr(13, 7) == 'success') {
                        window.location.reload();
                    }
                }
            });
        });
    }
    
    // Text Resizer
    if ($('fontDecrease')) {
			$('fontDecrease').addEvent('click', function(e){
				new Event(e).stop();
				$$('.itemFullText').removeClass('largerFontSize');
				$$('.itemFullText').addClass('smallerFontSize');
			});
    }
    if ($('fontIncrease')) {
			$('fontIncrease').addEvent('click', function(e){
				new Event(e).stop();
				$$('.itemFullText').removeClass('smallerFontSize');
				$$('.itemFullText').addClass('largerFontSize');
			});
    }
    
    // Smooth Scroll
    new SmoothScroll({
        duration: 500
    });
    
    // Equal block heights for the "default" view
    if($$('.defCategoryBlock')){
			var blocks = $$('.defCategoryBlock');
			var maxHeight = 0;
			blocks.each(function(item){
				maxHeight = Math.max(maxHeight, parseInt(item.getStyle('height')));
			});
			blocks.setStyle('height', maxHeight);
		}

});

// reCaptcha
var RecaptchaOptions = {
   theme : 'clean'
};

// End
