/* [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','95',jdecode('%7E+2Go+Home+%7E'),jdecode(''),'/95/index.html','true',[ 
		['PAGE','4782',jdecode('*+Guestbook'),jdecode(''),'/95/4782.html','true',[],''],
		['PAGE','4781',jdecode('*+Read+Guestbook'),jdecode(''),'/95/4781.html','false',[],'']
	],''],
	['PAGE','125',jdecode('%7E+Fresh+Snakes+%7E'),jdecode(''),'/125/index.html','true',[ 
		['PAGE','134',jdecode('*+Available+Corns'),jdecode(''),'/125/134.html','true',[],''],
		['PAGE','143',jdecode('*+Available+Milks'),jdecode(''),'/125/143.html','true',[],''],
		['PAGE','152',jdecode('*+Available+Kings'),jdecode(''),'/125/152.html','true',[],''],
		['PAGE','6156',jdecode('*+Available+Balls'),jdecode(''),'/125/6156.html','true',[],'']
	],''],
	['PAGE','2220',jdecode('%7E+Hot+Snakes+%7E'),jdecode(''),'/2220/index.html','true',[ 
		['PAGE','4085',jdecode('*+Sweet+Snakes'),jdecode(''),'/2220/4085.html','false',[],''],
		['PAGE','4544',jdecode('%7E+*+%7E'),jdecode(''),'/2220/4544.html','false',[],'']
	],''],
	['PAGE','224',jdecode('%7E+Terms+%7E'),jdecode(''),'/224.html','true',[],''],
	['PAGE','197',jdecode('%7E+Contacts+%7E'),jdecode(''),'/197.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Party';
theSitetree.paletteFamily='B36B1A';
theSitetree.keyvisualId='3519';
theSitetree.keyvisualName='kv_3519.jpg';
theSitetree.fontsetId='10723';
theSitetree.graphicsetId='10809';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B36B1A';
var theTemplate={
				name: 			'Party',
				paletteFamily: 	'B36B1A',
				keyvisualId: 	'3519',
				keyvisualName: 	'kv_3519.jpg',
				fontsetId: 		'10723',
				graphicsetId: 	'10809',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B36B1A',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'E6FFAB',
				e_color: 		'E6FFAB',
				f_color: 		'E6FFAB',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-4782AHW050IN357G']={
webappId:    '1002',
documentId:  '4782',
internalId:  '4782AHW050IN357G',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '95',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-7f0a4919ffeb1f5640a2c207a34221eb']={
webappId:    '7060',
documentId:  '2220',
internalId:  '7f0a4919ffeb1f5640a2c207a34221eb',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-8339d16d364a873f3628aa4f00c027df']={
webappId:    '7060',
documentId:  '4085',
internalId:  '8339d16d364a873f3628aa4f00c027df',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-1169c039ae3198466c44fb2951705245']={
webappId:    '7060',
documentId:  '4544',
internalId:  '1169c039ae3198466c44fb2951705245',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95',
internalId:  '',
customField: '20090720-100900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4781',
internalId:  '',
customField: '20051120-195708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4782',
internalId:  '',
customField: '20070921-150817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125',
internalId:  '',
customField: '20090720-100845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134',
internalId:  '',
customField: '20090720-101736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143',
internalId:  '',
customField: '20090720-101801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152',
internalId:  '',
customField: '20090720-101713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6156',
internalId:  '',
customField: '20090720-101836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2220',
internalId:  '',
customField: '20070921-164553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4085',
internalId:  '',
customField: '20070921-150721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4544',
internalId:  '',
customField: '20050928-221112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224',
internalId:  '',
customField: '20070921-164742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '197',
internalId:  '',
customField: '20090720-100734'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN357G';
var companyName   = '%7E+HotSnakes+2+Go+%7E';
var htmlTitle	  = 'HotSnakes2Go.com';
var metaKeywords  = 'SNAKES%2C+COLUBRIDS%2C+CORN+SNAKES%2C+MILK+SNAKES%2C+KING+SNAKES%2C+BALL+PYTHONS%2C+SNAKES+FOR+SALE%2C+PET+SNAKES%2C+NON-VENOMOUS+SNAKES';
var metaContents  = 'SPECIALIZING+IN+HIGH-END+NON-VENOMOUS+SNAKES%3A+COLUBRIDS%28CORN+SNAKES%2C+MILK+SNAKES%2C+KING+SNAKES%29+AND+SELECT+BALL+PYTHON+MORPHS.+BREEDERS+AND+PETS+FOR+SALE.+GUARANTEED+LIVE+DELIVERY+WITH+SIGNATURE%2C+SOLD++SHIPPED+VIA+FED+EX+WITHIN+THE+CONTINENTAL+US.+';
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();
};
