/* [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(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','1852',jdecode('Dee+Stuff+4+Pets'),jdecode(''), jdecode('%2F1852%2Findex.html'), 'true',[ 
		['PAGE','41531',jdecode('Soothing%2C+Therapeutic+Soap'),jdecode(''), jdecode('%2F1852%2F41531.html'), 'true',[],'',''],
		['PAGE','1894',jdecode('Healthy+Pet+Treats'),jdecode(''), jdecode('%2F1852%2F1894.html'), 'true',[],'',''],
		['PAGE','1873',jdecode('Handcrafted+Pet+Fashions'),jdecode(''), jdecode('%2F1852%2F1873.html'), 'true',[],'',''],
		['PAGE','34431',jdecode('Cat+Trees'),jdecode(''), jdecode('%2F1852%2F34431.html'), 'true',[],'',''],
		['PAGE','32120',jdecode('Shop+Now'),jdecode(''), jdecode('%2F1852%2F32120.html'), 'true',[],'','']
	],'',''],
	['PAGE','1957',jdecode('About+us'),jdecode(''), jdecode('%2F1957%2Findex.html'), 'true',[ 
		['PAGE','1978',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F1957%2F1978.html'), 'true',[],'',''],
		['PAGE','1999',jdecode('Our+team'),jdecode(''), jdecode('%2F1957%2F1999.html'), 'true',[],'','']
	],'',''],
	['PAGE','13729',jdecode('Recent+Events'),jdecode(''), jdecode('%2F13729.html'), 'true',[],'',''],
	['PAGE','13750',jdecode('Upcoming+Activities'),jdecode(''), jdecode('%2F13750.html'), 'true',[],'',''],
	['PAGE','11601',jdecode('The+Menagerie'),jdecode(''), jdecode('%2F11601.html'), 'true',[],'',''],
	['PAGE','18829',jdecode('What+do+you+think%3F'),jdecode(''), jdecode('%2F18829.html'), 'true',[],'',''],
	['PAGE','18729',jdecode('The+Zakary+Chronicles'),jdecode(''), jdecode('%2F18729.html'), 'true',[],'',''],
	['PAGE','24567',jdecode('Comments'),jdecode(''), jdecode('%2F24567.html'), 'true',[],'',''],
	['PAGE','11643',jdecode('Links'),jdecode(''), jdecode('%2F11643.html'), 'true',[],'',''],
	['PAGE','2020',jdecode('Contact'),jdecode(''), jdecode('%2F2020.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Card';
theSitetree.paletteFamily='669900';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='427';
theSitetree.graphicsetId='481';
theSitetree.contentColor='006633';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Card',
				paletteFamily: 	'669900',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'427',
				graphicsetId: 	'481',
				contentColor: 	'006633',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20110930-000049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20110915-182637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20110914-131721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20110916-132207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20100510-234911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20090430-134704'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20100508-194512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2020',
internalId:  '',
customField: '20090920-215436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32120',
internalId:  '',
customField: '20110916-134400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20090430-133310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11643',
internalId:  '',
customField: '20090706-144228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13729',
internalId:  '',
customField: '20110804-190530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13750',
internalId:  '',
customField: '20100508-193642'
};
webappMappings['7050']=webappMappings['7050-3020']={
webappId:    '7050',
documentId:  '18729',
internalId:  '3020',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-11321']={
webappId:    '7008',
documentId:  '2020',
internalId:  '11321',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18729',
internalId:  '',
customField: '20090922-142402'
};
webappMappings['1003']=webappMappings['1003-avfl30inhj2m123da3c37fb']={
webappId:    '1003',
documentId:  '18829',
internalId:  'avfl30inhj2m123da3c37fb',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18829',
internalId:  '',
customField: '20090920-215250'
};
webappMappings['1002']=webappMappings['1002-24567avfl30inhj2m']={
webappId:    '1002',
documentId:  '24567',
internalId:  '24567avfl30inhj2m',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24567',
internalId:  '',
customField: '20091110-200112'
};
webappMappings['4001']=webappMappings['4001-15615835']={
webappId:    '4001',
documentId:  '32120',
internalId:  '15615835',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34431',
internalId:  '',
customField: '20110927-234353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41531',
internalId:  '',
customField: '20111019-125620'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHJ2M';
var companyName   = 'Dee+Stuff';
var htmlTitle	  = 'DeeStuff+4+Pets-Healthy+pet+treats+and+pet+fashions';
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();
};

