/* [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','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','494',jdecode('Resources'),jdecode(''), jdecode('%2F494%2Findex.html'), 'true',[ 
		['PAGE','23601',jdecode('Bil.+Alvernaz'),jdecode(''), jdecode('%2F494%2F23601.html'), 'true',[],'','']
	],'',''],
	['PAGE','452',jdecode('Grid+Lines'),jdecode(''), jdecode('%2F452%2Findex.html'), 'true',[ 
		['PAGE','37301',jdecode('Grid+BLOG'),jdecode(''), jdecode('%2F452%2F37301.html'), 'true',[],'',''],
		['PAGE','21201',jdecode('HCI'),jdecode(''), jdecode('%2F452%2F21201.html'), 'true',[],'','']
	],'',''],
	['PAGE','19501',jdecode('...+on+the+grid'),jdecode(''), jdecode('%2F19501%2Findex.html'), 'true',[ 
		['PAGE','21222',jdecode('PC+%2B+TV'),jdecode(''), jdecode('%2F19501%2F21222.html'), 'true',[],'','']
	],'',''],
	['PAGE','19801',jdecode('...+off+the+grid'),jdecode(''), jdecode('%2F19801%2Findex.html'), 'true',[ 
		['PAGE','29001',jdecode('FAT+%26+Fitness'),jdecode(''), jdecode('%2F19801%2F29001.html'), 'true',[],'','']
	],'',''],
	['PAGE','30901',jdecode('Zen+Grid'),jdecode(''), jdecode('%2F30901.html'), 'true',[],'',''],
	['PAGE','54165',jdecode('The+Meaning+of+Life'),jdecode(''), jdecode('%2F54165.html'), 'true',[],'',''],
	['PAGE','515',jdecode('Communiques'),jdecode(''), jdecode('%2F515.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1742';
theSitetree.keyvisualName='ebusiness2.jpg';
theSitetree.fontsetId='290';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1742',
				keyvisualName: 	'ebusiness2.jpg',
				fontsetId: 		'290',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120123-161808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20111226-145254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20111226-145435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20111226-145502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37301',
internalId:  '',
customField: '20111226-145531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20111226-145547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20111226-145601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21222',
internalId:  '',
customField: '20111226-145615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20111226-145649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20111226-145708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20111226-145732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54165',
internalId:  '',
customField: '20111226-145751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20111226-145805'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEN32';
var companyName   = 'ALVERNAZ.COM+-+on+the+grid';
var htmlTitle	  = 'ALVERNAZ.COM+-+on+the+grid';
var metaKeywords  = 'Alvernaz.Com+-+the+grid%2C+Bil.+Alvernaz%2C+Towne+Square+America%2C+Blue+Moon+Cafe%2C+Clouds%2C+meaning+of+life%2C+computerist%2C+writer%2C+training%2C+Vista%2C+Microsoft+Office+2007%2C+SharePoint%2C+business+strategy%2C+planning%2C+marketing%2C+media+relations%2C+business+intelligence%2C+content+management%2C+web+development%2C+html%2C+evolution+of+Internet+consciousness';
var metaContents  = 'Towne+Square+America%2C+Blue+Moon+Cafe%2C+Clouds%2C+meaning+of+life%2C+technology%2C+computing%2C+Office+2007%2C+Vista%2C+SharePoint%2C+evolution+of+Internet+consciousness%2C+writing%2C+learning%2C+training%2C+disaster+recovery%2C+SLA%2C+business+continuity+planning%2C+understanding+how+the+web+works%2C+getting+the+most+out+of+the+web%2C+finding+just+the+writer+you%27ve+been+looking+for+amidst+the+%22play+of+words.%22';
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();
};

