/* [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','52',jdecode('Home'),jdecode(''),'/52.html','true',[],''],
	['PAGE','73',jdecode('Contact'),jdecode(''),'/73.html','true',[],''],
	['PAGE','4801',jdecode('Wedding+Invitations'),jdecode(''),'/4801.html','true',[],''],
	['PAGE','20201',jdecode('Party+links'),jdecode(''),'/20201.html','true',[],''],
	['PAGE','3701',jdecode('Guest+book'),jdecode(''),'/3701.html','true',[],''],
	['PAGE','91',jdecode('Map+Locator'),jdecode(''),'/91.html','true',[],''],
	['PAGE','82',jdecode('About+us'),jdecode(''),'/82.html','true',[],''],
	['PAGE','118',jdecode('Range+of+Practice'),jdecode(''),'/118.html','true',[],''],
	['PAGE','3101',jdecode('Party+pictures'),jdecode(''),'/3101.html','true',[],''],
	['PAGE','3301',jdecode('Custom+Centerpiece%26%23x27%3Bs'),jdecode(''),'/3301.html','true',[],''],
	['PAGE','10101',jdecode('Candle+Holders'),jdecode(''),'/10101.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='955956';
theSitetree.keyvisualId='6910';
theSitetree.keyvisualName='kv_6910.jpg';
theSitetree.fontsetId='11216';
theSitetree.graphicsetId='12041';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B17775';
var theTemplate={
				name: 			'Antigua',
				paletteFamily: 	'955956',
				keyvisualId: 	'6910',
				keyvisualName: 	'kv_6910.jpg',
				fontsetId: 		'11216',
				graphicsetId: 	'12041',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B17775',
				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:  '52',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52',
internalId:  '',
customField: '20090115-140755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118',
internalId:  '',
customField: '20090115-142216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20091021-163610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82',
internalId:  '',
customField: '20090115-141437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20090928-100104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73',
internalId:  '',
customField: '20090115-140822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91',
internalId:  '',
customField: '20090115-141256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20090203-171125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20090928-094325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20090928-112236'
};
webappMappings['1002']=webappMappings['1002-3701ahw050in33fy']={
webappId:    '1002',
documentId:  '3701',
internalId:  '3701ahw050in33fy',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '91',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20090115-140854'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN33FY';
var companyName   = 'PARTY+SHACK';
var htmlTitle	  = '';
var metaKeywords  = 'balloons%2Cbirthday%2Cbaptism%2Cchristening%2Cwedding%2C+bachelorette%2Canniversary%2C+holiday%2C+plates%2Ccups%2Cnapkins%2Cthemes%2C+sweet+sixteen%2Cnew+years%2Csports%2C+candy%2Ccandy+molds+merkens+chocolate%2Cmms%2C+gifts+bags%2Clicensed+pinyata%2C+holywood%2C+broadway%2C+casino%2Cmarti+gra+fiesta%2C+winter%2Cspring%2Csummer%2Cfall%2Chorns%2C+toys%2Cfork%2Cspoon%2Cknife%2Cplasticware%2Cwine%2Cchampaign%2Cflutted%2Cdishes%2Cboxes%2Cinvitations+custom%2Cthank+yous%2Cbarmitzvah%2C+basmitzvah%2Channa+montana+sesame+street%2C+baby%2Cbride+groom%2C+table+cloth%2C+round+rectangle%2C+colors%2Cconfetti+boy%2Cgirl%2C1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C18%2C21%2C30%2C40%2C50%2C60%2C70%2C80%2C90%2C100%2Csports%2C+carlsoncraft%2Cbirchcraft%2Cparty+decorations%2Cmylar+latex%2Chelium%2C+numbers%2C+fire%2C+batman%2C+high+school+musical%2Clicensed+disney+princess%2C+diago%2Cmickey+mouse%2Crentals%2Ccustom+';
var metaContents  = 'Party+supplies+for+every+ocassion.+We+do+custom+centerpieces%2C+balloons+and+more';
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();
};
