/* [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','4401',jdecode('Home'),jdecode(''), jdecode('%2F4401.html'), 'true',[],'',''],
	['PAGE','118433',jdecode('Shop+our+products'),jdecode(''), jdecode('%2F118433.html'), 'true',[],'',''],
	['PAGE','4901',jdecode('About+us'),jdecode(''), jdecode('%2F4901.html'), 'true',[],'',''],
	['PAGE','111233',jdecode('Be+our+guest'),jdecode(''), jdecode('%2F111233.html'), 'true',[],'',''],
	['PAGE','111733',jdecode('Our+location+and+links'),jdecode(''), jdecode('%2F111733.html'), 'true',[],'',''],
	['PAGE','4964',jdecode('Service'),jdecode(''), jdecode('%2F4964.html'), 'true',[],'',''],
	['PAGE','36822',jdecode('FAQ'),jdecode(''), jdecode('%2F36822.html'), 'true',[],'',''],
	['PAGE','52322',jdecode('Discounts'),jdecode(''), jdecode('%2F52322.html'), 'true',[],'',''],
	['PAGE','71133',jdecode('Glamour+Pets'),jdecode(''), jdecode('%2F71133.html'), 'true',[],'',''],
	['PAGE','113233',jdecode('Winter+artist'),jdecode(''), jdecode('%2F113233.html'), 'true',[],'',''],
	['PAGE','38422',jdecode('Flea+control'),jdecode(''), jdecode('%2F38422.html'), 'true',[],'',''],
	['PAGE','12001',jdecode('Guestbook'),jdecode(''), jdecode('%2F12001.html'), 'true',[],'',''],
	['PAGE','58222',jdecode('Testimonials'),jdecode(''), jdecode('%2F58222.html'), 'true',[],'',''],
	['PAGE','20901',jdecode('Peaceful+Ponderings'),jdecode(''), jdecode('%2F20901.html'), 'true',[],'',''],
	['PAGE','45222',jdecode('Cancellation+policy'),jdecode(''), jdecode('%2F45222.html'), 'true',[],'',''],
	['PAGE','77833',jdecode('Lost+and+found'),jdecode(''), jdecode('%2F77833.html'), 'true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Herzchen';
theSitetree.paletteFamily='FFC0E1';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17098';
theSitetree.graphicsetId='12487';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLYTCPI5'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Herzchen',
				paletteFamily: 	'FFC0E1',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17098',
				graphicsetId: 	'12487',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'E64446',
				e_color: 		'FFC0E1',
				f_color: 		'F5B4B5',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20120130-232750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20110627-180201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4964',
internalId:  '',
customField: '20111231-213510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111733',
internalId:  '',
customField: '20120207-004514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113233',
internalId:  '',
customField: '20120108-212655'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14870838']={
webappId:    '1501',
documentId:  '4401',
internalId:  '14870838',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77833',
internalId:  '',
customField: '20120206-230730'
};
webappMappings['7050']=webappMappings['7050-3575']={
webappId:    '7050',
documentId:  '20901',
internalId:  '3575',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20091126-112544'
};
webappMappings['1002']=webappMappings['1002-12001avfl30i7ccdt']={
webappId:    '1002',
documentId:  '12001',
internalId:  '12001avfl30i7ccdt',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52322',
internalId:  '',
customField: '20111001-002537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20100103-205732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36822',
internalId:  '',
customField: '20111231-213746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38422',
internalId:  '',
customField: '20110805-170043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45222',
internalId:  '',
customField: '20110829-215027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71133',
internalId:  '',
customField: '20120130-234033'
};
webappMappings['4001']=webappMappings['4001-16551170']={
webappId:    '4001',
documentId:  '118433',
internalId:  '16551170',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58222',
internalId:  '',
customField: '20111102-215516'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '111733',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111233',
internalId:  '',
customField: '20111231-211303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118433',
internalId:  '',
customField: '20120207-003950'
};
webappMappings['4001']=webappMappings['4001-16550970']={
webappId:    '4001',
documentId:  '118433',
internalId:  '16550970',
customField: 'language:en;country:US;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30I7CCDT';
var companyName   = 'A+Peaceful+Pet';
var htmlTitle	  = '';
var metaKeywords  = 'pet%2C+cat%2C+dog%2C+peace%2C+love%2C+dogs%2C+dog+food%2C+cat+food%2C+pet+food%2C+treats%2C+grooming%2C+healthy%2C+holistic%2C+cage-free%2C+gentle%2C+biodegradable%2C+recycled%2C+organic%2C+botanical%2C+local';
var metaContents  = 'Earth+Friendly.+Less+Stress.+National+Certified+Master+Groomer.%0AHolistic+Pet+Spa+and+Health+Products%0A701+Richmond+Avenue+suite+145+Houston%2C+Texas+77006';
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();
};

