/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('About+us'),jdecode(''), jdecode('%2F552.html'), 'true',[],'',''],
	['PAGE','594',jdecode('Products'),jdecode(''), jdecode('%2F594%2Findex.html'), 'true',[ 
		['PAGE','110301',jdecode('Bar+Supports'),jdecode(''), jdecode('%2F594%2F110301.html'), 'true',[],'',''],
		['PAGE','156801',jdecode('Bathroom'),jdecode(''), jdecode('%2F594%2F156801.html'), 'true',[],'',''],
		['PAGE','126001',jdecode('Black+Iron'),jdecode(''), jdecode('%2F594%2F126001.html'), 'true',[],'',''],
		['PAGE','105001',jdecode('Cabinet+Handles'),jdecode(''), jdecode('%2F594%2F105001.html'), 'true',[],'',''],
		['PAGE','87001',jdecode('Door+Furniture'),jdecode(''), jdecode('%2F594%2F87001.html'), 'true',[],'',''],
		['PAGE','98601',jdecode('Door+Stops'),jdecode(''), jdecode('%2F594%2F98601.html'), 'true',[],'',''],
		['PAGE','118201',jdecode('Electronic'),jdecode(''), jdecode('%2F594%2F118201.html'), 'true',[],'',''],
		['PAGE','112601',jdecode('Handrail+Brkts'),jdecode(''), jdecode('%2F594%2F112601.html'), 'true',[],'',''],
		['PAGE','70122',jdecode('Hinges'),jdecode(''), jdecode('%2F594%2F70122.html'), 'true',[],'',''],
		['PAGE','112622',jdecode('Latchbacks'),jdecode(''), jdecode('%2F594%2F112622.html'), 'true',[],'',''],
		['PAGE','133101',jdecode('Legs+%2F+Feet'),jdecode(''), jdecode('%2F594%2F133101.html'), 'true',[],'',''],
		['PAGE','130301',jdecode('Locks+%2F+Latches'),jdecode(''), jdecode('%2F594%2F130301.html'), 'true',[],'',''],
		['PAGE','82601',jdecode('Magnets'),jdecode(''), jdecode('%2F594%2F82601.html'), 'true',[],'',''],
		['PAGE','121901',jdecode('Pull+Handles'),jdecode(''), jdecode('%2F594%2F121901.html'), 'true',[],'',''],
		['PAGE','162801',jdecode('Restoration'),jdecode(''), jdecode('%2F594%2F162801.html'), 'true',[],'',''],
		['PAGE','115101',jdecode('Safety+Rails'),jdecode(''), jdecode('%2F594%2F115101.html'), 'true',[],'',''],
		['PAGE','10901',jdecode('Sink+Inserts'),jdecode(''), jdecode('%2F594%2F10901.html'), 'true',[],'',''],
		['PAGE','131801',jdecode('Sliding+Door+H%2FW'),jdecode(''), jdecode('%2F594%2F131801.html'), 'true',[],'',''],
		['PAGE','111701',jdecode('Stays'),jdecode(''), jdecode('%2F594%2F111701.html'), 'true',[],'',''],
		['PAGE','70185',jdecode('Tools+-+Hand'),jdecode(''), jdecode('%2F594%2F70185.html'), 'true',[],'',''],
		['PAGE','161501',jdecode('Towel+Rails'),jdecode(''), jdecode('%2F594%2F161501.html'), 'true',[],'','']
	],'',''],
	['PAGE','678',jdecode('Contact+Us'),jdecode(''), jdecode('%2F678.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7112';
theSitetree.keyvisualId='8818';
theSitetree.keyvisualName='KV_04.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12654';
theSitetree.contentColor='FF7112';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'mitdnz',
  product: 'WSCSYSSSSLYTC22A'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7112',
				keyvisualId: 	'8818',
				keyvisualName: 	'KV_04.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12654',
				contentColor: 	'FF7112',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126001',
internalId:  '',
customField: '20090514-010335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156801',
internalId:  '',
customField: '20110130-210302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161501',
internalId:  '',
customField: '20090512-034946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162801',
internalId:  '',
customField: '20090513-235854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110301',
internalId:  '',
customField: '20080410-035323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20110130-205001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110322-032425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20110202-220655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105001',
internalId:  '',
customField: '20110130-210730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87001',
internalId:  '',
customField: '20110130-205813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98601',
internalId:  '',
customField: '20090514-012539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118201',
internalId:  '',
customField: '20110130-214953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112601',
internalId:  '',
customField: '20080204-193110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70122',
internalId:  '',
customField: '20070615-025306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112622',
internalId:  '',
customField: '20090701-034700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133101',
internalId:  '',
customField: '20091021-163812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130301',
internalId:  '',
customField: '20080429-032145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82601',
internalId:  '',
customField: '20090721-194339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121901',
internalId:  '',
customField: '20110130-205352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115101',
internalId:  '',
customField: '20080206-172214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20090521-040741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131801',
internalId:  '',
customField: '20080429-033311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111701',
internalId:  '',
customField: '20080203-215348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70185',
internalId:  '',
customField: '20070126-045039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20110208-192132'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN28OY';
var companyName   = 'Designer+Marketing+';
var htmlTitle	  = 'Designer+Marketing+-+Connecting+People+with+Products%2C+Windsor+Brass';
var metaKeywords  = 'windsor+brass+designer+marketing+hinge+pin+door+stops+magnets+adjustable+angle+door+stops+joinery+building+jpg+image+handles+sinks+gds+valore+locks+bathroom+fittings+tools+locks+latches+astron+weiser+delf+miles+nelson+drake+wrigley+lockwood+whitco+doors+heritage+hardware+sylvan+henderson+cavlock+sopers+laminex+sylvan+lever+handles+door+pulls+keyless+entry+latchback+pedestal+post+magnet+fasteners+schlage+cavlock';
var metaContents  = 'Connecting+people+with+products+in+the+joinery+and+building+industry%2C+Windsor+Brass+Door+Hardware%2C+Kitchen+Handles%2C+Valore+Sinks%2C+Miles+Nelson+Locks%2C+Delf+Hardware%2C+Miles+Nelson%2C+Lockwood%2C+Stefano+Orlati+Cabinet+handles%2C+Schlage%2C+Cavlock%2C+Interlock%2C+Whitco%2C+Sylvan.';
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();
};

