/* [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','7714',jdecode('Home'),jdecode(''),'/7714.html','true',[],'',''],
	['PAGE','18901',jdecode('About+us'),jdecode(''),'/18901.html','true',[],'',''],
	['PAGE','16501',jdecode('Paintless+Dent+Repair+FAQ+'),jdecode(''),'/16501.html','true',[],'',''],
	['PAGE','19501',jdecode('Pricing+Information'),jdecode(''),'/19501.html','true',[],'',''],
	['PAGE','18022',jdecode('Photo+Gallery'),jdecode(''),'/18022.html','true',[],'',''],
	['PAGE','23801',jdecode('Testimonials+'),jdecode(''),'/23801.html','true',[],'',''],
	['PAGE','18701',jdecode('Articles+about+PDR'),jdecode(''),'/18701.html','true',[],'',''],
	['PAGE','18085',jdecode('Request+a+Quote'),jdecode(''),'/18085.html','true',[],'',''],
	['PAGE','18106',jdecode('Contact+Us'),jdecode(''),'/18106.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='727D9C';
theSitetree.keyvisualId='11165';
theSitetree.keyvisualName='kv_11165.jpg';
theSitetree.fontsetId='32063';
theSitetree.graphicsetId='13879';
theSitetree.contentColor='4e5978';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Office',
				paletteFamily: 	'727D9C',
				keyvisualId: 	'11165',
				keyvisualName: 	'kv_11165.jpg',
				fontsetId: 		'32063',
				graphicsetId: 	'13879',
				contentColor: 	'4e5978',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-4978']={
webappId:    '7008',
documentId:  '18085',
internalId:  '4978',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-4979']={
webappId:    '7008',
documentId:  '18106',
internalId:  '4979',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7714',
internalId:  '',
customField: '20110101-120825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20101128-204040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20081022-215824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18022',
internalId:  '',
customField: '20090613-122323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18085',
internalId:  '',
customField: '20101128-210245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18106',
internalId:  '',
customField: '20101128-204233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20110101-115855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20091109-163304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20090529-072353'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7714',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-23801aendu0in2x35']={
webappId:    '1002',
documentId:  '23801',
internalId:  '23801aendu0in2x35',
customField: 'icq=false'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2X35';
var companyName   = '';
var htmlTitle	  = 'The+Dent+Mender';
var metaKeywords  = 'Paintless+Dent+Repair%2C+Paintless+Dent+Removal%2C+PDR%2C+Dent+Mender%2C+The+Dent+Mender%2C+The+Dent+Mender%2C+LLC%2C+car+repair%2C+car+dent%2C+door+scratch%2C+car+crease%2C+minor+door+dent%2C+hail+damage%2C+car+door+ding%2C+door+ding%2C+ding+repair%2C+dent+repair%2C+Bill+Hayes%2C+William+Hayes%2C+Billy+Hayes%2C+Horry+county%2C+Georgetown+county%2C+Georgetown%2C+Murrells+Inlet%2C+Litchfield%2C+Surfside%2C+Garden+City%2C+Myrtle+Beach%2C+Loris%2C+Little+River%2C+North+Myrtle+Beach%2C+Conway%29+and+North+Carolina+%28Calabash%29%2C+mobile+dent+repair';
var metaContents  = 'Mobile+Paintless+Dent+Repair+aka+Paintless+Dent+Removal+or+Paintless+Dent+Repair+or+PDR%2C+in+Horry+and+Georgetown+counties%2C+South+Carolina+%28Georgetown%2C+Pawleys+Island%2C+Murrells+Inlet%2C+Litchfield%2C+Surfside+Beach%2C+Garden+City%2C+Myrtle+Beach%2C+North+Myrtle+Beach%2C+Conway%2C+Loris%2C+Little+River%29+and+North+Carolina+%28Calabash%2C+Ocean+Isle+City%2C+Sunset+Beach%2C+Shallotte%29';
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();
};

