/* [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','43',jdecode('Home'),jdecode(''),'/43.html','true',[],''],
	['PAGE','82',jdecode('1.+Cotton+Shopping+Bag'),jdecode(''),'/82/index.html','true',[ 
		['PAGE','665',jdecode('String+Shopping+Bag'),jdecode(''),'/82/665.html','true',[],''],
		['PAGE','6712',jdecode('Cotton+Spa+Bag'),jdecode(''),'/82/6712.html','true',[],'']
	],''],
	['PAGE','12401',jdecode('2.+Handmade+Net+Bag+'),jdecode(''),'/12401.html','true',[],''],
	['PAGE','73',jdecode('3.+Sporting+Net'),jdecode(''),'/73/index.html','true',[ 
		['PAGE','100',jdecode('Golf+Netting'),jdecode(''),'/73/100.html','true',[],''],
		['PAGE','674',jdecode('Baseball+Netting'),jdecode(''),'/73/674.html','true',[],''],
		['PAGE','683',jdecode('Basketball+Net'),jdecode(''),'/73/683.html','true',[],''],
		['PAGE','1092',jdecode('Tennis+Net'),jdecode(''),'/73/1092.html','true',[],''],
		['PAGE','1101',jdecode('Volleyball++Net'),jdecode(''),'/73/1101.html','true',[],''],
		['PAGE','1110',jdecode('Soccer+Net'),jdecode(''),'/73/1110.html','true',[],''],
		['PAGE','692',jdecode('Hockey+Net'),jdecode(''),'/73/692.html','true',[],'']
	],''],
	['PAGE','64',jdecode('4.+Agricultural+Net'),jdecode(''),'/64.html','true',[],''],
	['PAGE','14001',jdecode('5.+Scaffold+Net'),jdecode(''),'/14001.html','true',[],''],
	['PAGE','18901',jdecode('6.Partiton+Net'),jdecode(''),'/18901.html','true',[],''],
	['PAGE','14101',jdecode('7.+Anti-bird+net'),jdecode(''),'/14101.html','true',[],''],
	['PAGE','91',jdecode('8.+Stroller+Mesh+Bag'),jdecode(''),'/91.html','true',[],''],
	['PAGE','647',jdecode('9.+Mesh+washing+Bag'),jdecode(''),'/647.html','true',[],''],
	['PAGE','656',jdecode('10.+Net+Bag'),jdecode(''),'/656.html','true',[],''],
	['PAGE','701',jdecode('11.+PU+Ball'),jdecode(''),'/701.html','true',[],''],
	['PAGE','7211',jdecode('12.+Mesh+bath+sponge'),jdecode(''),'/7211.html','true',[],''],
	['PAGE','109',jdecode('Contact+us'),jdecode(''),'/109/index.html','true',[ 
		['PAGE','4768',jdecode('Contact+us+%28follow+up+page%29'),jdecode(''),'/109/4768.html','false',[],'']
	],'']];
var siteelementCount=24;
theSitetree.topTemplateName='Beach';
theSitetree.paletteFamily='E7D795';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10565';
theSitetree.graphicsetId='10929';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E7D794';
var theTemplate={
				name: 			'Beach',
				paletteFamily: 	'E7D795',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10565',
				graphicsetId: 	'10929',
				contentColor: 	'000000',
				contentBGColor: 'E7D794',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF503F',
				e_color: 		'FF503F',
				f_color: 		'FF503F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-2150725']={
webappId:    '1501',
documentId:  '43',
internalId:  '2150725',
customField: '1501'
};
webappMappings['1001']=webappMappings['1001-ahw050invmkn50b64dd209a78844']={
webappId:    '1001',
documentId:  '109',
internalId:  'ahw050invmkn50b64dd209a78844',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050invmkn50b64dd209a78844']={
webappId:    '1001',
documentId:  '4768',
internalId:  'ahw050invmkn50b64dd209a78844',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43',
internalId:  '',
customField: '20090128-221517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109',
internalId:  '',
customField: '20080409-164419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64',
internalId:  '',
customField: '20090127-210915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82',
internalId:  '',
customField: '20091003-025647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '665',
internalId:  '',
customField: '20080427-161529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6712',
internalId:  '',
customField: '20080217-044332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20090114-214930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73',
internalId:  '',
customField: '20080218-170321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100',
internalId:  '',
customField: '20080325-153747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '674',
internalId:  '',
customField: '20080313-170534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '683',
internalId:  '',
customField: '20080224-160609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1092',
internalId:  '',
customField: '20080313-173702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20080313-173335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1110',
internalId:  '',
customField: '20080315-174353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '692',
internalId:  '',
customField: '20080214-111943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91',
internalId:  '',
customField: '20080217-052803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '647',
internalId:  '',
customField: '20080316-142850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '656',
internalId:  '',
customField: '20080316-142015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20080322-152228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7211',
internalId:  '',
customField: '20080322-154053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4768',
internalId:  '',
customField: '20080215-013219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20090127-120000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20091003-044910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20091003-032948'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVMKN';
var companyName   = 'Professional+Industrial+Ltd';
var htmlTitle	  = 'Netting+Products+Specialist';
var metaKeywords  = 'SPORTING+NET%2C+STRING+SHOPPING+BAG';
var metaContents  = '';
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();
};
