/* [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','1311',jdecode('Home'),jdecode(''), jdecode('%2F1311.html'), 'true',[],'',''],
	['PAGE','63925',jdecode('2011+Season'),jdecode(''), jdecode('%2F63925.html'), 'true',[],'',''],
	['PAGE','62825',jdecode('Cruising'),jdecode(''), jdecode('%2F62825.html'), 'true',[],'',''],
	['PAGE','25701',jdecode('Employment+App'),jdecode(''), jdecode('%2F25701.html'), 'false',[],'',''],
	['PAGE','36201',jdecode('Menu'),jdecode(''), jdecode('%2F36201.html'), 'true',[],'',''],
	['PAGE','63025',jdecode('Contact+Us'),jdecode(''), jdecode('%2F63025.html'), 'true',[],'',''],
	['PAGE','64925',jdecode('Coupons'),jdecode(''), jdecode('%2F64925.html'), 'true',[],'',''],
	['PAGE','1332',jdecode('Events'),jdecode(''), jdecode('%2F1332%2Findex.html'), 'false',[ 
		['PAGE','27501',jdecode('Book+An+Event'),jdecode(''), jdecode('%2F1332%2F27501.html'), 'true',[],'','']
	],'',''],
	['PAGE','31401',jdecode('Our+Club'),jdecode(''), jdecode('%2F31401%2Findex.html'), 'false',[ 
		['PAGE','34101',jdecode('Application'),jdecode(''), jdecode('%2F31401%2F34101.html'), 'false',[],'','']
	],'',''],
	['PAGE','1353',jdecode('Photo+Album'),jdecode(''), jdecode('%2F1353.html'), 'false',[],'',''],
	['PAGE','1385',jdecode('Guestbook'),jdecode(''), jdecode('%2F1385.html'), 'false',[],'',''],
	['PAGE','6401',jdecode('Music'),jdecode(''), jdecode('%2F6401.html'), 'false',[],'',''],
	['PAGE','7701',jdecode('Links'),jdecode(''), jdecode('%2F7701.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='D43F3F';
theSitetree.keyvisualId='9840';
theSitetree.keyvisualName='kv_9840.jpg';
theSitetree.fontsetId='17629';
theSitetree.graphicsetId='13031';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLY0XFEL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Valiant',
				paletteFamily: 	'D43F3F',
				keyvisualId: 	'9840',
				keyvisualName: 	'kv_9840.jpg',
				fontsetId: 		'17629',
				graphicsetId: 	'13031',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-4ef827adb50e642ab2ffebc1e553cc07']={
webappId:    '7060',
documentId:  '1353',
internalId:  '4ef827adb50e642ab2ffebc1e553cc07',
customField: 'language:en;country:US;'
};
webappMappings['7002']=webappMappings['7002-1510']={
webappId:    '7002',
documentId:  '1385',
internalId:  '1510',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1311',
internalId:  '',
customField: '20111103-114357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1332',
internalId:  '',
customField: '20110601-073255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1353',
internalId:  '',
customField: '20110206-104217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1385',
internalId:  '',
customField: '20110206-111745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20111011-080748'
};
webappMappings['7008']=webappMappings['7008-12605']={
webappId:    '7008',
documentId:  '63925',
internalId:  '12605',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20111103-121336'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '63025',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64925',
internalId:  '',
customField: '20111103-120930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63025',
internalId:  '',
customField: '20111101-223234'
};
webappMappings['7008']=webappMappings['7008-10829']={
webappId:    '7008',
documentId:  '25701',
internalId:  '10829',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20110803-133504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20111103-120901'
};
webappMappings['7008']=webappMappings['7008-10830']={
webappId:    '7008',
documentId:  '27501',
internalId:  '10830',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20110220-142608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31401',
internalId:  '',
customField: '20110316-111957'
};
webappMappings['7008']=webappMappings['7008-10861']={
webappId:    '7008',
documentId:  '34101',
internalId:  '10861',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34101',
internalId:  '',
customField: '20110223-094738'
};
webappMappings['7070']=webappMappings['7070-163']={
webappId:    '7070',
documentId:  '1332',
internalId:  '163',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62825',
internalId:  '',
customField: '20111103-120742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63925',
internalId:  '',
customField: '20111103-122535'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INF9SY';
var companyName   = 'The+Suds+Drive-In';
var htmlTitle	  = 'The+Suds+Drive-In';
var metaKeywords  = 'the+suds+drive+in+restaurant+greenwood+indiana+classic+car+cruising+antiques+cars+vintage+rat+rods+root+beer+floats+ford+chevy+buick+olds+pontiac+cadillac+car+crusie';
var metaContents  = 'The+Suds+Drive+In+Restaurant+Greenwood+Indiana';
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();
};

