/* [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','701',jdecode('home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','962',jdecode('about+us'),jdecode(''),'/962/index.html','true',[ 
		['PAGE','773',jdecode('playroom+fun'),jdecode(''),'/962/773.html','true',[],''],
		['PAGE','794',jdecode('menu+'),jdecode(''),'/962/794.html','true',[],''],
		['PAGE','1004',jdecode('play+groups'),jdecode(''),'/962/1004.html','true',[],''],
		['PAGE','55345',jdecode('fundraisers'),jdecode(''),'/962/55345.html','true',[],''],
		['PAGE','40034',jdecode('press'),jdecode(''),'/962/40034.html','true',[],'']
	],''],
	['PAGE','836',jdecode('calendar+%26+special+events'),jdecode(''),'/836.html','true',[],''],
	['PAGE','26001',jdecode('birthday+parties'),jdecode(''),'/26001.html','true',[],''],
	['PAGE','983',jdecode('Prenatal+Fit4Baby+class'),jdecode(''),'/983.html','true',[],''],
	['PAGE','50545',jdecode('Cafe+At+Work'),jdecode(''),'/50545.html','true',[],''],
	['PAGE','43745',jdecode('Playhouse+Faves...'),jdecode(''),'/43745.html','true',[],''],
	['PAGE','941',jdecode('contact+us'),jdecode(''),'/941/index.html','true',[ 
		['PAGE','27501',jdecode('directions'),jdecode(''),'/941/27501.html','true',[],'']
	],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='617F92';
theSitetree.keyvisualId='6905';
theSitetree.keyvisualName='kv_6905.jpg';
theSitetree.fontsetId='11216';
theSitetree.graphicsetId='12036';
theSitetree.contentColor='304B5C';
theSitetree.contentBGColor='809DAF';
var theTemplate={
				name: 			'Antigua',
				paletteFamily: 	'617F92',
				keyvisualId: 	'6905',
				keyvisualName: 	'kv_6905.jpg',
				fontsetId: 		'11216',
				graphicsetId: 	'12036',
				contentColor: 	'304B5C',
				contentBGColor: '809DAF',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100204-203203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100205-154127'
};
webappMappings['1501']=webappMappings['1501-2585705']={
webappId:    '1501',
documentId:  '701',
internalId:  '2585705',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '962',
internalId:  '',
customField: '20100205-154314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '983',
internalId:  '',
customField: '20100207-211528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1004',
internalId:  '',
customField: '20100205-154441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20091105-090807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '941',
internalId:  '',
customField: '20091105-090611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43745',
internalId:  '',
customField: '20100212-205800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20100226-160703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26001',
internalId:  '',
customField: '20100218-181935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40034',
internalId:  '',
customField: '20090908-132538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20100223-212737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50545',
internalId:  '',
customField: '20091024-212723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55345',
internalId:  '',
customField: '20091105-085841'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVQCI';
var companyName   = '++++++The+Playhouse+Cafe++++++++++++++++++++kids+play+while+you+cafe';
var htmlTitle	  = '';
var metaKeywords  = 'play%2C+playhouse%2C+my+playhouse%2C+lemoyne%2C+child-friendly+coffeehouse%2C+kids%2C+play+area%2C+playroom%2C+toddlers%2C+kid-friendly+coffee+shop%2C+pennsylvania%2C+playtime%2C+espresso%2C+lunch%2C+breakfast%2C+meetings%2C+catering%2C+kid+classes%2C+seminars%2C+delivery%2C+donuts%2C+maple+donuts';
var metaContents  = 'kids+play+while+you+cafe%2C+the+playhouse+cafe+in+South+Central+PA+caters+to+guests+of+all+ages.+celebrating+1+year+in+lemoyne%2C+pa.';
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();
};
