/* [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 theSitetree=[ 
	['PAGE','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','5152',jdecode('About+us'),jdecode(''),'/5152.html','true',[],''],
	['PAGE','59901',jdecode('LIQUIDATION+CATALOG'),jdecode(''),'/59901.html','false',[],''],
	['PAGE','100601',jdecode('Barebone+System'),jdecode(''),'/100601/index.html','true',[ 
		['PAGE','100901',jdecode('PC+Barebone+Systems'),jdecode(''),'/100601/100901.html','true',[],''],
		['PAGE','100922',jdecode('Server+Barebone+Systems'),jdecode(''),'/100601/100922.html','true',[],'']
	],''],
	['PAGE','104001',jdecode('Cable'),jdecode(''),'/104001.html','true',[],''],
	['PAGE','66401',jdecode('Desktops'),jdecode(''),'/66401.html','true',[],''],
	['PAGE','112053',jdecode('Digital+Cameras'),jdecode(''),'/112053.html','true',[],''],
	['PAGE','66201',jdecode('Notebooks+%2F+Netbooks'),jdecode(''),'/66201/index.html','true',[ 
		['PAGE','92401',jdecode('Acer+Notebook'),jdecode(''),'/66201/92401.html','true',[],'']
	],''],
	['PAGE','75043',jdecode('Wholesale+Gaming'),jdecode(''),'/75043/index.html','true',[ 
		['PAGE','75064',jdecode('Game+Consoles'),jdecode(''),'/75043/75064.html','true',[],''],
		['PAGE','75301',jdecode('Games'),jdecode(''),'/75043/75301.html','true',[],'']
	],''],
	['PAGE','24901',jdecode('Liquidation'),jdecode(''),'/24901.html','true',[],''],
	['PAGE','5173',jdecode('Contact'),jdecode(''),'/5173.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='F1AA13';
theSitetree.keyvisualId='9810';
theSitetree.keyvisualName='kv_9810.jpg';
theSitetree.fontsetId='17626';
theSitetree.graphicsetId='13034';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Valiant',
				paletteFamily: 	'F1AA13',
				keyvisualId: 	'9810',
				keyvisualName: 	'kv_9810.jpg',
				fontsetId: 		'17626',
				graphicsetId: 	'13034',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20090826-131136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20090704-181500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5173',
internalId:  '',
customField: '20091027-144654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112053',
internalId:  '',
customField: '20091008-125512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24901',
internalId:  '',
customField: '20090704-181618'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66201',
internalId:  '',
customField: '20091007-153239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75301',
internalId:  '',
customField: '20090903-072042'
};
webappMappings['1501']=webappMappings['1501-4657040']={
webappId:    '1501',
documentId:  '5101',
internalId:  '4657040',
customField: '1501'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5152',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '24901',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66401',
internalId:  '',
customField: '20090823-170223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100901',
internalId:  '',
customField: '20090912-150544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59901',
internalId:  '',
customField: '20091017-164025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75043',
internalId:  '',
customField: '20090901-153445'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5173',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75064',
internalId:  '',
customField: '20090823-162411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100601',
internalId:  '',
customField: '20090912-140347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92401',
internalId:  '',
customField: '20090904-082751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100922',
internalId:  '',
customField: '20090913-002744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104001',
internalId:  '',
customField: '20090912-165928'
};
var canonHostname = 'cm4all.netfirms.com';
var accountId     = 'ANFI10INXVBE';
var companyName   = 'Super+Deal+Liquidation+Online';
var htmlTitle	  = 'Super+Deal+Liquidation+Inc+Bathurst+%7C+Broker+Reseller';
var metaKeywords  = 'Super+Deal+Liquidation%2C+Wholesale%2C+Super%2C+Deal%2C+Liquidation+New+Brunswick+Liquidation%2C+Deals%2C+Wholesale%2C+Liquidation%2C+Electronics%2C+middle+east%2C+export+Printer+Laser+Cartridges%2C+Savings%2C+Broker%2C+Baby+Clothes%2C+Clothing%2C+Shoes%2C+Clothes%2C+Broker%2C+Furniture%2C+Housewares%2C+Sporting+Goods%2C+Cheap%2C+Affordable%2C+Inexpensive%2C+Ebay%2C+Reseller%2C+Online+Store%2C+Tools%2C+Canada+Liquidation%2C+East+Coast+Liquidation%2C+USA+Liquidation%2C+Iran+Liquidation%2C+Iraq+Liquidation%2C+Lebanon+Liquidation%2C+Morocco+Liquidation%2C+Saudi+Arabia+Liquidation%2C+Pakistan+Liquidation%2C+Palestine+Liquidation%2C+Israel+Liquidation';
var metaContents  = 'We+are+liquidators+who+have+access+to+anything%21+Huge+savings+on+housewares%2C+electronics%2C+tools%2C+furniture%2C+office+supplies%2C+laser+cartridges+%2C+clothing+and+much+more%21+Below+Wholesale+pricing%2C+worldwide+export.';
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();
};
