hasAd=0;
var sct = document.getElementsByTagName("script");
for ( var i=0; i<sct.length; i++) {
  if(sct[i].src.match(/(alimama|qunsee|vodone|googlesyndication|taobao)/)) {alert("ADs here"); hasAd=1}
}
if(hasAd == 0) {
  if (window.location.href.indexOf('logs')==-1) {
    para = "?user=" + user + "&id=";
    for (var a = getElementsByClass("readmore",null,"a"),i = 0; i < a.length; i++ ){
      if (i != a.length-1 ) {
        para += a[i].href.replace(/.*?(\d+)\.html/g,"$1") + ","
      } else {
        para += a[i].href.replace(/.*?(\d+)\.html/g,"$1")
      }
    }
    document.write("<script src='http://blogbusstat.appspot.com/"+para+"'></"+"script>");
  } else {
    if (location.href.match(/.*?(\d+)\.html/)) {
    para = "?user="+user+"&id=" +  location.href.replace(/.*?(\d+)\.html/g,"$1") ;
    document.write("<script src='http://blogbusstat.appspot.com/add"+para+"'></"+"script>");
    }
  }
} else {
  alert("you need to remove your ads in your blog to contiune use this plugin!<br/>or you can buy an plugin accout for your blog!")
}
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}