/* Last update: 13.01.2012, lembit@ux.ee */
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js'];c=b.join(' ');h.className+=' '+c;return c;};css_browser_selector(navigator.userAgent);(function($)
{$.fn.jTweetsAnywhere=function(options)
{var baseSelector=this.selector;var options=$.extend({username:'asirel',list:null,searchParams:null,count:0,tweetProfileImagePresent:null,showFollowButton:false,showConnectButton:false,showLoginInfo:false,showTweetBox:false,loadingDecorator:defaultLoadingDecorator,mainDecorator:defaultMainDecorator,tweetFeedDecorator:defaultTweetFeedDecorator,tweetDecorator:defaultTweetDecorator,tweetProfileImageDecorator:defaultTweetProfileImageDecorator,tweetBodyDecorator:defaultTweetBodyDecorator,tweetTextDecorator:defaultTweetTextDecorator,tweetTimestampDecorator:defaultTweetTimestampDecorator,connectButtonDecorator:defaultConnectButtonDecorator,loginInfoDecorator:defaultLoginInfoDecorator,loginInfoContentDecorator:defaultLoginInfoContentDecorator,followButtonDecorator:defaultFollowButtonDecorator,tweetBoxDecorator:defaultTweetBoxDecorator,linkDecorator:defaultLinkDecorator,usernameDecorator:defaultUsernameDecorator,hashtagDecorator:defaultHashtagDecorator,_tweetBoxConfig:{counter:true,width:515,height:65,label:"What's happening?",defaultContent:'',onTweet:function(textTweet,htmlTweet){}},_connectButtonConfig:{size:"medium"},_baseElement:null,_tweetFeedElement:null,_followButtonElement:null,_loginInfoElement:null,_connectButtonElement:null,_tweetBoxElement:null,_loadingIndicatorElement:null},options);if(!options.mainDecorator)
return;if(typeof(options.username)!='string')
{if(!options.searchParams)
options.searchParams=['q=from:'+options.username.join(" OR from:")];options.username=options.username[0];}
if(options.tweetProfileImagePresent==null)
options.tweetProfileImagePresent=(options.list||options.searchParams)&&options.tweetProfileImageDecorator;if(typeof(options.showTweetBox)=='object')
{options._tweetBoxConfig=options.showTweetBox;options.showTweetBox=true;}
if(typeof(options.showConnectButton)=='object')
{options._connectButtonConfig=options.showConnectButton;options.showConnectButton=true;}
if(options.count<=0)
options.tweetFeedDecorator=null;if(!options.showFollowButton)
options.followButtonDecorator=null;if(!options.showTweetBox)
options.tweetBoxDecorator=null;if(!options.showConnectButton)
options.connectButtonDecorator=null;if(!options.showLoginInfo)
options.loginInfoDecorator=null;$.ajaxSetup({cache:true});return this.each(function()
{options._baseElement=$(this);if(options.tweetFeedDecorator&&options.loadingDecorator)
{options._loadingIndicatorElement=$(options.loadingDecorator(options));options._baseElement.append(options._loadingIndicatorElement);}
options._tweetFeedElement=options.tweetFeedDecorator?$(options.tweetFeedDecorator(options)):null;options._followButtonElement=options.followButtonDecorator?$(options.followButtonDecorator(options)):null;options._tweetBoxElement=options.tweetBoxDecorator?$(options.tweetBoxDecorator(options)):null;options._connectButtonElement=options.connectButtonDecorator?$(options.connectButtonDecorator(options)):null;options._loginInfoElement=options.loginInfoDecorator?$(options.loginInfoDecorator(options)):null;if(options.mainDecorator)
options.mainDecorator(options);if(options.tweetFeedDecorator)
{$.getJSON(getTwitterUrl(options),function(data,textStatus)
{if(options._loadingIndicatorElement)
options._loadingIndicatorElement.remove();if(data.error)
{return;}
else
{$.each(data.results||data,function(idx,tweet)
{if(options._tweetFeedElement)
$(options._tweetFeedElement).append(options.tweetDecorator(tweet,options));});if(isAnywherePresent())
{twttr.anywhere(function(T)
{T(baseSelector).hovercards();T(baseSelector+' img').hovercards({username:function(node){return node.alt;}});});}}});}
if(isAnywherePresent())
{twttr.anywhere(function(T)
{if(options.tweetBoxDecorator)
{T(baseSelector+' .jta-tweet-box').tweetBox(options._tweetBoxConfig);}
if(options.followButtonDecorator)
{T(baseSelector+' .jta-follow-button').followButton(options.username);}
if(options.connectButtonDecorator)
{var o=$.extend({authComplete:function(user)
{updateLoginInfoElement(baseSelector,options,T);},signOut:function()
{updateLoginInfoElement(baseSelector,options,T);}},options._connectButtonConfig);T(baseSelector+' .jta-connect-button').connectButton(o);updateLoginInfoElement(baseSelector,options,T);}});}});};defaultMainDecorator=function(options)
{if(options._tweetFeedElement)
options._baseElement.append(options._tweetFeedElement);if(options._connectButtonElement)
options._baseElement.append(options._connectButtonElement);if(options._loginInfoElement)
options._baseElement.append(options._loginInfoElement);if(options._followButtonElement)
options._baseElement.append(options._followButtonElement);if(options._tweetBoxElement)
options._baseElement.append(options._tweetBoxElement);};defaultTweetFeedDecorator=function(options)
{return'<ul class="jta-tweet-list"></ul>';};defaultTweetDecorator=function(tweet,options)
{var html='';if(options.tweetProfileImagePresent)
html+=options.tweetProfileImageDecorator(tweet,options);if(options.tweetBodyDecorator)
html+=options.tweetBodyDecorator(tweet,options);html+='<div class="jta-clear">&nbsp;</div>';return'<li class="jta-tweet-list-item">'+html+'</li>';};defaultTweetProfileImageDecorator=function(tweet,options)
{var screenName=tweet.user?tweet.user.screen_name:false||tweet.from_user;var imageUrl=tweet.user?tweet.user.profile_image_url:false||tweet.profile_image_url;var html='<a class="jta-tweet-profile-image-link" href="http://twitter.com/'+screenName+'" target="_blank">'+'<img src="'+imageUrl+'" alt="'+screenName+'"'+
(isAnywherePresent()?'':(' title="'+screenName+'"'))+' width="48" height="48" border="0"/>'+'</a>';return'<div class="jta-tweet-profile-image">'+html+'</div>';};defaultTweetBodyDecorator=function(tweet,options)
{var html='';if(options.tweetTextDecorator)
html+=options.tweetTextDecorator(tweet,options);if(options.tweetTimestampDecorator)
html+=options.tweetTimestampDecorator(tweet,options);return'<div class="jta-tweet-body '+(options.tweetProfileImagePresent?'jta-tweet-body-list-profile-image-present':'')+'">'+html+'</div>';};defaultTweetTextDecorator=function(tweet,options)
{var tweetText=options.linkDecorator?options.linkDecorator(tweet.text,options):tweet.text;if(options.usernameDecorator)
tweetText=options.usernameDecorator(tweetText,options);if(options.hashtagDecorator)
tweetText=options.hashtagDecorator(tweetText,options);return'<span class="tweet-text">'+tweetText+'</span>';};defaultTweetTimestampDecorator=function(tweet,options)
{var createdAt=formatDate(tweet.created_at);var diff=parseInt((new Date().getTime()-Date.parse(createdAt))/1000);var tweetTimestamp='';if(diff<60)
{tweetTimestamp+='less than a minute ago';}
else if(diff<3600)
{var t=parseInt((diff+30)/60);tweetTimestamp+=t+' minute'+(t==1?'':'s')+' ago';}
else if(diff<86400)
{var t=parseInt((diff+1800)/3600);tweetTimestamp+='about '+t+' hour'+(t==1?'':'s')+' ago';}
else
{var t=parseInt((diff+43200)/86400);tweetTimestamp+='about '+t+' day'+(t==1?'':'s')+' ago';var d=new Date(createdAt);var period='AM';var hours=d.getHours();if(hours>12)
{hours-=12;period='PM';}
var mins=d.getMinutes();var minutes=(mins<10?'0':'')+mins;tweetTimestamp+=' ('+hours+':'+minutes+' '+period+' '+(d.getMonth()+1)+'/'+d.getDate()+'/'+d.getFullYear()+')';}
return'<span class="jta-tweet-timestamp">'+tweetTimestamp+'</span>';};defaultConnectButtonDecorator=function(options)
{return'<div class="jta-connect-button"></div>';};defaultLoginInfoDecorator=function(options)
{return'<div class="jta-login-info"></div>';};defaultLoginInfoContentDecorator=function(options,T)
{var html='';if(T.isConnected())
{var screenName=T.currentUser.data('screen_name');var imageUrl=T.currentUser.data('profile_image_url');html='<div class="jta-login-info-profile-image">'+'<a href="http://twitter.com/'+screenName+'" target="_blank">'+'<img src="'+imageUrl+'" alt="'+screenName+'" title="'+screenName+'"'+' width="48" height="48" border="0"/>'+'</a>'+'</div>'+'<div class="jta-login-info-block">'+'<div class="jta-login-info-screen-name">'+'<a href="http://twitter.com/'+screenName+'" target="_blank">'+screenName+'</a>'+'</div>'+'<div class="jta-login-info-sign-out">'+'Sign out'+'</div>'+'</div>'+'<div class="jta-clear">&nbsp;</div>';}
return html;};defaultFollowButtonDecorator=function(options)
{return'<div class="jta-follow-button"></div>';};defaultTweetBoxDecorator=function(options)
{return'<div class="jta-tweet-box"></div>';};defaultLinkDecorator=function(text,options)
{return text.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1" class="jta-tweet-a jta-tweet-link" target="_blank" rel="nofollow">$1<\/a>');};defaultUsernameDecorator=function(text,options)
{return isAnywherePresent()?text:text.replace(/@([a-zA-Z0-9_]+)/gi,'@<a href="http://twitter.com/$1" class="jta-tweet-a twitter-anywhere-user" target="_blank" rel="nofollow">$1<\/a>');};defaultHashtagDecorator=function(text,options)
{return text.replace(/#([a-zA-Z0-9_]+)/gi,'<a href="http://search.twitter.com/search?q=%23$1" class="jta-tweet-a jta-tweet-hashtag" title="#$1" target="_blank" rel="nofollow">#$1<\/a>');};defaultLoadingDecorator=function(options)
{return'<div class="jta-loading">loading ...</div>';};getTwitterUrl=function(options)
{var url=('https:'==document.location.protocol?'https:':'http:');if(options.searchParams)
{var searchParams=(options.searchParams instanceof Array)?options.searchParams.join('&'):options.searchParams;url+='//search.twitter.com/search.json?'+searchParams+'&rpp='+options.count+'&callback=?';}
else if(options.list)
{url+='//api.twitter.com/1/'+options.username+'/lists/'+options.list+'/statuses.json?per_page='+
options.count+'&callback=?';}
else
{url+='//api.twitter.com/1/statuses/user_timeline.json?screen_name='+options.username+'&count='+
options.count+'&include_rts=true&callback=?';}
return url;};updateLoginInfoElement=function(baseSelector,options,T)
{if(options._loginInfoElement&&options.loginInfoContentDecorator)
{options._loginInfoElement.children().remove();options._loginInfoElement.append(options.loginInfoContentDecorator(options,T));$(baseSelector+' .jta-login-info-sign-out').bind('click',function()
{twttr.anywhere.signOut();});}};isAnywherePresent=function()
{return typeof(twttr)!='undefined';};formatDate=function(dateStr)
{return dateStr.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i,'$1,$2$4$3');};})(jQuery);jQuery(function($){if(!$('.content-fragment.blog-feedback-list .content-list').length){$('.content-fragment.blog-feedback-list').addClass('no-comments');}});jQuery(function($){if($('#twitter-asirel')){$('#twitter-asirel').jTweetsAnywhere({username:'asirel',count:5,loadingDecorator:false,tweetTimestampDecorator:false,tweetDecorator:function(tweet,options){var html='';if(options.tweetProfileImagePresent)
html+=options.tweetProfileImageDecorator(tweet,options);if(options.tweetBodyDecorator)
html+=options.tweetBodyDecorator(tweet,options);return'<li>'+html+'</li>';}});}});jQuery(function($){$(window).load(function(){if($('#twitter-asirel .jta-tweet-list')){$('<a rel="me" class="url uid twitter twitter-anywhere-user" href="http://twitter.com/asirel">@asirel</a>').appendTo($('#twitter-asirel'));}});});jQuery(function($){var fbfrm=$('.content-fragment.contact-blog fieldset.field-list');if(fbfrm){$(fbfrm).find('label').eq(3).hide();}});jQuery(function($){var srchfrm=$('.content-fragment.search-form .search div');if(srchfrm){$(srchfrm).find('input.searchField').css({background:"none",width:"177px"});$(srchfrm).find('input.search-button').css({background:"none"});$(srchfrm).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});$('.content-fragment.search-form .search input').focus(function(){$(srchfrm).addClass('focus');});$('.content-fragment.search-form .search input').blur(function(){$(srchfrm).removeClass('focus');});}});jQuery(function($){var copyr=$('.copyright-info ul.footer-fragment-links');if(copyr){$(copyr).find('li.abuse').hide();$(copyr).find('li.version').hide();}});jQuery(function($){var frmflds=$('.field-item-input').children();if(frmflds){$(frmflds).each(function(){$(this).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});$(this).focus(function(){$(this).addClass('focus');});$(this).blur(function(){$(this).removeClass('focus');});});}});jQuery(function($){var arch=$('.blog-archive-list .content-list');var archtrggr=$('.right-sidebar .archive.trigger');if(arch&&archtrggr){$(archtrggr).show();$(archtrggr).click(function(){$(arch).slideToggle('400');$(this).toggleClass('active');});}});jQuery(function($){$(window).load(function(){var dbldrop=$('.content-fragment-content .dropj .dropj');if(dbldrop){$(dbldrop).each(function(){$(this).css('font-size','33.075px');$(this).css('line-height','30.87px');$(this).parent().replaceWith(dbldrop);});}});});(function($){var CJKrx=/^\s*([^\uAC00-\uD7A3\u4E00-\u9FFF]?[\u00C0-\u02B8\uAC00-\uD7A3\u4E00-\u9FFF])(.*)/im;var ExtRx=/^\s*([^a-z\u00C0-\u02B8]?[a-z\u00C0-\u02B8])(.*)/im;var ASCIIrx=/^\s*(\W?[a-z])(.*)/im;var UnifiedRx=/^\s*([^a-z\u00C0-\u02B8\uAC00-\uD7A3\u4E00-\u9FFF]?[a-z\u00C0-\u02B8\uAC00-\uD7A3\u4E00-\u9FFF])(.*)/im;var UnifiedRxPlusNo=/^\s*([^a-z0-9\u00C0-\u02B8\uAC00-\uD7A3\u4E00-\u9FFF]?[a-z0-9\u00C0-\u02B8\uAC00-\uD7A3\u4E00-\u9FFF])(.*)/im;var Mode={"ascii":ASCIIrx,"cjk":CJKrx,"extended":ExtRx,"unified":UnifiedRx,"unifiedplus":UnifiedRxPlusNo};var dCSS={opacity:1,padding:0,display:"block",textAlign:"center",float:"left",fontStyle:"normal",fontWeight:"bold",overflow:"visible",textDecoration:"none",color:"white",backgroundImage:"url('http://cdn.ux.ee/ms/evangelism/img/dropj_01.png')",backgroundRepeat:"repeat-x",marginRight:"4px",minWidth:"37px",height:"35px",paddingTop:"3px",paddingRight:"3px"};$.fn.dropJ=function(arg){var opts=$.extend({},$.fn.dropJ.defaults,arg);return this.each(function(){$this=$(this);var o=$.meta?$.extend({},opts,$this.data()):opts;if(_addDropCap($this.get(0),$this.get(0),o)&&o.clear){$this.css({clear:"left"});}});};$.fn.dropJ.defaults={"css":dCSS,"clear":true,"keepCase":true,"regex":Mode.unified,"element":"span","factor":1.5,"toggleFamily":false,"class":"dropj"};function _addDropCap(c,n,o){var rx=Mode.unifiedplus;if((n.nodeType==3)&&n.nodeValue.match(rx)){var val=n.nodeValue;val=val.replace(/\n+/g," ");var capRemainder=val.match(rx);var capText=capRemainder?capRemainder[capRemainder.length-2]:'';var remainderText=capRemainder?capRemainder[capRemainder.length-1]:'';if(!o.keepCase)capText=capText.toUpperCase();var cap=document.createTextNode(capText);var remainder=document.createTextNode(remainderText);var dropCap=document.createElement(o["element"]);dropCap.appendChild(cap);n.parentNode.replaceChild(remainder,n);remainder.parentNode.insertBefore(dropCap,remainder);$(dropCap).css(o["css"]);$(dropCap).addClass(o["class"]);_setSpecialCSS(c,dropCap,o)
return dropCap;}
else if(n.nodeType==3){$(n).parent().css({float:"left",display:"inline"});}
for(var i=0;i<n.childNodes.length;i++){var dc=_addDropCap(c,n.childNodes[i],o);if(dc)return dc;}};function _setSpecialCSS(c,dc,o){var h=$(dc).css("lineHeight");if(o.factor==true){if(o.hang){var fs=($(c).height())+"px";var lh=($(c).height()*.9)+"px";$(dc).css({fontSize:fs,lineHeight:lh});_update_hang(dc);}else{var i=6;while(i--){if($(dc).height()>=$(c).height())break;if($(dc).width()>(.4*$(c).width()))break;var fs=($(c).height()*1.2)+"px";var lh=($(c).height()*1)+"px";$(dc).css({fontSize:fs,lineHeight:lh});}
var mb=(-1*$(dc).height()/9)+"px";$(dc).css({marginBottom:mb});}}
else if(h.substr(h.length-2,2)=="px"){var px=h.substring(0,h.length-2);var mt=(-1*Math.round(px/10))+"px";var mb=(-1*Math.round(px/5))+"px";$(dc).css({marginTop:mt,marginBottom:mb});var fs=(o.factor*1.05*px)+"px";var lh=(o.factor*px*0.98)+"px";$(dc).css({fontSize:fs,lineHeight:lh});}else{var fs=(o.factor*1.05)+"em";$(dc).css({fontSize:fs});$(dc).css({margin:"-.1ex 0 -.25ex 0",lineHeight:"95%"});}
if(o.hang)_update_hang(dc);}
function _update_hang(dc){var m=(-1*$(dc).width())+"px";$(dc).css({marginLeft:m,marginRight:m});}})(jQuery);
