/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','44029',jdecode('Ball+Python'),jdecode(''), jdecode('%2F44029%2Findex.html'), 'true',[ 
		['PAGE','3301',jdecode('Collection'),jdecode(''), jdecode('%2F44029%2F3301.html'), 'true',[],'',''],
		['PAGE','40529',jdecode('Clutches'),jdecode(''), jdecode('%2F44029%2F40529.html'), 'true',[],'','']
	],'',''],
	['PAGE','46050',jdecode('Hedgehog'),jdecode(''), jdecode('%2F46050.html'), 'true',[],'',''],
	['PAGE','60340',jdecode('Wallaby'),jdecode(''), jdecode('%2F60340.html'), 'true',[],'',''],
	['PAGE','46071',jdecode('Coatimundi'),jdecode(''), jdecode('%2F46071.html'), 'true',[],'',''],
	['PAGE','46092',jdecode('Ostrich+%26+Emu'),jdecode(''), jdecode('%2F46092.html'), 'true',[],'',''],
	['PAGE','61940',jdecode('Cane+Corso'),jdecode(''), jdecode('%2F61940.html'), 'true',[],'',''],
	['PAGE','46113',jdecode('Mandarin+Duck'),jdecode(''), jdecode('%2F46113.html'), 'true',[],'',''],
	['PAGE','46134',jdecode('Rodents'),jdecode(''), jdecode('%2F46134.html'), 'true',[],'',''],
	['PAGE','23515',jdecode('Mouse%2FRat+Racks'),jdecode(''), jdecode('%2F23515.html'), 'true',[],'',''],
	['PAGE','3543',jdecode('Care+and+Info'),jdecode(''), jdecode('%2F3543.html'), 'true',[],'',''],
	['PAGE','3401',jdecode('Terms'),jdecode(''), jdecode('%2F3401.html'), 'true',[],'',''],
	['PAGE','3501',jdecode('Guarantee'),jdecode(''), jdecode('%2F3501.html'), 'true',[],'',''],
	['PAGE','3522',jdecode('Contact'),jdecode(''), jdecode('%2F3522.html'), 'true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='D4483C';
theSitetree.contentBGColor='2E2E2E';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'fatcow',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'D4483C',
				contentBGColor: '2E2E2E',
				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:  '1801',
internalId:  '',
customField: '20111104-135340'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23515',
internalId:  '',
customField: '20101126-103356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61940',
internalId:  '',
customField: '20111101-102606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20110415-102949'
};
webappMappings['1501']=webappMappings['1501-16716592']={
webappId:    '1501',
documentId:  '1801',
internalId:  '16716592',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20111028-105912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20110906-151502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3522',
internalId:  '',
customField: '20101126-103546'
};
webappMappings['7008']=webappMappings['7008-14345']={
webappId:    '7008',
documentId:  '3522',
internalId:  '14345',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3543',
internalId:  '',
customField: '20101126-102546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40529',
internalId:  '',
customField: '20111028-102242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44029',
internalId:  '',
customField: '20111014-140800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60340',
internalId:  '',
customField: '20111101-092904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46071',
internalId:  '',
customField: '20110428-142540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46092',
internalId:  '',
customField: '20110428-142242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46113',
internalId:  '',
customField: '20110428-141451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46134',
internalId:  '',
customField: '20110428-133751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46050',
internalId:  '',
customField: '20111013-122950'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3077';
var companyName   = 'Snake+Eyes+Reptiles';
var htmlTitle	  = 'www.snakeeyesreptiles.net';
var metaKeywords  = 'ball+python+pied+pastel+snake+bumblebee+bee+spider+morph+breed+reptile+feed+breeding+breeder+feeding+mouse+rat+albino+axanthic+black+back+head+burgundy+butter+ghost+caramel+chocolate+cinnamon+pewter+pastave+sterling+super+jungle+clown+coral+glow+crystal+ball+desert+ghost+ebony+enchi+fireball+fire+banded+reduced+hypomelanistic+granite+ivory+labyrinth+lavender+leucistic+black+eyed+blue+eyed+eye+paragon+pearl+phantom+piebald+pinstripe+lemon+graziani+bell+platinum+lesser+powerball+red+ringer+sable+snow+cinnabee+recessive+co-dominant+woma+killer+queen+spotnose+yellow+belly+wanna+bee+stripe+tiger+terrarium+aquarium+cage+sale+cheap+for+discount';
var metaContents  = 'Providing+quality+reptiles+to+the+public+and+breeders+alike.+We+handle+normals+as+well+as+morphs.+We+are+located+in+South+Carolina+and+can+provide+help+with+any+of+your+reptile+needs%2C+and+if+we+cant%2C+well+find+someone+who+can%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();
};

