/* [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','3301',jdecode('Home'),jdecode(''), jdecode('%2F3301.html'), 'true',[],'',''],
	['PAGE','3352',jdecode('ABOUT+US'),jdecode(''), jdecode('%2F3352.html'), 'true',[],'',''],
	['PAGE','3373',jdecode('CONTACT'),jdecode(''), jdecode('%2F3373.html'), 'true',[],'',''],
	['PAGE','31401',jdecode('SHOWROOM'),jdecode(''), jdecode('%2F31401.html'), 'true',[],'',''],
	['PAGE','3394',jdecode('INVITATIONS'),jdecode(''), jdecode('%2F3394.html'), 'true',[],'',''],
	['PAGE','28601',jdecode('dream+invitation+%28new%29'),jdecode(''), jdecode('%2F28601.html'), 'true',[],'',''],
	['PAGE','3901',jdecode('pre-designed'),jdecode(''), jdecode('%2F3901.html'), 'true',[],'',''],
	['PAGE','14801',jdecode('sample+album+pre+designed'),jdecode(''), jdecode('%2F14801.html'), 'true',[],'',''],
	['PAGE','3922',jdecode('custom+design'),jdecode(''), jdecode('%2F3922.html'), 'true',[],'',''],
	['PAGE','22401',jdecode('+more+samples'),jdecode(''), jdecode('%2F22401.html'), 'true',[],'',''],
	['PAGE','14101',jdecode('sample+album+custom'),jdecode(''), jdecode('%2F14101.html'), 'true',[],'',''],
	['PAGE','3943',jdecode('wpp+design'),jdecode(''), jdecode('%2F3943.html'), 'true',[],'',''],
	['PAGE','3964',jdecode('ACCESSORIES'),jdecode(''), jdecode('%2F3964.html'), 'true',[],'',''],
	['PAGE','14301',jdecode('sample+album+accessories'),jdecode(''), jdecode('%2F14301.html'), 'true',[],'',''],
	['PAGE','3985',jdecode('PACKAGES'),jdecode(''), jdecode('%2F3985.html'), 'true',[],'',''],
	['PAGE','3415',jdecode('ORDERING'),jdecode(''), jdecode('%2F3415.html'), 'true',[],'',''],
	['PAGE','4006',jdecode('PRICES'),jdecode(''), jdecode('%2F4006.html'), 'true',[],'',''],
	['PAGE','4048',jdecode('EMAIL+ENQUIRY'),jdecode(''), jdecode('%2F4048.html'), 'true',[],'',''],
	['PAGE','4069',jdecode('HANDY+INFO'),jdecode(''), jdecode('%2F4069.html'), 'true',[],'',''],
	['PAGE','4090',jdecode('T-SHIRTS'),jdecode(''), jdecode('%2F4090.html'), 'true',[],'',''],
	['PAGE','4111',jdecode('SPECIALS'),jdecode(''), jdecode('%2F4111.html'), 'true',[],'',''],
	['PAGE','22422',jdecode('HAPPY+CLIENTS'),jdecode(''), jdecode('%2F22422.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Family';
theSitetree.paletteFamily='D6BDC8';
theSitetree.keyvisualId='3835';
theSitetree.keyvisualName='kv_3835.jpg';
theSitetree.fontsetId='10484';
theSitetree.graphicsetId='11021';
theSitetree.contentColor='4F4F4F';
theSitetree.contentBGColor='D6BDC8';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Family',
				paletteFamily: 	'D6BDC8',
				keyvisualId: 	'3835',
				keyvisualName: 	'kv_3835.jpg',
				fontsetId: 		'10484',
				graphicsetId: 	'11021',
				contentColor: 	'4F4F4F',
				contentBGColor: 'D6BDC8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AEAEAF',
				e_color: 		'AEAEAF',
				f_color: 		'AEAEAF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20111004-004039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3373',
internalId:  '',
customField: '20110912-055916'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3352',
internalId:  '',
customField: '20110912-054329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3394',
internalId:  '',
customField: '20110219-215248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3415',
internalId:  '',
customField: '20100828-031907'
};
webappMappings['7008']=webappMappings['7008-3840']={
webappId:    '7008',
documentId:  '4048',
internalId:  '3840',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4006',
internalId:  '',
customField: '20110219-215927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20100828-025900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3964',
internalId:  '',
customField: '20101001-050701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3985',
internalId:  '',
customField: '20100828-030902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22422',
internalId:  '',
customField: '20101024-191713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4048',
internalId:  '',
customField: '20110219-220110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3922',
internalId:  '',
customField: '20111004-012057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3943',
internalId:  '',
customField: '20100912-044021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4069',
internalId:  '',
customField: '20100822-012249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4090',
internalId:  '',
customField: '20100905-044220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4111',
internalId:  '',
customField: '20110219-220727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20100828-010411'
};
webappMappings['7060']=webappMappings['7060-5f6e93580c0b1c12c85607cf3a0c0008']={
webappId:    '7060',
documentId:  '14801',
internalId:  '5f6e93580c0b1c12c85607cf3a0c0008',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20100912-043701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100912-043919'
};
webappMappings['7060']=webappMappings['7060-051264423dd98aa6c1ed5b3526882e36']={
webappId:    '7060',
documentId:  '14301',
internalId:  '051264423dd98aa6c1ed5b3526882e36',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-6aaa7c84c63a5ac93f3d5485c42c1b69']={
webappId:    '7060',
documentId:  '14101',
internalId:  '6aaa7c84c63a5ac93f3d5485c42c1b69',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20111004-012016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28601',
internalId:  '',
customField: '20110414-003012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31401',
internalId:  '',
customField: '20110430-215457'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN340INFLSY';
var companyName   = 'Weddings-Parties-Papers';
var htmlTitle	  = '';
var metaKeywords  = 'invitations%2C+invites%2C+weddings%2C+papers%2C+place+cards%2C+thank+you+cards%2C+stationery%2C+wedding+invites%2C+wedding+stationery.+Funeral+stationery%2C+Perth%2C+printing%2C+wedding+accessories%2Cwedding+favours%2C+wedding+invitations+';
var metaContents  = '+invitations+Perth+WA+%0Atalk+to+a+live+person+%0Aall+budgets%2C+see+B4+you+buy';
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();
};

