/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1852',jdecode('Sell+My+Car'),jdecode(''),'/1852.html','true',[],'',''],
	['PAGE','1873',jdecode('Resources'),jdecode(''),'/1873.html','true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Meta';
theSitetree.paletteFamily='72A7D3';
theSitetree.keyvisualId='11103';
theSitetree.keyvisualName='kv_11103.jpg';
theSitetree.fontsetId='31993';
theSitetree.graphicsetId='13826';
theSitetree.contentColor='020202';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Meta',
				paletteFamily: 	'72A7D3',
				keyvisualId: 	'11103',
				keyvisualName: 	'kv_11103.jpg',
				fontsetId: 		'31993',
				graphicsetId: 	'13826',
				contentColor: 	'020202',
				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['7008']=webappMappings['7008-749']={
webappId:    '7008',
documentId:  '1852',
internalId:  '749',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20091004-220827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20091004-221317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20090505-231254'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1801',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1852',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1873',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN330INZ3DX';
var companyName   = '818+Cash+for+Cars';
var htmlTitle	  = '818+Cash+For+Cars%21+We+Buy+Cars+in+Van+Nuys%2C+North+Hollywood%2C+Studio+City%2C+Burbank%2C+Sherman+Oaks%21+';
var metaKeywords  = 'Cash+for+Cars%2C+Sell%2C+Car%2C+818%2C+Tow%2C+Junk%2C+Arleta%2C+Cahuenga+Pass%2C+Canoga+Park%2C+Chatsworth%2C+Encino%2C+Granada+Hills%2C+Kagel+Canyon%2C+Knollwood%2C+Lake+View+Terrace%2C+Lake+Balboa%2C+La+Tuna+Canyon%2C+Mission+Hills%2C+NoHo+Arts+District%2C+North+Hills%2C+North+Hollywood%2C+Northridge%2C+Olive+View%2C+Pacoima%2C+Panorama+City%2C+Porter+Ranch%2C+Reseda%2C+Sepulveda%2C+Shadow+Hills%2C+Sherman+Oaks%2C+Studio+City%2C+Stonehurst%2C+Sun+Valley%2C+Sunland%2C+Sylmar%2C+Tarzana%2C+Toluca+Lake%2C+Toluca+Woods%2C+Tujunga%2C+Valley+Glen%2C+Valley+Village%2C+Van+Nuys%2C+Ventura+Business+District%2C+Warner+Center%2C+West+Hills%2C+West+Toluca%2C+Winnetka%2C+Woodland+Hills%2C+fast%2C+cash%2C+free%2C+towing';
var metaContents  = 'Cash+for+cars%21+Why+let+a+a+car+sit+in+your+driveway+and+grow+roots%3F+Sell+your+car++for+cash+now%21+Get+a+free+quote+on+the+phone+of+your+cars+value+and+fast+cash+for+your+car%21+We+come+to+you%21+Prompt%2C+courteous%2C+professional+car+buyers+are+just+a+phone+call+away%21+We+buy+late+model+cars%2C+trucks+or+vans+in+excellent+condition+for+top+dollar.+We+also+buy+cars+that+need+work+or+repairs.+We+send+the+tow+truck+for+junk+cars%2C+crashed+cars%2C+salvaged+cars.+Liquidating+a+fleet%3F+Want+to+sell+a+car+that+failed+the+smog+check%3F+DMV+paperwork+problems%3F+Are+their+back+DMV+fees+due%3F+Call+us+we+can+help%21+We+have+over+25+years+experience+buying+cars+in+the+San+Fernando+Valley%2C+Los+Angeles+%2C+California';
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();
};
