/* [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','21401',jdecode('Home'),jdecode(''),'/21401.html','true',[],''],
	['PAGE','2164',jdecode('What%26%23x27%3Bs+on+Sale+%26+Coupons'),jdecode(''),'/2164.html','true',[],''],
	['PAGE','2801',jdecode('Professional+Decorating'),jdecode(''),'/2801.html','true',[],''],
	['PAGE','2143',jdecode('Invites%2C+Favors+%26+More'),jdecode(''),'/2143.html','true',[],''],
	['PAGE','2822',jdecode('Party+Supplies'),jdecode(''),'/2822.html','true',[],''],
	['PAGE','25301',jdecode('Commercial+Printing'),jdecode(''),'/25301.html','true',[],''],
	['PAGE','2101',jdecode('Contact+Us'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','1801',jdecode('About+Us'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','2843',jdecode('Our+Friends'),jdecode(''),'/2843.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='68638F';
theSitetree.keyvisualId='6910';
theSitetree.keyvisualName='kv_6910.jpg';
theSitetree.fontsetId='11214';
theSitetree.graphicsetId='12038';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8782AC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Antigua',
				paletteFamily: 	'68638F',
				keyvisualId: 	'6910',
				keyvisualName: 	'kv_6910.jpg',
				fontsetId: 		'11214',
				graphicsetId: 	'12038',
				contentColor: 	'FFFFFF',
				contentBGColor: '8782AC',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20090917-140753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20091211-155821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2143',
internalId:  '',
customField: '20090916-175452'
};
webappMappings['7008']=webappMappings['7008-3599']={
webappId:    '7008',
documentId:  '2101',
internalId:  '3599',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20091020-135234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20091017-134403'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '21401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20091017-134244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2164',
internalId:  '',
customField: '20091211-144651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2843',
internalId:  '',
customField: '20090804-183739'
};
webappMappings['4001']=webappMappings['4001-22465111']={
webappId:    '4001',
documentId:  '2164',
internalId:  '22465111',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-f8debbc3017d93b0f21ec1975be91f55']={
webappId:    '7060',
documentId:  '2801',
internalId:  'f8debbc3017d93b0f21ec1975be91f55',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21401',
internalId:  '',
customField: '20091017-132155'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2IAM';
var companyName   = 'Events+by+Giftscapes';
var htmlTitle	  = 'Events+by+Giftscapes';
var metaKeywords  = 'event%2C+party%2C+parties%2C+invitations%2C+invitation%2C+webkinz%2C+lil+kinz%2C+favor%2C+favors%2C+wedding%2C+balloon%2C+balloons%2C+decor%2C+decorations%2C+certified+balloon+artist%2C+centerpieces%2C+sweet+16%2C+sweet+sixteen%2C+invite%2C+invites%2C+mitzvah%2C+bar+mitzvah%2C+bat+mitzvah%2C+events%2C+candles%2C+balloon+decor%2C+sculptures%2C+theme%2C+themes%2C+themed%2C+baseball%2C+princess%2C+sports%2C+football%2C+halloween%2C+christmas%2C+new+years%2C+wedding%2C+weddings%2C+bridal%2C+shower%2C+rental%2C+qualatex%2C+latex%2C+melissa+and+doug%2C+mylar%2C+singing+balloons%2C+singatunes';
var metaContents  = 'Give+your+event+the+WOW+factor+with+great+decor+from+Events+by+Giftscapes.++We+offer+professional+decorating+for+any+event.++We+also+have+a+large+selection+of+invitations%2C+favors+and+accessories.++We+specialize+in+custom+printing+to+give+you+one-of-a-kind+invitations.+';
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();
};
