/* [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(''), jdecode('%2F43.html'), 'true',[],'',''],
	['PAGE','1539',jdecode('About'),jdecode(''), jdecode('%2F1539%2Findex.html'), 'true',[ 
		['PAGE','1642',jdecode('Scrapbook'),jdecode(''), jdecode('%2F1539%2F1642.html'), 'true',[],'',''],
		['PAGE','1651',jdecode('Taste+It%21'),jdecode(''), jdecode('%2F1539%2F1651.html'), 'true',[],'',''],
		['PAGE','1660',jdecode('Evaluate+It%21'),jdecode(''), jdecode('%2F1539%2F1660.html'), 'true',[],'',''],
		['PAGE','1669',jdecode('Review+It%21'),jdecode(''), jdecode('%2F1539%2F1669.html'), 'true',[],'',''],
		['PAGE','1678',jdecode('To+Your+Taste%21+Party+Space'),jdecode(''), jdecode('%2F1539%2F1678.html'), 'true',[],'',''],
		['PAGE','5701',jdecode('Heidi+McLain'),jdecode(''), jdecode('%2F1539%2F5701.html'), 'true',[],'','']
	],'',''],
	['PAGE','4401',jdecode('Buy'),jdecode(''), jdecode('%2F4401%2Findex.html'), 'true',[ 
		['PAGE','2068',jdecode('Who+should+buy'),jdecode(''), jdecode('%2F4401%2F2068.html'), 'true',[],'',''],
		['PAGE','4422',jdecode('Where+to+buy'),jdecode(''), jdecode('%2F4401%2F4422.html'), 'true',[],'','']
	],'',''],
	['PAGE','1548',jdecode('Testimonials'),jdecode(''), jdecode('%2F1548.html'), 'true',[],'',''],
	['PAGE','14101',jdecode('News'),jdecode(''), jdecode('%2F14101.html'), 'true',[],'',''],
	['PAGE','1687',jdecode('Links+for+wine+lovers'),jdecode(''), jdecode('%2F1687.html'), 'true',[],'',''],
	['PAGE','16501',jdecode('To+Your+Taste%21+Blog'),jdecode(''), jdecode('%2F16501.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 prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC245'
};
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: '20111127-162742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1539',
internalId:  '',
customField: '20100911-163513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1642',
internalId:  '',
customField: '20100911-163753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1651',
internalId:  '',
customField: '20100911-163920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1660',
internalId:  '',
customField: '20100911-164217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1669',
internalId:  '',
customField: '20100319-081326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1678',
internalId:  '',
customField: '20100911-162417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100726-120240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20100911-164358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2068',
internalId:  '',
customField: '20100911-164543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4422',
internalId:  '',
customField: '20111127-162609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1548',
internalId:  '',
customField: '20100911-162804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1687',
internalId:  '',
customField: '20100911-163050'
};
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: '20100911-165718'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.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+tasting%2C+wine+games%2C+wine+education%2C+wine+lovers%2C+wine+parties';
var metaKeywords  = 'wine+party%2C+wine+tasting+party%2C+wine+game%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+wine+games+to+learn+how+to+taste+wine%2C+evaluate+wine%2C+review+wines%2C+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();
};

