window.addEvent('domready',function(){if($('comment-form')){$('comment-form').addEvent('submit',function(e){new Event(e).stop();$('formLog').empty().addClass('formLogLoading');this.send({onComplete:function(res){$('formLog').removeClass('formLogLoading').setHTML(res);if(typeof(Recaptcha)!="undefined"){Recaptcha.reload();}if(res.substr(13,7)=='success'){window.location.reload();}}});});}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');});}new SmoothScroll({duration:500,links:'a.k2Anchor'});if($$('.itemRatingForm').length>0){$$('.itemRatingForm a').addEvent('click',function(e){e=new Event(e).stop();var itemID=this.getProperty('rel');var log=$('itemRatingLog'+itemID).empty().addClass('formLogLoading');var rating=this.getText();var url=K2RatingURL+"index.php?option=com_k2&view=item&task=vote&user_rating="+rating+"&itemID="+itemID;new Ajax(url,{method:"get",update:log,onComplete:function(){log.removeClass('formLogLoading');new Ajax(K2RatingURL+"index.php?option=com_k2&view=item&task=getVotesPercentage&itemID="+itemID,{method:"get",onComplete:function(percentage){$('itemCurrentRating'+itemID).setStyle('width',percentage+"%");setTimeout(function(){new Ajax(K2RatingURL+"index.php?option=com_k2&view=item&task=getVotesNum&itemID="+itemID,{method:"get",update:log}).request();},2000);}}).request();}}).request();});}$$('.classicPopup').addEvent('click',function(e){e=new Event(e).stop();var options=Json.evaluate(this.getProperty('rel'));window.open(this.getProperty('href'),'K2PopUpWindow','width='+options.x+',height='+options.y+',menubar=yes,resizable=yes');});});window.addEvent('load',function(){if($$('.subCategory')){var blocks=$$('.subCategory');var maxHeight=0;blocks.each(function(item){maxHeight=Math.max(maxHeight,parseInt(item.getStyle('height')));});blocks.setStyle('height',maxHeight);}});