/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','1701',jdecode('Contact'),jdecode(''),'/1701.html','true',[],''],
	['PAGE','1722',jdecode('Opening+hours'),jdecode(''),'/1722.html','true',[],''],
	['PAGE','1785',jdecode('Menu'),jdecode(''),'/1785/index.html','true',[ 
		['PAGE','1806',jdecode('Appetizers'),jdecode(''),'/1785/1806.html','true',[],''],
		['PAGE','1827',jdecode('Soups+%26+Salad'),jdecode(''),'/1785/1827.html','true',[],''],
		['PAGE','1848',jdecode('On+the+side'),jdecode(''),'/1785/1848.html','true',[],''],
		['PAGE','3601',jdecode('Tandoori+Sizzlers'),jdecode(''),'/1785/3601.html','true',[],''],
		['PAGE','3622',jdecode('Vegetarian+Delicacies'),jdecode(''),'/1785/3622.html','true',[],''],
		['PAGE','3643',jdecode('Chicken+Specialties'),jdecode(''),'/1785/3643.html','true',[],''],
		['PAGE','3664',jdecode('Lamb+Specialties'),jdecode(''),'/1785/3664.html','true',[],''],
		['PAGE','3685',jdecode('Seafood+Delicacies'),jdecode(''),'/1785/3685.html','true',[],''],
		['PAGE','3706',jdecode('Basmati+Rice+Platters'),jdecode(''),'/1785/3706.html','true',[],''],
		['PAGE','3727',jdecode('Breads'),jdecode(''),'/1785/3727.html','true',[],''],
		['PAGE','3748',jdecode('Mahan+Dinner+Specials'),jdecode(''),'/1785/3748.html','true',[],''],
		['PAGE','3769',jdecode('Desserts+%26+Sweets'),jdecode(''),'/1785/3769.html','true',[],'']
	],''],
	['PAGE','1764',jdecode('Our+services'),jdecode(''),'/1764.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Boston';
theSitetree.paletteFamily='832A2A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11068';
theSitetree.graphicsetId='11840';
theSitetree.contentColor='FFC77E';
theSitetree.contentBGColor='A34242';
var theTemplate={
				name: 			'Boston',
				paletteFamily: 	'832A2A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11068',
				graphicsetId: 	'11840',
				contentColor: 	'FFC77E',
				contentBGColor: 'A34242',
				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: 	'false',
				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: '20090313-212803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20090313-212855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1722',
internalId:  '',
customField: '20070925-235838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1785',
internalId:  '',
customField: '20070926-001014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1806',
internalId:  '',
customField: '20090313-213103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1827',
internalId:  '',
customField: '20090313-213231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1848',
internalId:  '',
customField: '20090313-213419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20090313-213634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3622',
internalId:  '',
customField: '20090313-214626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3685',
internalId:  '',
customField: '20090313-213800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3643',
internalId:  '',
customField: '20090313-214051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3664',
internalId:  '',
customField: '20090313-214144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3706',
internalId:  '',
customField: '20090313-214858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3727',
internalId:  '',
customField: '20090313-215025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3748',
internalId:  '',
customField: '20090313-215345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3769',
internalId:  '',
customField: '20090313-215514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1764',
internalId:  '',
customField: '20090313-215808'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INEBVW';
var companyName   = 'Mahan+Indian+Restaurant';
var htmlTitle	  = 'Mahan+Indian+Restaurant';
var metaKeywords  = 'Mahan%2C+Mahan+restaurant%2C+mahan+indian+restaurant%2C+mahan+alhambra%2C+indian+restaurant+alhambra';
var metaContents  = 'Mahan%2C+Mahan+restaurant%2C+mahan+indian+restaurant%2C+mahan+alhambra%2C+indian+restaurant+alhambra';
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();
};
