/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','6301',jdecode('Menu'),jdecode(''),'/6301/index.html','true',[ 
		['PAGE','6322',jdecode('Appetizers+-+Chinese'),jdecode(''),'/6301/6322.html','true',[],'',''],
		['PAGE','6343',jdecode('Appetizers+-+Japanese'),jdecode(''),'/6301/6343.html','true',[],'',''],
		['PAGE','6364',jdecode('Soup'),jdecode(''),'/6301/6364.html','true',[],'',''],
		['PAGE','6385',jdecode('Salad'),jdecode(''),'/6301/6385.html','true',[],'',''],
		['PAGE','6406',jdecode('Entrees+-+Chicken'),jdecode(''),'/6301/6406.html','true',[],'',''],
		['PAGE','6427',jdecode('Entrees+-+Beef%2C+Pork'),jdecode(''),'/6301/6427.html','true',[],'',''],
		['PAGE','6448',jdecode('Entrees+-+Seafood'),jdecode(''),'/6301/6448.html','true',[],'',''],
		['PAGE','6469',jdecode('Specialties+-+Chinese'),jdecode(''),'/6301/6469.html','true',[],'',''],
		['PAGE','6490',jdecode('Specialties+-+Pan+Asia'),jdecode(''),'/6301/6490.html','true',[],'',''],
		['PAGE','6511',jdecode('Thai+Curry'),jdecode(''),'/6301/6511.html','true',[],'',''],
		['PAGE','6532',jdecode('Vegetables'),jdecode(''),'/6301/6532.html','true',[],'',''],
		['PAGE','6553',jdecode('Rice'),jdecode(''),'/6301/6553.html','true',[],'',''],
		['PAGE','6574',jdecode('Noodles'),jdecode(''),'/6301/6574.html','true',[],'',''],
		['PAGE','6595',jdecode('Asiana+Combinations'),jdecode(''),'/6301/6595.html','true',[],'',''],
		['PAGE','6616',jdecode('Japanese+Entrees'),jdecode(''),'/6301/6616.html','true',[],'',''],
		['PAGE','6637',jdecode('Lunch+Specials'),jdecode(''),'/6301/6637.html','true',[],'',''],
		['PAGE','6658',jdecode('Japanese+Lunch+Specials'),jdecode(''),'/6301/6658.html','true',[],'','']
	],'',''],
	['PAGE','18817',jdecode('Box+Menu'),jdecode(''),'/18817.html','true',[],'',''],
	['PAGE','18826',jdecode('Platter+Menu'),jdecode(''),'/18826.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='F2D0A5';
theSitetree.keyvisualId='6248';
theSitetree.keyvisualName='kv_6248.jpg';
theSitetree.fontsetId='11091';
theSitetree.graphicsetId='11862';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F2D0A5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Diamond',
				paletteFamily: 	'F2D0A5',
				keyvisualId: 	'6248',
				keyvisualName: 	'kv_6248.jpg',
				fontsetId: 		'11091',
				graphicsetId: 	'11862',
				contentColor: 	'000000',
				contentBGColor: 'F2D0A5',
				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:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20081209-213618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20081209-203527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18817',
internalId:  '',
customField: '20110904-142423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18826',
internalId:  '',
customField: '20081223-193954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20080814-221627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6343',
internalId:  '',
customField: '20080814-223050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6364',
internalId:  '',
customField: '20080814-223223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6385',
internalId:  '',
customField: '20080814-223343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6406',
internalId:  '',
customField: '20080814-223633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6427',
internalId:  '',
customField: '20080814-224000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6448',
internalId:  '',
customField: '20080814-224521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6469',
internalId:  '',
customField: '20080901-214928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6490',
internalId:  '',
customField: '20080901-215230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6511',
internalId:  '',
customField: '20080901-215345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6532',
internalId:  '',
customField: '20080901-215641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6553',
internalId:  '',
customField: '20080901-220007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6574',
internalId:  '',
customField: '20080901-220313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6595',
internalId:  '',
customField: '20080901-220501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6616',
internalId:  '',
customField: '20080901-223417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6637',
internalId:  '',
customField: '20080901-223708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6658',
internalId:  '',
customField: '20080901-223918'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INE3OA';
var companyName   = 'Asiana+Bistro';
var htmlTitle	  = 'Asiana+Bistro+-+Home';
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();
};

