/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],''],
	['PAGE','47871',jdecode('SG+Braveheart+Jenny'),jdecode(''),'/47871.html','true',[],''],
	['PAGE','47892',jdecode('Miya+vom+Linmarc'),jdecode(''),'/47892.html','true',[],''],
	['PAGE','47913',jdecode('Ali+vom+Linmarc'),jdecode(''),'/47913.html','true',[],''],
	['PAGE','936',jdecode('Photos'),jdecode(''),'/936.html','true',[],''],
	['PAGE','47955',jdecode('Photos+II'),jdecode(''),'/47955.html','true',[],''],
	['PAGE','77285',jdecode('more+photos'),jdecode(''),'/77285.html','true',[],''],
	['PAGE','90785',jdecode('Working+Photos'),jdecode(''),'/90785.html','true',[],''],
	['PAGE','8901',jdecode('Planned+breedings'),jdecode(''),'/8901.html','true',[],''],
	['PAGE','9301',jdecode('Retired'),jdecode(''),'/9301.html','true',[],''],
	['PAGE','978',jdecode('In+Memory'),jdecode(''),'/978.html','true',[],''],
	['PAGE','46471',jdecode('Honor+Roll%2FPhotos'),jdecode(''),'/46471.html','true',[],''],
	['PAGE','14801',jdecode('Warranty'),jdecode(''),'/14801.html','true',[],''],
	['PAGE','14822',jdecode('Payment+Info'),jdecode(''),'/14822.html','true',[],''],
	['PAGE','873',jdecode('Contact+Us%2FLinks'),jdecode(''),'/873.html','true',[],''],
	['PAGE','97385',jdecode('Vom+Polizeihaus+'),jdecode(''),'/97385.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Riga';
theSitetree.paletteFamily='E29D43';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11222';
theSitetree.graphicsetId='12042';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='E29D43';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Riga',
				paletteFamily: 	'E29D43',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11222',
				graphicsetId: 	'12042',
				contentColor: 	'FFFFFF',
				contentBGColor: 'E29D43',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				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:  '801',
internalId:  '',
customField: '20100308-215021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '936',
internalId:  '',
customField: '20100213-220832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20100305-164612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20091201-235819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20091201-221907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20100106-222527'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-16211059']={
webappId:    '1501',
documentId:  '801',
internalId:  '16211059',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20091201-235852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14822',
internalId:  '',
customField: '20091201-222035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47955',
internalId:  '',
customField: '20091201-235330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77285',
internalId:  '',
customField: '20091129-223838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47913',
internalId:  '',
customField: '20100308-220242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47892',
internalId:  '',
customField: '20100308-125518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47871',
internalId:  '',
customField: '20100109-212109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46471',
internalId:  '',
customField: '20100131-205901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97385',
internalId:  '',
customField: '20100129-234055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90785',
internalId:  '',
customField: '20091215-103820'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INXHH1';
var companyName   = 'Von+Eintze+Working+Dogs';
var htmlTitle	  = 'Von+Eintze+Shepherds';
var metaKeywords  = 'German+Shepherd+Dogs%2C+Working+German+Shepherds%2C+German+Shepherd+Breeders%2C+DDR+German+Shepherds%2C+East+German+Shepherd%2C+West+German+Shepherds%2C+Czech+German+Shepherds%2C+Schutzhund%2C+Personal+Protection+Dogs%2C+Search+and+Rescue+Dogs%2C+Competition%2C+Obedience%2C+Agility%2C+Family+Companions%2C+Puppies%2C+Puppies+For+Sale%2C+German+Shepherds+For+Sale%2C+Narcotics%2C+Explosives+Detection%2CHRD+dogs%2CPolice+Dogs%2CPolizeihaus';
var metaContents  = 'German+Shepherd+breeders+and+puppy+breeders+of+quality+working+German+Shepherd+dogs+and+DDR+German+Shepherds+in+Oklahoma';
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();
};
