/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','5194',jdecode('Location'),jdecode(''),'/5194.html','true',[],''],
	['PAGE','5501',jdecode('Breakfast+Menu'),jdecode(''),'/5501/index.html','true',[ 
		['PAGE','8701',jdecode('Off+The+Griddle'),jdecode(''),'/5501/8701.html','true',[],''],
		['PAGE','9401',jdecode('Omelettes'),jdecode(''),'/5501/9401.html','true',[],''],
		['PAGE','9422',jdecode('Egg-ceptional+Eggs'),jdecode(''),'/5501/9422.html','true',[],''],
		['PAGE','9443',jdecode('Breakfast+Specialties'),jdecode(''),'/5501/9443.html','true',[],''],
		['PAGE','9464',jdecode('Just+for+the+Kids'),jdecode(''),'/5501/9464.html','true',[],''],
		['PAGE','11601',jdecode('Sides'),jdecode(''),'/5501/11601.html','true',[],'']
	],''],
	['PAGE','10301',jdecode('Lunch+%26+Dinner+Menu'),jdecode(''),'/10301/index.html','true',[ 
		['PAGE','10322',jdecode('Appetizers'),jdecode(''),'/10301/10322.html','true',[],''],
		['PAGE','10364',jdecode('Soups'),jdecode(''),'/10301/10364.html','true',[],''],
		['PAGE','10343',jdecode('Salads'),jdecode(''),'/10301/10343.html','true',[],''],
		['PAGE','10385',jdecode('Sandwiches%2C+Dips+%26+More'),jdecode(''),'/10301/10385.html','true',[],''],
		['PAGE','10406',jdecode('Burgers'),jdecode(''),'/10301/10406.html','true',[],''],
		['PAGE','10427',jdecode('Hot+off+the+Grill'),jdecode(''),'/10301/10427.html','true',[],''],
		['PAGE','10448',jdecode('Seafood'),jdecode(''),'/10301/10448.html','true',[],''],
		['PAGE','10469',jdecode('Just+for+the+Kids'),jdecode(''),'/10301/10469.html','true',[],'']
	],''],
	['PAGE','10490',jdecode('Late+Night+Menu'),jdecode(''),'/10490.html','true',[],''],
	['PAGE','10511',jdecode('Specials'),jdecode(''),'/10511.html','true',[],''],
	['PAGE','5215',jdecode('Events'),jdecode(''),'/5215.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='BFD4ED';
theSitetree.keyvisualId='6213';
theSitetree.keyvisualName='kv_6213.jpg';
theSitetree.fontsetId='11090';
theSitetree.graphicsetId='11865';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BFD4ED';
var theTemplate={
				name: 			'Diamond',
				paletteFamily: 	'BFD4ED',
				keyvisualId: 	'6213',
				keyvisualName: 	'kv_6213.jpg',
				fontsetId: 		'11090',
				graphicsetId: 	'11865',
				contentColor: 	'000000',
				contentBGColor: 'BFD4ED',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20090207-201026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5215',
internalId:  '',
customField: '20091113-144948'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20091206-163535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5194',
internalId:  '',
customField: '20090207-162151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20091206-163841'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5194',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20091206-164506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9422',
internalId:  '',
customField: '20091206-164715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9443',
internalId:  '',
customField: '20091206-164800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10511',
internalId:  '',
customField: '20090207-191628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10490',
internalId:  '',
customField: '20090207-191628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090209-175330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10322',
internalId:  '',
customField: '20091113-145348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10343',
internalId:  '',
customField: '20091113-145650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10364',
internalId:  '',
customField: '20091113-145510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10385',
internalId:  '',
customField: '20091113-145908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10406',
internalId:  '',
customField: '20091113-150130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10427',
internalId:  '',
customField: '20091113-150451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10448',
internalId:  '',
customField: '20091113-150557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10469',
internalId:  '',
customField: '20090207-191628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9464',
internalId:  '',
customField: '20090207-175032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20090209-164341'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVZWU';
var companyName   = 'The+Inn+Sports+Bar+%26+Grill';
var htmlTitle	  = 'The+Inn+Sports+Bar+%26+Grill';
var metaKeywords  = 'Sports+Bar%2C+Restaurant%2C+Bar%2C+Live+Music%2C+Family+Dining%2C+Full+menu';
var metaContents  = 'Sports+Bar+in+Lynnwood+with+family+dining%2C+full+service+bar%2C+entertainment';
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();
};
