/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','5252',jdecode('Custom+Lab'),jdecode(''),'/5252/index.html','true',[ 
		['PAGE','5273',jdecode('Film+Processing'),jdecode(''),'/5252/5273.html','true',[],''],
		['PAGE','6301',jdecode('Printing'),jdecode(''),'/5252/6301.html','true',[],'']
	],''],
	['PAGE','5294',jdecode('Art+Reproduction'),jdecode(''),'/5294.html','true',[],''],
	['PAGE','5336',jdecode('Digital+Services'),jdecode(''),'/5336.html','true',[],''],
	['PAGE','5420',jdecode('Photography'),jdecode(''),'/5420/index.html','true',[ 
		['PAGE','5901',jdecode('Corporate+%2F+Commercial'),jdecode(''),'/5420/5901.html','true',[],''],
		['PAGE','5922',jdecode('Portrait'),jdecode(''),'/5420/5922.html','true',[],''],
		['PAGE','5943',jdecode('Dog+Portrait'),jdecode(''),'/5420/5943.html','true',[],''],
		['PAGE','6501',jdecode('Passport+Photo'),jdecode(''),'/5420/6501.html','true',[],'']
	],''],
	['PAGE','5483',jdecode('Design+Services'),jdecode(''),'/5483.html','true',[],''],
	['PAGE','6343',jdecode('FTP+Service'),jdecode(''),'/6343.html','true',[],''],
	['PAGE','5567',jdecode('Client+List'),jdecode(''),'/5567.html','true',[],''],
	['PAGE','5588',jdecode('Contact'),jdecode(''),'/5588.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='02325B';
theSitetree.keyvisualId='11074';
theSitetree.keyvisualName='kv_11074.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13796';
theSitetree.contentColor='98A4B0';
theSitetree.contentBGColor='02325B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Displace',
				paletteFamily: 	'02325B',
				keyvisualId: 	'11074',
				keyvisualName: 	'kv_11074.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13796',
				contentColor: 	'98A4B0',
				contentBGColor: '02325B',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5273',
internalId:  '',
customField: '20090108-075732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100421-103200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20090402-091725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5420',
internalId:  '',
customField: '20090108-095442'
};
webappMappings['7060']=webappMappings['7060-491f303c97ddc54d7f98c4f0062f83ec']={
webappId:    '7060',
documentId:  '5901',
internalId:  '491f303c97ddc54d7f98c4f0062f83ec',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-ffd02305b360e48172b5c95e5ebc24b5']={
webappId:    '7060',
documentId:  '5922',
internalId:  'ffd02305b360e48172b5c95e5ebc24b5',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-55e78bcfbd38f8c493dc90660d2d5195']={
webappId:    '7060',
documentId:  '5943',
internalId:  '55e78bcfbd38f8c493dc90660d2d5195',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5588',
internalId:  '',
customField: '20100421-103248'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5588',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20090706-085049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5294',
internalId:  '',
customField: '20090120-101225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5922',
internalId:  '',
customField: '20090109-083211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5943',
internalId:  '',
customField: '20090109-083328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20090109-083148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5336',
internalId:  '',
customField: '20090109-074407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5567',
internalId:  '',
customField: '20090112-074515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5483',
internalId:  '',
customField: '20090112-080429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6343',
internalId:  '',
customField: '20080725-132738'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20090120-120641'
};
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH030IN2QNU';
var companyName   = 'On+Location+Studios%2C+inc.';
var htmlTitle	  = 'On+Location+Studios';
var metaKeywords  = 'photography%2C+photographic+lab%2C+photography+studio%2C+poughkeepsie%2C+film+processing%2C+E-6%2C+slides%2C+black+and+white+printing%2C+BW+printing%2C+BW+processing%2C+art+reproduction%2C+scanning%2C+restoration%2C+FTP%2C+passport+photo%2C+C-41';
var metaContents  = 'On+Location+studios+is+a+professional+photographic+lab+and+studio.';
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();
};
