/*
 * cmcustom.js
 * $Id: cmcustom.js 153071 2010-08-02 21:51:32Z wbird $
 * $Revision: 153071 $
 *
 * Version 4.2.0
 *
 * Coremetrics Tag v4.0, 8/7/2006
 * COPYRIGHT 1999-2002 COREMETRICS, INC. 
 * ALL RIGHTS RESERVED. U.S.PATENT PENDING
 *
 * The following functions aid in the creation of Coremetrics data tags.
 *
 */

// Creates a Productview Tag
// Also creates a Pageview Tag by setting pc="Y"
// Format of Page ID is "PRODUCT: <Product Name> (<Product ID>)"
//
// productID	: required. Product ID to set on this Productview tag
// productName	: required. Product Name to set on this Productview tag
// categoryID	: optional. Category ID to set on this Productview tag 
// searchString	: optional. Internal search string entered by user to reach this Product Detail page. Only usable if pc="Y".
// searchResults : optional.  Total numeric search results count. Only usable if pc="Y".


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]);
}



function cmCreateRegistrationTag(__cd,__em,__ct,__sa,__zp,__nl,__sd,purchaseUse,howSelection,quiltAssortments,quiltBatiks,
	quiltDesignerCotton,quiltExtraWide,quiltFatQuarters,quiltFlannel,quiltHomespuns,quiltMuslin,quiltPreQuilted,quiltSolids,
	apparelBridal,apparelDenim,apparelFauxFur,apparelFlannel,apparelPolarFleece,apparelKnits,apparelLinens,apparelShirtings,
	apparelSilk,apparelSlinky,apparelSpecialOccasion,apparelSportswear,apparelTwill,apparelVelvet,apparelWoolen,homeCanvas,
	homeChenille,homeDenim,homeDraperyLining,homeDraperyPrints,homeFleece,homeJacquards,homeLeather,homeLinen,homeOutdoor,
	homeSheers,homeSilk,homeTable,homeTapestries,homeTrim,homeUpholstery,homeVinyl,homeWaverly) {
	var r = 0;
	if (arguments.length > 9) {
		var x = 1;
		var i = 0;
		for (i = 9; i < arguments.length; ++i) {
			if (arguments[i] == "Y") {
				r += x;	
			}
			x *= 2;
		}
	}
	cmMakeTag(["tid","2","cd",__cd,"em",__em,"ct",__ct,"sa",__sa,"zp",__zp,"nl",__nl,"sd",__sd,"rg11",purchaseUse,"rg12",howSelection,"rg13",r,"li","1000","ps1",r]);
}
