var sys_url = "http://topmalaysia.com/"
//var siteid = "userid";
//var width = 88;
//var height = 31;
var visited = 1;
var cookies_name = 'Top!Malaysia_visited_site_'+siteid;

function  readCookie(name)  
{  
   var  cookieValue = "";  
   var  search = name + "=";  
   if(document.cookie.length > 0)  
   {    
       offset = document.cookie.indexOf(search);  
       if (offset != -1)  
       {  
           offset += search.length;  
           end = document.cookie.indexOf(";", offset);  
           if  (end == -1) end = document.cookie.length;  
           cookieValue = unescape(document.cookie.substring(offset, end))  
       }  
   }  
   return  cookieValue;  
}  

//document.write (readCookie(cookies_name)+' <--COOKIENAME')

if(readCookie(cookies_name).length < 1)
{
	writeCookie(cookies_name, "visited", 24); 
	//alert(readCookie(cookies_name)); 
	visited = 0;
}


function  writeCookie(name, value, hours)  
{  
   var  expire = "";  
   if(hours != null)  
   {
       expire = new Date((new Date()).getTime() + hours * 3600000);  
       expire = "; expires=" + expire.toGMTString();  
   }  
   document.cookie = name + "=" + escape(value) + expire;  
}  

//if(typeof(width)=="undefined") width=88;
//if(typeof(height)=="undefined") height=31;
if(typeof(style)=="undefined") style="logo";
var page = escape(location.href);
var ref = escape(document.referrer);
var count = sys_url 
			   + "top_counter.asp" + "?id=" + siteid
			   + "&s=" + style + "&p=" + page + "&r=" + ref + "&v=" + visited;

document.write('<a href="'+sys_url+'in.asp?siteid='+siteid+'" target="_blank">'
	+ '<img src="'+count+'" alt="Top!Malaysia - The First Top List in Malaysia." border=0>'
	+ '</a>');

//End of count.js