/* [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 theSitetree=[ 
	['PAGE','101',jdecode('Home'),jdecode(''),'/101.html','true',[],''],
	['PAGE','107',jdecode('Mission'),jdecode(''),'/107.html','true',[],''],
	['PAGE','112',jdecode('Contact'),jdecode(''),'/112.html','true',[],'']];
var siteelementCount=3;
theSitetree.topTemplateName='Padma';
theSitetree.paletteFamily='507979';
theSitetree.keyvisualId='1021';
theSitetree.keyvisualName='seerose.jpg';
theSitetree.fontsetId='179';
theSitetree.graphicsetId='214';
theSitetree.contentColor='003333';
theSitetree.contentBGColor='B2B285';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Padma',
				paletteFamily: 	'507979',
				keyvisualId: 	'1021',
				keyvisualName: 	'seerose.jpg',
				fontsetId: 		'179',
				graphicsetId: 	'214',
				contentColor: 	'003333',
				contentBGColor: 'B2B285',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'507979',
				b_color: 		'003333',
				c_color: 		'000000',
				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:  '101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101',
internalId:  '',
customField: '20090417-224728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20090417-224807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112',
internalId:  '',
customField: '20080326-143455'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INXP69';
var companyName   = 'Wake+the+World';
var htmlTitle	  = 'Wake+the+World';
var metaKeywords  = 'TITLEWake+the+World%2FTITLE+META+NAME%3DDESCRIPTION+CONTENT%3DWake+the+World+strives+to+inspire+the+soul+and+stir+the+imagination+through+music%2C+art%2C+expression+and+thought.+We+embrace+the+purity+of+the+human+soul%2C+its+creative+endeavors%2C+and+the+energy+behind+it+all.++We+understand+that+we+all+come+from+different+walks+of+life.+We+all+travel+on+different+paths.+Yet+ideally+we+move+towards+a+common+destination+to+find+love%2C+truth%2C+and+peace.+++We+are+a+record+label.++But+we+want+to+be+more+than+just+that.++We+want+to+serve+as+a+guide+toward+self-discovery+and+forward+movement.++Feel+free+to+use+this+site+as+inspiration+for+yourself+and+to+help+you+inspire+others.++Nicholas+Mrozinski+and+The+Feelin+are+one+in+the+same.++A+predigious+talent+from+the+Twin+Cities+area.++Also+a+member+of+The+White+Iron+Band.+Nick+Mrozinski.++Music.+Piano.+++Acoustic+Guitar.+Singer+Songwriter.+Soul.+R++B.+Jazz.+Blues.+Alternative.+Country.++Created+by+Jackson+Tyler+Eddy+and+Jack+Eddy.+META+NAME%3DKEYWORDS+CONTENT%3DRecord+Label%2C+Music%2C+Inspirational+Resource%2C+The+Feelin%2C+Nicholas+Mrozinski%2C+Nick+Mrozinski%2C++Soul%2C+R++B%2C+Jazz%2C+Blues%2C+Rock%2C+Alternative%2C+Country%2C+Music%2C+Piano%2C+Acoustic+Guitar%2C+Singer+Songwriter%2C+Four-Legged+Light%2C+Oak+Chase+Way%2C+Paul+Grill%2C+Sammy+Weyandt%2C+Rich+Nelson%2C+Created+by+Jackson+Tyler+Eddy+and+Jack+Eddy%2C+Get+Down+and+Lift+Up%2C+Learning%2C+loving%2C+growing%2C+changing%2C+evolving%2C+sharing%2C+helping%2C+advancing%2C+.progressing%2C+teaching%2C+inspiring%2C+listening%2C+adapting%2C+encouraging%2C++striving%2C+opening%2C+protecting%2C+shining%2C+lending%2C+acting%2C+doing%2C+aspiring%2C+guiding%2C+planning%2C+evaluating%2C+moving%2C+succeeding%2C+believing%2C+adjusting%2C+thinking+and+re-thinking%2C++';
var metaContents  = 'wake+the+world+records%2C+the+feelin%2C+www.thefeelin.com%2C+music%2C+local%2C+indie%2C+independent%2C+conscious%2C+karma%2C+good%2C+nick+mrozinski%2C+nicholas+mrozinski%2C+records%2C+minnesota%2C+saint+paul%2C+jackson+tyler+eddy%2C+jack+eddy%2C+wake+the+world+productions.';
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();
};

