/* [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','5401',jdecode('Home'),jdecode(''),'/5401.html','true',[],''],
	['PAGE','6301',jdecode('Plugs'),jdecode(''),'/6301/index.html','true',[ 
		['PAGE','7301',jdecode('Tapered'),jdecode(''),'/6301/7301.html','true',[],''],
		['PAGE','7327',jdecode('Pull+Through'),jdecode(''),'/6301/7327.html','true',[],''],
		['PAGE','7353',jdecode('Self+Threading'),jdecode(''),'/6301/7353.html','true',[],'']
	],''],
	['PAGE','6327',jdecode('Caps'),jdecode(''),'/6327.html','true',[],''],
	['PAGE','6353',jdecode('Tubing'),jdecode(''),'/6353.html','true',[],''],
	['PAGE','6379',jdecode('Tapes'),jdecode(''),'/6379/index.html','true',[ 
		['PAGE','10301',jdecode('Plating'),jdecode(''),'/6379/10301.html','true',[],''],
		['PAGE','11301',jdecode('Specialist'),jdecode(''),'/6379/11301.html','true',[],'']
	],''],
	['PAGE','6405',jdecode('Discs+'),jdecode(''),'/6405.html','true',[],''],
	['PAGE','6431',jdecode('Lacquers+'),jdecode(''),'/6431/index.html','true',[ 
		['PAGE','12301',jdecode('Application'),jdecode(''),'/6431/12301.html','true',[],''],
		['PAGE','12501',jdecode('Water+based'),jdecode(''),'/6431/12501.html','true',[],'']
	],''],
	['PAGE','6457',jdecode('RO-59+PTFE+'),jdecode(''),'/6457.html','true',[],''],
	['PAGE','6483',jdecode('Terms'),jdecode(''),'/6483.html','true',[],''],
	['PAGE','5701',jdecode('Contact'),jdecode(''),'/5701.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Staples';
theSitetree.paletteFamily='E4E4D9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10767';
theSitetree.graphicsetId='10485';
theSitetree.contentColor='05232d';
theSitetree.contentBGColor='E4E4D9';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Staples',
				paletteFamily: 	'E4E4D9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10767',
				graphicsetId: 	'10485',
				contentColor: 	'05232d',
				contentBGColor: 'E4E4D9',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'09541e',
				e_color: 		'2f3a32',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20090401-202320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20090328-225301'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090322-224657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20090320-115247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20090320-223738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7327',
internalId:  '',
customField: '20090320-224024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7353',
internalId:  '',
customField: '20090320-223921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6327',
internalId:  '',
customField: '20090320-223602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6353',
internalId:  '',
customField: '20090320-225332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6379',
internalId:  '',
customField: '20090322-090118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6405',
internalId:  '',
customField: '20090320-085209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6431',
internalId:  '',
customField: '20090328-225037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6457',
internalId:  '',
customField: '20090406-073702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6483',
internalId:  '',
customField: '20090322-230541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20090616-165827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20090328-223917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20090328-224148'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEFEM';
var companyName   = 'Hi-Tek+Products+Ltd+%3Asuppliers+of+maskings';
var htmlTitle	  = 'Suppliers+of+specialist+masking+products+for+the+metal+finishing+industry';
var metaKeywords  = 'Hi-Tek%2CHi-Tech%2Chi-tek%2Chi-tech%2C+hitek%2Chitech%2CHitech%2CHitek%2Cmasking%2Cmaskings%2CPlugs%2CNeoprene+plugs%2CSilicone+Plugs%2Ccaps%2Cmasking+caps%2Csilicone+caps%2Cvinyl+caps%2Ctubing%2Csilicone+tubing%2Ctapes%2Cmasking+tapes%2C+masking+discs%2C+custom+masking%2CTolber%2C+Tolber+lacquer%2C+Miccroshield%2CMiccrotape%2CXP+2000%2Cxp2000%2C+Miccromask%2C+Miccrostop%2C+Miccropeel%2C+Miccrowax%2C+Miccrotex%2C+Miccropatch%2C+Miccrothinners%2C+masking+lacquer%2Clacquer%2C+RO59%2CRO-59%2Cro59%2Cro-59%2Csolid+film+PTFE%2C+MT-6000WB%2C+water+basked+maskant%2Csolid+film+ptfe+lubricant%2Csolid+film+lubricant%2C+ptfe+solid+film';
var metaContents  = 'The+South%E2%80%99s+premier+supplier+of+outstanding+masking+products+and+service+to+the+metal+finishing+industry+for+electroplating%2C+powder+coating+and+specialist+metal+finishing.';
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();
};
