/* [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','5101',jdecode('Home'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','103923',jdecode('Upcoming+stuff'),jdecode(''), jdecode('%2F103923.html'), 'true',[],'',''],
	['PAGE','18101',jdecode('Guest+Book'),jdecode(''), jdecode('%2F18101.html'), 'true',[],'',''],
	['PAGE','5236',jdecode('Booking+info'),jdecode(''), jdecode('%2F5236.html'), 'true',[],'',''],
	['PAGE','121634',jdecode('Song+List'),jdecode(''), jdecode('%2F121634.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('Photos'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','137034',jdecode('Links'),jdecode(''), jdecode('%2F137034.html'), 'true',[],'',''],
	['PAGE','172334',jdecode('The+Silence+In+B%26%23x27%3Btween'),jdecode(''), jdecode('%2F172334.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Delta';
theSitetree.paletteFamily='080245';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10440';
theSitetree.graphicsetId='10811';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='080245';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hostway_generic',
  product: 'WSCSYSSSSLYTCPH7'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Delta',
				paletteFamily: 	'080245',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10440',
				graphicsetId: 	'10811',
				contentColor: 	'FFFFFF',
				contentBGColor: '080245',
				a_color: 		'221785',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20120208-214720'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103923',
internalId:  '',
customField: '20120206-193028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137034',
internalId:  '',
customField: '20120206-192834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5236',
internalId:  '',
customField: '20110324-065832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20120206-192807'
};
webappMappings['1002']=webappMappings['1002-18101ahw050inz1b0']={
webappId:    '1002',
documentId:  '18101',
internalId:  '18101ahw050inz1b0',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20091228-213625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172334',
internalId:  '',
customField: '20120109-065111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121634',
internalId:  '',
customField: '20120206-192117'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INZ1B0';
var companyName   = '+SCARECROW';
var htmlTitle	  = 'The+Variety+Band+of+2012';
var metaKeywords  = 'nsw-6lu07b2y-0d8dnpdefn43l6ngngx6qezo3er7tic4a7hg39al5s-lwalrhwldtmroqy57uv93n4b-jhwdh40g2yv345amn3hml3sb5vzfr92dvg2kgc2e4z-6x7gdm9w%0D%0A%0D%0AScarecrow%2C+Music%2C+Lorenzos%2C+Sicamous%2C+Weddings%2C+Partys%2C+Proffesional%2C+brothers+pub%2C+paddlewheeler+community+hall%2C+Twin+Anchors+Pub%2C+Revelstoke+Easy+Rock%0D%0A%0D%0A%3Ciframe+src%3D%22http%3A%2F%2Fwww.facebook.com%2Fplugins%2Flikebox.php%3Fhref%3Dhttp%253A%252F%252Fwww.facebook.com%252Fplatform%26amp%3Bwidth%3D292%26amp%3Bcolorscheme%3Dlight%26amp%3Bconnections%3D10%26amp%3Bstream%3Dtrue%26amp%3Bheader%3Dtrue%26amp%3Bheight%3D587%22+scrolling%3D%22no%22+frameborder%3D%220%22+style%3D%22border%3Anone%3B+overflow%3Ahidden%3B+width%3A292px%3B+height%3A587px%3B%22+allowTransparency%3D%22true%22%3E%3C%2Fiframe%3E';
var metaContents  = '+Sicamous+Music+Group';
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();
};

