/* [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 theSitetree=[ 
	['PAGE','6922',jdecode('WELCOME'),jdecode(''),'/6922.html','true',[],''],
	['PAGE','6994',jdecode('SADIE%26%23x27%3BS+PUPPIES'),jdecode(''),'/6994.html','true',[],''],
	['PAGE','6973',jdecode('JAZZ%26%23x27%3BS+PUPPIES'),jdecode(''),'/6973.html','true',[],''],
	['PAGE','78341',jdecode('DOLLY%26%23x27%3BS+PUPPIES'),jdecode(''),'/78341.html','true',[],''],
	['PAGE','7057',jdecode('OUR+PUGGLES'),jdecode(''),'/7057.html','true',[],''],
	['PAGE','90925',jdecode('Life%26%23x27%3Bs+Abundance+Dog+Food'),jdecode(''),'/90925.html','true',[],''],
	['PAGE','47301',jdecode('Forever+Homes'),jdecode(''),'/47301.html','true',[],''],
	['PAGE','7015',jdecode('More+Forever+Homes'),jdecode(''),'/7015.html','true',[],''],
	['PAGE','81211',jdecode('More+forever+Homes%21'),jdecode(''),'/81211.html','true',[],''],
	['PAGE','7036',jdecode('WHAT%26%23x27%3BS+A+PUGGLE%3F'),jdecode(''),'/7036.html','true',[],''],
	['PAGE','20501',jdecode('PUGGLE+GUESTBOOK'),jdecode(''),'/20501.html','true',[],''],
	['PAGE','7099',jdecode('PUPPY+WARRANTY'),jdecode(''),'/7099.html','true',[],''],
	['PAGE','79441',jdecode('YORKIE+PUPPIES'),jdecode(''),'/79441.html','true',[],''],
	['PAGE','78362',jdecode('Links'),jdecode(''),'/78362.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Comic';
theSitetree.paletteFamily='76064D';
theSitetree.keyvisualId='9983';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17761';
theSitetree.graphicsetId='13132';
theSitetree.contentColor='76064D';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Comic',
				paletteFamily: 	'76064D',
				keyvisualId: 	'9983',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17761',
				graphicsetId: 	'13132',
				contentColor: 	'76064D',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6922',
internalId:  '',
customField: '20091026-221023'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6922',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79441',
internalId:  '',
customField: '20090830-114428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6973',
internalId:  '',
customField: '20090419-002126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6994',
internalId:  '',
customField: '20090419-001911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7015',
internalId:  '',
customField: '20090705-224034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7036',
internalId:  '',
customField: '20080905-233719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7057',
internalId:  '',
customField: '20081116-103523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7099',
internalId:  '',
customField: '20080906-224506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47301',
internalId:  '',
customField: '20090705-215046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90925',
internalId:  '',
customField: '20090913-200442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81211',
internalId:  '',
customField: '20090705-214953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78341',
internalId:  '',
customField: '20090705-212648'
};
webappMappings['1002']=webappMappings['1002-20501aendu0in2qup']={
webappId:    '1002',
documentId:  '20501',
internalId:  '20501aendu0in2qup',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20090118-210225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78362',
internalId:  '',
customField: '20090913-190519'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2QUP';
var companyName   = 'PUGGLES+TO+CUDDLE';
var htmlTitle	  = 'PUGGLES+TO+CUDDLE';
var metaKeywords  = 'second+generation+puggles%2C+cute+puggles%2C+iowa+puggle+breeder%2C+puggle+puppies+for+sale%2C+tri-color+puggle%2C+puggle+breeders%2C+puggle+breeder%2C+puggles%2C+puggle+pictures%2C+puggle+information%2C+hybrid+puppies%2C+designer+dogs%2C+puggles+puppy+for+sale%2C+puggle+dog%2C+puggle+for+sale%2C+puggle+puppy+pictures%2C+pictures+of+puggles%2C+puggles+puppies+for+sale%2C+puggle+puppies%2C+puggles+puppies%2C+puggles+for+sale%2C+puggle+dogs%2C+dogs%2C+puggle+dog+info%2C+puggle+puppies+iowa%2C+breeders+of+puggles%2C+in+home+breeder%2C+welcome+to+puggles%2C+puggle+hybrid+dogs%2C+puggle+dog+breeders%2C+black+puggle%2C+dog+breeders+puppies+for+sale%2C+dog+puggle%2C+pugle%2C+pugles%2C+pugle+dog%2C+pugle+puppies%2C+puppies+puggle%2C+dog+puggle+breeder%2C+pugle+puppy';
var metaContents  = 'WELCOME+TO+PUGGLES+TO+CUDDLE%21+We+raise+Adorable+Second+Generation+Puggle+Puppies+located+in+Iowa.+Tri-colors%2C+Fawn+and+Black+are+common+colors.+Our+Puggle+Pups+are+ACHC+Registered.+CUTE+PUGGLES+TO+CUDDLE+FOR+YOU%21%21';
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();
};
