/* [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','30201',jdecode('SPECIAL+OFFERS+*'),jdecode(''), jdecode('%2F30201.html'), 'false',[],'',''],
	['PAGE','15201',jdecode('Vertical+Cages'),jdecode(''), jdecode('%2F15201%2Findex.html'), 'true',[ 
		['PAGE','15222',jdecode('SC-1+-+Standard'),jdecode(''), jdecode('%2F15201%2F15222.html'), 'true',[],'',''],
		['PAGE','15901',jdecode('SC-2+MID-SIZE'),jdecode(''), jdecode('%2F15201%2F15901.html'), 'true',[],'',''],
		['PAGE','15922',jdecode('SC-3+LARGE'),jdecode(''), jdecode('%2F15201%2F15922.html'), 'true',[],'',''],
		['PAGE','34001',jdecode('SC4-SHORT'),jdecode(''), jdecode('%2F15201%2F34001.html'), 'true',[],'',''],
		['PAGE','15243',jdecode('SC-4+EXTRA+LARGE'),jdecode(''), jdecode('%2F15201%2F15243.html'), 'true',[],'','']
	],'',''],
	['PAGE','26401',jdecode('Hanging+Wall+Cages'),jdecode(''), jdecode('%2F26401%2Findex.html'), 'false',[ 
		['PAGE','26422',jdecode('SCW1'),jdecode(''), jdecode('%2F26401%2F26422.html'), 'false',[],'',''],
		['PAGE','26443',jdecode('SCW2'),jdecode(''), jdecode('%2F26401%2F26443.html'), 'false',[],'','']
	],'',''],
	['PAGE','16101',jdecode('Horizontal+Cages+'),jdecode(''), jdecode('%2F16101%2Findex.html'), 'true',[ 
		['PAGE','16122',jdecode('HC3+-+LARGE'),jdecode(''), jdecode('%2F16101%2F16122.html'), 'true',[],'',''],
		['PAGE','16143',jdecode('HC4+-++EXTRA+LARGE'),jdecode(''), jdecode('%2F16101%2F16143.html'), 'true',[],'','']
	],'',''],
	['PAGE','20901',jdecode('Acrylic+Cages+-+NEW%21'),jdecode(''), jdecode('%2F20901%2Findex.html'), 'true',[ 
		['PAGE','20922',jdecode('AC+1'),jdecode(''), jdecode('%2F20901%2F20922.html'), 'false',[],'',''],
		['PAGE','20943',jdecode('AC-01V'),jdecode(''), jdecode('%2F20901%2F20943.html'), 'false',[],'',''],
		['PAGE','26464',jdecode('AC-01H'),jdecode(''), jdecode('%2F20901%2F26464.html'), 'false',[],'',''],
		['PAGE','26485',jdecode('AC-03'),jdecode(''), jdecode('%2F20901%2F26485.html'), 'true',[],'',''],
		['PAGE','26506',jdecode('AC-04'),jdecode(''), jdecode('%2F20901%2F26506.html'), 'true',[],'','']
	],'',''],
	['PAGE','15264',jdecode('Lighting+Models'),jdecode(''), jdecode('%2F15264%2Findex.html'), 'true',[ 
		['PAGE','15285',jdecode('LH-1+12%22'),jdecode(''), jdecode('%2F15264%2F15285.html'), 'true',[],'',''],
		['PAGE','15306',jdecode('LH-2+16%22'),jdecode(''), jdecode('%2F15264%2F15306.html'), 'true',[],'',''],
		['PAGE','15943',jdecode('LH-3+18%22'),jdecode(''), jdecode('%2F15264%2F15943.html'), 'true',[],'',''],
		['PAGE','15964',jdecode('LH-4+24%22'),jdecode(''), jdecode('%2F15264%2F15964.html'), 'true',[],'',''],
		['PAGE','22301',jdecode('FH3+18%22+Fluorescent+'),jdecode(''), jdecode('%2F15264%2F22301.html'), 'false',[],'',''],
		['PAGE','22322',jdecode('FH4+24%22+Fluorescent+'),jdecode(''), jdecode('%2F15264%2F22322.html'), 'true',[],'','']
	],'',''],
	['PAGE','26527',jdecode('Substrate+Trays'),jdecode(''), jdecode('%2F26527.html'), 'true',[],'',''],
	['PAGE','1915',jdecode('ONLINE+STORE'),jdecode(''), jdecode('%2F1915.html'), 'true',[],'',''],
	['PAGE','1936',jdecode('Phone+Orders'),jdecode(''), jdecode('%2F1936.html'), 'true',[],'',''],
	['PAGE','1852',jdecode('About+us'),jdecode(''), jdecode('%2F1852%2Findex.html'), 'true',[ 
		['PAGE','1894',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F1852%2F1894.html'), 'true',[],'','']
	],'',''],
	['PAGE','1957',jdecode('Terms'),jdecode(''), jdecode('%2F1957.html'), 'true',[],'',''],
	['PAGE','10201',jdecode('Instructions'),jdecode(''), jdecode('%2F10201.html'), 'true',[],'',''],
	['PAGE','1978',jdecode('Product+Photos'),jdecode(''), jdecode('%2F1978.html'), 'true',[],'','']];
var siteelementCount=35;
theSitetree.topTemplateName='Building';
theSitetree.paletteFamily='018101';
theSitetree.keyvisualId='11961';
theSitetree.keyvisualName='kv_11961.jpg';
theSitetree.fontsetId='33254';
theSitetree.graphicsetId='14120';
theSitetree.contentColor='333333';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'brinkster',
  product: 'WSCSYSSSSLYTCVUK'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Building',
				paletteFamily: 	'018101',
				keyvisualId: 	'11961',
				keyvisualName: 	'kv_11961.jpg',
				fontsetId: 		'33254',
				graphicsetId: 	'14120',
				contentColor: 	'333333',
				contentBGColor: 'FFFFFF',
				a_color: 		'008102',
				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: '20111117-140844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20090624-184558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20110228-143217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20090814-171214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20090624-184930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20090713-194703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20091015-231220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20090814-181224'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['4001']=webappMappings['4001-15652948']={
webappId:    '4001',
documentId:  '1915',
internalId:  '15652948',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-15703709']={
webappId:    '1501',
documentId:  '1801',
internalId:  '15703709',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-2c66e78f68f150e05d7e339e1bf53065']={
webappId:    '7060',
documentId:  '10201',
internalId:  '2c66e78f68f150e05d7e339e1bf53065',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-24631d963ad15b208c66e7c56b3b1ce1']={
webappId:    '7060',
documentId:  '1978',
internalId:  '24631d963ad15b208c66e7c56b3b1ce1',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20100312-194452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15222',
internalId:  '',
customField: '20110902-163303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20100312-194647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15264',
internalId:  '',
customField: '20100312-194741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20111117-135140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15922',
internalId:  '',
customField: '20111117-135223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15243',
internalId:  '',
customField: '20111117-135302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16122',
internalId:  '',
customField: '20100923-113221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16143',
internalId:  '',
customField: '20100923-113245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15285',
internalId:  '',
customField: '20100422-020652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15306',
internalId:  '',
customField: '20100422-020737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15943',
internalId:  '',
customField: '20100422-020811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15964',
internalId:  '',
customField: '20100422-020835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20100616-131336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20110429-203456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20943',
internalId:  '',
customField: '20111006-151252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20100616-202232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22322',
internalId:  '',
customField: '20110420-015925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26527',
internalId:  '',
customField: '20110429-194439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26401',
internalId:  '',
customField: '20110429-194731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26422',
internalId:  '',
customField: '20110429-200058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26443',
internalId:  '',
customField: '20110429-195750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26464',
internalId:  '',
customField: '20111006-151508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26485',
internalId:  '',
customField: '20111006-151319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26506',
internalId:  '',
customField: '20120103-124830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20110623-134003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34001',
internalId:  '',
customField: '20111117-135942'
};
var webAppHostname = 'wsc.brinkster.com:80';
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INLYQL';
var companyName   = 'DIYCAGES.COM';
var htmlTitle	  = 'SCREEN+REPTILE+CAGES%2C+CHAMELEON+CAGES%2C+GECKO+CAGE%2C+REPTILE+ENCLOSURES+AND+LIGHTS%2CLIGHTING';
var metaKeywords  = 'SCREEN+CAGES%2C+CHAMELEON+CAGES%2C+CAGE%2C+LIGHTS%2C+LIGHTING%2CSCREEN+REPTILE+CAGES%2C+REPTILE+HABITAT%2C+GECKO%2C+CHAMELEON%2C+FRESH+AIR+HABITAT%2C+REPTIBREEZE%2C+OUTDOOR+CAGE%2C+DO+IT+YOURSELF+CAGES%2C+HERP+CAGES%2C+AMPHIBIAN+CAGES%2C+FROG+CAGES%2CFULL+SPECTRUM%2C+UVB%2CUVA';
var metaContents  = 'SCREEN+CAGES%2C+CHAMELEON+CAGES%2C+SCREEN+REPTILE+CAGES%2C+REPTILE+HABITAT%2C+GECKO%2CLIGHTS%2CLIGHTING%2CFULL+SPECTRUM%2C+CHAMELEON%2C+FRESH+AIR+HABITAT%2C+REPTIBREEZE%2C+OUTDOOR+CAGE%2C+DO+IT+YOURSELF+CAGES%2C+HERP+CAGES%2C+AMPHIBIAN+CAGES%2C+FROG+CAGES%2CCAGE%2CUVA%2CUVB';
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();
};

