/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','13201',jdecode('About+us'),jdecode(''),'/13201.html','true',[],''],
	['PAGE','53156',jdecode('Handmold+Series'),jdecode(''),'/53156.html','true',[],''],
	['PAGE','53198',jdecode('Architectural+Series'),jdecode(''),'/53198.html','true',[],''],
	['PAGE','54456',jdecode('Watercolor+Decos'),jdecode(''),'/54456/index.html','true',[ 
		['PAGE','54477',jdecode('Traditional+Designs'),jdecode(''),'/54456/54477.html','true',[],''],
		['PAGE','54498',jdecode('Whimsical+Designs'),jdecode(''),'/54456/54498.html','true',[],'']
	],''],
	['PAGE','53324',jdecode('Watercolor+Wear'),jdecode(''),'/53324/index.html','true',[ 
		['PAGE','46256',jdecode('Shop'),jdecode(''),'/53324/46256.html','true',[],'']
	],''],
	['PAGE','55756',jdecode('Mens%26%23x27%3B+Fashion'),jdecode(''),'/55756/index.html','true',[ 
		['PAGE','55777',jdecode('Cufflinks'),jdecode(''),'/55756/55777.html','true',[],''],
		['PAGE','55798',jdecode('Rings'),jdecode(''),'/55756/55798.html','true',[],'']
	],''],
	['PAGE','62456',jdecode('Rainbow+Rosaries'),jdecode(''),'/62456/index.html','true',[ 
		['PAGE','62477',jdecode('Rainbow+Rosaries'),jdecode(''),'/62456/62477.html','true',[],''],
		['PAGE','62498',jdecode('Shop'),jdecode(''),'/62456/62498.html','true',[],'']
	],''],
	['PAGE','62519',jdecode('Marissa%26%23x27%3Bs+Sweet+Cakes'),jdecode(''),'/62519/index.html','true',[ 
		['PAGE','62540',jdecode('Online+Ordering'),jdecode(''),'/62519/62540.html','true',[],'']
	],''],
	['PAGE','13369',jdecode('Contact'),jdecode(''),'/13369.html','true',[],''],
	['PAGE','57856',jdecode('Catalog'),jdecode(''),'/57856.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Ragtime';
theSitetree.paletteFamily='DBC984';
theSitetree.keyvisualId='3572';
theSitetree.keyvisualName='kv_3572.jpg';
theSitetree.fontsetId='10452';
theSitetree.graphicsetId='10848';
theSitetree.contentColor='6F6E49';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Ragtime',
				paletteFamily: 	'DBC984',
				keyvisualId: 	'3572',
				keyvisualName: 	'kv_3572.jpg',
				fontsetId: 		'10452',
				graphicsetId: 	'10848',
				contentColor: 	'6F6E49',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'DBC984',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'707272',
				e_color: 		'A99B63',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['4001']=webappMappings['4001-10632683']={
webappId:    '4001',
documentId:  '46256',
internalId:  '10632683',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100410-060724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13369',
internalId:  '',
customField: '20100416-100235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20100407-064119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46256',
internalId:  '',
customField: '20080813-102434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53324',
internalId:  '',
customField: '20100408-064633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53156',
internalId:  '',
customField: '20110414-103824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53198',
internalId:  '',
customField: '20110414-103913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54456',
internalId:  '',
customField: '20110414-103948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54477',
internalId:  '',
customField: '20100416-091448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54498',
internalId:  '',
customField: '20100415-054637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55756',
internalId:  '',
customField: '20100408-072138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55777',
internalId:  '',
customField: '20100408-085102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55798',
internalId:  '',
customField: '20100408-085037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57856',
internalId:  '',
customField: '20100705-162443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62456',
internalId:  '',
customField: '20110414-112826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62477',
internalId:  '',
customField: '20110414-112826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62498',
internalId:  '',
customField: '20110414-112826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62519',
internalId:  '',
customField: '20110414-112826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62540',
internalId:  '',
customField: '20110414-112826'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INEROI';
var companyName   = 'Donna+Marie+Collection';
var htmlTitle	  = 'Donna+Marie+Collection';
var metaKeywords  = 'tiles%2C+hand-painted%2C+bullnose%2C+trim%2C+ceramic%2C+decorative+tile%2C+field+tile%2C+bathroom%2C+kitchen%2C+fireplace.++Watercolor+Wear%2C+Handpainted+necklaces%2C+Handpainted+Hair+Ties%2C+rings%2C+cufflinks%2C+jewelry%2C+ceramic%2C+glazed+tiles';
var metaContents  = 'Handpainted+ceramic+tiles';
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();
};

