/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','62',jdecode('Products'),jdecode(''),'/62.html','true',[],'',''],
	['PAGE','17901',jdecode('Newsletter'),jdecode(''),'/17901.html','true',[],'',''],
	['PAGE','21001',jdecode('Eastwood'),jdecode(''),'/21001.html','true',[],'',''],
	['PAGE','28001',jdecode('CTI+Products'),jdecode(''),'/28001/index.html','true',[ 
		['PAGE','30401',jdecode('Background'),jdecode(''),'/28001/30401.html','true',[],'',''],
		['PAGE','30201',jdecode('News+Releases'),jdecode(''),'/28001/30201.html','true',[],'',''],
		['PAGE','34501',jdecode('Problem%2FSolution'),jdecode(''),'/28001/34501.html','true',[],'',''],
		['PAGE','30222',jdecode('Typical+installations'),jdecode(''),'/28001/30222.html','true',[],'','']
	],'',''],
	['PAGE','15201',jdecode('Dimple%C2%AE'),jdecode(''),'/15201/index.html','true',[ 
		['PAGE','19101',jdecode('Black+Hole%E2%84%A2'),jdecode(''),'/15201/19101.html','true',[],'',''],
		['PAGE','3573',jdecode('HarleyDavidson+Aps.'),jdecode(''),'/15201/3573.html','true',[],'',''],
		['PAGE','71',jdecode('FAQ+on+Magnets'),jdecode(''),'/15201/71.html','true',[],'','']
	],'',''],
	['PAGE','80',jdecode('Unique+Car+Care'),jdecode(''),'/80.html','true',[],'',''],
	['PAGE','3152',jdecode('Amsoil+Link'),jdecode(''),'/3152.html','true',[],'',''],
	['PAGE','3975',jdecode('Mother%26%23x27%3Bs+Products'),jdecode(''),'/3975.html','true',[],'',''],
	['PAGE','2653',jdecode('Book'),jdecode(''),'/2653.html','true',[],'',''],
	['PAGE','53',jdecode('About+MAGDANA'),jdecode(''),'/53.html','true',[],'',''],
	['PAGE','107',jdecode('Contact+Us'),jdecode(''),'/107/index.html','true',[ 
		['PAGE','1345',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''),'/107/1345.html','false',[],'','']
	],'',''],
	['PAGE','1140',jdecode('Links'),jdecode(''),'/1140.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Cogwheel';
theSitetree.paletteFamily='FF9900';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10398';
theSitetree.graphicsetId='10607';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cogwheel',
				paletteFamily: 	'FF9900',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10398',
				graphicsetId: 	'10607',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF9900',
				e_color: 		'9E9D9D',
				f_color: 		'9E9D9D',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20100711-080011'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28001',
internalId:  '',
customField: '20100122-132124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20100430-164937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100711-082817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20100503-204912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3573',
internalId:  '',
customField: '20100420-101423'
};
webappMappings['7008']=webappMappings['7008-7861']={
webappId:    '7008',
documentId:  '107',
internalId:  '7861',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20100420-095444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20081120-212635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3152',
internalId:  '',
customField: '20080823-075407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3975',
internalId:  '',
customField: '20080823-074431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2653',
internalId:  '',
customField: '20080623-074046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17901',
internalId:  '',
customField: '20100711-075809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20100422-130457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20090915-220815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20100413-223645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1345',
internalId:  '',
customField: '20080416-021438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1140',
internalId:  '',
customField: '20100220-073640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20100405-085426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30222',
internalId:  '',
customField: '20100307-090248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20090923-105137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34501',
internalId:  '',
customField: '20091011-220528'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INXEK5';
var companyName   = 'Auto-innovation';
var htmlTitle	  = 'MAGDANA';
var metaKeywords  = '';
var metaContents  = '';
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();
};
