/* [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','14201',jdecode('News'),jdecode(''),'/14201/index.html','true',[ 
		['PAGE','72301',jdecode('Latest+Live+Music+Blogs'),jdecode(''),'/14201/72301.html','false',[],'']
	],''],
	['PAGE','14222',jdecode('Gigs'),jdecode(''),'/14222/index.html','true',[ 
		['PAGE','14243',jdecode('Archives'),jdecode(''),'/14222/14243.html','true',[],'']
	],''],
	['PAGE','1873',jdecode('Tunes'),jdecode(''),'/1873/index.html','true',[ 
		['PAGE','14801',jdecode('Album'),jdecode(''),'/1873/14801.html','true',[],'']
	],''],
	['PAGE','50095',jdecode('Photos'),jdecode(''),'/50095/index.html','true',[ 
		['PAGE','1801',jdecode('Donna+Jeans'),jdecode(''),'/50095/1801.html','true',[],''],
		['PAGE','63601',jdecode('Paisley+Violin+'),jdecode(''),'/50095/63601.html','true',[],'']
	],''],
	['PAGE','2020',jdecode('Video'),jdecode(''),'/2020/index.html','true',[ 
		['PAGE','58389',jdecode('Video+by+Scott+Stahl'),jdecode(''),'/2020/58389.html','true',[],'']
	],''],
	['PAGE','14822',jdecode('Bio'),jdecode(''),'/14822/index.html','true',[ 
		['PAGE','1852',jdecode('About+GD'),jdecode(''),'/14822/1852.html','true',[],'']
	],''],
	['PAGE','2146',jdecode('Contact+GD'),jdecode(''),'/2146/index.html','true',[ 
		['PAGE','1999',jdecode('Myspace'),jdecode(''),'/2146/1999.html','true',[],'']
	],''],
	['PAGE','1978',jdecode('Guest+Book'),jdecode(''),'/1978.html','true',[],''],
	['PAGE','57789',jdecode('Open+Mic+Rock+Night'),jdecode(''),'/57789.html','false',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Folder';
theSitetree.paletteFamily='F8B78C';
theSitetree.keyvisualId='11088';
theSitetree.keyvisualName='kv_11088.jpg';
theSitetree.fontsetId='31973';
theSitetree.graphicsetId='13811';
theSitetree.contentColor='E8F3FC';
theSitetree.contentBGColor='F8B78C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Folder',
				paletteFamily: 	'F8B78C',
				keyvisualId: 	'11088',
				keyvisualName: 	'kv_11088.jpg',
				fontsetId: 		'31973',
				graphicsetId: 	'13811',
				contentColor: 	'E8F3FC',
				contentBGColor: 'F8B78C',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100101-194543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14822',
internalId:  '',
customField: '20090510-211213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20100101-195752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20100101-195111'
};
webappMappings['7060']=webappMappings['7060-4177e0d5ce79b6fdc7cc95fc88e2e057']={
webappId:    '7060',
documentId:  '1801',
internalId:  '4177e0d5ce79b6fdc7cc95fc88e2e057',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-16020']={
webappId:    '7008',
documentId:  '2146',
internalId:  '16020',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20090902-235117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20090727-011033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2020',
internalId:  '',
customField: '20100302-050819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20100707-013951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14222',
internalId:  '',
customField: '20100707-020307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20100101-194932'
};
webappMappings['1002']=webappMappings['1002-1978aendu0in372g']={
webappId:    '1002',
documentId:  '1978',
internalId:  '1978aendu0in372g',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2146',
internalId:  '',
customField: '20100127-180802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14243',
internalId:  '',
customField: '20100707-012108'
};
webappMappings['7060']=webappMappings['7060-57071199d20613175ae8dcf9cd287bb3']={
webappId:    '7060',
documentId:  '1873',
internalId:  '57071199d20613175ae8dcf9cd287bb3',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72301',
internalId:  '',
customField: '20100124-234208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50095',
internalId:  '',
customField: '20100302-051200'
};
webappMappings['7008']=webappMappings['7008-22774']={
webappId:    '7008',
documentId:  '57789',
internalId:  '22774',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57789',
internalId:  '',
customField: '20100411-165148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58389',
internalId:  '',
customField: '20100101-195341'
};
webappMappings['7060']=webappMappings['7060-fcfe74168b909afc2f56871cf3e2ad90']={
webappId:    '7060',
documentId:  '63601',
internalId:  'fcfe74168b909afc2f56871cf3e2ad90',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63601',
internalId:  '',
customField: '20100101-181600'
};
webappMappings['7050']=webappMappings['7050-14198']={
webappId:    '7050',
documentId:  '72301',
internalId:  '14198',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14201',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN372G';
var companyName   = 'GRACEFUL+DEGRADATION';
var htmlTitle	  = 'Graceful+Degradation';
var metaKeywords  = 'Graceful+Degradation%2C+Gracefuldegradation.com%2C+GDRocks%2C+GDRocks.com%2C+itunes%2C+Nicole+Heffington%2C+Erick+Sanchez%2C+Stephen+Brown%2C+Jason+Allie%2C+Craigs+List%2C+Back+Page%2C+graceful+degragation%2C+graceful+degration%2C+graceful+degradate%2C+degradation%2C+graceful%2C+donna+jeans+libations%2C+the+blooze%2C+the+stray+cat%2C+www.myspace.com%2Fgracefuldegradation%2C+tell+me+about+the+rabbits%2C+gomi%2C+the+andys%2C+First+Friday%2C+Hollywood+Alley%2C+Ruby+Room%2C+Casablanca+Sports+Lounge+and+Nightclub%2C+Paper+Heart+Gallery%2C+Sanchez%2C+Allie%2C+Brown%2C+Heffington%2C+Graceful+Degradation+music%2C+rock+music%2C+real+rock+music%2C+phoenix+rock+music';
var metaContents  = 'Graceful+Degradation+Rocks...Check+out+the+latest+news%2C+upcoming+shows%2C+band+information%2C+lyrics%2C+pictures%2C+and+music+of+Graceful+Degradation%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();
};
