/* [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','38775',jdecode('Specials'),jdecode(''),'/38775.html','false',[],'',''],
	['PAGE','652',jdecode('Welcome'),jdecode(''),'/652.html','true',[],'',''],
	['PAGE','6901',jdecode('Our+Menu'),jdecode(''),'/6901.html','true',[],'',''],
	['PAGE','36665',jdecode('Burger+Challenge'),jdecode(''),'/36665.html','true',[],'',''],
	['PAGE','757',jdecode('On-Line+Store'),jdecode(''),'/757/index.html','true',[ 
		['PAGE','23801',jdecode('BarBQ+Sauce+%26+Such'),jdecode(''),'/757/23801.html','true',[],'','']
	],'',''],
	['PAGE','27401',jdecode('Newsletter'),jdecode(''),'/27401.html','false',[],'',''],
	['PAGE','32637',jdecode('Contests+%26+Coupons'),jdecode(''),'/32637.html','false',[],'',''],
	['PAGE','16301',jdecode('Map%2FHow+to+find+us%21'),jdecode(''),'/16301.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Natural';
theSitetree.paletteFamily='325349';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='157';
theSitetree.graphicsetId='180';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FCFCF4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Natural',
				paletteFamily: 	'325349',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'157',
				graphicsetId: 	'180',
				contentColor: 	'000066',
				contentBGColor: 'FCFCF4',
				a_color: 		'325349',
				b_color: 		'689183',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '16301',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20100701-002702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20100701-004941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20100606-202904'
};
webappMappings['4001']=webappMappings['4001-13634847']={
webappId:    '4001',
documentId:  '23801',
internalId:  '13634847',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20090719-182313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36665',
internalId:  '',
customField: '20090830-004730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20100126-163230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38775',
internalId:  '',
customField: '20100219-222553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27401',
internalId:  '',
customField: '20100124-023311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32637',
internalId:  '',
customField: '20100124-025120'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPDV7';
var companyName   = 'OUTLAWS+BarBQ+%26+Steakhouse';
var htmlTitle	  = 'OutlawsBarBQ';
var metaKeywords  = 'BBQ%2C+Burgers%2C+Steaks%2C+Seafood%2C+restaurant%2C+draft+beer%2C+beer%2C+wine%2C+catering%2C+wedding%2C+sandwiches%2C+vegan';
var metaContents  = 'BBQ%2C+Barbeque%2C+Steaks%2C+Seafood%2C+restaurant%2C+draft+beer%2C+beer%2C+wine%2C+catering%2C+wedding%2C+sandwiches%2C+burgers';
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();
};
