/* [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','6201',jdecode('Home'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','35622',jdecode('About+us'),jdecode(''), jdecode('%2F35622.html'), 'true',[],'',''],
	['PAGE','35501',jdecode('Products'),jdecode(''), jdecode('%2F35501%2Findex.html'), 'true',[ 
		['PAGE','23401',jdecode('ANPR+System'),jdecode(''), jdecode('%2F35501%2F23401.html'), 'true',[],'',''],
		['PAGE','46001',jdecode('EasyHoist'),jdecode(''), jdecode('%2F35501%2F46001.html'), 'true',[],'',''],
		['PAGE','46801',jdecode('RailTrolley'),jdecode(''), jdecode('%2F35501%2F46801.html'), 'true',[],'','']
	],'',''],
	['PAGE','48701',jdecode('How+to...'),jdecode(''), jdecode('%2F48701.html'), 'true',[],'',''],
	['PAGE','35601',jdecode('Contact+us'),jdecode(''), jdecode('%2F35601.html'), 'true',[],'',''],
	['PAGE','63701',jdecode('PAIA'),jdecode(''), jdecode('%2F63701.html'), 'true',[],'',''],
	['PAGE','64601',jdecode('Location'),jdecode(''), jdecode('%2F64601.html'), 'true',[],'',''],
	['PAGE','65301',jdecode('Blog'),jdecode(''), jdecode('%2F65301.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='25882F';
theSitetree.keyvisualId='9815';
theSitetree.keyvisualName='kv_9815.jpg';
theSitetree.fontsetId='17630';
theSitetree.graphicsetId='13033';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hetzner',
  product: 'WSCSYSSSSLY0XKDS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Valiant',
				paletteFamily: 	'25882F',
				keyvisualId: 	'9815',
				keyvisualName: 	'kv_9815.jpg',
				fontsetId: 		'17630',
				graphicsetId: 	'13033',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				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:  '6201',
internalId:  '',
customField: '20110511-044313'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '63701',
internalId:  '-',
customField: '20111210-063329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23401',
internalId:  '',
customField: '20110526-034621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20110528-083215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20110404-041751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35622',
internalId:  '',
customField: '20110401-124656'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '64601',
internalId:  '-',
customField: '20120102-093906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20110531-060253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48701',
internalId:  '',
customField: '20110706-060911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46001',
internalId:  '',
customField: '20111210-050813'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '64601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7050']=webappMappings['7050-1034']={
webappId:    '7050',
documentId:  '65301',
internalId:  '1034',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '65301',
internalId:  '-',
customField: '20120102-093336'
};
var webAppHostname = 'sitebuilder.host-h.net:80';
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10IN29BO';
var companyName   = 'from+concept+to+consumer';
var htmlTitle	  = 'Green+Monster+Projects';
var metaKeywords  = 'license+plate+number+plate+green+monster+software+ANPR+system+automated+number+plate+recognition+engineering+products+manual+hoist';
var metaContents  = 'Design+and+Manufacturing+of+Quality+Engineering+Products';
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();
};

