/* [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','4801',jdecode('HOME'),jdecode(''),'/4801.html','true',[],''],
	['PAGE','4852',jdecode('ABOUT+US'),jdecode(''),'/4852.html','true',[],''],
	['PAGE','27801',jdecode('FINISH+OPTIONS'),jdecode(''),'/27801.html','true',[],''],
	['PAGE','5801',jdecode('HOME+OFFICE'),jdecode(''),'/5801/index.html','true',[ 
		['PAGE','5822',jdecode('TRADITIONAL+OFFICE'),jdecode(''),'/5801/5822.html','true',[],''],
		['PAGE','5843',jdecode('MISSION+OFFICE'),jdecode(''),'/5801/5843.html','true',[],''],
		['PAGE','5864',jdecode('MODERN+OFFICE'),jdecode(''),'/5801/5864.html','true',[],'']
	],''],
	['PAGE','5906',jdecode('TV+CONSOLES'),jdecode(''),'/5906/index.html','true',[ 
		['PAGE','5927',jdecode('TRADITIONAL+CONSOLES'),jdecode(''),'/5906/5927.html','true',[],''],
		['PAGE','5948',jdecode('MISSION+CONSOLES'),jdecode(''),'/5906/5948.html','true',[],''],
		['PAGE','5969',jdecode('MODERN+CONSOLES'),jdecode(''),'/5906/5969.html','true',[],''],
		['PAGE','5990',jdecode('STEREO+CABINETS'),jdecode(''),'/5906/5990.html','true',[],'']
	],''],
	['PAGE','5643',jdecode('OCCASIONAL+'),jdecode(''),'/5643.html','true',[],''],
	['PAGE','37901',jdecode('KID%26%23x27%3BS+BEDROOM'),jdecode(''),'/37901.html','true',[],''],
	['PAGE','5664',jdecode('BEDROOM'),jdecode(''),'/5664.html','true',[],''],
	['PAGE','4873',jdecode('CONTACT+INFO'),jdecode(''),'/4873.html','true',[],''],
	['PAGE','12301',jdecode('EMAIL+US'),jdecode(''),'/12301.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Usa';
theSitetree.paletteFamily='CBBE76';
theSitetree.keyvisualId='4332';
theSitetree.keyvisualName='kv_4332.jpg';
theSitetree.fontsetId='10796';
theSitetree.graphicsetId='11231';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CBBE76';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Usa',
				paletteFamily: 	'CBBE76',
				keyvisualId: 	'4332',
				keyvisualName: 	'kv_4332.jpg',
				fontsetId: 		'10796',
				graphicsetId: 	'11231',
				contentColor: 	'000000',
				contentBGColor: 'CBBE76',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20100414-020517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5927',
internalId:  '',
customField: '20090711-023642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5906',
internalId:  '',
customField: '20090304-030521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20090312-171403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5948',
internalId:  '',
customField: '20091112-214052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4852',
internalId:  '',
customField: '20090115-021632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5643',
internalId:  '',
customField: '20090317-184115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4873',
internalId:  '',
customField: '20090110-032146'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14803206']={
webappId:    '1501',
documentId:  '4801',
internalId:  '14803206',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5822',
internalId:  '',
customField: '20100226-214324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5843',
internalId:  '',
customField: '20100414-022716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5864',
internalId:  '',
customField: '20091112-232356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5969',
internalId:  '',
customField: '20091112-215615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5990',
internalId:  '',
customField: '20091112-220104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20100414-020632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20100421-200456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20090302-203510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20090115-024146'
};
webappMappings['7008']=webappMappings['7008-12346']={
webappId:    '7008',
documentId:  '12301',
internalId:  '12346',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INESVA';
var companyName   = 'OAK+DESIGN+CORPORATION';
var htmlTitle	  = 'OAK+DESIGN+CORPORATION';
var metaKeywords  = 'oak+office%2C+Oak%2C+Mission+Oak++consoles%2C+Traditional+Oak+consoles%2C+Contemporary+Oak+Consoles%2C+Contemporary+Oakd+office%2C+Mission+Oak+Office%2C+Oak+Traditional+Office%2C+occassional%2C+Entertainment+Centers%2C+Desks%2C+Consoles%2C+Made+in+the+USA%2C+oak+Furniture%2C+oak+Bedroom%2C+Bookcases%2C+Bookshelves%2C+oak+Bookcases%2C+plywood+bookcases%2C+bedroom+furniture%2C+oak+bedroom%2C+oak+Night+Stand%2C+Oak+Dresser%2C+Oak+Mirror%2C+Oak+Headboard%2C+Real+Oak+Furniture%2C+Oak+Mission+Rake+Bed%2C+Oak+Pedestal+Bed%2C+Oak+Trash+Can%2C+Oak+Media+Stands%2C+Oak+Media+Consoles%2C+Custom+Oak+Furniture%2C+Oak+Bookcases%2C+Oak+bookshelves%2C+Oak+Shelves%2C+Queen+oak+Beds%2C+Oak+Quality';
var metaContents  = 'oak+office%2C+Oak%2C+Mission+Oak++consoles%2C+Traditional+Oak+consoles%2C+Contemporary+Oak+Consoles%2C+Contemporary+Oakd+office%2C+Mission+Oak+Office%2C+Oak+Traditional+Office%2C+occassional%2C+Entertainment+Centers%2C+Desks%2C+Consoles%2C+Made+in+the+USA%2C+oak+Furniture%2C+oak+Bedroom%2C+Bookcases%2C+Bookshelves%2C+oak+Bookcases%2C+plywood+bookcases%2C+bedroom+furniture%2C+oak+bedroom%2C+oak+Night+Stand%2C+Oak+Dresser%2C+Oak+Mirror%2C+Oak+Headboard%2C+Real+Oak+Furniture%2C+Oak+Mission+Rake+Bed%2C+Oak+Pedestal+Bed%2C+Oak+Trash+Can%2C+Oak+Media+Stands%2C+Oak+Media+Consoles%2C+Custom+Oak+Furniture%2C+Oak+Bookcases%2C+Oak+bookshelves%2C+Oak+Shelves%2C+Queen+oak+Beds%2C+Oak+Quality';
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();
};
