/* [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','5901',jdecode('Welcome'),jdecode(''),'/5901.html','true',[],''],
	['PAGE','11201',jdecode('Chinese+Shar-pei+History'),jdecode(''),'/11201/index.html','true',[ 
		['PAGE','11222',jdecode('Chinese+Shar-pei+Standard'),jdecode(''),'/11201/11222.html','true',[],'']
	],''],
	['PAGE','12501',jdecode('Selecting+a+Shar-pei+Puppy'),jdecode(''),'/12501/index.html','true',[ 
		['PAGE','13101',jdecode('Puppy+Questionnaire'),jdecode(''),'/12501/13101.html','true',[],'']
	],''],
	['PAGE','11901',jdecode('Males'),jdecode(''),'/11901/index.html','true',[ 
		['PAGE','15601',jdecode('Aaron'),jdecode(''),'/11901/15601.html','true',[],''],
		['PAGE','15622',jdecode('Rumor'),jdecode(''),'/11901/15622.html','true',[],''],
		['PAGE','47329',jdecode('Ironman'),jdecode(''),'/11901/47329.html','true',[],'']
	],''],
	['PAGE','11943',jdecode('Females'),jdecode(''),'/11943/index.html','true',[ 
		['PAGE','15643',jdecode('Vegas'),jdecode(''),'/11943/15643.html','true',[],''],
		['PAGE','15664',jdecode('Bluff'),jdecode(''),'/11943/15664.html','true',[],''],
		['PAGE','15685',jdecode('Torie'),jdecode(''),'/11943/15685.html','true',[],''],
		['PAGE','15706',jdecode('Kitty'),jdecode(''),'/11943/15706.html','true',[],''],
		['PAGE','15727',jdecode('Katie'),jdecode(''),'/11943/15727.html','true',[],'']
	],''],
	['PAGE','15748',jdecode('Puppy+Candids'),jdecode(''),'/15748.html','true',[],''],
	['PAGE','13301',jdecode('Available+Puppies'),jdecode(''),'/13301.html','true',[],''],
	['PAGE','13322',jdecode('Available+Adults'),jdecode(''),'/13322.html','true',[],''],
	['PAGE','15769',jdecode('Handling'),jdecode(''),'/15769.html','true',[],''],
	['PAGE','42829',jdecode('My+Kids+In+Juniors'),jdecode(''),'/42829.html','true',[],''],
	['PAGE','15790',jdecode('Devon+Rex+Cats'),jdecode(''),'/15790.html','true',[],''],
	['PAGE','15811',jdecode('Links'),jdecode(''),'/15811.html','true',[],''],
	['PAGE','15832',jdecode('Contact+Us'),jdecode(''),'/15832.html','true',[],'']];
var siteelementCount=23;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				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:  '5901',
internalId:  '',
customField: '20100620-232429'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20080401-011700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11222',
internalId:  '',
customField: '20080401-011814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20080503-000402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20080401-012132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11943',
internalId:  '',
customField: '20080503-000419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20080401-012236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20100620-213200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13322',
internalId:  '',
customField: '20090102-222241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15832',
internalId:  '',
customField: '20080402-020630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20090102-222606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15622',
internalId:  '',
customField: '20080410-014443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15643',
internalId:  '',
customField: '20090315-144843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15664',
internalId:  '',
customField: '20090102-223052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15685',
internalId:  '',
customField: '20090102-223155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15706',
internalId:  '',
customField: '20080410-015052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15727',
internalId:  '',
customField: '20080410-014724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15748',
internalId:  '',
customField: '20080423-002331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15769',
internalId:  '',
customField: '20100620-213110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15790',
internalId:  '',
customField: '20080403-005021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15811',
internalId:  '',
customField: '20090103-155750'
};
webappMappings['7060']=webappMappings['7060-09e6cb73e310d08ced714c1e9bee10c6']={
webappId:    '7060',
documentId:  '15748',
internalId:  '09e6cb73e310d08ced714c1e9bee10c6',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-f7716843a3e074e4238f2cd2b48baccb']={
webappId:    '7060',
documentId:  '15601',
internalId:  'f7716843a3e074e4238f2cd2b48baccb',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-0d7c7b5bd5658659926c91406006e171']={
webappId:    '7060',
documentId:  '15790',
internalId:  '0d7c7b5bd5658659926c91406006e171',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42829',
internalId:  '',
customField: '20080423-002000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47329',
internalId:  '',
customField: '20090102-143648'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2Q7M';
var companyName   = 'Lynperial+Chinese+Shar-pei';
var htmlTitle	  = 'Lynperial+Chinese+Shar-pei';
var metaKeywords  = 'Lynperial%2C+Chinese+Shar-pei%2C+Shar-pei%2C+Alberta%2C+Canada%2C+Central+Alberta%2C+Devon+Rex+Cats%2C+Linda+Yasinski%2C+CH.+Barhunds+All+Things+Consider%2C+CH.+Lynperials+Stackin+The+Deck%2C+CH.+Lynperials+Sincity';
var metaContents  = 'Lynperial+Chinese+Shar-pei%2C+breeder+of+Chinese+Shar-pei+for+over+20+years.+++Excellent+Temperments%2C+Health+Testing%2C+Quality+Puppies%2C+Champion+Breeding+Stock%2C+Stud+Services+to+approved+females.++Located+in+central+Alberta%2C+Canada.';
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();
};

