/* [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','3301',jdecode('Home'),jdecode(''), jdecode('%2F3301.html'), 'true',[],'',''],
	['PAGE','3373',jdecode('Lessons+and+Classes'),jdecode(''), jdecode('%2F3373.html'), 'true',[],'',''],
	['PAGE','3352',jdecode('Faculty'),jdecode(''), jdecode('%2F3352.html'), 'true',[],'',''],
	['PAGE','9612',jdecode('Links'),jdecode(''), jdecode('%2F9612.html'), 'true',[],'',''],
	['PAGE','8812',jdecode('Just+for+Kids'),jdecode(''), jdecode('%2F8812.html'), 'true',[],'',''],
	['PAGE','45512',jdecode('Contact+and+Location+'),jdecode(''), jdecode('%2F45512.html'), 'true',[],'',''],
	['PAGE','88834',jdecode('Photo+Gallery'),jdecode(''), jdecode('%2F88834.html'), 'true',[],'',''],
	['PAGE','81734',jdecode('Kellis%26%23x27%3B+Piano+Studio'),jdecode(''), jdecode('%2F81734.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='669999';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='497';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='a1c6c6';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Round',
				paletteFamily: 	'669999',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'497',
				contentColor: 	'FFFFFF',
				contentBGColor: 'a1c6c6',
				a_color: 		'a1c6c6',
				b_color: 		'669999',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3352',
internalId:  '',
customField: '20111014-134417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20120123-204417'
};
webappMappings['1501']=webappMappings['1501-12247803']={
webappId:    '1501',
documentId:  '3301',
internalId:  '12247803',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3373',
internalId:  '',
customField: '20120109-210724'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88834',
internalId:  '',
customField: '20101011-082602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9612',
internalId:  '',
customField: '20110925-202005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8812',
internalId:  '',
customField: '20101009-202043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45512',
internalId:  '',
customField: '20111020-115646'
};
webappMappings['7008']=webappMappings['7008-12042']={
webappId:    '7008',
documentId:  '45512',
internalId:  '12042',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81734',
internalId:  '',
customField: '20101011-082634'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INEAJA';
var companyName   = '+Dryer+Music+Studio';
var htmlTitle	  = 'Quality+Piano%2C+Clarinet%2C+Flute%2C+Violin%2C+Guitar%2C+and+Voice+Instruction+in+Cary%2C+NC';
var metaKeywords  = '+piano%2C+studio%2C+piano+studio%2C+piano+lessons%2C+piano+instruction%2C+piano+instructor%2C+piano+teacher%2C+violin%2C+violin+instructor%2C+violin+lessons%2C+violin+teacher%2C+guitar%2C+guitar+instructor%2C+guitar+lessons%2C+guitar+teacher%2C+clarinet+lessons%2C+clarinet+teacher%2C+clarinet+instructor%2C+flute+teacher%2C+flute+lessons%2C+flute+instructor%2C+instruction%2C+Cary%2C+Raleigh%2C+Apex%2C+Morrisville%2C+Morisville%2C+NC%2C+North+Carolina%2C+advanced+piano%2C+piano+performance%2C+voice%2C+voice+lessons%2C+vocal+lessons%2C+singing+lessons%2C++voice+teacher%2C+vocal+teacher%2C+singing+teacher%2C+music%2C+chamber+music%2C+accompanying%2C+competitions%2C+Guild%2C+recitals%2C+orchestra%2C+Kellis+Dryer%2C+Richard+Dryer%2C+Katherine+Palmer%2C+Chris+Wear%2C+Christopher+Wear%2C+Ecki+Heins%2C+Ellen+Swanson%2C+chinese%2C+mandarin%2C+violinist%2C++violin+instruction%2C+violin+Cary+NC%2C+flute+instruction%2C+flute+Cary+NC%2C+Kelli+Dryer%2C+Kelli+Mindock%2C+Kelli+Mindock+Dryer%2C+music+school%2C+school%2C+conservatory%2C+music+school+cary%2C+Katherine+Gordon%2C+Kate+Gordon%2C++sing%2C+learn+to+sing%2C+vocal%2C+bass%2C+baritone%2C+soprano%2C+alto%2C+mezzo+soprano%2C+choir%2C+chorus%2C+opera%2C+Andrew+Pittman';
var metaContents  = 'Welcome+to++Dryer+Music+Studio+in+Cary%2C+NC.++We+offer+quality+private+lessons+in+piano%2C+voice%2C+violin%2C+guitar%2C+clarinet%2C+and+flute.';
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();
};

