/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1852',jdecode('All-Purpose+Medicine'),jdecode(''),'/1852/index.html','true',[ 
		['PAGE','1873',jdecode('Monoatomic+Supplement'),jdecode(''),'/1852/1873.html','true',[],'','']
	],'',''],
	['PAGE','148822',jdecode('New+Organ+Growth+%2F+Life+Forms'),jdecode(''),'/148822.html','true',[],'',''],
	['PAGE','1999',jdecode('Super-Conductive+Material'),jdecode(''),'/1999.html','true',[],'',''],
	['PAGE','87001',jdecode('Super-Fluidity+Material'),jdecode(''),'/87001.html','true',[],'',''],
	['PAGE','159401',jdecode('New+Boson%2FFermion+Material'),jdecode(''),'/159401.html','true',[],'',''],
	['PAGE','148801',jdecode('Quantum+State+Proofs'),jdecode(''),'/148801.html','true',[],'',''],
	['PAGE','154001',jdecode('The+Alternate+Universe'),jdecode(''),'/154001/index.html','true',[ 
		['PAGE','156901',jdecode('Fermion+based+Alternate+Universe'),jdecode(''),'/154001/156901.html','true',[],'',''],
		['PAGE','157401',jdecode('Accessing+the+Alternate+Universe'),jdecode(''),'/154001/157401.html','true',[],'','']
	],'',''],
	['PAGE','162501',jdecode('Genetic+Engineering'),jdecode(''),'/162501.html','true',[],'',''],
	['PAGE','1936',jdecode('Bunnell+Trust'),jdecode(''),'/1936.html','true',[],'',''],
	['PAGE','101101',jdecode('03%2F14%2F11+Press+Releases'),jdecode(''),'/101101.html','true',[],'',''],
	['PAGE','2041',jdecode('Contact+Us'),jdecode(''),'/2041/index.html','true',[ 
		['PAGE','2062',jdecode('Organization'),jdecode(''),'/2041/2062.html','true',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='1982';
theSitetree.keyvisualName='microchips.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'1982',
				keyvisualName: 	'microchips.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'383',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20110207-164420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20100301-001044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20100608-132626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162501',
internalId:  '',
customField: '20100811-223003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20100811-223511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20100103-230417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2041',
internalId:  '',
customField: '20110315-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2062',
internalId:  '',
customField: '20100714-130633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87001',
internalId:  '',
customField: '20091015-175351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101101',
internalId:  '',
customField: '20110315-225655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148801',
internalId:  '',
customField: '20100908-172102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148822',
internalId:  '',
customField: '20100614-211233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '154001',
internalId:  '',
customField: '20100722-172436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156901',
internalId:  '',
customField: '20100722-170547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157401',
internalId:  '',
customField: '20100722-172709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159401',
internalId:  '',
customField: '20100802-113222'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN3EAJ';
var companyName   = 'Bunnell+Industries';
var htmlTitle	  = 'Bunnell+Industries+-+All-Purpose+Medicine+-+Super-Conductive+Material+-+Platinum+Group+Metals+';
var metaKeywords  = 'Bunnell+Industries%2C+Bunnell%2C+APM%2C+SCM%2C+SFM%2C+PGM%2C+All-Purpose+Medicine%2C+Super-Conductive+Material%2C+Superconductive%2C+Super-Fluidity+Material%2C+Platinum+Group+Metals%2C+Anti-Gravity%2C+antigravity%2C+Levitation%2C+Disease+Cure%2C+Cancer+Cure%2C+Medical+Breakthrough%2C+Medicine%2C+Anti-particales%2C+antiparticles%2C+Quantum+State%2C+Monoatomic%2C+Monatomic%2C+M-state%2C+frictionless%2C+Supplements%2C+Platinum%2C+Rhodium%2C+Gold';
var metaContents  = 'The+most+scientifically+advanced+company+in+the+world.++All-Purpose+Medicine%2C+Super-Conductive+Material%2C+Super-Fluidity+Material%2C+Platinum+Group+Metals+and+etc.++Quantum+state+monoatomic+materials+that+are+advanced+beyond+anything+ever+made+available.';
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();
};

