/* [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','5301',jdecode('Home'),jdecode(''), jdecode('%2F5301.html'), 'true',[],'',''],
	['PAGE','5394',jdecode('Contact'),jdecode(''), jdecode('%2F5394.html'), 'true',[],'',''],
	['PAGE','5352',jdecode('About+us'),jdecode(''), jdecode('%2F5352.html'), 'true',[],'',''],
	['PAGE','5373',jdecode('Service'),jdecode(''), jdecode('%2F5373.html'), 'true',[],'',''],
	['PAGE','5801',jdecode('ART+MART'),jdecode(''), jdecode('%2F5801%2Findex.html'), 'false',[ 
		['PAGE','50001',jdecode('Art+Classes+%26+Workshops'),jdecode(''), jdecode('%2F5801%2F50001.html'), 'true',[],'','']
	],'',''],
	['PAGE','54701',jdecode('CRYSTAL+CLEAR+ART+BAGS'),jdecode(''), jdecode('%2F54701.html'), 'true',[],'',''],
	['PAGE','34601',jdecode('Ready+Made+Canvas'),jdecode(''), jdecode('%2F34601.html'), 'true',[],'',''],
	['PAGE','39401',jdecode('Canvas+Stretching+%26+Stretcher+Bars'),jdecode(''), jdecode('%2F39401.html'), 'true',[],'',''],
	['PAGE','69801',jdecode('Quality+Artist+Supplies'),jdecode(''), jdecode('%2F69801.html'), 'false',[],'',''],
	['PAGE','32001',jdecode('Plak+Laminating'),jdecode(''), jdecode('%2F32001.html'), 'true',[],'',''],
	['PAGE','22001',jdecode('Designer+Wood+Mouldings'),jdecode(''), jdecode('%2F22001.html'), 'true',[],'',''],
	['PAGE','49001',jdecode('Omega+Wood%2C+Mouldings'),jdecode(''), jdecode('%2F49001.html'), 'true',[],'',''],
	['PAGE','26701',jdecode('Metal+Mouldings'),jdecode(''), jdecode('%2F26701.html'), 'false',[],'',''],
	['PAGE','22901',jdecode('Quote+Request+or+Online+order'),jdecode(''), jdecode('%2F22901.html'), 'true',[],'',''],
	['PAGE','37901',jdecode('Artist+Community+Forum'),jdecode(''), jdecode('%2F37901.html'), 'true',[],'',''],
	['PAGE','87212',jdecode('Catalogue'),jdecode(''), jdecode('%2F87212.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='293';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netfirms',
  product: 'WSCSYSSSSLY0XYNE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'293',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20120127-144431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5352',
internalId:  '',
customField: '20100427-130539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5373',
internalId:  '',
customField: '20110814-133202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5394',
internalId:  '',
customField: '20120127-141853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49001',
internalId:  '',
customField: '20100326-133046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20110802-085248'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87212',
internalId:  '',
customField: '20110827-145051'
};
webappMappings['4001']=webappMappings['4001-18070686']={
webappId:    '4001',
documentId:  '87212',
internalId:  '18070686',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20100124-081030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20100326-114652'
};
webappMappings['7008']=webappMappings['7008-1981']={
webappId:    '7008',
documentId:  '22901',
internalId:  '1981',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-8806777']={
webappId:    '1501',
documentId:  '5301',
internalId:  '8806777',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20110715-174635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20100602-021513'
};
webappMappings['1010']=webappMappings['1010-_Ea_126dd60b304']={
webappId:    '1010',
documentId:  '32001',
internalId:  '_Ea_126dd60b304',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-anfi20in2134126d2d0db88']={
webappId:    '1003',
documentId:  '37901',
internalId:  'anfi20in2134126d2d0db88',
customField: 'en:US'
};
webappMappings['1010']=webappMappings['1010-_Ea_12830f8f51a']={
webappId:    '1010',
documentId:  '34601',
internalId:  '_Ea_12830f8f51a',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34601',
internalId:  '',
customField: '20100424-120716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20100215-131331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20100427-130801'
};
webappMappings['1010']=webappMappings['1010-_Ea_126f1390cd0']={
webappId:    '1010',
documentId:  '39401',
internalId:  '_Ea_126f1390cd0',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20100221-105220'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5394',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54701',
internalId:  '',
customField: '20110823-090406'
};
webappMappings['7060']=webappMappings['7060-25f8d47861f90fd0af55213ebfe9b18c']={
webappId:    '7060',
documentId:  '69801',
internalId:  '25f8d47861f90fd0af55213ebfe9b18c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69801',
internalId:  '',
customField: '20110821-221238'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'ANFI20IN2134';
var companyName   = 'David+G.+Guthrie+Custom+Framing+Ltd.';
var htmlTitle	  = 'Custom+Picture+Framing+and+art+Supplies';
var metaKeywords  = 'picture%2C+art%2C+frames%2C+picture+framing%2C+laminating%2C+dry+mounting%2C+art+supplies%2C+picture+framing+supplies%2C+giclee+printing%2C+artist+canvas%2C+artist+oil+panits%2C+watercolour+paints%2C+daniel+smith+paints%2C+winton+paints%2C+winsor+newton+paint%2C+pebeo+paint%2C+arches+watercolourm+paper%2C+painting+panels%2C';
var metaContents  = 'picture++framing%2Ccustom+picture+framing%2C+sales+of+picture+framing+and+art+supplies%2Claminating%2C+giclee+wide+format+printing.';
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();
};

