/* [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','601',jdecode('Home'),jdecode(''),'/601/index.html','true',[ 
		['PAGE','25501',jdecode('About+us'),jdecode(''),'/601/25501.html','true',[],''],
		['PAGE','841',jdecode('Contact+us'),jdecode(''),'/601/841.html','true',[],'']
	],''],
	['PAGE','652',jdecode('Classes'),jdecode(''),'/652/index.html','true',[ 
		['PAGE','673',jdecode('Full+Day'),jdecode(''),'/652/673.html','true',[],''],
		['PAGE','694',jdecode('Half+Day'),jdecode(''),'/652/694.html','true',[],''],
		['PAGE','715',jdecode('Series+'),jdecode(''),'/652/715.html','true',[],''],
		['PAGE','736',jdecode('Special+Occasions'),jdecode(''),'/652/736.html','true',[],''],
		['PAGE','6701',jdecode('For+more+info...'),jdecode(''),'/652/6701/index.html','true',[ 
			['PAGE','8001',jdecode('Sign+Up%21+%28follow+up+page%29'),jdecode(''),'/652/6701/8001.html','false',[],'']
		],''],
		['PAGE','24901',jdecode('Class+Schedule+and+Cost'),jdecode(''),'/652/24901.html','true',[],'']
	],''],
	['PAGE','9101',jdecode('Antipasti'),jdecode(''),'/9101/index.html','true',[ 
		['PAGE','9801',jdecode('Food+of+the+Month'),jdecode(''),'/9101/9801.html','true',[],''],
		['PAGE','9822',jdecode('Wine+of+the+Month'),jdecode(''),'/9101/9822.html','true',[],''],
		['PAGE','11301',jdecode('Word+of+the+Month'),jdecode(''),'/9101/11301.html','true',[],'']
	],''],
	['PAGE','31928',jdecode('Tours'),jdecode(''),'/31928/index.html','true',[ 
		['PAGE','32416',jdecode('Norcia%2C+May+2010'),jdecode(''),'/31928/32416.html','true',[],''],
		['PAGE','32425',jdecode('Toscana%2C+May+2010'),jdecode(''),'/31928/32425.html','true',[],''],
		['PAGE','32434',jdecode('Norcia+allbum'),jdecode(''),'/31928/32434.html','true',[],''],
		['PAGE','32443',jdecode('Toscana+album'),jdecode(''),'/31928/32443.html','true',[],'']
	],''],
	['PAGE','799',jdecode('Tour+Information'),jdecode(''),'/799.html','true',[],''],
	['PAGE','820',jdecode('Members+Only'),jdecode(''),'/820/index.html','true',[ 
		['PAGE','28701',jdecode('Food+of+the+Month'),jdecode(''),'/820/28701.html','true',[],''],
		['PAGE','28722',jdecode('Wine+of+the+Month'),jdecode(''),'/820/28722.html','true',[],''],
		['PAGE','28743',jdecode('Word+of+the+Month'),jdecode(''),'/820/28743.html','true',[],'']
	],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Snapshot';
theSitetree.paletteFamily='67845B';
theSitetree.keyvisualId='3635';
theSitetree.keyvisualName='kv_3635.jpg';
theSitetree.fontsetId='10755';
theSitetree.graphicsetId='10877';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='67845B';
var theTemplate={
				name: 			'Snapshot',
				paletteFamily: 	'67845B',
				keyvisualId: 	'3635',
				keyvisualName: 	'kv_3635.jpg',
				fontsetId: 		'10755',
				graphicsetId: 	'10877',
				contentColor: 	'000000',
				contentBGColor: '67845B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FC5E7B',
				e_color: 		'BFBFBF',
				f_color: 		'050001',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1001']=webappMappings['1001-ahw050inea3wac4f484b26aaa33a']={
webappId:    '1001',
documentId:  '6701',
internalId:  'ahw050inea3wac4f484b26aaa33a',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050inea3wac4f484b26aaa33a']={
webappId:    '1001',
documentId:  '8001',
internalId:  'ahw050inea3wac4f484b26aaa33a',
customField: 'followUp'
};
webappMappings['7060']=webappMappings['7060-45d21346bd5a5285a00a30d266b75321']={
webappId:    '7060',
documentId:  '32443',
internalId:  '45d21346bd5a5285a00a30d266b75321',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-ae033d5e9198f15271516c4334919b8c']={
webappId:    '7060',
documentId:  '32434',
internalId:  'ae033d5e9198f15271516c4334919b8c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100115-185916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31928',
internalId:  '',
customField: '20100115-200831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20070603-161430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '841',
internalId:  '',
customField: '20070603-160538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20070117-212137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20070603-153827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20070603-153854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20070603-151836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20070603-163757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20080404-192210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20070112-205031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24901',
internalId:  '',
customField: '20100115-185301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20070115-150209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20080404-182357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9822',
internalId:  '',
customField: '20100115-184548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20070115-200502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '799',
internalId:  '',
customField: '20100115-170934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '820',
internalId:  '',
customField: '20100115-184322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20080404-184544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28722',
internalId:  '',
customField: '20080404-184318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28743',
internalId:  '',
customField: '20080404-184157'
};
webappMappings['7008']=webappMappings['7008-1416']={
webappId:    '7008',
documentId:  '799',
internalId:  '1416',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32416',
internalId:  '',
customField: '20100115-202730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32434',
internalId:  '',
customField: '20100115-202605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32425',
internalId:  '',
customField: '20100115-202805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32443',
internalId:  '',
customField: '20100115-202646'
};
webappMappings['7060']=webappMappings['7060-cda30ff38ac2d21cba01d39ebb20f64d']={
webappId:    '7060',
documentId:  '820',
internalId:  'cda30ff38ac2d21cba01d39ebb20f64d',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEA3W';
var companyName   = 'Primi+Piatti+-+-+A+Taste+of+Italy';
var htmlTitle	  = 'Primi+Piatti+--+A+Taste+of+Italy';
var metaKeywords  = 'Italian+cooking+lessons++Cape+Cod+Italian++Italian+food++Italian+culture+Lu+Matrascia';
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();
};
