/* [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','1201',jdecode('Photos+In+Motion'),jdecode(''),'/1201/index.html','true',[ 
		['PAGE','1252',jdecode('About++Us'),jdecode(''),'/1201/1252.html','true',[],''],
		['PAGE','1294',jdecode('Our+Process'),jdecode(''),'/1201/1294.html','true',[],''],
		['PAGE','1273',jdecode('Sample+Shows'),jdecode(''),'/1201/1273.html','true',[],''],
		['PAGE','1420',jdecode('Testimonials'),jdecode(''),'/1201/1420.html','true',[],''],
		['PAGE','1315',jdecode('Packages+%26+Prices'),jdecode(''),'/1201/1315.html','true',[],'']
	],''],
	['PAGE','1336',jdecode('Contact'),jdecode(''),'/1336.html','true',[],''],
	['PAGE','1378',jdecode('KEYFRAME+Productions'),jdecode(''),'/1378.html','true',[],''],
	['PAGE','62601',jdecode('PHOTO%2FVIDEOGRAPHERS+'),jdecode(''),'/62601.html','true',[],''],
	['PAGE','1357',jdecode('OTHER+UNIQUE+GIFT+IDEAS'),jdecode(''),'/1357.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Solid';
theSitetree.paletteFamily='8396BA';
theSitetree.keyvisualId='4359';
theSitetree.keyvisualName='kv_4359.jpg';
theSitetree.fontsetId='10802';
theSitetree.graphicsetId='11232';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='8396BA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Solid',
				paletteFamily: 	'8396BA',
				keyvisualId: 	'4359',
				keyvisualName: 	'kv_4359.jpg',
				fontsetId: 		'10802',
				graphicsetId: 	'11232',
				contentColor: 	'000000',
				contentBGColor: '8396BA',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-588']={
webappId:    '7008',
documentId:  '1336',
internalId:  '588',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-589']={
webappId:    '7008',
documentId:  '1378',
internalId:  '589',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-590']={
webappId:    '7008',
documentId:  '1273',
internalId:  '590',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-591']={
webappId:    '7008',
documentId:  '1420',
internalId:  '591',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20101208-164015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1273',
internalId:  '',
customField: '20101208-163744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1378',
internalId:  '',
customField: '20100109-230145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1252',
internalId:  '',
customField: '20090629-215002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1294',
internalId:  '',
customField: '20101208-164710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1420',
internalId:  '',
customField: '20090124-215920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1315',
internalId:  '',
customField: '20090124-220138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1336',
internalId:  '',
customField: '20090318-130830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1357',
internalId:  '',
customField: '20090611-232857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62601',
internalId:  '',
customField: '20090629-215329'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INVW1B';
var companyName   = 'A+Time+To+Remember+%26+Keyframe+Productions';
var htmlTitle	  = 'Photos+In+Motion%2C+Celebration+of+Life%2C+Videographers%2C+Photographer';
var metaKeywords  = 'A+TIME+TO+REMEMBER+PRODUCTIONS%2C+KEYFRAME+PRODUCTIONS%2CPHOTOS+IN+MOTION%2C+PROMOTIONAL+BUSINESS+PORTFOLIOS%2C+UNIQUE+GIFTS%2C+CELEBRATION+OF+LIFE%2C+KEEP+SAKE+PHOTOS%2C+ADVERTISING%2C+MARKETING%2C+FAMILY%2C+PHOTOS%2C+WEDDINGS%2C+BIRTH+OF+A+CHILD%2C+BIRTHDAYS%2C+ANNIVERSARIES%2C+GRADUATIONS%2C+SPORTS%2C+VACATIONS%2C+MEMORIALS%2C+REAL+ESTATE%2C+TILE+SETTERS%2C+GRANITE%2C+LANDSCAPING%2C+CONTRACTORS%2C+WASAGA+BEACH%2C+VIDEOGRAPHERS%2C+PHOTOGRAPHERS%2C+PHOTOS%2C+INEXPENSIVE%2C+QUALITY%2C+SPORTS%2C+THEMES';
var metaContents  = 'A+TIME+TO+REMEMBER+PRODUCTIONS%2C+KEYFRAME+PRODUCTIONS%2CPHOTOS+IN+MOTION%2C+PROMOTIONAL+BUSINESS+PORTFOLIOS%2C+UNIQUE+GIFTS%2C+CELEBRATION+OF+LIFE%2C+KEEP+SAKE+PHOTOS%2C+ADVERTISING%2C+MARKETING%2C+FAMILY%2C+PHOTOS%2C+WEDDINGS%2C+BIRTH+OF+A+CHILD%2C+BIRTHDAYS%2C+ANNIVERSARIES%2C+GRADUATIONS%2CSPORTS%2C+VACATIONS%2C+MEMORIALS%2C+REAL+ESTATE%2C+TILE+SETTERS%2CGRANITE%2C+LANDSCAPING%2C+CONTRACTORS%2C+WASAGA+BEACH%2C+VIDEOGRAPHERS%2C+PHOTOGRAPHERS%2C+PHOTOS%2C+INEXPENSIVE%2C+QUALITY%2C+SPORTS+THEMES';
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();
};

