/* 3e.k2.js */

var $K2=jQuery.noConflict();$K2(document).ready(function(){$K2('#comment-form').submit(function(event){event.preventDefault();$K2('#formLog').empty().addClass('formLogLoading');$K2.ajax({url:$K2('#comment-form').attr('action'),type:'post',dataType:'json',data:$K2('#comment-form').serialize(),success:function(response){$K2('#formLog').removeClass('formLogLoading').html(response.message);if(typeof(Recaptcha)!="undefined"){Recaptcha.reload();}
if(response.refresh){window.location.reload();}}});});$K2('.commentRemoveLink').click(function(event){event.preventDefault();var element=$K2(this);$K2(element).parent().addClass('commentToolbarLoading');$K2.ajax({url:$K2(element).attr('href'),type:'post',data:$K2('#comment-form input:last').serialize(),success:function(response){$K2(element).parent().removeClass('commentToolbarLoading');if(response=='true'){$K2(element).parent().parent().remove();}}});});$K2('.commentApproveLink').click(function(event){event.preventDefault();var element=$K2(this);$K2(element).parent().addClass('commentToolbarLoading');$K2.ajax({url:$K2(element).attr('href'),type:'post',data:$K2('#comment-form input:last').serialize(),success:function(response){$K2(element).parent().removeClass('commentToolbarLoading');if(response=='true'){$K2(element).parent().parent().removeClass('unpublishedComment');}}});});$K2('#k2ReportCommentForm').submit(function(event){event.preventDefault();$K2('#formLog').empty().addClass('formLogLoading');$K2.ajax({url:$K2('#k2ReportCommentForm').attr('action'),type:'post',data:$K2('#k2ReportCommentForm').serialize(),success:function(response){$K2('#formLog').removeClass('formLogLoading').html(response);if(typeof(Recaptcha)!="undefined"){Recaptcha.reload();}}});});$K2('#fontDecrease').click(function(event){event.preventDefault();$K2('.itemFullText').removeClass('largerFontSize');$K2('.itemFullText').addClass('smallerFontSize');});$K2('#fontIncrease').click(function(event){event.preventDefault();$K2('.itemFullText').removeClass('smallerFontSize');$K2('.itemFullText').addClass('largerFontSize');});$K2('.k2Anchor').click(function(event){event.preventDefault();var target=this.hash;$K2('html, body').stop().animate({scrollTop:$K2(target).offset().top},500);});$K2('.itemRatingForm a').click(function(event){event.preventDefault();var itemID=$K2(this).attr('rel');var log=$K2('#itemRatingLog'+itemID).empty().addClass('formLogLoading');var rating=$K2(this).html();$K2.ajax({url:K2SitePath+"index.php?option=com_k2&view=item&task=vote&user_rating="+rating+"&itemID="+itemID,type:'get',success:function(response){log.removeClass('formLogLoading');log.html(response);$K2.ajax({url:K2SitePath+"index.php?option=com_k2&view=item&task=getVotesPercentage&itemID="+itemID,type:'get',success:function(percentage){$K2('#itemCurrentRating'+itemID).css('width',percentage+"%");setTimeout(function(){$K2.ajax({url:K2SitePath+"index.php?option=com_k2&view=item&task=getVotesNum&itemID="+itemID,type:'get',success:function(response){log.html(response);}});},2000);}});}});});$K2('.classicPopup').click(function(event){event.preventDefault();if($K2(this).attr('rel')){var json=$K2(this).attr('rel');json=json.replace(/'/g,'"');var options=$K2.parseJSON(json);}else{var options={x:900,y:600};}
window.open($K2(this).attr('href'),'K2PopUpWindow','width='+options.x+',height='+options.y+',menubar=yes,resizable=yes');});$K2('div.k2LiveSearchBlock form input[name=searchword]').keyup(function(event){var parentElement=$K2(this).parent().parent();if($K2(this).val().length>3&&event.key!='enter'){$K2(this).addClass('k2SearchLoading');parentElement.find('.k2LiveSearchResults').css('display','none').empty();parentElement.find('input[name=t]').val($K2.now());parentElement.find('input[name=format]').val('raw');var url='index.php?option=com_k2&view=itemlist&task=search&'+parentElement.find('form').serialize();parentElement.find('input[name=format]').val('html');$K2.ajax({url:url,type:'get',success:function(response){parentElement.find('.k2LiveSearchResults').html(response);parentElement.find('input[name=searchword]').removeClass('k2SearchLoading');parentElement.find('.k2LiveSearchResults').css('display','block');}});}else{parentElement.find('.k2LiveSearchResults').css('display','none').empty();}});$K2('a.calendarNavLink').live('click',function(event){event.preventDefault();var parentElement=$K2(this).parent().parent().parent().parent();var url=$K2(this).attr('href');parentElement.empty().addClass('k2CalendarLoader');$K2.ajax({url:url,type:'post',success:function(response){parentElement.html(response);parentElement.removeClass('k2CalendarLoader');}});});$K2('.k2Scroller').css('width',($K2('.k2Scroller').find('.k2ScrollerElement:first').outerWidth(true))*$K2('.k2Scroller').children('.k2ScrollerElement').length);});$K2(window).load(function(){var blocks=$K2('.subCategory, .k2EqualHeights');var maxHeight=0;blocks.each(function(){maxHeight=Math.max(maxHeight,parseInt($K2(this).css('height')));});blocks.css('height',maxHeight);});

/* 66.ja_contentslide.js */

var JS_ContentSlider=new Class({initialize:function(options)
{this.options=$extend({w:100,h:200,num_elem:4,total:0,url:'',mode:'horizontal',direction:'right',wrapper:'ja-slide-wrapper',duration:1000,interval:3000,auto:1},options||{});if(this.options.total){if(this.options.total<this.options.num_elem)this.options.num_elem=this.options.total;this.elements=new Array(this.options.total);}else
this.elements=new Array();this.current=0;this.options.wrapper.setStyle('position','relative');this.options.wrapper.setStyle('overflow','hidden');if(this.options.mode=='vertical'){this.options.wrapper.setStyle('width',this.options.w);this.options.wrapper.setStyle('height',this.options.h*this.options.num_elem);}else{this.options.wrapper.setStyle('width',this.options.w*this.options.num_elem);this.options.wrapper.setStyle('height',this.options.h);}
elems=this.options.wrapper.getElementsByClassName('content_element');for(i=0;i<elems.length;i++){elems[i].setStyle('width',this.options.w);elems[i].setStyle('height',this.options.h);elems[i].setStyle('display','none');}
this.ef_u={};this.ef_d={};this.ef_l={};this.ef_r={};for(i=0;i<=this.options.num_elem;i++){this.ef_u[i]={'top':[i*this.options.h,(i-1)*this.options.h]};this.ef_d[i]={'top':[(i-1)*this.options.h,i*this.options.h]};this.ef_l[i]={'left':[i*this.options.w,(i-1)*this.options.w]};this.ef_r[i]={'left':[(i-1)*this.options.w,i*this.options.w]};}},getFx:function(){if(this.options.mode=='vertical'){if(this.options.direction=='up'){return this.ef_u;}else{return this.ef_d;}}else{if(this.options.direction=='left'){return this.ef_l;}else{return this.ef_r;}}},add:function(text){var divobj=new Element('DIV',{'id':'jsslide_'+this.elements.length,'class':'jsslide'});divobj.innerHTML=text;divobj.setStyle('position','absolute');divobj.setStyle('width',this.options.w);divobj.setStyle('height',this.options.h);if(this.elements.length>1){divobj.injectAfter(this.elements[this.elements.length-2]);}else{divobj.inject(this.options.wrapper);}
this.hide(divobj);this.elements.push(divobj);},update:function(text,ind){divobj=new Element('DIV',{'id':'jsslide_'+ind,'class':'jsslide'});divobj.innerHTML=text;divobj.setStyle('position','absolute');divobj.setStyle('z-index',1);divobj.setStyle('width',this.options.w);divobj.setStyle('height',this.options.h);divobj.inject(this.options.wrapper);this.hide(divobj);this.elements[ind]=divobj;},hide:function(el){if(this.options.mode=='vertical'){el.setStyle('top','-999px');el.setStyle('left','0');}else{el.setStyle('top','0');el.setStyle('left','-999em');}},setPos:function(elems){if(!elems)elems=this.getRunElems();for(var i=0;i<elems.length;i++){var el=elems[i];if(el){if(this.options.mode=='vertical'){if(this.options.direction=='up'){el.setStyle('top',this.options.h*i);}else{el.setStyle('top',this.options.h*(i-1));}}else{if(this.options.direction=='left'){el.setStyle('left',this.options.w*i);}else{el.setStyle('left',this.options.w*(i-1));}}}}},getRunElems:function(){var objs=new Array();if(this.options.direction=='left'||this.options.direction=='up'){adj=0;}else{adj=this.elements.length-1;}
for(var i=0;i<=this.options.num_elem;i++){objs[i]=this.elements[(this.current+i+adj)%this.elements.length];}
if(this.options.total<=this.options.num_elem){if(this.options.direction=='left'||this.options.direction=='up'){objs[this.options.num_elem]=null;}else{objs[0]=null;}}
return objs;},start:function(){this.clearTimeOut();if(!this.elements[this.next()]){this.nextRun();return;}
if(this.elements[this.next()]=='fetching'){this.nextRun();return;}
if(this.running)return;this.running=1;var objs=this.getRunElems();this.setPos(objs);this.x=new Fx.Elements(objs,{duration:this.options.duration,onComplete:this.end.bind(this)});this.x.start(this.getFx());this.current=this.nextCurr();},end:function(){this.running=0;this.nextRun();},clearTimeOut:function(){if(this.timeOut){clearTimeout(this.timeOut);this.timeOut=0;}},nextRun:function(){this.clearTimeOut();if(this.options.total<=this.options.num_elem)return;if(this.options.auto){this.timeOut=setTimeout(this.start.bind(this),this.options.interval);this.fetchNext();}},nextCurr:function(){var next=0;if(this.options.direction=='left'||this.options.direction=='up'){next=(this.current+1)%this.elements.length;}else{next=(this.current+this.elements.length-1)%this.elements.length;}
return next;},next:function(){var next=0;if(this.options.direction=='left'||this.options.direction=='up'){next=(this.current+this.options.num_elem)%this.elements.length;}else{next=(this.current+this.elements.length-1)%this.elements.length;}
return next;},fetchNext:function(){var next=this.next();if(!this.elements[next]){this.elements[next]='fetching';url=this.options.url+'?total='+this.options.total+'&news='+next+'&loadajax=1&modid='+this.options.modid;new Ajax(url,{method:'get',onComplete:function(request){this.update(request,next)}.bind(this)}).request();return;}},fetchUpdate:function(text,next){this.update(text,next);},setDirection:function(direction){this.options.direction=direction;}});

/* 62.core.js */

function switchFontSize(ckname,val){var bd=document.getElementsByTagName('body');if(!bd||!bd.length)return;bd=bd[0];switch(val){case'inc':if(CurrentFontSize+1<7){CurrentFontSize++;}
break;case'dec':if(CurrentFontSize-1>0){CurrentFontSize--;}
break;case'reset':default:CurrentFontSize=DefaultFontSize;}
var newclass='fs'+CurrentFontSize;bd.className=bd.className.replace(new RegExp('fs.?','g'),'');bd.className=trim(bd.className);bd.className+=(bd.className?' ':'')+newclass;createCookie(ckname,CurrentFontSize,365);}
function switchTool(ckname,val){createCookie(ckname,val,365);window.location.reload();}
function cpanel_reset(){var matches=document.cookie.match(new RegExp('(?:^|;)\\s*'+tmpl_name.escapeRegExp()+'_([^=]*)=([^;]*)','g'));if(!matches)return;for(var i=0;i<matches.length;i++){var ck=matches[i].match(new RegExp('(?:^|;)\\s*'+tmpl_name.escapeRegExp()+'_([^=]*)=([^;]*)'));if(ck){createCookie(tmpl_name+'_'+ck[1],'',-1);}}
if(window.location.href.indexOf('?')>-1){window.location.href=window.location.href.substr(0,window.location.href.indexOf('?'));}else{window.location.reload(true);}}
function cpanel_apply(){var elems=document.getElementById('ja-cpanel-main').getElementsByTagName('*');var usersetting={};for(var i=0;i<elems.length;i++){var el=elems[i];if(el.name&&(match=el.name.match(/^user_(.*)$/))){var name=match[1];var value='';if(el.tagName.toLowerCase()=='input'&&(el.type.toLowerCase()=='radio'||el.type.toLowerCase()=='checkbox')){if(el.checked)value=el.value;}else{value=el.value;}
if(usersetting[name]){if(value)usersetting[name]=value+','+usersetting[name];}else{usersetting[name]=value;}}}
for(var k in usersetting){name=tmpl_name+'_'+k;value=usersetting[k].trim();if(value.length>0){createCookie(name,value,365);}}
if(window.location.href.indexOf('?')>-1){window.location.href=window.location.href.substr(0,window.location.href.indexOf('?'));}else{window.location.reload(true);}}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else{expires="";}
document.cookie=name+"="+value+expires+"; path=/";}
function trim(str,chars){return ltrim(rtrim(str,chars),chars);}
function ltrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"");}
function rtrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"");}
function getScreenWidth(){var x=0;if(self.innerHeight){x=self.innerWidth;}else if(document.documentElement&&document.documentElement.clientHeight){x=document.documentElement.clientWidth;}else if(document.body){x=document.body.clientWidth;}
return x;}
function equalHeight(els){els=$$_(els);if(!els||els.length<2)return;var maxh=0;var els_=[];els.each(function(el,i){if(!el)return;els_[i]=el;var ch=els_[i].getCoordinates().height;maxh=(maxh<ch)?ch:maxh;},this);els_.each(function(el,i){if(!el)return;if(el.getStyle('padding-top')!=null&&el.getStyle('padding-bottom')!=null){if(maxh-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt()>0){el.setStyle('min-height',maxh-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt());}}else{if(maxh>0)el.setStyle('min-height',maxh);}},this);}
function getDeepestWrapper(el){while(el.getChildren().length==1){el=el.getChildren()[0];}
return el;}
function fixHeight(els,group1,group2){els=$$_(els);group1=$$_(group1);group2=$$_(group2);if(!els||!group1)return;var height=0;group1.each(function(el){if(!el)return;height+=el.getCoordinates().height;});if(group2){group2.each(function(el){if(!el)return;height-=el.getCoordinates().height;});}
els.each(function(el,i){if(!el)return;if(el.getStyle('padding-top')!=null&&el.getStyle('padding-bottom')!=null){if(height-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt()>0){el.setStyle('min-height',height-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt());}}else{if(height>0){el.setStyle('min-height',height);}}});}
function addFirstLastItem(el){el=$(el);if(!el||!el.getChildren()||!el.getChildren().length)return;el.getChildren()[0].addClass('first-item');el.getChildren()[el.getChildren().length-1].addClass('last-item');}
function $$_(els){if($type(els)=='string')return $$(els);var els_=[];els.each(function(el){el=$(el);if(el)els_.push(el);});return els_;}

