/* [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','77',jdecode('HOME'),jdecode(''),'/77.html','true',[],'',''],
	['PAGE','2080',jdecode('ABOUT+US'),jdecode(''),'/2080.html','true',[],'',''],
	['PAGE','1786',jdecode('HOURS'),jdecode(''),'/1786.html','true',[],'',''],
	['PAGE','152',jdecode('COUPONS'),jdecode(''),'/152.html','true',[],'',''],
	['PAGE','1795',jdecode('PIRATE+PARTY'),jdecode(''),'/1795.html','true',[],'',''],
	['PAGE','1804',jdecode('WILD+%26+WACKY'),jdecode(''),'/1804.html','true',[],'',''],
	['PAGE','6601',jdecode('PAJAMA+PARTY'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','30501',jdecode('SILLY+SCIENCE+PARTY'),jdecode(''),'/30501.html','true',[],'',''],
	['PAGE','34201',jdecode('SILLY+SCIENCE+CRAFT'),jdecode(''),'/34201.html','true',[],'',''],
	['PAGE','12001',jdecode('STUFF-A-PET+PARTY'),jdecode(''),'/12001.html','true',[],'',''],
	['PAGE','6622',jdecode('OTHER+PARTY+PACKAGES'),jdecode(''),'/6622.html','true',[],'',''],
	['PAGE','13201',jdecode('PHOTOS'),jdecode(''),'/13201.html','true',[],'',''],
	['PAGE','22801',jdecode('MORE+PHOTOS'),jdecode(''),'/22801.html','true',[],'',''],
	['PAGE','32501',jdecode('AND+MORE+'),jdecode(''),'/32501.html','true',[],'',''],
	['PAGE','134',jdecode('HOW+TO+FIND+US'),jdecode(''),'/134.html','true',[],'',''],
	['PAGE','116',jdecode('CONTACT'),jdecode(''),'/116.html','true',[],'',''],
	['PAGE','26701',jdecode('E-MAIL+US'),jdecode(''),'/26701.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Cinema';
theSitetree.paletteFamily='B00E18';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16615';
theSitetree.graphicsetId='12208';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B00E18';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cinema',
				paletteFamily: 	'B00E18',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16615',
				graphicsetId: 	'12208',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B00E18',
				a_color: 		'000000',
				b_color: 		'C03E46',
				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:  '77',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2080',
internalId:  '',
customField: '20081103-214314'
};
webappMappings['1501']=webappMappings['1501-2323746']={
webappId:    '1501',
documentId:  '77',
internalId:  '2323746',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77',
internalId:  '',
customField: '20081103-214731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20081118-205906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1786',
internalId:  '',
customField: '20081103-215024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152',
internalId:  '',
customField: '20090219-103706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1795',
internalId:  '',
customField: '20080929-214713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1804',
internalId:  '',
customField: '20081111-220212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20081102-003833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20081102-003820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20081010-215615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134',
internalId:  '',
customField: '20081102-225137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116',
internalId:  '',
customField: '20080928-222108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20081118-205527'
};
webappMappings['7008']=webappMappings['7008-491']={
webappId:    '7008',
documentId:  '26701',
internalId:  '491',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20100206-192452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20100206-105930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20100206-191806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34201',
internalId:  '',
customField: '20100428-212214'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3E9Q';
var companyName   = '+++++++++++++++++++++++++++++++++++++FUN+CRAFT';
var htmlTitle	  = 'FUN+CRAFT+';
var metaKeywords  = 'BIRTHDAY+PARTY';
var metaContents  = 'BIRTHDAY';
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();
};
