/* [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','52',jdecode('Home'),jdecode(''),'/52.html','true',[],'',''],
	['PAGE','82',jdecode('Who+are+BMM'),jdecode(''),'/82.html','true',[],'',''],
	['PAGE','17501',jdecode('Press+Releases+'),jdecode(''),'/17501.html','true',[],'',''],
	['PAGE','100',jdecode('2in1+Fountain+Solution'),jdecode(''),'/100.html','true',[],'',''],
	['PAGE','73',jdecode('Product+Range'),jdecode(''),'/73.html','true',[],'',''],
	['PAGE','91',jdecode('Technical+Sheets'),jdecode(''),'/91.html','true',[],'',''],
	['PAGE','109',jdecode('Contact+Us'),jdecode(''),'/109.html','true',[],'',''],
	['PAGE','118',jdecode('Distributor+Network'),jdecode(''),'/118.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Aroundtheworld';
theSitetree.paletteFamily='7FACDC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10793';
theSitetree.graphicsetId='11215';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7FACDC';
var localeDef={
  language: 'en',
  country: 'US'
};
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: 	'FFFFFF',
				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:  '52',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52',
internalId:  '',
customField: '20090602-041833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100',
internalId:  '',
customField: '20090206-073640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118',
internalId:  '',
customField: '20090203-055436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109',
internalId:  '',
customField: '20090602-042250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82',
internalId:  '',
customField: '20090203-055031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20100614-030434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73',
internalId:  '',
customField: '20090129-040553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91',
internalId:  '',
customField: '20060628-100241'
};
webappMappings['7008']=webappMappings['7008-8561']={
webappId:    '7008',
documentId:  '52',
internalId:  '8561',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3U0A';
var companyName   = 'BMM+Print+Ltd';
var htmlTitle	  = 'BMM+Print+Ltd+supplier+of+2+in+1+Fountain+Solution+UK+';
var metaKeywords  = '2+in+1+fountain+solution%2C+solo+fount%2C+2+and+1+%2C2+and+1+fount%2C+http%3A%2F%2Fwww.bing.com2in1fountainsolution%3B+http%3A%2F%2Fwww.touchmiltonkeynes.com%2Fbusiness%2Flist%2Fbid%2F5622348%2Cfount+2+in+1+fount%2C+bmmprint%2C+bmmprint+ltd%2C+2+in+1+fountain+solution%2C+fountain+solution%2Cbmm%2Cbm+management%2Cspecialist+printing+chemicals%2Call+in+one+fountain+solution%2Csave+water%2Ccheap+fountain+solutions%2C+brianmoore%2C+all+in+one+fount%2C+all+in+one+fountain+solution%2C+varn+all+in+one+fountain+solution%2C+varn%2C+hdp%2C+avon+graphics%2C+hydrofast+all+in+one+fount%2C2+in+1+fountain+solution%2C+all+in+one+fount%2C+all+in+one+fountain+solution%2C+2in1+fount+solution%2C+2in1+fount%2C+2+in+1+fount%2C+2in1fountainsolution%2C+2and1+fountain+solution%2Cfountain+solution%2C+bmm+print%2C+bmm+print+ltd%2C+2+in+1+fountain+solution%2C+bmm+print%2C+bmm%2C+lithographic+printing+supplier%2C+lithographic+printing+consumables+supplier%2C+lithographic+chemical%2C+lithographic+chemical+distributor%2C+fountain+solution%2Cbmm+management%2C+photo+litho+transvaal%2C+LTI%2C+specialist+printing+chemicals%2C+all+in+one+fountain+solution%2C+save+water+in+print%2C+cheap+fountain+solutions%2C+bmm%2C+brian+moore%2C2in1fount%2C+2+in+1+fount%2C+2+in+1+fount+solution%2C+2+in+1+fountain+solution%2C+yahoo+2in1+fountain+solution+wonderfount%2C+yahoo+uk+2+in+1+fountain+solution%2C+search.com+2+in+1+fountain+solution%2C+msn+uk+2+in+1+fountain+solution%2C+msn+2+in+1+fountain+solution%2C+live+uk+2+in+1+fountain+solution%2C+live+2+in+1+fountain+solution%2C+all+the+web+2+in+1+fountain+solution%2C+altavista+2+in+1+fountain+solution%2C+altavista+uk+2+in+1+fountain+solution%2C+exalead+2+in+1+fountain+solution%2C+exalead+uk+2+in+1+fountain+solution%2C+msn+2+in+1+fountain+solution%2C+wonderfount%2C+worlds+leading+fountain+solution%2C+';
var metaContents  = '2+in+1+fountain+solution%2C+all+in+one+fount%2C+2+in1+fount%2C+wonderfount';
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();
};
