/* [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','74',jdecode('Home'),jdecode(''),'/74.html','true',[],''],
	['PAGE','9285',jdecode('Menu+'),jdecode(''),'/9285.html','true',[],''],
	['PAGE','10525',jdecode('Specials'),jdecode(''),'/10525.html','true',[],''],
	['PAGE','10356',jdecode('Children%26%23x27%3Bs+Menu'),jdecode(''),'/10356.html','true',[],''],
	['PAGE','1158',jdecode('Ice+Cream'),jdecode(''),'/1158.html','true',[],''],
	['PAGE','7424',jdecode('Coupons'),jdecode(''),'/7424.html','true',[],''],
	['PAGE','7406',jdecode('Employment'),jdecode(''),'/7406/index.html','true',[ 
		['PAGE','8978',jdecode('Core+Values'),jdecode(''),'/7406/8978.html','true',[],'']
	],''],
	['PAGE','7081',jdecode('Guestbook'),jdecode(''),'/7081/index.html','true',[ 
		['PAGE','7080',jdecode('Read+Guestbook'),jdecode(''),'/7081/7080.html','false',[],'']
	],''],
	['PAGE','9416',jdecode('Directions'),jdecode(''),'/9416.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='AD1D1D';
theSitetree.keyvisualId='5821';
theSitetree.keyvisualName='kv_5821.jpg';
theSitetree.fontsetId='11096';
theSitetree.graphicsetId='11868';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Easylife',
				paletteFamily: 	'AD1D1D',
				keyvisualId: 	'5821',
				keyvisualName: 	'kv_5821.jpg',
				fontsetId: 		'11096',
				graphicsetId: 	'11868',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '74',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9285',
internalId:  '',
customField: '20080404-041716'
};
webappMappings['1002']=webappMappings['1002-7081AHW050IN3IL4']={
webappId:    '1002',
documentId:  '7081',
internalId:  '7081AHW050IN3IL4',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9416',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74',
internalId:  '',
customField: '20090624-174952'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '74',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10525',
internalId:  '',
customField: '20090624-175114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10356',
internalId:  '',
customField: '20080324-041705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1158',
internalId:  '',
customField: '20080115-052158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7424',
internalId:  '',
customField: '20080401-031505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7406',
internalId:  '',
customField: '20070418-032621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8978',
internalId:  '',
customField: '20070306-044505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7081',
internalId:  '',
customField: '20061105-023116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7080',
internalId:  '',
customField: '20061105-023116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9416',
internalId:  '',
customField: '20070320-024235'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3IL4';
var companyName   = 'KK+Codders+Seafood+%26+Grille';
var htmlTitle	  = 'KK+Codders+Seafood+Grille';
var metaKeywords  = 'KK+Codders+Cape+Cod+Fried+Clams+Falmouth+Massachusetts.+Fried+Clams.+Fried+Seafood.+Homemade+Onion+Rings.+Restaurant+in+Falmouth%2C+MA';
var metaContents  = 'Seafood+restaurant+in+Falmouth+Massachusetts++Falmouth%2C+MA+Restaurants++kkcodders.com++Cape+Cod+Dining++Ice+Cream+on+Cape+Cod.+Fried+Clams.+Fried+Seafood.';
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();
};
