/* [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','601',jdecode('Home'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','9301',jdecode('Our+Philosophy'),jdecode(''), jdecode('%2F9301.html'), 'true',[],'',''],
	['PAGE','9343',jdecode('Workshops+%26+Webinars'),jdecode(''), jdecode('%2F9343.html'), 'true',[],'',''],
	['PAGE','9385',jdecode('Become+an+Interior+Sylist%3F'),jdecode(''), jdecode('%2F9385.html'), 'true',[],'',''],
	['PAGE','9448',jdecode('Certification+Programs%2FTraining'),jdecode(''), jdecode('%2F9448.html'), 'true',[],'',''],
	['PAGE','9406',jdecode('Instructors'),jdecode(''), jdecode('%2F9406.html'), 'true',[],'',''],
	['PAGE','9322',jdecode('Why+Us%3F+%2F++FAQ'),jdecode(''), jdecode('%2F9322.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Shopping';
theSitetree.paletteFamily='CDE855';
theSitetree.keyvisualId='11760';
theSitetree.keyvisualName='kv_11760.jpg';
theSitetree.fontsetId='33043';
theSitetree.graphicsetId='14023';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='f5f6d4';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp19-dulles',
  product: 'WSCSYSSSSLYTCPII'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Shopping',
				paletteFamily: 	'CDE855',
				keyvisualId: 	'11760',
				keyvisualName: 	'kv_11760.jpg',
				fontsetId: 		'33043',
				graphicsetId: 	'14023',
				contentColor: 	'000000',
				contentBGColor: 'f5f6d4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20120125-105623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20110830-081431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20110328-072604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9343',
internalId:  '',
customField: '20111126-080149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9385',
internalId:  '',
customField: '20110324-063059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9406',
internalId:  '',
customField: '20111123-071917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9448',
internalId:  '',
customField: '20120201-155023'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLZRX';
var companyName   = 'Interior+Stylist+Program+-+Certification+Home+Staging%2C+Redesign+%26+Decorating+Education';
var htmlTitle	  = 'Interior+Stylist+Program+-+Certification+Home+Staging%2C+Interior+Redesign%2C+Decorating+Training';
var metaKeywords  = 'Home+Staging%2C+Interior+Redesign%2C+Certification%2C+Certified%2C+Training%2C+Chicago%2C+Interior+Decorating%2C+One+Day+Makeover%2C+Room%2C+Education%2C+Workshops%2C+Seminars%2C+On-Line%2C+Stylist%2C+Julea+Joseph%2C+Accessorizing%2C+Styling%2C+Seasonal%2C+Holiday%2C+Lifestyle+Design%2C+Accessory%2C+Staged+Homes%2C+House%2C+Advanced%2C+Illinois';
var metaContents  = 'Home+Staging%2C+Redesign+%26+Interior+Stylist+Training%2C+Certification';
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();
};

