/* **************************************************
   **************************************************
   ** Customer:         cMarket, Inc.              **
   ** Copyright:        2006 WebSideStory, Inc.    **
   ** PSE:              Clint Ivy                  **
   ** Version:          1.1                        **
   ** Created:          November 6, 2006           **
   ** Last Modified:    December 22, 2006           **
   ** Last Modified By: Clint Ivy                  **
   **************************************************
   ************************************************** */	
 
function _constructMlc()	{
	var mlc = (hbx.mlc !="CONTENT+CATEGORY")?hbx.mlc:location.pathname; //store the hbx.mlc string
	var sSpos = hbx.acct.indexOf(";",0); //finds the first semicolon in an account string
	var fSpos = mlc.indexOf("/",1); //finds the second forward slash in an mlc string
	var localAcct = ""; //declaring localAcct
	var rootMlc = "" //declaring rootMlc
	var currMlc = mlc.substring(fSpos,mlc.lastIndexOf('/')); //declaring currMlc
	var globalMlc = mlc.substring(0,mlc.lastIndexOf('/'));
					
	//Find the local account and store it
		if(sSpos == -1)	{
			localAcct = hbx.acct; //if there is only 1 account number, use hbx.acct for localAcct
			hbx.acct = localAcct + ";DM56110182EE93EN3"; //and append the global account number to hbx.acct
			} else	{
				localAcct = hbx.acct.substring(0,sSpos); //otherwise use the first account number
		}
		if(fSpos == -1)	{
				rootMlc = globalMlc; //if the mlc is only 1 level, use mlc
				} else	{
					rootMlc = mlc.substring(0,fSpos); //otherwise truncate the mlc to the root category
			}
			
		if(localAcct == 'DM561101L8FS93EN3' || localAcct != 'DM561101L8FS93EN3' && rootMlc != '/catalogs' || localAcct != 'DM561101L8FS93EN3' && rootMlc != '/cmarketplace')	{
			if(mlc.indexOf('.') != -1 && mlc.lastIndexOf('/') != fSpos)	{
			hbx.mlc = currMlc + ';' + globalMlc;
		} else	{
			switch(rootMlc)	{
				case '/bidder+forums'	:
				case '/catalogs'	:
					hbx.mlc = mlc + ';/auctions' + mlc;
					break;
				case '/cmarketplace'	:
					hbx.mlc = mlc;
					break;
			}
		}
	}
}
_constructMlc(); //build the content category
