/* [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','67523',jdecode('Home'),jdecode(''),'/67523.html','true',[],'',''],
	['PAGE','94255',jdecode('Join+Our+Petition'),jdecode(''),'/94255.html','true',[],'',''],
	['PAGE','95334',jdecode('Contact+US'),jdecode(''),'/95334.html','true',[],'',''],
	['PAGE','109634',jdecode('Wind+Turbine+Forum'),jdecode(''),'/109634.html','true',[],'',''],
	['PAGE','67923',jdecode(''),jdecode(''),'/67923.html','true',[],'',''],
	['PAGE','43423',jdecode(''),jdecode(''),'/43423.html','true',[],'',''],
	['PAGE','43444',jdecode(''),jdecode(''),'/43444.html','true',[],'',''],
	['PAGE','80634',jdecode(''),jdecode(''),'/80634.html','true',[],'',''],
	['PAGE','43465',jdecode(''),jdecode(''),'/43465.html','true',[],'',''],
	['PAGE','81534',jdecode(''),jdecode(''),'/81534.html','true',[],'',''],
	['PAGE','66223',jdecode(''),jdecode(''),'/66223.html','true',[],'',''],
	['PAGE','43486',jdecode(''),jdecode(''),'/43486.html','true',[],'',''],
	['PAGE','82234',jdecode(''),jdecode(''),'/82234.html','true',[],'',''],
	['PAGE','68023',jdecode(''),jdecode(''),'/68023.html','true',[],'',''],
	['PAGE','79323',jdecode(''),jdecode(''),'/79323.html','true',[],'',''],
	['PAGE','79344',jdecode(''),jdecode(''),'/79344.html','true',[],'',''],
	['PAGE','79365',jdecode(''),jdecode(''),'/79365.html','true',[],'',''],
	['PAGE','85134',jdecode(''),jdecode(''),'/85134.html','true',[],'',''],
	['PAGE','86134',jdecode(''),jdecode(''),'/86134.html','true',[],'',''],
	['PAGE','86155',jdecode(''),jdecode(''),'/86155.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='7179A3';
theSitetree.keyvisualId='7078';
theSitetree.keyvisualName='kv_7078.jpg';
theSitetree.fontsetId='16379';
theSitetree.graphicsetId='12122';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7179A3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Billy',
				paletteFamily: 	'7179A3',
				keyvisualId: 	'7078',
				keyvisualName: 	'kv_7078.jpg',
				fontsetId: 		'16379',
				graphicsetId: 	'12122',
				contentColor: 	'FFFFFF',
				contentBGColor: '7179A3',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85134',
internalId:  '',
customField: '20090428-074745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43444',
internalId:  '',
customField: '20090428-112907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109634',
internalId:  '',
customField: '20091204-161715'
};
webappMappings['1003']=webappMappings['1003-ahw050invh6f1255514685e']={
webappId:    '1003',
documentId:  '109634',
internalId:  'ahw050invh6f1255514685e',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43465',
internalId:  '',
customField: '20090427-191220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43423',
internalId:  '',
customField: '20090429-210703'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '67523',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43486',
internalId:  '',
customField: '20090427-191326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82234',
internalId:  '',
customField: '20090425-092657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66223',
internalId:  '',
customField: '20090427-191306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94255',
internalId:  '',
customField: '20090803-092825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67523',
internalId:  '',
customField: '20100310-091053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67923',
internalId:  '',
customField: '20090413-201202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68023',
internalId:  '',
customField: '20090413-201230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95334',
internalId:  '',
customField: '20090623-133937'
};
webappMappings['7008']=webappMappings['7008-3759']={
webappId:    '7008',
documentId:  '94255',
internalId:  '3759',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79323',
internalId:  '',
customField: '20090422-143504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79344',
internalId:  '',
customField: '20090422-143504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79365',
internalId:  '',
customField: '20090422-143504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80634',
internalId:  '',
customField: '20090423-195752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81534',
internalId:  '',
customField: '20090424-215043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86134',
internalId:  '',
customField: '20090428-135547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86155',
internalId:  '',
customField: '20090428-135547'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INVH6F';
var companyName   = 'CITIZENS+FOR+THE+PROTECTION+OF+WAYNE';
var htmlTitle	  = 'Wind+Turbines%2C+Wayne%2C+New+Jersey';
var metaKeywords  = 'wind+turbines%2C+wind+mills%2C+wayne+auto+spa%2C+Robert+W+Burke%2C+Alan+Bess%2C+Dr+Alan+Bess%2C+Wayne+car+wash%2C+Robert+Burke';
var metaContents  = 'The+Wind+Turbine+Action+Committee+of+Wayne%2C+New+Jersey+was+formed+to+counteract+the+misleading+information+promulgated+by+the+wind+energy+industry%2C+various+environmental+groups%2C+and+some+individuals+in+Wayne.+Support+for+this+effort+comes+from+a+large+and+diversified+group+of+residents+and+business+owners+in+New+Jersey.';
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();
};
