/* [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','9101',jdecode('Home'),jdecode(''),'/9101.html','true',[],'',''],
	['PAGE','9215',jdecode('Heros'),jdecode(''),'/9215.html','true',[],'',''],
	['PAGE','9173',jdecode('+News+'),jdecode(''),'/9173.html','true',[],'',''],
	['PAGE','9257',jdecode('Media+Album'),jdecode(''),'/9257.html','true',[],'',''],
	['PAGE','9152',jdecode('Contact+Us+'),jdecode(''),'/9152.html','true',[],'',''],
	['PAGE','9236',jdecode(''),jdecode(''),'/9236.html','true',[],'',''],
	['PAGE','9278',jdecode(''),jdecode(''),'/9278/index.html','true',[ 
		['PAGE','9299',jdecode(''),jdecode(''),'/9278/9299.html','true',[],'','']
	],'',''],
	['PAGE','29112',jdecode('Save+It+forever+'),jdecode(''),'/29112.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='333333';
theSitetree.keyvisualId='1251';
theSitetree.keyvisualName='kerzenschein.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='227';
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: 			'Profile',
				paletteFamily: 	'333333',
				keyvisualId: 	'1251',
				keyvisualName: 	'kerzenschein.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'227',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'333333',
				b_color: 		'999999',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-5019']={
webappId:    '7008',
documentId:  '9152',
internalId:  '5019',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-1173']={
webappId:    '7050',
documentId:  '9173',
internalId:  '1173',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-82d3f368641a3b76c86ac7dc533c29e0']={
webappId:    '7060',
documentId:  '9257',
internalId:  '82d3f368641a3b76c86ac7dc533c29e0',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '9278',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20090519-020324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9299',
internalId:  '',
customField: '20090301-072455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9173',
internalId:  '',
customField: '20090301-074840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9152',
internalId:  '',
customField: '20090408-122308'
};
webappMappings['1501']=webappMappings['1501-14842507']={
webappId:    '1501',
documentId:  '9101',
internalId:  '14842507',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29112',
internalId:  '',
customField: '20091215-150952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9215',
internalId:  '',
customField: '20090409-070654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9236',
internalId:  '',
customField: '20090301-072454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9257',
internalId:  '',
customField: '20090301-072454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9278',
internalId:  '',
customField: '20090301-072455'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHK9D';
var companyName   = 'American+Pride+Candles+';
var htmlTitle	  = 'American+Pride+Candles';
var metaKeywords  = 'Candles%2C+New+Richmond+Ohio%2C+Manufacture%2C+sales%2C+design%2C+Photo+imprints%2C+red%2C+white+%2C+blue%2C+all+things+candles%2C+American%2C+Pride%2C+Candles%2CCandle+candles+candle+red+candles+wedding+candlesunity%2C+Cincinnatti+F.I.R.E.+Coalition%2C+Yellow+Ribion+Support+Center+Fantastic+Interiors+Drywall.+++';
var metaContents  = 'All+our+products+are+proudly++Made+in+the+U.S.A.+We+have++candles+and+we+can+design+many+candles+just+for+your+needs.++At+your+request%2C+American+Pride+Candles+will+Ship+any+candle+we+make+for++you+or+your++loved+one+any+where+in+the+world.++We+will+ship+any+candle+you+purchase+for+our++service+men+and+women+for+free%2C+any+where+any+time+of+year%2C+no+questions+asked...+';
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();
};

