/* [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','2301',jdecode('Home'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','7501',jdecode('Policies'),jdecode(''), jdecode('%2F7501.html'), 'true',[],'',''],
	['PAGE','7522',jdecode('Nursery'),jdecode(''), jdecode('%2F7522.html'), 'true',[],'',''],
	['PAGE','7564',jdecode('+Contract+'),jdecode(''), jdecode('%2F7564.html'), 'true',[],'',''],
	['PAGE','7543',jdecode('Diet+and+Nutrition'),jdecode(''), jdecode('%2F7543.html'), 'true',[],'',''],
	['PAGE','7585',jdecode('Housing+and+Variations+'),jdecode(''), jdecode('%2F7585.html'), 'true',[],'',''],
	['PAGE','7606',jdecode('Warnings%2F+Frequently+Asked+Questions'),jdecode(''), jdecode('%2F7606.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Anlage';
theSitetree.paletteFamily='CCFF99';
theSitetree.keyvisualId='2000';
theSitetree.keyvisualName='internet.jpg';
theSitetree.fontsetId='331';
theSitetree.graphicsetId='389';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCFF99';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Anlage',
				paletteFamily: 	'CCFF99',
				keyvisualId: 	'2000',
				keyvisualName: 	'internet.jpg',
				fontsetId: 		'331',
				graphicsetId: 	'389',
				contentColor: 	'000000',
				contentBGColor: 'CCFF99',
				a_color: 		'CCFF99',
				b_color: 		'FFFFFF',
				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:  '2301',
internalId:  '',
customField: '20111003-151841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20111009-215357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20111009-215004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7543',
internalId:  '',
customField: '20100614-121005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7564',
internalId:  '',
customField: '20110703-123332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7585',
internalId:  '',
customField: '20110703-124230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7606',
internalId:  '',
customField: '20110703-130049'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7501',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7522',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7543',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7564',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7585',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7606',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-6832749']={
webappId:    '1501',
documentId:  '2301',
internalId:  '6832749',
customField: '1501'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2AUV';
var companyName   = 'Outback+Gliders-+Sugar+Gliders+';
var htmlTitle	  = 'Sugar+Glider-Leucistic+And+Mosaic+Maryland+Sugar+Gliders+Breeder+of+White+Sugar++Gliders++';
var metaKeywords  = 'Mosaic+Sugar+gliders%2C+Leucistic+Sugar+Gliders+%2C+Sugar+Gliders%2C+exotic+pets+%2C+white+gliders+%2C+100%25+het++blonde%2C+glider%2C+sugar+Glider%2C+color+variations+%2C+joeys+%2C+Exotic+Pet%2C+Baltimore+Maryland+%2C+Sugar+Gliders+White+%2C+Sugar+glider+++++++Joey+Color%3A+Female+is+Lecistic+and++Possible+Platnium++%28Temperament%3A+Angels+-+NO+crabbing-+Lil+angel+%29+Male+is+100%25+Het+Leucistic+-and++Possible+Platnium++';
var metaContents  = 'The+Sugar+Glider+is+basically+a+marsupial+and+related+to+the+opposum.+%28+But+much+cuter%21+%29+They+are+around+6.3+to+7.5+inches+in+length%2C+with+a+tail+almost+as+long+as+the+body+and+almost+as+thick+as+a+human+thumb%2C+and+weighs+between+3+to+5.3+oz.+The+muzzle+is+short+and+rounded%2C+with+a+little+pink+nose%21+The+most+noticeable+features+of+its+anatomy%2C+however%2C+are+the+twin+skin+membranes+called+patagium+which+extend+from+the+fifth+finger+of+the+forelimb+back+to+the+first+toe+of+the+hind+foot.+These+are+inconspicuous+when+the+Sugar+Glider+is+at+rest%2C+it+merely+looks+a+little+flabby%2C+as+though+it+had+lost+a+lot+of+weight+recently%2C+but+immediately+obvious+when+it+takes+flight.+The+membranes+are+used+to+glide+between+trees%3A+when+fully+extended+they+form+an+aerodynamic+surface+the+size+of+a+large+handkerchief.I+have+one+of+the+most+beautiful+BEW+boys+ever%2C+in+search+of+a+forever+home+to+call+his+own%21+Also+in+search+of+the+perfect+family+to+cuddle+and+snuggle+with+is+his+Leucistic+brother%21+They+are+two+of+the+sweetest+joeys+Ive+had+yet%21+I+spend+lots+of+time+with+them+everyday.+%28+riding+in+the+pouch%2C+sleeping+in+the+shirt+or+my+hand%2C+rubbing+bellys+and+patagiums%21+%29+These+boys+are+both+very+well+socialized+and+will+make+the+perfect+addition+to+someones+glider+family%21+Their+OOP+date+is+February+22%2C+2008+and+will+be+ready+April+21%2C+2008%21+Dont+miss+out+on+the+opportunity+to+get+to+know+one+of+these+beautiful+boys%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();
};

