/* [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','1701',jdecode('Home'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','2201',jdecode('About+us'),jdecode(''), jdecode('%2F2201%2Findex.html'), 'true',[ 
		['PAGE','2222',jdecode('Our+team'),jdecode(''), jdecode('%2F2201%2F2222.html'), 'true',[],'','']
	],'',''],
	['PAGE','6301',jdecode('Service'),jdecode(''), jdecode('%2F6301%2Findex.html'), 'true',[ 
		['PAGE','6322',jdecode('Contact'),jdecode(''), jdecode('%2F6301%2F6322.html'), 'true',[],'','']
	],'',''],
	['PAGE','30812',jdecode('Jobs'),jdecode(''), jdecode('%2F30812.html'), 'true',[],'',''],
	['PAGE','29033',jdecode('Interesting+links'),jdecode(''), jdecode('%2F29033.html'), 'true',[],'',''],
	['PAGE','34712',jdecode('Client+references'),jdecode(''), jdecode('%2F34712.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Aroundtheworld';
theSitetree.paletteFamily='7FACDC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10793';
theSitetree.graphicsetId='11215';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7FACDC';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC24G'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Aroundtheworld',
				paletteFamily: 	'7FACDC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10793',
				graphicsetId: 	'11215',
				contentColor: 	'FFFFFF',
				contentBGColor: '7FACDC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20110718-135730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20110712-001648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20110711-231701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2222',
internalId:  '',
customField: '20110723-211630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20101001-205059'
};
webappMappings['7008']=webappMappings['7008-4416']={
webappId:    '7008',
documentId:  '6322',
internalId:  '4416',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-8360510']={
webappId:    '1501',
documentId:  '1701',
internalId:  '8360510',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34712',
internalId:  '',
customField: '20110712-000741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29033',
internalId:  '',
customField: '20110723-211856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30812',
internalId:  '',
customField: '20110711-231800'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVKYZ';
var companyName   = 'John+Yaryan+Investigations';
var htmlTitle	  = 'Professional+Detective%2C+Process+service+agency%2C+Investigations';
var metaKeywords  = 'Detective%2C+private+investigator%2C+private+investigations%2C+surveillance%2C+sub+rosa%2C+process+serve%2C+reno+investigator%2C+sparks+investigator%2C+carson+city+investigator%2C+lake+tahoe+investigator%2C+accident+investigator%2C+bug+sweep%2C+electronic+counter+measures%2C+cost+effective+investigations%2C+insurance+fraud%2C+homicide+investigation%2C+child+abuse+investigations%2C+cheater%2C+domestic%2C+follow+%2C+John+Yaryan%2C+Jim+Overton%2C+Don+Ramsey%2C+Best+investigator%2C+thorough+investigations%2C+highly+regarded%2C+respected+investigator%2C+professional+investigations%2C+professional+investigator%2C+experienced+investigator%2C+experienced+investigations%2C+subrosa%2C+yaryan+investigations%2C+overton+investigator%2C+insurance+companies%2C+most+experinced%2C+Best+of+Reno%2C+ASIS%2C+CALI%2C+BBB%2C+Crisis+Call+Center%2C+Nevada+Private+Investigator%2C+Nevada+Private+Detective%2C+Quick+response%2C+fast+response%2C+investigators+in+Nevada%2C+Provate+Investigators+in+Nevada%2C+private+investigator+in+Reno%2C+detective+in+reno%2C+Due+Dilligence%2C+Employment+screening%2C+Tucson+Arizona%2C+Arizona+Investigator%2C+investigator+arizona%2C+investigator+Tucson%2C+private+investigator+Tucson%2C+private+investigator+Reno%2C+investigator+Reno%2C+investigator+Nevada%2C+insurance+fraud%2C+vandalism%2C+stalking%2C+harrassment%2C+child+custody%2C+home+inventory+and+documentation+service%2C+investigator+in+Tucson%2C+Mike+Allen';
var metaContents  = 'Investigators+in+Tucson%2C+Investigators+in+Reno%2C+Cost+effective+and+efficient+investigations...';
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();
};

