/* 
	DETERMINE WHAT THE SOURCECODE VALUE SHOULD BE IN THE HIDDEN FORM
	NOTE: CODE MUST BE RUN AFTER set_wtracker.js
   
*/


var SourceCodeExistsInCookie = SourceCodeCookieExists();
var DomainExistsInCookie = DomainCookieExists();
var SourceCodeInCookie = extractSourceCodeFromCookie(); // GETS SOURCE CODE FROM COOKIE
var DomainInCookie = extractDomainFromCookie(); // GETS REFERRING DOMAIN FROM COOKIE

if (wTrackerSourcecodeInURL != "")
	// Hidden Field Has Value SourceCode In The URL If It Exists and Isn't Empty
	{document.write('<INPUT TYPE=hidden NAME=sourcecode VALUE=' + wTrackerSourcecodeInURL + '>');}
else if (SourceCodeExistsInCookie == 1 && SourceCodeInCookie != '')
	// Hidden Field Has Value SourceCode In The Cookie If It Exists and Isn't Empty
	{
		if (SourceCodeInCookie != "")
			{document.write('<INPUT TYPE=hidden NAME=sourcecode VALUE=' + SourceCodeInCookie + '>');}
		else
			{document.write('<INPUT TYPE=hidden NAME=sourcecode VALUE=none>');}
	}
else if (DomainExistsInCookie == 1 && DomainInCookie != '')
	// Hidden Field Has Value Referring Domain In The Cooke If It Exists and Isn't Empty
	{
		if (DomainInCookie != "")
			{document.write('<INPUT TYPE=hidden NAME=referring_domain VALUE=' + DomainInCookie + '>');}
		else
			{document.write('<INPUT TYPE=hidden NAME=sourcecode VALUE=none>');}
	}
else
	// Display Default SourceCode
	{document.write('<INPUT TYPE=hidden NAME=sourcecode VALUE=none>');}
