/* [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','6401',jdecode('Home'),jdecode(''),'/6401.html','true',[],'',''],
	['PAGE','8001',jdecode('Menu'),jdecode(''),'/8001/index.html','true',[ 
		['PAGE','7101',jdecode('Drink+Menu'),jdecode(''),'/8001/7101.html','true',[],'',''],
		['PAGE','8201',jdecode('Bakery'),jdecode(''),'/8001/8201.html','true',[],'',''],
		['PAGE','8222',jdecode('Breakfast+'),jdecode(''),'/8001/8222.html','true',[],'',''],
		['PAGE','8243',jdecode('Lunch'),jdecode(''),'/8001/8243.html','true',[],'',''],
		['PAGE','8264',jdecode('Soup'),jdecode(''),'/8001/8264.html','true',[],'','']
	],'',''],
	['PAGE','14864',jdecode('The+Weekly+Brew'),jdecode(''),'/14864.html','true',[],'',''],
	['PAGE','7185',jdecode('Calendar'),jdecode(''),'/7185.html','true',[],'',''],
	['PAGE','7122',jdecode('Go+Java+Catering'),jdecode(''),'/7122.html','true',[],'',''],
	['PAGE','7143',jdecode('Booking+Events'),jdecode(''),'/7143/index.html','true',[ 
		['PAGE','10264',jdecode('Rental+Agreement'),jdecode(''),'/7143/10264.html','true',[],'','']
	],'',''],
	['PAGE','13564',jdecode('Gift+Ideas'),jdecode(''),'/13564.html','true',[],'',''],
	['PAGE','7164',jdecode('Java+Staff'),jdecode(''),'/7164.html','true',[],'',''],
	['PAGE','17164',jdecode('Java+Media'),jdecode(''),'/17164.html','true',[],'',''],
	['PAGE','7206',jdecode('Related+Links'),jdecode(''),'/7206.html','true',[],'',''],
	['PAGE','7227',jdecode('Contact+Us'),jdecode(''),'/7227.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Comedy';
theSitetree.paletteFamily='C39C46';
theSitetree.keyvisualId='2793';
theSitetree.keyvisualName='tasse.jpg';
theSitetree.fontsetId='10602';
theSitetree.graphicsetId='10724';
theSitetree.contentColor='F8F4EA';
theSitetree.contentBGColor='CEAE67';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Comedy',
				paletteFamily: 	'C39C46',
				keyvisualId: 	'2793',
				keyvisualName: 	'tasse.jpg',
				fontsetId: 		'10602',
				graphicsetId: 	'10724',
				contentColor: 	'F8F4EA',
				contentBGColor: 'CEAE67',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9F7E34',
				e_color: 		'9F7E34',
				f_color: 		'9F7E34',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100708-134903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20091208-094340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7122',
internalId:  '',
customField: '20100708-150911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20091029-110205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7164',
internalId:  '',
customField: '20100708-134257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7185',
internalId:  '',
customField: '20100708-133947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7206',
internalId:  '',
customField: '20100407-134758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7227',
internalId:  '',
customField: '20091023-110139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20100527-154729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20100708-134157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8222',
internalId:  '',
customField: '20091022-143347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8243',
internalId:  '',
customField: '20091022-150604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8264',
internalId:  '',
customField: '20100527-154859'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-12298']={
webappId:    '7008',
documentId:  '7227',
internalId:  '12298',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10264',
internalId:  '',
customField: '20091026-113544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13564',
internalId:  '',
customField: '20100407-130802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14864',
internalId:  '',
customField: '20100407-130655'
};
webappMappings['7060']=webappMappings['7060-d91cd9e784c02723251844ba275ef77e']={
webappId:    '7060',
documentId:  '17164',
internalId:  'd91cd9e784c02723251844ba275ef77e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17164',
internalId:  '',
customField: '20100520-130024'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHPK6';
var companyName   = 'JAVA+JOYS+COFFEE+SHOP';
var htmlTitle	  = 'Java+Joys+Coffee+Shop+of+Janesville%2C+WI++Coffee%2C+FREE+WI-FI%2C+Drive-Thru%2C+Lunch+Menu%2C+Music';
var metaKeywords  = '';
var metaContents  = '';
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();
};
