
var count_ed=new Date();
var count_now=parseInt(count_ed.getTime());
var count_gid=gccook('count_g8');
var count_eid=0;
//var count_eid=gccook('count_e8');
var rep=1;
var lang=!-[1,] ? navigator.systemLanguage :window.navigator.language;
var count_et=(86400-count_ed.getHours()*3600-count_ed.getMinutes()*60-count_ed.getSeconds());
count_ed.setTime(count_now+1000*(count_et-count_ed.getTimezoneOffset()*60));

if(count_gid==undefined || count_gid==null || count_gid.length!=32){ count_gid=newGuid();rep=0;}
//if(count_eid==undefined || count_eid==null){count_eid=0;}
//if(count_eid>0) document.cookie='count_e8='+count_eid+';expires='+count_ed.toGMTString()+ '; path=/';

count_ed.setTime(count_now+1000*86400*182);
document.cookie='count_g8='+escape(count_gid)+ ';expires='+count_ed.toGMTString()+';path=/';

var js_data='&es='+count_eid+'&gs='+count_gid+'&rp='+rep+'&lp='+escape(location.href.substr(0,512))+'&r='+escape(document.referrer.substr(0,512))+'&lg='+escape(lang)+'&showp='+escape(screen.width+'x'+screen.height); 
document.write('<img src="http://asiavtour.com/count/stat.php?id=8'+js_data+'" border=0 width=0 height=0 />');

function gvcook(of){
	var es = document.cookie.indexOf(';',of);
	if(es==-1) es=document.cookie.length;
	return unescape(document.cookie.substring(of,es));
}
function gccook(n){
	var arg=n+'=';
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while(i<clen){
		var j=i+alen;
		if(document.cookie.substring(i,j)==arg) return gvcook(j);
		i=document.cookie.indexOf(' ',i)+1;
		if(i==0)	break;
	}
	return -1;
}
function newGuid()
{
    var guid = '';
    for (var i = 1; i <= 32; i++){
      var n = Math.floor(Math.random()*16.0).toString(16);
      guid +=   n;
    }
    return guid;    
}
