<!--
/* * cmcustom.js 
 * *	Add Custom Reg Tag:Country, CustomerNumber, Company, Application, JobTitle fields
 * 		Migrate to Hosted lib
 */

//Creates a formatted pageview tag
function cmCreateProductviewTag(productID, productName, categoryID, attributes, cm_vc) {
	cmMakeTag(["tid","5","pi",c1(cm_ClientID) ? c1(cm_ClientID) : "Product: " + productName + " (" + productID + ")","pr",productID,"pm",productName,"cg",categoryID,"pc","Y","cm_vc",cm_vc?cm_vc:cmExtractParameter("cm_vc",document.location.href),"cmAttributes",attributes]);
}

//Extra parms for RG11-RG15; Legacy Newsletter parms
function cmCreateRegistrationTag(customerID, customerEmail, customerCity, customerState, customerZIP, 
	customerCountry, customerNumber, Company, Application, JobTitle, newsletterName, subscribe, attributes) {
	if(attributes) {
		var attr=attributes.split("-_-");
		if (customerNumber){
			attr[10]=customerNumber;
		}
		if (Company){
			attr[11]=Company;
		}
		if (Application){
			attr[12]=Application;
		}
		if (JobTitle){
			attr[13]=JobTitle;
		}
		attributes=attr.join("-_-");
	}
	cmMakeTag(["tid","2","cd",customerID,"em",customerEmail,"ct",customerCity,"sa",customerState,"zp",customerZIP,"cy",customerCountry,"rg11",customerNumber,"rg12",Company,"rg13",Application,"rg14",JobTitle,"nl",newsletterName,"sd",subscribe,"cmAttributes",attributes]);
}

//-->
