/* [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 theSitetree=[ 
	['PAGE','44',jdecode('Home'),jdecode(''),'/44.html','true',[],''],
	['PAGE','1075',jdecode('About+SOS'),jdecode(''),'/1075/index.html','true',[ 
		['PAGE','1527',jdecode('Mission+Statement'),jdecode(''),'/1075/1527.html','true',[],''],
		['PAGE','1603',jdecode('Why+SOS%3F'),jdecode(''),'/1075/1603.html','true',[],'']
	],''],
	['PAGE','1612',jdecode('Monthly+Message'),jdecode(''),'/1612.html','true',[],''],
	['PAGE','1621',jdecode('Month%26%23x27%3Bs+Events'),jdecode(''),'/1621.html','true',[],''],
	['PAGE','1630',jdecode('References'),jdecode(''),'/1630.html','true',[],''],
	['PAGE','1639',jdecode('Pictures'),jdecode(''),'/1639.html','true',[],''],
	['PAGE','1648',jdecode('Join+SOS'),jdecode(''),'/1648.html','true',[],''],
	['PAGE','1657',jdecode('Fun+Links'),jdecode(''),'/1657.html','true',[],''],
	['PAGE','2168',jdecode('Guestbook'),jdecode(''),'/2168/index.html','true',[ 
		['PAGE','2167',jdecode('Read+Guestbook'),jdecode(''),'/2168/2167.html','false',[],'']
	],''],
	['PAGE','4401',jdecode('Journal'),jdecode(''),'/4401.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Daily';
theSitetree.paletteFamily='D4C3E6';
theSitetree.keyvisualId='7270';
theSitetree.keyvisualName='kv_7270.jpg';
theSitetree.fontsetId='16458';
theSitetree.graphicsetId='12153';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Daily',
				paletteFamily: 	'D4C3E6',
				keyvisualId: 	'7270',
				keyvisualName: 	'kv_7270.jpg',
				fontsetId: 		'16458',
				graphicsetId: 	'12153',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '44',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1527',
internalId:  '',
customField: '20080117-081308'
};
webappMappings['1002']=webappMappings['1002-2168AHW050INX21X']={
webappId:    '1002',
documentId:  '2168',
internalId:  '2168AHW050INX21X',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1075',
internalId:  '',
customField: '20090206-031745'
};
webappMappings['7050']=webappMappings['7050-85']={
webappId:    '7050',
documentId:  '4401',
internalId:  '85',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44',
internalId:  '',
customField: '20080603-061024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1603',
internalId:  '',
customField: '20080117-081944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1612',
internalId:  '',
customField: '20091101-021318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1621',
internalId:  '',
customField: '20091101-022957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1630',
internalId:  '',
customField: '20090508-134651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1639',
internalId:  '',
customField: '20080117-072639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1648',
internalId:  '',
customField: '20080117-103106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1657',
internalId:  '',
customField: '20080117-072640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2168',
internalId:  '',
customField: '20080603-065552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2167',
internalId:  '',
customField: '20080603-065552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20090902-181356'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INX21X';
var companyName   = 'Starting+Over+Singles';
var htmlTitle	  = '';
var metaKeywords  = 'Starting+Over+Singles++Starting+Over+Single++Starting+Over++Singles++Single++Divorced++Separated+++Widowed++Friends++Friendship++Fellowship++Marriage++Dating++Engaged++Love++Fun++Singledom++Events++Activities++SOS++Sea+Of+Singles+movies+mini-golf+comedy+dancing+music+trips+events+functions+organization+organizations+group+groups+bowling+dinner+dinners+museums+gambling+shows+theatre+films+cookouts+picnics+BBQs+park+clubs++join+membership+application+singledom+walks+billiards+bowling+orientation+pool';
var metaContents  = '';
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();
};
