/* [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','43',jdecode('Wine+Party+Kit+Welcome'),jdecode(''),'/43.html','true',[],'',''],
	['PAGE','1539',jdecode('About'),jdecode(''),'/1539/index.html','true',[ 
		['PAGE','1642',jdecode('Scrapbook'),jdecode(''),'/1539/1642.html','true',[],'',''],
		['PAGE','1651',jdecode('Taste+It%21'),jdecode(''),'/1539/1651.html','true',[],'',''],
		['PAGE','1660',jdecode('Evaluate+It%21'),jdecode(''),'/1539/1660.html','true',[],'',''],
		['PAGE','1669',jdecode('Review+It%21'),jdecode(''),'/1539/1669.html','true',[],'',''],
		['PAGE','1678',jdecode('To+Your+Taste%21+Party+Space'),jdecode(''),'/1539/1678.html','true',[],'',''],
		['PAGE','5701',jdecode('Heidi+McLain'),jdecode(''),'/1539/5701.html','true',[],'','']
	],'',''],
	['PAGE','4401',jdecode('Buy'),jdecode(''),'/4401/index.html','true',[ 
		['PAGE','2068',jdecode('Who+should+buy'),jdecode(''),'/4401/2068.html','true',[],'',''],
		['PAGE','4422',jdecode('Where+to+buy'),jdecode(''),'/4401/4422.html','true',[],'','']
	],'',''],
	['PAGE','1548',jdecode('Testimonials'),jdecode(''),'/1548.html','true',[],'',''],
	['PAGE','14101',jdecode('News'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','1687',jdecode('Links+for+wine+lovers'),jdecode(''),'/1687.html','true',[],'',''],
	['PAGE','16501',jdecode('To+Your+Taste%21+Blog'),jdecode(''),'/16501.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Concise';
theSitetree.paletteFamily='59C54E';
theSitetree.keyvisualId='7267';
theSitetree.keyvisualName='kv_7267.jpg';
theSitetree.fontsetId='16438';
theSitetree.graphicsetId='12144';
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: 			'Concise',
				paletteFamily: 	'59C54E',
				keyvisualId: 	'7267',
				keyvisualName: 	'kv_7267.jpg',
				fontsetId: 		'16438',
				graphicsetId: 	'12144',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '43',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43',
internalId:  '',
customField: '20100726-121347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1539',
internalId:  '',
customField: '20100726-115309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1642',
internalId:  '',
customField: '20100319-080719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1651',
internalId:  '',
customField: '20100319-081236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1660',
internalId:  '',
customField: '20100319-081259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1669',
internalId:  '',
customField: '20100319-081326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1678',
internalId:  '',
customField: '20100319-081434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100726-120240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20100319-081542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2068',
internalId:  '',
customField: '20100319-081635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4422',
internalId:  '',
customField: '20100719-184902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1548',
internalId:  '',
customField: '20100319-081940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1687',
internalId:  '',
customField: '20100806-185511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20091230-171954'
};
webappMappings['7050']=webappMappings['7050-1834']={
webappId:    '7050',
documentId:  '16501',
internalId:  '1834',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20100531-174122'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN28RH';
var companyName   = 'To+Your+Taste%21%C2%AE+Wine+Party+Kit';
var htmlTitle	  = 'To+Your+Taste%21%C2%AE+Wine+Party+Kit--wine+tasting%2C+wine+aromas%2C+wine+education%2C+wine+lovers';
var metaKeywords  = 'wine+party%2C+wine+tasting+party%2C+wine+education%2C+wine+faults%2C+wine+aromas%2C+wine+gift%2C+wine+ratings%2C+wine+lovers%2C+wine+reviews';
var metaContents  = 'Have+a+wine+tasting+party%21+This+is+a+great+wine+education+product+that+is+also+a+great+gift+for+your+favorite+wine+lover%21+Includes+three+games+to+learn+how+to+taste+wine%2C+evaluate+wine%2C+and+review+wines+and+how+to+detect+a+bad+bottle+of+wine+with+wine+aromas+included+in+the+kit%21';
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();
};
