/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','91657',jdecode('Catalogue%2Fdownload'),jdecode(''),'/91657.html','true',[],'',''],
	['PAGE','80',jdecode('More+Ways+To+Order'),jdecode(''),'/80.html','true',[],'',''],
	['PAGE','17701',jdecode('Dates+For+Your+Calender'),jdecode(''),'/17701.html','true',[],'',''],
	['PAGE','30401',jdecode('Quilt+Photo+Gallery'),jdecode(''),'/30401.html','true',[],'',''],
	['PAGE','5828',jdecode('Pattern+Dealers'),jdecode(''),'/5828.html','true',[],'',''],
	['PAGE','5741',jdecode('Wholesale+Information'),jdecode(''),'/5741.html','true',[],'',''],
	['PAGE','45101',jdecode('Contact+'),jdecode(''),'/45101.html','true',[],'',''],
	['PAGE','44901',jdecode('Email+Contact+Form'),jdecode(''),'/44901.html','true',[],'',''],
	['PAGE','66857',jdecode('Testimonials'),jdecode(''),'/66857.html','true',[],'',''],
	['PAGE','2068',jdecode('Privacy+Policy'),jdecode(''),'/2068.html','true',[],'',''],
	['PAGE','97457',jdecode('Classifieds'),jdecode(''),'/97457.html','true',[],'',''],
	['PAGE','97478',jdecode('Sew+Fabulous+Helpful+Hints'),jdecode(''),'/97478.html','true',[],'',''],
	['PAGE','2050',jdecode('About+Us'),jdecode(''),'/2050.html','true',[],'',''],
	['PAGE','68957',jdecode('Free%2FDownload'),jdecode(''),'/68957.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='5351C2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10894';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'5351C2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10894',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5351C2',
				e_color: 		'5351C2',
				f_color: 		'5351C2',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66857',
internalId:  '',
customField: '20091103-205432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68957',
internalId:  '',
customField: '20100225-112520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91657',
internalId:  '',
customField: '20100317-233344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100407-102527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97457',
internalId:  '',
customField: '20100214-211505'
};
webappMappings['1501']=webappMappings['1501-157803']={
webappId:    '1501',
documentId:  '32',
internalId:  '157803',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20091009-092525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20091009-092332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2050',
internalId:  '',
customField: '20100216-142101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45101',
internalId:  '',
customField: '20091211-132259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44901',
internalId:  '',
customField: '20091211-132616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2068',
internalId:  '',
customField: '20090917-162715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5741',
internalId:  '',
customField: '20100317-233438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5828',
internalId:  '',
customField: '20100209-124209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20100315-143051'
};
webappMappings['7008']=webappMappings['7008-2775']={
webappId:    '7008',
documentId:  '44901',
internalId:  '2775',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97478',
internalId:  '',
customField: '20100227-102045'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXEML';
var companyName   = 'SEW+FABULOUS%C2%AE';
var htmlTitle	  = 'www.sewfabulous.com';
var metaKeywords  = 'Free+Downloads+Sew+Fabulous%C2%AE+sewfabulous+Sew+Fabulous+LTD.+Co.+Catalog+Catalogue+Houston+Humble+TX+Festival+International+Quilt+Market+Quilts+Fabrics+wall-hanging+wall+hanging+hangings++quilt+quilts+quilters+guild+patterns+applique+pattern+Africans+Appliques+So+African+Afrika+African+African+American+Made+Xmas+ornament+ornaments+Dashiki+Christmas+Dashiki+Ethnic+collection+Fabrics+mask+patterns+Luba+Queen+Dagomba+Senufo+Songye+Queen+Lele+Benin+Kota+Azande+Queen+Lumar+Oni+Oba+Baboula++Double+Star++String++Ethnic++sewing+patterns+masks+mask+Water+Walk+Dancers+Dances+for++Babu+Grandfather+Girls+Portrait+Wearing+Babies+Jumpers+Asante+King+Queen+Basket+maker+Basketmaker+Flute+Player+Bobo+Amandi+Keeping+History+Alive+Mancala+Game+Mali+Market+Making+Mealie+Meal+Blue+Women+Men++Taureq+Kanga+Balo+Musician+Xylophone+Nupe+Weaver+Sangomas+Healers+Sambruru+Potter+Maasai+Wire+Car+Groom+South+Grand+Bubbas+Bubas+Blue+Taureg+Father++Child++Old+Man++Woman++Special+Occasion+Reunion++Men++Women++Mother+Daughter++Family++Children+at+Play+handmade+by+Jeffie+Johnson+Designed+Kibana+Hut+Cabana+Huts+House+Houses+American+Made+African-American+Afro-American+Bride+Queens+Palace+Jumba+Kings+Sea+Shore+Kibana+Hut+Huts++Houses+Thatched++Jungle+stone+traditional+mission+grooms+bush+tribal+adobe+grass+bush+Steam-a-Seam2Quilters+Dream+Black+batting+polyester+Steam-A-Seam2+Steam-A-Seam+fusible+webbing+Craft+size+Crib+Sewing+Strings+String+scrap+scraps+Quilting+Guild+Church+Hat+Society+Red+Hats+Pink+Hat+Mother+With+Child+Sleepy+New+The+Woodlands++P+O+Box+9173+Mail+Order+Online+Shop+Strings+scraps+Store+Free+Download+order+orders+ordering+Estate+Classifieds+Helpful+Hints';
var metaContents  = 'SEW+FABULOUS%C2%AE+offers+pattern+collections+designed+by+Jeffie+Johnson+such+as+The+African+Applique+Pattern+Collections%E2%84%A2+a+unique+collection+of+African+inspired+applique+wall+hanging+quilt+patterns.+We+have+just+added+the+New+Kibana+Pattern+Collection%E2%84%A2+featuring+16+new+patterns.+We+also+offer+The+African+Mask+Applique+Pattern+Collection.+You+will+also+find+our+collection+of+American-made+quilts+for+sale.+Our+hand+cut+STRiNGS%E2%84%A2+are+available+in+half-pound+bags.+We+also+feature+handmade%2C+one+of+a+kind+African+Dashiki+Ornaments+Collection+in+various+shapes+are+also+available.+Our+products+are+available+by+Mail+Order+and+through+our+Online+Catalogue+only.';
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();
};
