var tcvistorroute_chkflahscount = 0;
document.writeln("<script id='tcvistorroute_AjaxVRInfo' type='text/javascript' src='' charset='utf-8'>\<\/script\>");
function tcvistorroute_AjaxRequest() 
{ 
var ajaxScript=null;var completeMethod='';var param=''; 
var ajaxScriptId = 'tcvistorroute_AjaxVRInfo'; 
var isIE = navigator.appName.indexOf ('Microsoft') !=-1 ? true : false; 
this.Create =function () 
{ 
if(isIE) ajaxScript = document.getElementById(ajaxScriptId); 
else if(document.getElementById(ajaxScriptId) !=null)
{
var target=document.getElementById(ajaxScriptId); 
var pobj = target.parentNode;
if (pobj != null) pobj.removeChild(target);
}
};
this.Complete =function(OnComplete){ completeMethod = OnComplete; };
this.Param = function(name,parameter){ param += '&'+name +'='+ escape(parameter); };
this.Request =function(url)
{
var requestUrl=''; 
if(completeMethod=='')
requestUrl=url+ '?' + param + '&____v='+Math.random();
else
requestUrl=url+ '?' + param + '&OnComplete='+ completeMethod+'&____v='+Math.random();
if(!isIE)
{
var head = document.getElementsByTagName('head').item(0);
var script = document.createElement ('script');
script.src = requestUrl; 
script.charset='utf-8'; 
script.id=ajaxScriptId; 
head.appendChild(script);
}
else
{
if (document.readyState == 'complete')
{
var target=document.getElementById(ajaxScriptId); 
var pobj = target.parentNode;
if (pobj != null) pobj.removeChild(target);
var head = document.getElementsByTagName('head').item(0);
var script = document.createElement ('script');
script.src = requestUrl;
script.charset='utf-8'; 
script.id=ajaxScriptId;
head.appendChild(script);
}
else
ajaxScript.src = requestUrl;
}
};
}
function tcvistorroute_OnComplete( VRVisitorId )
{
if ((VRVisitorId == null) || (VRVisitorId==''))return;
tcvistorroute_setBrowserVisitorCookie( VRVisitorId );
tcvistorroute_setSOVisitorCookie( VRVisitorId );
}
function tcvistorroute_loadso() 
{
document.write('<object id="tcvistorroute_so" name="tc_netSiteGuidec_as" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="0" height="0"> ');
document.write('<param name="movie" value="http://vstlog.17usoft.com/so/so.swf">');
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<embed name="tcvistorroute_so" src="http://vstlog.17usoft.com/so/so.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="0" height="0" wmode="transparent"></embed> ');
document.write('</object> ');
}
tcvistorroute_loadso();
var tcvistorroute_orgURL = encodeURI( document.referrer );
var tcvistorroute_desURL = encodeURIComponent( window.location );
var tcvistorroute_vrCode = '10000-0-3000027';
var tcvistorroute_visitorId = tcvistorroute_getVisitorCookie();
var tcvistorroute_orderno = encodeURIComponent('');
var tcvistorroute_b2cuserid = encodeURIComponent('');
var tcvistorroute_requestIP = escape('38.107.191.111');
function postVRData()
{
var ajax = new tcvistorroute_AjaxRequest();
ajax.Create();
ajax.Param('orgurl',tcvistorroute_orgURL);
ajax.Param('desurl',tcvistorroute_desURL);
ajax.Param('vrcode',tcvistorroute_vrCode);
ajax.Param('b2cid',tcvistorroute_b2cuserid);
ajax.Param('reqip',tcvistorroute_requestIP);
ajax.Param('vrerid',tcvistorroute_visitorId);
ajax.Param('tcorder',tcvistorroute_orderno);
ajax.Complete('tcvistorroute_OnComplete');
ajax.Request('http://vstlog.17usoft.com/VRProcess.ashx'); 
eval( ajax );
}
function tcvistorroute_getVisitorCookie()
{
var ckData = '';
ckData = tcvistorroute_getBrowserVisitorCookie();
if (ckData == '')
ckData = tcvistorroute_getSOVisitorCookie();
return ckData;
}
function tcvistorroute_getBrowserVisitorCookie()
{
var ckData = '';
var ckName = 'tcvistorroute_visitorId=';
var ckList = document.cookie.split(';'); 
for(var i=0;i < ckList.length;i++) { 
var ck = ckList[i]; 
while (ck.charAt(0)==' ') ck = ck.substring(1,ck.length);
if (ck.indexOf(ckName) == 0){ckData = unescape(ck.substring(ckName.length,ck.length));break;}
}
return ckData;
}
function tcvistorroute_setBrowserVisitorCookie( VRVisitorId )
{
var date = new Date();
date.setTime(date.getTime()+(365*24*60*60*1000));
var expires = '; expires='+date.toGMTString();
document.cookie = 'tcvistorroute_visitorId='+escape(VRVisitorId)+expires+'; path=/';
}
function tcvistorroute_getSOVisitorCookie()
{
var ckData = '';
var so = document.getElementById('http://vstlog.17usoft.com/so/so.swf');
so = (navigator.appName.indexOf('Microsoft') != -1)?so:so.getElementsByTagName('embed')[0];
try
{
ckData = so.read();
if(ckData == null)
ckData = '';
}
catch(e){}
return ckData;
}
function tcvistorroute_setSOVisitorCookie( VRVisitorId )
{
var so =document.getElementById('http://vstlog.17usoft.com/so/so.swf');
so = (navigator.appName.indexOf('Microsoft') != -1)?so:so.getElementsByTagName('embed')[0];
try
{
so.write( VRVisitorId );
}
catch(e){}
}
function tcvistorroute_checkCookie() 
{
if (tcvistorroute_visitorId != '')
postVRData();
else
{
tcvistorroute_chkflahscount ++;
tcvistorroute_visitorId = tcvistorroute_getVisitorCookie();
if ((tcvistorroute_visitorId == '') && (tcvistorroute_chkflahscount > 20))
postVRData();
else
window.setTimeout('tcvistorroute_checkCookie()',100);
}
}
window.setTimeout('tcvistorroute_checkCookie()',80);
