/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','21801',jdecode('Pug+Photo+Contest'),jdecode(''),'/21801.html','true',[],''],
	['PAGE','4222',jdecode('Pug+Fun'),jdecode(''),'/4222.html','true',[],''],
	['PAGE','4264',jdecode('Pug+News'),jdecode(''),'/4264.html','true',[],''],
	['PAGE','4622',jdecode('Our+Pugs'),jdecode(''),'/4622.html','true',[],''],
	['PAGE','3901',jdecode('Pugs+For+Sale'),jdecode(''),'/3901.html','true',[],''],
	['PAGE','4201',jdecode('Q+%26+A'),jdecode(''),'/4201.html','true',[],''],
	['PAGE','4243',jdecode('Pug+Links'),jdecode(''),'/4243.html','true',[],''],
	['PAGE','3601',jdecode('Contact+Us'),jdecode(''),'/3601.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Herzchen';
theSitetree.paletteFamily='F6DD62';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17116';
theSitetree.graphicsetId='12485';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Herzchen',
				paletteFamily: 	'F6DD62',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17116',
				graphicsetId: 	'12485',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF8C04',
				e_color: 		'F6DD62',
				f_color: 		'FFC47F',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20100331-015818'
};
webappMappings['7008']=webappMappings['7008-13723']={
webappId:    '7008',
documentId:  '3601',
internalId:  '13723',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20091125-231737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20100519-235522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4222',
internalId:  '',
customField: '20100303-191550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20100102-152635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20100715-122205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4243',
internalId:  '',
customField: '20090301-151646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4622',
internalId:  '',
customField: '20100303-183313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4264',
internalId:  '',
customField: '20090319-215958'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-15762343']={
webappId:    '1501',
documentId:  '2101',
internalId:  '15762343',
customField: '1501'
};
webappMappings['7005']=webappMappings['7005-1721']={
webappId:    '7005',
documentId:  '21801',
internalId:  '1721',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-8571']={
webappId:    '7050',
documentId:  '4264',
internalId:  '8571',
customField: 'language:en;country:US;'
};
webappMappings['7005']=webappMappings['7005-2219']={
webappId:    '7005',
documentId:  '4222',
internalId:  '2219',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN3CHG';
var companyName   = 'c+o+r+d+o+v+a+++p+u+g+s';
var htmlTitle	  = '';
var metaKeywords  = 'pug%2C+pugs%2C+puppies%2C+puppy%2C+show%2C+showing%2C+akc%2C+for+sale%2C+Glencoe%2C+Minnesota%2C+MN%2C+midwest%2C+breeder%2C+breeders%2C+black%2C+fawn%2C+minn%2C+dog%2C+dogs';
var metaContents  = 'pugs+for+sale+in+glencoe+MN%2C+pugs+for+sale%2C+pug+puppies+for+sale%2C+black+pugs%2C+fawn+pugs%2C+pug+puppy%2C+pug+show+prospects%2C+pugs+for+sale+in+minnesota%2C+pugs+for+sale+in+mn%2C+pug+breeder%2C+pug+breeder+in+MN%2C+pug+breeders%2C+pug+breeders+in+MN%2C+Cordova+Pugs%2C+black+MN+pugs%2C+fawn+MN+pugs%2C+pug+puppies+in+minnesota%2C+vet+check%2C+kid+safe+dogs%2C+kid+safe+dog+breeds%2C+family+dogs%2C+best+dog+breed%2C+toy+dogs%2C+dogs+for+sale+in+MN%2C+pug+dogs+for+sale';
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();
};
