/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','1952',jdecode('Classes'),jdecode(''), jdecode('%2F1952.html'), 'true',[],'',''],
	['PAGE','32401',jdecode('Our+Instructors'),jdecode(''), jdecode('%2F32401.html'), 'true',[],'',''],
	['ITEM','207112',jdecode('Calendar'),jdecode(''), jdecode('http%3A%2F%2Fwww.fqqscalendar.com'), 'true',[],'','_blank'],
	['PAGE','7401',jdecode('Shop+Pics'),jdecode(''), jdecode('%2F7401.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('Projects+%26+Models'),jdecode(''), jdecode('%2F7001.html'), 'true',[],'',''],
	['PAGE','45901',jdecode('Arriving+Soon'),jdecode(''), jdecode('%2F45901.html'), 'true',[],'',''],
	['PAGE','98701',jdecode('Special+Events'),jdecode(''), jdecode('%2F98701.html'), 'true',[],'',''],
	['PAGE','7043',jdecode('Contact+Us-+Sign-Up'),jdecode(''), jdecode('%2F7043.html'), 'true',[],'',''],
	['PAGE','1994',jdecode('Driving+Directions'),jdecode(''), jdecode('%2F1994.html'), 'true',[],'',''],
	['ITEM','205701',jdecode('LET%26%23x27%3BS+GO+SHOPPING'),jdecode(''), jdecode('http%3A%2F%2Fwww.fatquartersquiltshop.biz'), 'true',[],'','_blank'],
	['ITEM','186401',jdecode('Facebook'),jdecode(''), jdecode('http%3A%2F%2Fwww.facebook.com%2Ffatquarterquiltshop'), 'true',[],'','_blank'],
	['ITEM','186501',jdecode('Twitter'),jdecode(''), jdecode('http%3A%2F%2Ftwitter.com%2F%23%21%2Ffatquartersqlts'), 'true',[],'','_blank'],
	['ITEM','186601',jdecode('BLOG'),jdecode(''), jdecode('http%3A%2F%2Ffatquartersquiltshop.blogspot.com%2F'), 'true',[],'','_blank'],
	['ITEM','216923',jdecode('Yelp*'),jdecode(''), jdecode('http%3A%2F%2Fwww.yelp.com%2Fbiz%2Ffat-quarters-quilt-shop-vista'), 'true',[],'','_blank']];
var siteelementCount=15;
theSitetree.topTemplateName='Seasons_spring';
theSitetree.paletteFamily='F5E7EE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='21090';
theSitetree.graphicsetId='13189';
theSitetree.contentColor='2E2E2E';
theSitetree.contentBGColor='F5E7EE';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netfirms',
  product: 'WSCSYSSSSLY0XYNE'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Seasons_spring',
				paletteFamily: 	'F5E7EE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'21090',
				graphicsetId: 	'13189',
				contentColor: 	'2E2E2E',
				contentBGColor: 'F5E7EE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '1994',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20120117-184752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20120110-194425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20110901-193133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20120117-184848'
};
webappMappings['1501']=webappMappings['1501-2136317']={
webappId:    '1501',
documentId:  '1901',
internalId:  '2136317',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-0731db3c1762eb948bcc87334a04ff3f']={
webappId:    '7060',
documentId:  '7401',
internalId:  '0731db3c1762eb948bcc87334a04ff3f',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-9c5fb132ecc2d9e697b46d416661f1d8']={
webappId:    '7060',
documentId:  '7001',
internalId:  '9c5fb132ecc2d9e697b46d416661f1d8',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-420']={
webappId:    '7008',
documentId:  '7043',
internalId:  '420',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20110926-135253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20110901-193437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20120105-134728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98701',
internalId:  '',
customField: '20111227-183236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45901',
internalId:  '',
customField: '20111227-122217'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'ANFI10INXELE';
var companyName   = 'Fat+Quarters+Quilt+Shop';
var htmlTitle	  = 'Fat+Quarters+Quilt+Shop+-+Quilt+Store+-+Quilt+Class+-+quilt+fabric+-+quilt+notions+-+patterns+-+Judie+Rothermel+-+Jo+Morton+-+MODA';
var metaKeywords  = 'fat+quarter%2C+quilt+shop%2C+quilt+store%2C+fabric+store%2C+quilt+classes%2C+moda%2C+marcus+fabrics%2C+andover+fabrics%2C+jo+morton%2C+quilt+notions%2C+quilt+patterns%2C+patterns%2C++fat+quarter+bundle%2C+San+Marcos+quilt+shop%2C+Vista+quilt+shop%2C+San+Marcos+fabric%2C+Vista+fabric%2C';
var metaContents  = 'Fat+Quarters+Quilt+Shop+-+quilt+fabric%2C+patterns%2C+notions+%26+quilt+classes.+Quilting+the+world+together+one+stitch+at+a+time+since+1999.+Meet+your+friends+at+Fat+Quarters+Quilt+Shop+and+be+inspired.';
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();
};

