var buzzstat=
{
		  init:function(site_id)
		  {
					 if(document.location.protocol=="https:")
					 {
								buzzstat.domain="https://static.buzzstat.com";buzzstat.secure=1;
					 }
					 else
					 {
								buzzstat.domain="http://static.buzzstat.com";buzzstat.secure=0;
					 }

					 buzzstat.img=new Image();
					 //buzzstat.img_base=buzzstat.domain+"/in.php?site_id="+site_id+"&res="+screen.width+"x"+screen.height+"&lang="+(navigator.language||navigator.browserLanguage).substr(0,2)+"&secure="+buzzstat.secure;
					 buzzstat.img_base=buzzstat.domain+"/pageload.php?site_id="+site_id+"&res="+screen.width+"x"+screen.height+"&lang="+(navigator.language||navigator.browserLanguage).substr(0,2)+"&secure="+buzzstat.secure;

					 if(buzzstat_custom.session)
					 {
								for(var i in buzzstat_custom.session)
								{
										  buzzstat.img_base+="&custom["+buzzstat.enc(i)+"]="+buzzstat.enc(buzzstat_custom.session[i]);
								}
					 }
					 
					 if(buzzstat_custom.goal)
					 {
								for(var i in buzzstat_custom.goal)
								{
										  buzzstat.img_base+="&goal["+buzzstat.enc(i)+"]="+buzzstat.enc(buzzstat_custom.goal[i]);
								}
					 }
					 
					 //var r=RegExp("^https?://[^/]*"+location.host.replace(/^www\./i,"")+"/","i").test(document.referrer)?"":buzzstat.enc(document.referrer);
					 var r = document.referrer;
					 
					 if(buzzstat_custom.pageview_disable)
					 {
								buzzstat.img_base+="&ref="+r;
					 }
					 else
					 {
								buzzstat.img.src=buzzstat.img_base+"&ref="+r+"&title="+buzzstat.enc(buzzstat_custom.title?buzzstat_custom.title:document.title)+"&href="+buzzstat.enc(buzzstat_custom.href?buzzstat_custom.href:location.pathname+location.search)+"&x="+Math.random();
					 }
				
					 buzzstat.add_event(window,'load',buzzstat.advanced);
		  },
					 
		  isset:function(e)
		  {
					 return(typeof(window[e])!="undefined");
		  },
		  
		  enc:function(e)
		  {
					 return window.encodeURIComponent?encodeURIComponent(e):escape(e);
		  },
		  
		  log:function(href,title,type)
		  {
					 type=type||"click";
					 if(type=="pageview")href=href.replace(/^https?:\/\/([^\/]+)/i,"");
					 buzzstat.img.src=buzzstat.img_base+"&type="+type+"&title="+buzzstat.enc(title)+"&href="+buzzstat.enc(href)+"&x="+Math.random();
					 buzzstat.pause();
		  },
		  
		  pause:function(x)
		  {
					 var now=new Date();
					 var stop=now.getTime()+(x||buzzstat_custom.timer||500);
								while(now.getTime()<stop)
										  var now=new Date();
		  },
		  
		  goal:function(id,revenue)
		  {
					 buzzstat.img.src=buzzstat.img_base+"&type=goal&goal[id]="+id+"&goal[revenue]="+revenue+"&x="+Math.random();
		  },
		  
		  add_event:function(e,type,func)
		  {
					 if(e.addEventListener)
					 {
								e.addEventListener(type,func,false);
					 }
					 else if(e.attachEvent)
					 {
								e.attachEvent("on"+type,func);
					 }
		  },
		  
		  download:function(e)
		  {
					 buzzstat.img_src(e,"download");
		  },
		  
		  outbound:function(e)
		  {
					 buzzstat.img_src(e,"outbound");
		  },
		  
		  click:function(e)
		  {
					 buzzstat.img_src(e,"click");
		  },
		  
		  img_src:function(e,type)
		  {
					 obj=buzzstat.get_target(e);
					 buzzstat.log(buzzstat.get_href(obj),buzzstat.get_text(obj),type);
		  },
		  
		  get_text:function(e)
		  {
					 do
					 {
								var txt=e.text?e.text:e.innerText;
								if(txt)
										  return txt;
								if(e.alt)
										  return e.alt;
								if(e.title)
										  return e.title;
								if(e.src)
										  return e.src;
								e=buzzstat.get_parent(e);
					 }
					 while(e);

					 return"";
		  },
		  
		  get_href:function(e)
		  {
					 do
					 {
								if(e.href&&!e.src)
										  return 
								e.href;
								e=buzzstat.get_parent(e);
					 }
					 while(e);
					 return"";
		  },
		  
		  get_parent:function(e)
		  {
					 return e.parentElement||e.parentNode;
		  },
		  
		  get_target:function(e)
		  {
					 if(!e)
								var e=window.event;
								var t=e.target?e.target:e.srcElement;
								if(t.nodeType&&t.nodeType==3)
										  t=t.parentNode;
					 return t;
		  },
		  
		  advanced:function()
		  {
					 //alert(buzzstat.img_base);

					 if(buzzstat_custom.advanced_disable)
								return;

					 var is_download=new RegExp("\\.(7z|aac|avi|cab|csv|doc(x|m)?|exe|flv|gif|gz|jpe?g|js|m4a|mp(3|4|e?g)|mov|msi|ods|pdf|phps|png|ppt(x|m)?|rar|rtf|sea|sit|tar|torrent|txt|wma|wmv|xls(x|m)?|xml|zip)$","i");
					 var is_link=new RegExp("^(https?|ftp|telnet|mailto):","i");
					 var is_link_internal=new RegExp("^https?:\/\/(.*)"+location.host.replace(/^www\./i,""),"i");
					 var a=document.getElementsByTagName("a");

					 for(var i=0;i<a.length;i++)
					 {
								if(a[i].className.match(/buzzstat_log/i))
								{
										  if(a[i].className.match(/buzzstat_log_download/i))
										  {
													 buzzstat.add_event(a[i],"mousedown",buzzstat.download);
										  }
										  else if(a[i].className.match(/buzzstat_log_outbound/i))
										  {
													 buzzstat.add_event(a[i],"mousedown",buzzstat.outbound);
										  }
										  else
										  {
													 buzzstat.add_event(a[i],"mousedown",buzzstat.click);
										  }
								}
								else
								{
										  if(is_link.test(a[i].href)&&!a[i].className.match(/buzzstat_ignore/i))
										  {
													 if(is_download.test(a[i].href))
													 {
																buzzstat.add_event(a[i],"mousedown",buzzstat.download);
													 }
													 else if(!is_link_internal.test(a[i].href))
													 {
																buzzstat.add_event(a[i],"mousedown",buzzstat.outbound);
													 }
										  }
								}
					 }

		  }
};
		  
if(!buzzstat.isset("buzzstat_custom"))
		  buzzstat_custom={};
if(buzzstat.isset("buzzstat_page_title"))
		  buzzstat_custom.title=buzzstat_page_title;
if(buzzstat.isset("buzzstat_advanced_disable"))
		  buzzstat_custom.advanced_disable=1;
if(buzzstat.isset("buzzstat_pause_timer"))
		  buzzstat_custom.timer=buzzstat_pause_timer;
if(buzzstat.isset("buzzstat_custom_session"))
		  buzzstat_custom.session=buzzstat_custom_session;
if(buzzstat.isset("buzzstat_goal"))
		  buzzstat_custom.goal=buzzstat_goal;

function statsgoyes(site_id)
{
		  buzzstat.init(site_id);
}

statsgoyes(_uacct);


