/* [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','57845',jdecode('Home'),jdecode(''),'/57845.html','true',[],'',''],
	['PAGE','77767',jdecode('History+of+the+Breed'),jdecode(''),'/77767.html','true',[],'',''],
	['PAGE','77788',jdecode('Character'),jdecode(''),'/77788.html','true',[],'',''],
	['PAGE','77809',jdecode('Maintenance'),jdecode(''),'/77809.html','true',[],'',''],
	['PAGE','77830',jdecode('My+Little+Girl%3A+JAYLEE'),jdecode(''),'/77830.html','true',[],'',''],
	['PAGE','77851',jdecode('My+Little+Guy%3A+JUBAL'),jdecode(''),'/77851.html','true',[],'',''],
	['PAGE','98167',jdecode('My+Sister%26%23x27%3Bs+Troops'),jdecode(''),'/98167.html','true',[],'',''],
	['PAGE','77893',jdecode('PUPPIES'),jdecode(''),'/77893.html','true',[],'',''],
	['PAGE','77914',jdecode('Contact+Information'),jdecode(''),'/77914.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Comic';
theSitetree.paletteFamily='1B4082';
theSitetree.keyvisualId='9983';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17762';
theSitetree.graphicsetId='13129';
theSitetree.contentColor='1B4082';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Comic',
				paletteFamily: 	'1B4082',
				keyvisualId: 	'9983',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17762',
				graphicsetId: 	'13129',
				contentColor: 	'1B4082',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98167',
internalId:  '',
customField: '20100602-184845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77893',
internalId:  '',
customField: '20100423-122110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57845',
internalId:  '',
customField: '20100810-091713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77767',
internalId:  '',
customField: '20100119-010547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77788',
internalId:  '',
customField: '20100810-084817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77914',
internalId:  '',
customField: '20090911-201934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77809',
internalId:  '',
customField: '20090911-171315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77830',
internalId:  '',
customField: '20100228-191553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77851',
internalId:  '',
customField: '20100228-190634'
};
webappMappings['7008']=webappMappings['7008-20795']={
webappId:    '7008',
documentId:  '77914',
internalId:  '20795',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '57845',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INVKOZ';
var companyName   = '.';
var htmlTitle	  = '';
var metaKeywords  = '+prague+ratter%2C+Prazsky+krysarik%2C++Prague+ratter+puppies%2C+Prazsky+krysarik+puppies%2C+rare+Czech+breed+%2C+worlds+smallest+dog%2CRatter+puppies%2C+Prazsky+puppies%2C+';
var metaContents  = 'Prazsky+krysarik+puppies+aka+prague+ratter+information%2C+history%2C+character%2C+maintenance+and+breed+standards.+My+pictures+of+this+rare+czech+breed+siad+to+be+the+smallest+dog+in+the+world.';
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();
};
