$(document).ready(function() {

//smooth scroll
if (! $.browser.safari) {
$(".toTop").click(function () {
$(this).blur();
$("html,body").animate({ scrollTop: 0 }, 'normal');
return false;
});
}

/*var plv = 0 ;
$("#entries ul li a").each(function(){
var txVal = $("#entries ul li a").eq(plv).text().length;
if(txVal >= 14) {
var txStr = $("#entries ul li a").eq(plv).text().slice(0,15);
$("#entries ul li a").eq(plv).text(txStr + "...");
}
plv = plv + 1 ;
});*/

//pager dev => www
$(".pager").css("display","block");
$.each($(".pager a[href^=http://dev]"),function(){
$(this).attr("href",$(this).attr("href").replace("dev","www"));
});

});

/* calendar fix */
$("#calendar").addClass("section");

/* pop up */
window.onload = function (){
var node_a = document.getElementsByTagName('a');
for (var i in node_a) {
if(node_a[i].className == 'popup'){
node_a[i].onclick = function() {
return winOpen(this.href, this.rel)
};
}
}
} ;

function winOpen(url, rel) {
var split = rel.split(',') ;
window.open(
url,'popup',
'width='+ split[0] +',height='+ split[1] +',toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes');

return false;
};
