/* [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','701',jdecode('Home'),jdecode(''), jdecode('%2F701.html'), 'true',[],'',''],
	['PAGE','752',jdecode('About+us'),jdecode(''), jdecode('%2F752%2Findex.html'), 'true',[ 
		['PAGE','773',jdecode('The+team'),jdecode(''), jdecode('%2F752%2F773%2Findex.html'), 'true',[ 
			['PAGE','12701',jdecode('The+team+%28follow+up+page%29'),jdecode(''), jdecode('%2F752%2F773%2F12701.html'), 'false',[],'','']
		],'','']
	],'',''],
	['PAGE','15501',jdecode('Products'),jdecode(''), jdecode('%2F15501%2Findex.html'), 'true',[ 
		['PAGE','857',jdecode('Railings+%26+Gates'),jdecode(''), jdecode('%2F15501%2F857.html'), 'true',[],'',''],
		['PAGE','794',jdecode('Copper+Work'),jdecode(''), jdecode('%2F15501%2F794.html'), 'true',[],'',''],
		['PAGE','815',jdecode('Custom+Furnishings'),jdecode(''), jdecode('%2F15501%2F815%2Findex.html'), 'true',[ 
			['PAGE','13101',jdecode('First+Product+%28follow+up+page%29'),jdecode(''), jdecode('%2F15501%2F815%2F13101.html'), 'false',[],'','']
		],'',''],
		['PAGE','836',jdecode('Lawn+%26+Garden'),jdecode(''), jdecode('%2F15501%2F836.html'), 'true',[],'',''],
		['PAGE','15522',jdecode('Construction+'),jdecode(''), jdecode('%2F15501%2F15522.html'), 'true',[],'',''],
		['PAGE','17401',jdecode('Signs'),jdecode(''), jdecode('%2F15501%2F17401.html'), 'true',[],'',''],
		['PAGE','18001',jdecode('Farm+%26+Ranch'),jdecode(''), jdecode('%2F15501%2F18001.html'), 'true',[],'','']
	],'',''],
	['PAGE','899',jdecode('Jobs'),jdecode(''), jdecode('%2F899.html'), 'true',[],'',''],
	['PAGE','920',jdecode('Contact'),jdecode(''), jdecode('%2F920%2Findex.html'), 'true',[ 
		['PAGE','941',jdecode('Adresses'),jdecode(''), jdecode('%2F920%2F941.html'), 'true',[],'','']
	],'',''],
	['PAGE','5806',jdecode('Guestbook'),jdecode(''), jdecode('%2F5806%2Findex.html'), 'true',[ 
		['PAGE','5801',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F5806%2F5801.html'), 'false',[],'','']
	],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10553';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10553',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20120121-115922'
};
webappMappings['1002']=webappMappings['1002-5806AHW050INEQS5']={
webappId:    '1002',
documentId:  '5806',
internalId:  '5806AHW050INEQS5',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20120121-113512'
};
webappMappings['7008']=webappMappings['7008-13060']={
webappId:    '7008',
documentId:  '815',
internalId:  '13060',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20120121-123310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20070912-011614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20120121-115837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20070912-012318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20071229-001943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20071207-230040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20070912-012728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20071005-125115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15522',
internalId:  '',
customField: '20091120-001037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20071228-233240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20071228-234024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '899',
internalId:  '',
customField: '20070305-003958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '920',
internalId:  '',
customField: '20071207-231248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '941',
internalId:  '',
customField: '20070304-010328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5806',
internalId:  '',
customField: '20070304-213207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20070304-213207'
};
webappMappings['7008']=webappMappings['7008-13059']={
webappId:    '7008',
documentId:  '773',
internalId:  '13059',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEQS5';
var companyName   = 'Mark+Siron+Custom+Iron+Works';
var htmlTitle	  = '';
var metaKeywords  = 'custom+kitchen+hoods%2C+granite+tables%2C+copper+work%2C+gazeboe%2C+wrought+iron%2C+ornamental+iron+for+lawn+and+garden%2C+iron+work+furnishings%2C+custom+metal+work%2C+wrought+iron+tables%2C+custom+iron+fences+and+gates%2C+Hermiston%2C+Oregon+ornamental+iron%2C+copper%2C+decorative+metal+work%2C+metal+art+work%2C+metal+sculpture%2C+weathervanes%2C+stainless+steel+railings%2C+stainless+steel+gates%2C+Metal+work+for+Hermiston+Oregon+and+surrounding+areas';
var metaContents  = 'Custom+Ornamental+Metal+Works.++Custom+Iron+Works%2C+Metal+Sculpture%2C+Brass+Works%2CCustom++Kitchen+Hoods%2C+Granite+Specialty+Tables%2C+Iron+Gates';
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();
};

