/* [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','403',jdecode('Home'),jdecode(''),'/403.html','true',[],''],
	['PAGE','6501',jdecode('Transducers'),jdecode(''),'/6501/index.html','true',[ 
		['PAGE','6522',jdecode('N26C'),jdecode(''),'/6501/6522.html','true',[],''],
		['PAGE','6543',jdecode('N26K'),jdecode(''),'/6501/6543.html','true',[],''],
		['PAGE','6564',jdecode('N28BE'),jdecode(''),'/6501/6564.html','true',[],''],
		['PAGE','6585',jdecode('N160FL'),jdecode(''),'/6501/6585.html','true',[],'']
	],''],
	['PAGE','20501',jdecode('Design+%2F+Engineering'),jdecode(''),'/20501.html','true',[],''],
	['PAGE','20522',jdecode('Consulting+'),jdecode(''),'/20522.html','true',[],''],
	['PAGE','20543',jdecode('Measurements'),jdecode(''),'/20543.html','true',[],''],
	['PAGE','20564',jdecode('Contact'),jdecode(''),'/20564.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='85AB88';
theSitetree.keyvisualId='11165';
theSitetree.keyvisualName='kv_11165.jpg';
theSitetree.fontsetId='32065';
theSitetree.graphicsetId='13880';
theSitetree.contentColor='6b8d6e';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Office',
				paletteFamily: 	'85AB88',
				keyvisualId: 	'11165',
				keyvisualName: 	'kv_11165.jpg',
				fontsetId: 		'32065',
				graphicsetId: 	'13880',
				contentColor: 	'6b8d6e',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '403',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '403',
internalId:  '',
customField: '20091217-012902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20100610-202857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100611-171700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20100611-171820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6543',
internalId:  '',
customField: '20100611-171731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6564',
internalId:  '',
customField: '20100611-171747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6585',
internalId:  '',
customField: '20100611-171839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20522',
internalId:  '',
customField: '20100610-202932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20543',
internalId:  '',
customField: '20100702-152126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20564',
internalId:  '',
customField: '20091217-031750'
};
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH010IN20RE';
var companyName   = 'NedLab';
var htmlTitle	  = 'NedLab+Precision+Loudspeaker+Engineering';
var metaKeywords  = 'loudspeaker%2C+loudspeakers%2C+speaker%2C+speakers%2C+drivers%2C+Nedlab%2C+tweeter%2C+tweeters%2C+midrange%2C+woofer%2C+woofers%2C+acoustics%2C+sound%2C+audio%2C+cross-over%2C+cross+over%2C+voice+coil%2C+bobbin%2C+engineering%2C+sound+room%2C+anechoic+chamber%2C+transducer%2C+eletroacoustic%2C+frequency%2C+frequency+response%2C+impedance%2C+TSP%2C+TS+parameters%2C+parameters%2C+inductor%2C+capacitor%2C+resistor%2C+cables%2C+cone%2C+dome%2C+pure+ceramic+dome+tweeter%2C+kevlar+cone%2C+Titanium+dome%2C+JBL%2C+inductor%2C+capacitor%2C+wire%2C+resistor%2C+klippel%2C+LMS%2C+MLSSA%2C+anachoic%2C+boron%2C+diamond+dome%2C+boron+dome%2C+diamond+cone%2C+infinity%2C+scanspeak%2C+vifa%2C+solen+electronics%2C+cabasse%2C+inverted+dome%2C+CCAW%2C+green+speakers%2C+green+loudspeakers';
var metaContents  = 'Loudspeaker+design+audio+engineering';
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();
};
