/* [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','785',jdecode('HOME'),jdecode(''),'/785.html','true',[],'',''],
	['PAGE','28117',jdecode('Embroidery+Machines'),jdecode(''),'/28117/index.html','true',[ 
		['PAGE','28138',jdecode('SPRINT+5'),jdecode(''),'/28117/28138.html','true',[],'',''],
		['PAGE','28159',jdecode('JAF+-+JAFA+SERIES'),jdecode(''),'/28117/28159.html','true',[],'',''],
		['PAGE','28180',jdecode('Special+Machines'),jdecode(''),'/28117/28180.html','true',[],'','']
	],'',''],
	['PAGE','28201',jdecode('Embroidery+Software'),jdecode(''),'/28201.html','true',[],'',''],
	['PAGE','66112',jdecode('GiS+BasePac+Training'),jdecode(''),'/66112.html','true',[],'',''],
	['PAGE','49212',jdecode('Digitizing+Samples'),jdecode(''),'/49212.html','true',[],'',''],
	['PAGE','28012',jdecode('Clothing+Collection'),jdecode(''),'/28012.html','true',[],'',''],
	['PAGE','11412',jdecode('Custom+Logo'),jdecode(''),'/11412.html','true',[],'',''],
	['PAGE','24912',jdecode('Digitizing+Services'),jdecode(''),'/24912.html','true',[],'',''],
	['PAGE','59712',jdecode('Metric+Conversion'),jdecode(''),'/59712.html','true',[],'',''],
	['PAGE','764',jdecode('Promo+Products'),jdecode(''),'/764.html','false',[],'',''],
	['PAGE','24254',jdecode('About+us'),jdecode(''),'/24254/index.html','true',[ 
		['PAGE','24275',jdecode('How+to+find+us'),jdecode(''),'/24254/24275.html','true',[],'',''],
		['PAGE','24296',jdecode('Our+team'),jdecode(''),'/24254/24296.html','true',[],'','']
	],'',''],
	['PAGE','43612',jdecode('Used+Equipment'),jdecode(''),'/43612.html','true',[],'',''],
	['PAGE','24233',jdecode('Specials'),jdecode(''),'/24233.html','true',[],'',''],
	['PAGE','51012',jdecode('Links'),jdecode(''),'/51012.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='CECEA9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10572';
theSitetree.graphicsetId='10772';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='F3F9FC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Borders',
				paletteFamily: 	'CECEA9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10572',
				graphicsetId: 	'10772',
				contentColor: 	'A00000',
				contentBGColor: 'F3F9FC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '764',
internalId:  '',
customField: '20100105-175817'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '785',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '24275',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '785',
internalId:  '',
customField: '20100218-115042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11412',
internalId:  '',
customField: '20100105-175817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43612',
internalId:  '',
customField: '20100215-143404'
};
webappMappings['1501']=webappMappings['1501-3979748']={
webappId:    '1501',
documentId:  '785',
internalId:  '3979748',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24254',
internalId:  '',
customField: '20091009-135451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24275',
internalId:  '',
customField: '20090129-170942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24912',
internalId:  '',
customField: '20100105-175817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24296',
internalId:  '',
customField: '20091009-135544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24233',
internalId:  '',
customField: '20091120-123508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28012',
internalId:  '',
customField: '20100105-180137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59712',
internalId:  '',
customField: '20091009-124411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66112',
internalId:  '',
customField: '20100115-132730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28117',
internalId:  '',
customField: '20100218-120012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28138',
internalId:  '',
customField: '20100218-115432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28159',
internalId:  '',
customField: '20091009-131702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28180',
internalId:  '',
customField: '20091009-131800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20091009-134010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49212',
internalId:  '',
customField: '20091009-134127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51012',
internalId:  '',
customField: '20090604-093419'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2RWZ';
var companyName   = '1-800-432-5610';
var htmlTitle	  = 'PSP+Embroidery+Plus+%26+ZSK+Embroidery+Systems%2C+here+to+meet+your+needs+13+South+Main+Street+Muncy+PA+1-800-432-5610';
var metaKeywords  = 'ZSK+Embroidery+Machines%2C+Embroidery+Machines%2C+Embroidery+Software%2C+Digitizing+Software%2C+Embroidery%2C+software+training%2C+GiS+Base+Pac+';
var metaContents  = 'ZSK+Embroidery+Machines+Sales+and+Service%2C+GiS+BasePac+Software+sales+and+training.';
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();
};
