/* [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','1401',jdecode('Home'),jdecode(''),'/1401/index.html','true',[ 
		['PAGE','8901',jdecode('emailus'),jdecode(''),'/1401/8901.html','false',[],'','']
	],'',''],
	['PAGE','8922',jdecode('What+We+Have'),jdecode(''),'/8922.html','true',[],'',''],
	['PAGE','8943',jdecode('Class+Listings'),jdecode(''),'/8943/index.html','true',[ 
		['PAGE','33501',jdecode('Beginners+Classes'),jdecode(''),'/8943/33501.html','true',[],'',''],
		['PAGE','33522',jdecode('Experienced+Classes'),jdecode(''),'/8943/33522.html','true',[],'',''],
		['PAGE','33543',jdecode('Advanced+Classes'),jdecode(''),'/8943/33543.html','false',[],'',''],
		['PAGE','35701',jdecode('KIDS+AFTERNOONS'),jdecode(''),'/8943/35701.html','true',[],'','']
	],'',''],
	['PAGE','16701',jdecode('Join+Our+Club'),jdecode(''),'/16701/index.html','true',[ 
		['PAGE','16722',jdecode('Club+Registration'),jdecode(''),'/16701/16722.html','false',[],'',''],
		['PAGE','18801',jdecode('Coming+Soon'),jdecode(''),'/16701/18801.html','false',[],'','']
	],'',''],
	['PAGE','1922',jdecode('About+us'),jdecode(''),'/1922.html','true',[],'',''],
	['PAGE','1943',jdecode('Contact'),jdecode(''),'/1943/index.html','true',[ 
		['PAGE','20801',jdecode('Class+Sign+Up'),jdecode(''),'/1943/20801.html','false',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Pixelprofi';
theSitetree.paletteFamily='2E3836';
theSitetree.keyvisualId='1084';
theSitetree.keyvisualName='sofa.jpg';
theSitetree.fontsetId='184';
theSitetree.graphicsetId='223';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2E3836';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Pixelprofi',
				paletteFamily: 	'2E3836',
				keyvisualId: 	'1084',
				keyvisualName: 	'sofa.jpg',
				fontsetId: 		'184',
				graphicsetId: 	'223',
				contentColor: 	'FFFFFF',
				contentBGColor: '2E3836',
				a_color: 		'2E3836',
				b_color: 		'5E726E',
				c_color: 		'000000',
				d_color: 		'455350',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20100831-124453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1922',
internalId:  '',
customField: '20090911-111628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1943',
internalId:  '',
customField: '20091005-142004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8943',
internalId:  '',
customField: '20100314-211450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8922',
internalId:  '',
customField: '20090911-121306'
};
webappMappings['7008']=webappMappings['7008-11062']={
webappId:    '7008',
documentId:  '8901',
internalId:  '11062',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20090910-183409'
};
webappMappings['7008']=webappMappings['7008-11110']={
webappId:    '7008',
documentId:  '16722',
internalId:  '11110',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20091026-155458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16722',
internalId:  '',
customField: '20090912-123312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20100830-192524'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-11574']={
webappId:    '7008',
documentId:  '20801',
internalId:  '11574',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20801',
internalId:  '',
customField: '20090928-131914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20100830-190730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20090917-181438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33522',
internalId:  '',
customField: '20100830-192420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33543',
internalId:  '',
customField: '20100427-135312'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHEGM';
var companyName   = 'Seams+To+Be+Fabrics';
var htmlTitle	  = 'seamstobefabrics.com';
var metaKeywords  = 'sewing%2C+fabric%2C+needles%2C+cloth%2C+sewing+supplies%2C+sewing+classes%2C+sewing+instruction%2C+sewing+accessories%2C+sewing+supplies';
var metaContents  = 'Seams+To+Be+Fabric+is+a+complete+sewing+center+with+sewing+supplies+and+sewing+classes.';
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();
};
