/* [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','12601',jdecode('Home'),jdecode(''), jdecode('%2F12601.html'), 'true',[],'',''],
	['PAGE','25001',jdecode('About+us'),jdecode(''), jdecode('%2F25001%2Findex.html'), 'true',[ 
		['PAGE','25085',jdecode('Contact'),jdecode(''), jdecode('%2F25001%2F25085.html'), 'true',[],'','']
	],'',''],
	['PAGE','33901',jdecode('Galleries'),jdecode(''), jdecode('%2F33901%2Findex.html'), 'true',[ 
		['PAGE','25043',jdecode('Love+Portraits'),jdecode(''), jdecode('%2F33901%2F25043.html'), 'true',[],'',''],
		['PAGE','25022',jdecode('Weddings'),jdecode(''), jdecode('%2F33901%2F25022.html'), 'true',[],'',''],
		['PAGE','25801',jdecode('Maternity'),jdecode(''), jdecode('%2F33901%2F25801.html'), 'true',[],'',''],
		['PAGE','25501',jdecode('Children'),jdecode(''), jdecode('%2F33901%2F25501.html'), 'true',[],'',''],
		['PAGE','25522',jdecode('Portraits+'),jdecode(''), jdecode('%2F33901%2F25522.html'), 'true',[],'',''],
		['PAGE','33701',jdecode('Bar%2FBat+Mitzvah'),jdecode(''), jdecode('%2F33901%2F33701.html'), 'true',[],'',''],
		['PAGE','34222',jdecode('Sweet+16'),jdecode(''), jdecode('%2F33901%2F34222.html'), 'true',[],'','']
	],'',''],
	['PAGE','33501',jdecode('Forensics'),jdecode(''), jdecode('%2F33501%2Findex.html'), 'true',[ 
		['PAGE','35101',jdecode('accidents'),jdecode(''), jdecode('%2F33501%2F35101.html'), 'true',[],'',''],
		['PAGE','35122',jdecode('Court+displays'),jdecode(''), jdecode('%2F33501%2F35122.html'), 'true',[],'','']
	],'',''],
	['PAGE','35222',jdecode('Real+Estate'),jdecode(''), jdecode('%2F35222%2Findex.html'), 'true',[ 
		['PAGE','125901',jdecode('Packages'),jdecode(''), jdecode('%2F35222%2F125901.html'), 'true',[],'',''],
		['PAGE','62801',jdecode('Benefits'),jdecode(''), jdecode('%2F35222%2F62801.html'), 'true',[],'',''],
		['PAGE','64601',jdecode('Other+Services'),jdecode(''), jdecode('%2F35222%2F64601.html'), 'true',[],'',''],
		['PAGE','44801',jdecode('About+US+++++'),jdecode(''), jdecode('%2F35222%2F44801.html'), 'true',[],'',''],
		['PAGE','64901',jdecode('FAQs'),jdecode(''), jdecode('%2F35222%2F64901.html'), 'true',[],'','']
	],'',''],
	['PAGE','25822',jdecode('Helpful+Ideas'),jdecode(''), jdecode('%2F25822%2Findex.html'), 'true',[ 
		['PAGE','66701',jdecode('Portraits'),jdecode(''), jdecode('%2F25822%2F66701.html'), 'true',[],'',''],
		['PAGE','34264',jdecode('Real+Estate'),jdecode(''), jdecode('%2F25822%2F34264.html'), 'true',[],'',''],
		['PAGE','25701',jdecode('Promotions'),jdecode(''), jdecode('%2F25822%2F25701.html'), 'true',[],'',''],
		['PAGE','33601',jdecode('Gifts'),jdecode(''), jdecode('%2F25822%2F33601.html'), 'true',[],'','']
	],'',''],
	['PAGE','33622',jdecode('Testimonials'),jdecode(''), jdecode('%2F33622.html'), 'true',[],'',''],
	['PAGE','25543',jdecode('Blog'),jdecode(''), jdecode('%2F25543.html'), 'true',[],'',''],
	['PAGE','44701',jdecode('Photo+Forum'),jdecode(''), jdecode('%2F44701.html'), 'true',[],'',''],
	['PAGE','30901',jdecode('Guestbook'),jdecode(''), jdecode('%2F30901.html'), 'true',[],'',''],
	['PAGE','30922',jdecode('E-mail+me'),jdecode(''), jdecode('%2F30922.html'), 'true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Draft';
theSitetree.paletteFamily='2D50A1';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10399';
theSitetree.graphicsetId='10611';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2D50A1';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Draft',
				paletteFamily: 	'2D50A1',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10399',
				graphicsetId: 	'10611',
				contentColor: 	'FFFFFF',
				contentBGColor: '2D50A1',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D09868',
				e_color: 		'9E9E9F',
				f_color: 		'051E56',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20090222-000319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20090709-084905'
};
webappMappings['1002']=webappMappings['1002-30901ahw050invseq']={
webappId:    '1002',
documentId:  '30901',
internalId:  '30901ahw050invseq',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-626']={
webappId:    '7008',
documentId:  '30922',
internalId:  '626',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25043',
internalId:  '',
customField: '20100204-042014'
};
webappMappings['7050']=webappMappings['7050-218']={
webappId:    '7050',
documentId:  '25543',
internalId:  '218',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66701',
internalId:  '',
customField: '20100203-123348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25022',
internalId:  '',
customField: '20100202-135451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25001',
internalId:  '',
customField: '20090908-200255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20120131-103926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25085',
internalId:  '',
customField: '20100220-071950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25522',
internalId:  '',
customField: '20081125-231253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20081125-230633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25543',
internalId:  '',
customField: '20081125-230254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25822',
internalId:  '',
customField: '20100203-121740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30922',
internalId:  '',
customField: '20081126-004225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20081126-004225'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '12601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20110304-094936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20090908-193809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62801',
internalId:  '',
customField: '20100220-071649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33601',
internalId:  '',
customField: '20081129-064606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33622',
internalId:  '',
customField: '20081129-064606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20081129-071623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35222',
internalId:  '',
customField: '20100203-130759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34222',
internalId:  '',
customField: '20081129-073053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35101',
internalId:  '',
customField: '20100204-042251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34264',
internalId:  '',
customField: '20100203-201500'
};
webappMappings['1003']=webappMappings['1003-ahw050invseq11eca69c0ea']={
webappId:    '1003',
documentId:  '44701',
internalId:  'ahw050invseq11eca69c0ea',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44701',
internalId:  '',
customField: '20090112-043614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35122',
internalId:  '',
customField: '20081214-004133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44801',
internalId:  '',
customField: '20100220-071137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64601',
internalId:  '',
customField: '20090221-232319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64901',
internalId:  '',
customField: '20090221-233541'
};
webappMappings['1501']=webappMappings['1501-3320155']={
webappId:    '1501',
documentId:  '12601',
internalId:  '3320155',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125901',
internalId:  '',
customField: '20120131-141823'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INVSEQ';
var companyName   = 'Andrew+James+Photography';
var htmlTitle	  = '';
var metaKeywords  = 'Andy+Guster%2CAndrew+Guster%2C+Photography%2CPhotographer%2CGlen+Cove+NY%2CAndrew+James+Photography%2CNY%2Cforensic+presentation%2Cforensic+photography%2Cforensic%2Cmaternity+portraits%2Ccourt+display%2Cnypd%2Cwedding%2Cwedding+photography%2Cwedding+cake%2Cwedding+hall%2Clove+portraits%2Cwedding+photographer%2Cportrait%2Cchildren+portraits%2Cengagement+portrait%2Chanukkah%2Cmaternity%2C+expecting%2C+pregnant%2C+child+portraits%2Ccommunion+portraits%2Cportraits%2Ckids%2Clatent+fingerprints%2Cquestioned+documents%2Cforensic+document+examiner%2CLong+Island+virtual+tours%2CNorth+Shore+Virtual+Tours%2Creal+estate%2Cvirtual+home+tours%2Cvirtual+360+tours%2CSuffolk+county+virtual+tours%2Creal+estate+virtual+tours%2CNassau+county+ny%2CNassau+ny+virtual+tours%2C';
var metaContents  = 'Andy+Guster%2CAndrew+Guster%2C+Photography%2CPhotographer%2CGlen+Cove+NY%2CAndrew+James+Photography';
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();
};

