/* [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','110234',jdecode('Good-buy+Angle%3F'),jdecode(''),'/110234.html','false',[],'',''],
	['PAGE','104434',jdecode('subject-sieve'),jdecode(''),'/104434.html','false',[],'',''],
	['PAGE','18301',jdecode('Daily+Scramscript'),jdecode(''),'/18301.html','false',[],'',''],
	['PAGE','36412',jdecode('New+Poetscopes'),jdecode(''),'/36412.html','true',[],'',''],
	['PAGE','31001',jdecode('American+Think'),jdecode(''),'/31001.html','true',[],'',''],
	['PAGE','32001',jdecode('Wintegrity'),jdecode(''),'/32001.html','true',[],'',''],
	['PAGE','95634',jdecode('Looking+UP'),jdecode(''),'/95634.html','true',[],'',''],
	['PAGE','35812',jdecode('More+scope'),jdecode(''),'/35812.html','false',[],'',''],
	['PAGE','4501',jdecode('Different+scopes'),jdecode(''),'/4501.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Vienna';
theSitetree.paletteFamily='D6D2C5';
theSitetree.keyvisualId='11875';
theSitetree.keyvisualName='kv_11875.jpg';
theSitetree.fontsetId='33183';
theSitetree.graphicsetId='14088';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='ebe8df';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vienna',
				paletteFamily: 	'D6D2C5',
				keyvisualId: 	'11875',
				keyvisualName: 	'kv_11875.jpg',
				fontsetId: 		'33183',
				graphicsetId: 	'14088',
				contentColor: 	'000000',
				contentBGColor: 'ebe8df',
				a_color: 		'EBE8DF',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Tahoma',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20090326-235127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20100227-064602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110234',
internalId:  '',
customField: '20091103-172250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20091129-102722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30001',
internalId:  '',
customField: '20090507-213721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31001',
internalId:  '',
customField: '20100225-113750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20100227-064013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35812',
internalId:  '',
customField: '20091202-165443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36412',
internalId:  '',
customField: '20100308-115734'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '31001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104434',
internalId:  '',
customField: '20091202-151952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95634',
internalId:  '',
customField: '20100227-064103'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INP38Y';
var companyName   = 'A+test+of+meant+and+said%3A+De-sigh+pull%2C+de-side+pool+of+mind..';
var htmlTitle	  = 'Happy+Sendings';
var metaKeywords  = 'Free+copyright+if+sending+by+US+MAIL+in+increment+of+one+per+week+%28poetscope+from+poetscope.com%29+or+one+per+day+%28dailyscramscript+from+dailyscramscript.com%29+at+current+postage+price.+Postal+permits+do+not+apply+without+prior+permission.+';
var metaContents  = '2009+Copyright+Permission+granted+to+send+in+accordance+with+integrity+of+equitable+share+of+wealth+at+all+levels.++Exception+for+daily+scramscript+or++poetscope++to+send+singly+copy++by+USPS.+Postage+required.';
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();
};
