function getElementsWithClass(tagName,matchClass) {
var elems = document.getElementsByTagName(tagName), i;
var result=[];
for (i in elems) {
if((' ' + elems[i].className + ' ').indexOf(' ' + matchClass + ' ')
> -1) {
result.push(elems[i]);
}
}
return result;
}
function shuffle(array) {
var currentIndex = array.length
, temporaryValue
, randomIndex
;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
function replaceContent() {
var columns = [document.getElementById('col_1'),document.getElementById('col_2'),document.getElementById('col_3')];
var items = getElementsWithClass('li','tumblr_photo_post');
var postbody = getElementsWithClass('ol','tumblr_posts')[0];
var data = [];
for (var i=0;i';
}
postbody.parentElement.removeChild(postbody);
}
replaceContent();