<!--
/*
 * cmcustom.js 
 *
 *
 *
 */


//NEW STANDARD TAG - does not create Pageview Tag
function cmCreateProductviewTag(productID, productName, categoryID,attributes) {
	if (attributes){
		var cm_exAttr=new Array;
		cm_exAttr=attributes.split("-_-");
	}
	cmMakeTag(["tid","5","pi","PRODUCT: "+productName+" ("+productID+")","pr",productID,"pm",productName,"cg",categoryID,"pc","Y","cm_vc",cmExtractParameter("cm_vc",document.location.href),"cm_exAttr",cm_exAttr]);
}

//CUSTOM for client
var cm_PrefixDefaultPageId = "";
var cmDefaultPageIdSuffix = "index.html";

function cmGetDefaultPageID() { 
	var pageName = window.location.pathname; 

	var tempIndex1 = pageName.indexOf("?");
	if (tempIndex1 != -1) {
		pageName = pageName.substr(0, tempIndex1);
	}
	var tempIndex2 = pageName.indexOf("#");
	if (tempIndex2 != -1) {
		pageName = pageName.substr(0, tempIndex2);
	}
	var tempIndex3 = pageName.indexOf(";");
	if (tempIndex3 != -1) {
		pageName = pageName.substr(0, tempIndex3);
	}
	
	pageName = jvgRemoveDwInteractionContinueId(pageName);
	var slashPos = pageName.lastIndexOf("/");
	if (slashPos == pageName.length - 1) {
		pageName = pageName + cmDefaultPageIdSuffix; /* SET TO DEFAULT DOC NAME */
	}

	while (pageName.indexOf("/") == 0) {
		pageName = pageName.substr(1,pageName.length);
	}
	
	return( cm_PrefixDefaultPageId + pageName); 
} 

function jvgRemoveDwInteractionContinueId(pageName)
{
	var tempIdAtEnd = /\/C[0-9]+[/]?$/;
	pageName = pageName.replace(tempIdAtEnd, '');
//	var tempIdInEndWithQuery = /\/C[0-9]*\?*/;
//	pageName = pageName.replace(tempIdInEndWithQuery ,'?');
//	var tempIdInMiddle = /\/C[0-9]*\//;
//	pageName = pageName.replace(tempIdInMiddle, '/');

	return pageName;
}
//-->

-->

