/* [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','1201',jdecode('Home'),jdecode(''),'/1201.html','true',[],'',''],
	['PAGE','1252',jdecode('Dinner+Menu'),jdecode(''),'/1252/index.html','true',[ 
		['PAGE','1273',jdecode('Appetizer'),jdecode(''),'/1252/1273.html','true',[],'',''],
		['PAGE','1294',jdecode('Soup'),jdecode(''),'/1252/1294.html','true',[],'',''],
		['PAGE','1315',jdecode('Chef%26%23x27%3Bs+special'),jdecode(''),'/1252/1315.html','true',[],'',''],
		['PAGE','1336',jdecode('Beef'),jdecode(''),'/1252/1336.html','true',[],'',''],
		['PAGE','1357',jdecode('Pork'),jdecode(''),'/1252/1357.html','true',[],'',''],
		['PAGE','1378',jdecode('Seafood'),jdecode(''),'/1252/1378.html','true',[],'',''],
		['PAGE','1399',jdecode('Poultry'),jdecode(''),'/1252/1399.html','true',[],'',''],
		['PAGE','1420',jdecode('Vegetable+%26+Tofu'),jdecode(''),'/1252/1420.html','true',[],'',''],
		['PAGE','1441',jdecode('Rice+%26+Noodle'),jdecode(''),'/1252/1441.html','true',[],'',''],
		['PAGE','1462',jdecode('Combination+Dinner'),jdecode(''),'/1252/1462.html','true',[],'',''],
		['PAGE','1483',jdecode('Family+Style+Dinner'),jdecode(''),'/1252/1483.html','true',[],'','']
	],'',''],
	['PAGE','1504',jdecode('Lunch+Menu'),jdecode(''),'/1504/index.html','true',[ 
		['PAGE','1525',jdecode('Lunch+Combination'),jdecode(''),'/1504/1525.html','true',[],'',''],
		['PAGE','1546',jdecode('Lunch+Special'),jdecode(''),'/1504/1546.html','true',[],'','']
	],'',''],
	['PAGE','1567',jdecode('Kid%26%23x27%3Bs+Menu'),jdecode(''),'/1567.html','true',[],'',''],
	['PAGE','1588',jdecode('Beverage'),jdecode(''),'/1588.html','true',[],'',''],
	['PAGE','1609',jdecode('Beer'),jdecode(''),'/1609.html','true',[],'',''],
	['PAGE','1630',jdecode('Wine'),jdecode(''),'/1630.html','true',[],'',''],
	['PAGE','1651',jdecode('Contact'),jdecode(''),'/1651.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='A4681A';
theSitetree.keyvisualId='7106';
theSitetree.keyvisualName='kv_7106.jpg';
theSitetree.fontsetId='16395';
theSitetree.graphicsetId='12131';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blossom',
				paletteFamily: 	'A4681A',
				keyvisualId: 	'7106',
				keyvisualName: 	'kv_7106.jpg',
				fontsetId: 		'16395',
				graphicsetId: 	'12131',
				contentColor: 	'000000',
				contentBGColor: 'E5E2E2',
				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:  '1201',
internalId:  '',
customField: '20100724-201805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1252',
internalId:  '',
customField: '20100708-040627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1273',
internalId:  '',
customField: '20090628-193229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1294',
internalId:  '',
customField: '20090628-193400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1315',
internalId:  '',
customField: '20100724-201003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1336',
internalId:  '',
customField: '20100724-201055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1357',
internalId:  '',
customField: '20100429-143015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1399',
internalId:  '',
customField: '20100724-200840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1378',
internalId:  '',
customField: '20100724-200049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1420',
internalId:  '',
customField: '20100429-143202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1441',
internalId:  '',
customField: '20090628-195111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1462',
internalId:  '',
customField: '20090628-195230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1483',
internalId:  '',
customField: '20090628-195343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1588',
internalId:  '',
customField: '20100724-201436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1609',
internalId:  '',
customField: '20090404-134715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1630',
internalId:  '',
customField: '20100429-144118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1651',
internalId:  '',
customField: '20100708-043508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1504',
internalId:  '',
customField: '20100708-043340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1546',
internalId:  '',
customField: '20100724-201653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1525',
internalId:  '',
customField: '20090628-195655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1567',
internalId:  '',
customField: '20090628-195534'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1201',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INV442';
var companyName   = 'Ming%27s+Garden+Chinese+Cuisine';
var htmlTitle	  = '';
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();
};

