if (typeof(lpUASconversionAction)=="undefined") lpUASconversionAction="";
lpUASconversionAction=lpUASconversionAction.toLowerCase();

if (typeof(tagVars)=="undefined")
	tagVars = "";

if (lpUASconversionAction=="purchase"){
	if (typeof(lpUASconversionTotal) != "undefined")
		tagVars = tagVars + '&PAGEVAR!OrderTotal=' + escape(lpUASconversionTotal);
} else {
	if (typeof(lpUASconversionTotal) != "undefined")
		tagVars = tagVars + '&PAGEVAR!ConversionTotal=' + escape(lpUASconversionTotal); 
}

if (typeof(lpUASconversionStage)!="undefined")
	tagVars = tagVars + '&PAGEVAR!ConversionStage=' + escape(lpUASconversionStage);

if (typeof(lpUASsmbStoreOrderId)!="undefined")
	tagVars = tagVars + '&PAGEVAR!OrderId=' + escape(lpUASsmbStoreOrderId);

if (typeof(lpUASsmbStoreSaveCartId)!="undefined")
	tagVars = tagVars + '&PAGEVAR!SaveCartId=' + escape(lpUASsmbStoreSaveCartId);

if (typeof(lpUAScheckoutRouting)!="undefined")
	tagVars = tagVars + '&PAGEVAR!CheckoutRouting=' + escape(lpUAScheckoutRouting);

if (typeof(lpUASproductLineID)!="undefined")
	tagVars = tagVars + '&PAGEVAR!ProductLineID=' + escape(lpUASproductLineID);

if (typeof(lpUASproductLineName)!="undefined")
	tagVars = tagVars + '&PAGEVAR!ProductLineName=' + escape(lpUASproductLineName);

if (typeof(lpUASfamilyID)!="undefined")
	tagVars = tagVars + '&PAGEVAR!FamilyID=' + escape(lpUASfamilyID);

if (typeof(lpUASfamilyDescription)!="undefined")
	tagVars = tagVars + '&PAGEVAR!FamilyDescription=' + escape(lpUASfamilyDescription);

if (typeof(lpUASsubFamilyID)!="undefined")
	tagVars = tagVars + '&PAGEVAR!SubFamilyID=' + escape(lpUASsubFamilyID);

if (typeof(lpUASsubFamilyDescription)!="undefined")
	tagVars = tagVars + '&PAGEVAR!SubFamilyDescription=' + escape(lpUASsubFamilyDescription);

if (typeof(lpUASsmbStoreShipToState)!="undefined")
	tagVars = tagVars + '&PAGEVAR!StoreShipToState=' + escape(lpUASsmbStoreShipToState);

if (typeof(lpUASsmbStoreShipToZip)!="undefined")
	tagVars = tagVars + '&PAGEVAR!StoreShipToZip=' + escape(lpUASsmbStoreShipToZip);

if (typeof(lpUASsmbStoreAccountId)!="undefined")
	tagVars = tagVars + '&PAGEVAR!StoreAccountId=' + escape(lpUASsmbStoreAccountId);

if (typeof(lpUASsmbStorePurchaseMethod)!="undefined")
	tagVars = tagVars + '&PAGEVAR!StorePurchaseMethod=' + escape(lpUASsmbStorePurchaseMethod);

if (lpUASconversionAction=="purchase"){
	if (typeof(lpUASconversionDetails)!= "undefined")
		tagVars = tagVars + '&PAGEVAR!OrderDetails=' + escape(lpUASconversionDetails);
} else {
	if (typeof(lpUASconversionDetails)!= "undefined")
		tagVars = tagVars + '&PAGEVAR!ConversionDetails=' + escape(lpUASconversionDetails); 
}

var INITIAL_MAX_SIZE = 300;
var MAX_TAGVARSURL_SIZE = 1900;
var INITIAL_STRING = document.location.toString() + document.title;
var STRING_MAX_SIZE = INITIAL_STRING.length + INITIAL_MAX_SIZE;

if ((typeof(tagVars) == "undefined") || (tagVars == null))
tagVars = "";
while ((tagVars.length + STRING_MAX_SIZE > MAX_TAGVARSURL_SIZE) && (tagVars.length > 0)) {
 var idx = tagVars.lastIndexOf("&");
 if (idx > 0)
  tagVars = tagVars.substring(0, idx);
 else
  tagVars = "";
}
