/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','452',jdecode('About+CBC'),jdecode(''), jdecode('%2F452%2Findex.html'), 'true',[ 
		['PAGE','473',jdecode('Contact+Us'),jdecode(''), jdecode('%2F452%2F473%2Findex.html'), 'true',[ 
			['PAGE','2801',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''), jdecode('%2F452%2F473%2F2801.html'), 'false',[],'','']
		],'','']
	],'',''],
	['PAGE','5301',jdecode('CBC+Shopping+Mall'),jdecode(''), jdecode('%2F5301.html'), 'true',[],'',''],
	['PAGE','494',jdecode('Inquiry+and+Research'),jdecode(''), jdecode('%2F494.html'), 'true',[],'',''],
	['PAGE','515',jdecode('Products'),jdecode(''), jdecode('%2F515.html'), 'true',[],'',''],
	['PAGE','536',jdecode('Purchasing'),jdecode(''), jdecode('%2F536.html'), 'true',[],'',''],
	['PAGE','557',jdecode('Mail+and+Shipping+Services'),jdecode(''), jdecode('%2F557.html'), 'true',[],'',''],
	['PAGE','578',jdecode('Export'),jdecode(''), jdecode('%2F578%2Findex.html'), 'true',[ 
		['PAGE','599',jdecode('Shipping+Information+Guam+%26+other+US+Territories'),jdecode(''), jdecode('%2F578%2F599.html'), 'true',[],'','']
	],'',''],
	['PAGE','620',jdecode('RV+and+Marine+Products'),jdecode(''), jdecode('%2F620.html'), 'true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Aroundtheworld';
theSitetree.paletteFamily='7FACDC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10793';
theSitetree.graphicsetId='11215';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='7FACDC';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Aroundtheworld',
				paletteFamily: 	'7FACDC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10793',
				graphicsetId: 	'11215',
				contentColor: 	'000000',
				contentBGColor: '7FACDC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20080108-003044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20090901-183607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20071217-151840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20070902-170054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20070902-162238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20071217-151921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20070902-153216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20070902-145242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20081025-112356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20081025-112612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20071217-152142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20070906-144517'
};
webappMappings['7008']=webappMappings['7008-12698']={
webappId:    '7008',
documentId:  '473',
internalId:  '12698',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEU29';
var companyName   = 'California+Buyer%27s+Connection';
var htmlTitle	  = 'California+Buyers+Connection';
var metaKeywords  = 'pet+supplies%2C+golf%2C+womens+fashion%2C+mens+fashion%2C+womens%2C+plus+sizes%2C+toys%2C+shoes%2C+garden%2C+food%2C+gift+baskets%2C+sausage%2C+cheese%2C+salmon%2C+diamonds%2C+jewelry%2C+bar%2C+crystal%2C+vitamins%2C+poster%2C+satellite+radio%2C+watches%2C+kids%2C+airline%2C+tickets%2C+purchase%2C+export%2C+shipping%2C+mail%2C+RV%2C+Marine%2C+Automotive%2C+Swimming+Pool+Supplies%2C+appliances%2C+parts%2C+medical%2C+electronics%2C+Industrial+equipment%2C+office+supplies%2C+emergency+disaster+supplies%2C+cable+TV+and+Broadcast+equipment';
var metaContents  = 'Automotive+parts%2C+Swimming+Pool+Supplies%2C+Promotional+items%2C+Appliances%2C+Computers%2C+electronics%2C+RV+parts%2C+RV+products%2C+Marine+Parts%2C+Marine+Products%2C+Cable+TV+Equiipment%2C+Television+Equipment%2C+Office+Supplies%2C+Emergency+Disaster+Supplies%2C+Industrial+Equipment%2C+Vehicles%2C+Trucks%2C+power+generators%2C+medical+equipment%2C+medical+supplies%2C+pet+supplies%2C+pet+medications%2C+golf%2C+womens+fashion%2C+mens+fashion%2C+womens+plus+sizes%2C+travel%2C+shoes%2C+gardening+supplies%2C+food%2C+sausage%2C+cheese%2C+jewelry%2C+diamonds%2C+crystal%2C+poster%2C+home+electronics%2C+vitamins%2C+watches%2C+kids+clothing%2C+toys.';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};

