/* [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','5501',jdecode('Home'),jdecode(''), jdecode('%2F5501.html'), 'true',[],'',''],
	['PAGE','435675',jdecode('KitchenAid+%26+More'),jdecode(''), jdecode('%2F435675.html'), 'true',[],'',''],
	['PAGE','23215',jdecode('Cookware+%26+Bakeware'),jdecode(''), jdecode('%2F23215.html'), 'true',[],'',''],
	['PAGE','12664',jdecode('Kitchenware%2C+Gadgets+%26+More'),jdecode(''), jdecode('%2F12664.html'), 'true',[],'',''],
	['PAGE','17001',jdecode('Location+%26+About+Us'),jdecode(''), jdecode('%2F17001.html'), 'true',[],'',''],
	['PAGE','6101',jdecode('E-mail+Us'),jdecode(''), jdecode('%2F6101.html'), 'true',[],'',''],
	['PAGE','17701',jdecode('Cooking+Classes'),jdecode(''), jdecode('%2F17701.html'), 'true',[],'',''],
	['PAGE','424875',jdecode('Registries+%26+Wishlists'),jdecode(''), jdecode('%2F424875.html'), 'true',[],'',''],
	['PAGE','6122',jdecode('Recipes'),jdecode(''), jdecode('%2F6122.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Sommelier';
theSitetree.paletteFamily='C39987';
theSitetree.keyvisualId='12101';
theSitetree.keyvisualName='kv_12101.jpg';
theSitetree.fontsetId='33294';
theSitetree.graphicsetId='14167';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Sommelier',
				paletteFamily: 	'C39987',
				keyvisualId: 	'12101',
				keyvisualName: 	'kv_12101.jpg',
				fontsetId: 		'33294',
				graphicsetId: 	'14167',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20120103-093248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '435675',
internalId:  '',
customField: '20120103-092451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23215',
internalId:  '',
customField: '20110630-165634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20080401-095642'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6122',
internalId:  '',
customField: '20120102-175302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '424875',
internalId:  '',
customField: '20111220-154451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20120103-092713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20120102-175916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12664',
internalId:  '',
customField: '20110630-165708'
};
webappMappings['7008']=webappMappings['7008-1851']={
webappId:    '7008',
documentId:  '6101',
internalId:  '1851',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2A5B';
var companyName   = 'Lori%27s+Kitchen+Store+on+the+square+in+Washington';
var htmlTitle	  = 'Lori%27s+Kitchen+Store%2C+Washington%2C+Illinois';
var metaKeywords  = 'Loris+Kitchen+Store%2C+LKS%2C+Clever+Chocolates%2C+Washington%2C+Illinois%2C+Lori+Peifer%2C+Executive+Chef+Mike+Stephans%2C+Executive+Chef+Michael+Stephans%2C+Angie+Pacotti-Long%2C+BeaterBlade%2C+beer+bread+mix%2C+butter+bell%2C+cast+iron%2C+Cherry+Chomper.+chocolate%2C+ChopStir%2C+cookies%2C+cookie+cutters%2C+cooking%2C+cookware%2C+Endurance%2C+Fasta+Pasta%2C+Gourmac+Hutzler%2C+Haeger+Pottery%2C+Haeger+Stoneware%2C+Harold+Import%2C+HIC%2C+Hutzler%2Cice+cream+balls%2C++King+Arthur%2C+King+Arthur+flour%2Ckitchen+tools%2C+kitchen+utensils%2C++KitchenAid%2C+kitchenware%2C+KrustBuster%2C+Kuhn+Rikon%2C+Le+Creuset%2C+Lodge+cast+iron%2C+melamine%2C+Microthin%2C+Nielsen-Massey%2C+NordicWare%2C+Norpro%2C+Pampered+Chef%2C+pecan+pie+mix%2C+pie+class%2C+Progressive%2C+recipes%2C+RSVP%2C+R.S.V.P.%2C+Scandicrafts%2C+Silicone+Zone%2C+Silvermark%2C+soup+mix%2C+spice+blends%2C+stoneware%2C+Tabletop+Solutions%2C+Trudeau%2C+vanilla%2C+ZAK+Designs%2C+Zyliss%2C+Washington%2C+IL';
var metaContents  = 'Kitchenware+store+in+Washington%2C+Illinois%2C+located+at+110+N.+Main+St.%2C+has+a+large+assortment+of+kitchenware+and+gadgets%2C+many+of+which+are+difficult+to+find.++Also+carry+their+own+line+of+baking+mixes+and+spice+blends.++For+special+orders+or+more+information%2C+call+309-444-LORI+%285674%29.';
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();
};

