function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1) { var s = strx.split("<"); for(var i=0;i<s.length;i++){ if(s[i].indexOf(">")!=-1){ s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length); } } strx = s.join("");}
chop = (chop < strx.length-1) ? chop : strx.length-2; while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++; strx = strx.substring(0,chop-1); return strx+'...';}

var titles=new Array();
var titlesNum=0;
var urls=new Array();
var time=new Array();
function related_results_labels(c)
	{
	for(var b=0;
	b<c.feed.entry.length;
	b++)
		{
		var d=c.feed.entry[b];
		titles[titlesNum]=d.title.$t;
		for(var a=0;
		a<d.link.length;
		a++)
			{
			if(d.link[a].rel=="alternate")
				{
				urls[titlesNum]=d.link[a].href;
				time[titlesNum]=d.published.$t;
				titlesNum++;
				break
			}
		}
	}
}
function removeRelatedDuplicates()
	{
	var b=new Array(0);
	var c=new Array(0);
	e=new Array(0);
	for(var a=0;
	a<urls.length;
	a++)
		{
		if(!contains(b,urls[a]))
			{
			b.length+=1;
			b[b.length-1]=urls[a];
			c.length+=1;
			c[c.length-1]=titles[a];
			e.length+=1;
			e[e.length-1]=time[a]
		}
	}
	titles=c;
	urls=b;
	time=e
}
function contains(b,d)
	{
	for(var c=0;
	c<b.length;
	c++)
		{
		if(b[c]==d)
			{
			return true
		}
	}
	return false
}

function printRelatedLabels(a){for(var b=0;b<urls.length;b++){if(urls[b]==a){urls.splice(b,1);titles.splice(b,1);time.splice(b,1)}}var c=Math.floor((titles.length-1)*Math.random());var b=0;document.write("<ul class='list-group'>");if(titles.length==0){document.write("<li class='list-group-item'>There is not any related post </li>")}else{while(b<titles.length&&b<20&&b<maxresults){document.write('<a href="'+urls[c]+'" title="'+time[c].substring(8,10)+"/"+time[c].substring(5,7)+"/"+time[c].substring(0,4)+'"><li class="list-group-item"><i class="fa fa-angle-right"></i> '+titles[c]+"</li></a>");if(c<titles.length-1){c++}else{c=0}b++}}document.write("</ul>");urls.splice(0,urls.length);titles.splice(0,titles.length)};

function t(e)
	{
	var n=e.split(" ");
	for(var i=0;
	i<n.length;
	i++)document.write("<a href=/search?q="+n[i]+" title="+n[i]+">"+n[i]+"</a>, ")
}
