d = document;

/////////////////////////////////////////////////////////////////////////////////////
//	GET THE USER-ID
/////////////////////////////////////////////////////////////////////////////////////

function GetID(TheID)
    {
UserID	= "";
Key 	= "";

	for(q = 0; q < TheID.length; q += 2)
		{
	UserID = parseInt(TheID.substr(q,[2])) + 23;
	UserID = unescape('%' + UserID.toString(16));
	Key += UserID;
		}

UserID = unescape(Key);
return UserID;
	}

UserID1 = GetID('77869224958292829376889487932476808224938286789123898189');
UserID2 = GetID('77869224958292829376889487932476808224929374939923898189');

/////////////////////////////////////////////////////////////////////////////////////
//	(ALWAYS) WRITE THE PAGE-TIMER
/////////////////////////////////////////////////////////////////////////////////////

function Timer(CountBook)
	{
if(d.getElementById("Timer"))	{d.getElementById("Timer").src = UserID1+"?b="+CountBook+"&i="+(new Date()).getTime();}
else							{d.write('<img src="dms/visitcount/img/pix.gif" width="1" height="1" alt="" style="display:block;position:absolute;margin:-1px;" id="Timer" />');}
CountedBook = CountBook;setTimeout('Timer(CountedBook)',30000);
	}

/////////////////////////////////////////////////////////////////////////////////////
//	(ONCE) WRITE THE VISIT-STATZ
/////////////////////////////////////////////////////////////////////////////////////

function Statz()
	{
/////////////////////////////////////////////////////////////////////////////////////
//	GET SCREEN-SETTINGS
/////////////////////////////////////////////////////////////////////////////////////

	ScreenColor  = window.screen.colorDepth;
	ScreenWidth  = screen.width;
	ScreenHeight = screen.height;

/////////////////////////////////////////////////////////////////////////////////////
//	GET THE REFERRER-PAGE
/////////////////////////////////////////////////////////////////////////////////////

	Referrer = d.referrer;if(Referrer == null || Referrer == '')Referrer = 0;
	
	for(qq = 0; qq < Referrer.length; qq ++)
		{
	Referrer = Referrer.replace('?', '^^^');
	Referrer = Referrer.replace('&', '~~~');
	Referrer = Referrer.replace('"', '|||');
	Referrer = Referrer.replace(' ', '%20');
		}

TheString = 's='+ScreenWidth+'x'+ScreenHeight+'&c='+ScreenColor+'&r='+Referrer;
d.write('<img src="'+UserID2+'?'+TheString+'" width="1" height="1" alt="" style="display:block;position:absolute;margin:-1px;" id="UniqueCount" />');
	}
	
/////////////////////////////////////////////////////////////////////////////////////
//	INITIALIZE COUNTER
/////////////////////////////////////////////////////////////////////////////////////

function dMScount(CountStatz,CountBook){Timer(CountBook);if(CountStatz)Statz();}