/* 60.css.js */

window.addEvent('domready',function(){var sfEls=$$('#ja-cssmenu li');sfEls.each(function(li){if((a=li.getElement('a'))&&li.hasChild(a))li.a=a;else li.a=null;});sfEls.each(function(li){li.addEvent('mouseenter',function(e){clearTimeout(this.timer);if(this.hasClass("havechild"))this.addClass('havechildsfhover').removeClass('havechild');else if(this.hasClass("havesubchild"))this.addClass('havesubchildsfhover').removeClass('havesubchild');this.addClass('sfhover');if(this.a)this.a.addClass('sfhover');});li.addEvent('mouseleave',function(e){this.timer=setTimeout(sfHoverOut.bind(this,e),100);});});});function sfHoverOut(){clearTimeout(this.timer);if(this.hasClass("havechildsfhover"))this.addClass('havechild').removeClass('havechildsfhover');else if(this.hasClass("havesubchildsfhover"))this.addClass('havesubchild').removeClass('havesubchildsfhover');this.removeClass('sfhover');if(this.a)this.a.removeClass('sfhover');}

/* 58.script.js */

var JATypo=new Class({initialize:function(options){this.options=$extend({offsets:{x:10,y:10}},options||{});this.overlay=new Element('div',{'id':'jatypo-overlay'}).inject($(document.body));this.overlay.setStyles({'width':window.getScrollWidth(),'height':window.getScrollHeight()});this.wrapper=$('jatypo-wrap');if(!this.wrapper)return;var button2=new Element('div',{'class':'button2-right jatypo-btn'});if(Browser.ie){button2.innerHTML='<a href="#" onclick="IeCursorFix(); return false;"><span>JATypo</span></a>';}
else
{button2.innerHTML='<span>JATypo</span>';}
this.button=new Element('div',{'class':'button2-left jatypo-button'}).adopt(button2).injectBefore($('editor-xtd-buttons'));this.typos=this.wrapper.getElements('.typo');this.typos.addEvents({'mouseenter':function(){this.addClass('typo-over');var wrapper=$('jatypo-wrap');var sample=this.getElement('.sample');var pos_s=findPos(sample);var pos_w=findPos(wrapper);var scroll_w={x:wrapper.scrollLeft,y:wrapper.scrollTop};var x0=pos_w.x+scroll_w.x;var y0=pos_w.y+scroll_w.y;var w0=wrapper.offsetWidth;var h0=wrapper.offsetHeight;var x1=pos_s.x;var y1=pos_s.y;var w1=sample.offsetWidth;var h1=sample.offsetHeight;if(y1<y0){this.addClass('typo-top').removeClass('typo-bottom')}
if(y1+h1>y0+h0){this.addClass('typo-bottom').removeClass('typo-top')}
if(x1<x0){this.addClass('typo-left').removeClass('typo-right')}
if(x1+w1>x0+w0){this.addClass('typo-right').removeClass('typo-left')}},'mouseleave':function(){this.removeClass('typo-over');},'click':function(){var sample=this.getElement('.sample');var html=sample.innerHTML;if($('jform_content')){jInsertEditorText(html,'jform_content');}
if($('jform_articletext')){jInsertEditorText(html,'jform_articletext');}
if($('jform_description')){jInsertEditorText(html,'jform_description');}
$('jatypo-wrap').style.display='none';}});this.wrapper.injectAfter(this.overlay);this.button.addEvent('click',function(event){event=new Event(event);this.position();event.stop();}.bind(this));this.overlay.addEvent('click',function(){this.wrapper.style.display='none';this.overlay.style.display='none';}.bind(this));var doc=null;if($('jform_articletext_ifr')){doc=$('jform_articletext_ifr').contentWindow.document;}
if($('jform_content_ifr')){doc=$('jform_content_ifr').contentWindow.document;}
if($('jform_description_ifr')){doc=$('jform_description_ifr').contentWindow.document;}
if(doc){var head=doc.getElementsByTagName('head')[0];var css=doc.createElement('link');css.rel='stylesheet';css.type='text/css';css.href=this.options.typocss;head.appendChild(css);}},locate:function(event){var win={'x':window.getWidth(),'y':window.getHeight()};var scroll={'x':window.getScrollLeft(),'y':window.getScrollTop()};var pwin={'x':this.wrapper.offsetWidth,'y':this.wrapper.offsetHeight};var prop={'x':'left','y':'top'};for(var z in prop){var pos=event.page[z]+this.options.offsets[z];if((pos+pwin[z]-scroll[z])>win[z])pos=event.page[z]-this.options.offsets[z]-pwin[z];this.wrapper.style.prop[z]=pos;};this.wrapper.style.display='block';this.overlay.style.display='block';},position:function(){this.wrapper.style.display='block';this.overlay.style.display='block';var pos=this.button.getPosition();var scroll={'x':window.getScrollLeft(),'y':window.getScrollTop()};var pwin={'x':this.wrapper.offsetWidth,'y':this.wrapper.offsetHeight};jaTop=pos.y+this.options.offsets.y-pwin.y;if(jaTop<0){jaTop=0;}
this.wrapper.setStyles({'left':pos.x+this.options.offsets.x,'top':jaTop});}});function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);}
return{x:curleft,y:curtop};}


