/* [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','6401',jdecode('Home'),jdecode(''),'/6401.html','true',[],''],
	['PAGE','6473',jdecode('Bearded+Dragons+for+sale'),jdecode(''),'/6473.html','true',[],''],
	['PAGE','87701',jdecode('Feeders+%26+Vitamins+for+sale'),jdecode(''),'/87701.html','true',[],''],
	['PAGE','6578',jdecode('Cages+for+sale'),jdecode(''),'/6578.html','true',[],''],
	['PAGE','124299',jdecode('Male+Breeders'),jdecode(''),'/124299.html','true',[],''],
	['PAGE','6494',jdecode('Female+Breeders'),jdecode(''),'/6494.html','true',[],''],
	['PAGE','123699',jdecode('Future+Breeders'),jdecode(''),'/123699.html','true',[],''],
	['PAGE','6515',jdecode('Photo+Gallery+1'),jdecode(''),'/6515.html','true',[],''],
	['PAGE','6452',jdecode('Bearded+Dragon+Care+Sheet'),jdecode(''),'/6452.html','true',[],''],
	['PAGE','6536',jdecode('Citrus+Tiger+Info.'),jdecode(''),'/6536.html','true',[],''],
	['PAGE','6557',jdecode('Terms%2FContact+info.'),jdecode(''),'/6557.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='A3AFD5';
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: 	'A3AFD5',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100225-042951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6452',
internalId:  '',
customField: '20090929-003059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6473',
internalId:  '',
customField: '20100313-181608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123699',
internalId:  '',
customField: '20100228-204157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6536',
internalId:  '',
customField: '20090305-015757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6494',
internalId:  '',
customField: '20100302-222137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6515',
internalId:  '',
customField: '20091024-235218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6578',
internalId:  '',
customField: '20100225-034226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6557',
internalId:  '',
customField: '20090928-210706'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6401',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6452',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6473',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6578',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6494',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6515',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6536',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6557',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87701',
internalId:  '',
customField: '20100301-013945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124299',
internalId:  '',
customField: '20100302-212524'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INECRU';
var companyName   = 'Livingston+Lizard+Lounge';
var htmlTitle	  = 'Bearded+Dragons+for+sale+%7E++livingstonlizardlounge.com';
var metaKeywords  = 'Bearded+Dragon+Translucent%2C+Bearded+Dragon+for+sale%2C+Bearded+Dragon+4+sale%2C+Bearded+Dragon+Breeder%2C+Red+Bearded+Dragon%2C+Orange+bearded+Dragon%2C+Yellow+Bearded+Dragon%2C+Citrus+Bearded+Dragon%2C+Hypo+Bearded+Dragon%2C+Tiger+Bearded+Dragon%2C+Sacramento+Bearded+Dragon%2CRed+bearded+dragons%2C+Bright+Saturated+Orange+Bearded+Dragons%2C+Citrus+bearded+dragons%2C+Red+Hypomelanistic+Bearded+Dragons%2C+Hypotranslucents%2C+Leucistic+translucents%2C+Silkback+Hypotranslucents%2C+Smoothie+Hypotranslucents%2C+Leatherback+Hypotranslucents%2C+Smoothie+Hypotranslucents%2C++Lavendar+bearded+dragons%2C+Purple+bearded+dragons%2C+Red%2C+Orange%2C+Yellow+Translucents%2C+Hypotranslucents%2C+Leucistic+bearded+dragon%2C+morphs%2C+Leucistic%2C+Bearded+Dragon+Pictures%2C+Bearded+Dragon+Care%2C+Bearded+Dragon+Care+Sheet%2C+Bearded+Dragon+Lizard%2C+Bearded+Dragon+Diet%2C+Bearded+Dragon+Breeders%2C+Bearded+Dragon+Food%2C+snow+bearded+dragons%2C+orange+bearded+dragon%2C+livingston+lizard+lounge%2C+livingsonlizardlounge%2C+livingstonlizardlounge.com%2C+lizard%2C+livingston%2C+livingston+lizards%2C+lizard+lounge%2C+Pogona%2C+Pogona+vitticeps%2C+Inland+Bearded+Dragon%2C+P.+barbata%2C+Coastal+Bearded+Dragon%2C+P.+henrylawsoni%2C+Black-soil+Bearded+Dragon%2C+P.+microlepidota%2C+Kimberley+Bearded+Dragon%2C+P.+minima%2C+Western+Bearded+Dragon%2C+P.+minor%2C+Dwarf+Bearded+Dragon%2C+P.+nullabor%2C+Nullabor%E2%80%99s+Bearded+Dragon%2C+';
var metaContents  = 'Bearded+Dragons+for+sale.+We+are+a+Bearded+Dragon+breeder%2C+Specializing+in+healthy+and+colorful+Bearded+Dragons.+We+breed+Citrus+Bearded+Dragons%2C+Citrus+Tiger%2C+Citrus+Translucent%2C+Super+Orange%2C+Extreme+Red%2C+Blood%2C+American+Smoothie%2C+Hypos%2C+and+many+more.+With+bloodlines+from+around+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();
};
