//called before intitial inval to quickly determine if redir ncsry.
var continueTracking = 'y';
var intervalId;
//LX tracker js
var lx_phpSessId;		//set in lx scripts
updateStrak();
setInterval("updateStrak()",3000);
/***************************/
function includeJS(script_filename) 
	{
	var html_doc = document.getElementsByTagName('head').item(0);
	var js = document.createElement('script');
	js.setAttribute('language', 'javascript');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src', script_filename);
	html_doc.appendChild(js);
	return false;
	}	
		
/***************************/

function updateStrak()
	{
	if(continueTracking == 'y')
		{
		escapedURL = escape(window.location);
		file = 'http://www.leadxpert.net/sTrak/?do=record&id='+Number(new Date());
		if(document.campaignForm)
			{
			campaignCode = document.campaignForm.LXcampaignCode.value;		
			file = file+'&campaignCode='+campaignCode;
			}
		if(lx_phpSessId && lx_phpSessId != 'undefined')
			{
			file = file+'&PHPSESSID='+lx_phpSessId+'&regSess=true';		
			alert(file);
			}

		file = file+'&lx_pageURL='+escapedURL;		
		includeJS(file);		
		}
	else
		{
		clearInterval(intervalId);
		}
	}
	
/***************************/



