/* [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','1512',jdecode('Home'),jdecode(''),'/1512.html','true',[],'',''],
	['PAGE','3112',jdecode('Original+Content'),jdecode(''),'/3112.html','true',[],'',''],
	['PAGE','3133',jdecode('Production+Services'),jdecode(''),'/3133.html','true',[],'',''],
	['PAGE','18912',jdecode('Language+Services'),jdecode(''),'/18912.html','true',[],'',''],
	['PAGE','35446',jdecode('What%26%23x27%3Bs+News%3F'),jdecode(''),'/35446.html','true',[],'',''],
	['PAGE','1605',jdecode('About+Us'),jdecode(''),'/1605.html','true',[],'',''],
	['PAGE','34444',jdecode('Contact+Us'),jdecode(''),'/34444.html','true',[],'',''],
	['PAGE','36191',jdecode('Trailer+Park'),jdecode(''),'/36191.html','true',[],'',''],
	['PAGE','36008',jdecode('Store'),jdecode(''),'/36008.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Snapshot';
theSitetree.paletteFamily='555F8C';
theSitetree.keyvisualId='3623';
theSitetree.keyvisualName='kv_3623.jpg';
theSitetree.fontsetId='10755';
theSitetree.graphicsetId='10876';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='555F8C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Snapshot',
				paletteFamily: 	'555F8C',
				keyvisualId: 	'3623',
				keyvisualName: 	'kv_3623.jpg',
				fontsetId: 		'10755',
				graphicsetId: 	'10876',
				contentColor: 	'FFFFFF',
				contentBGColor: '555F8C',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FC5E7B',
				e_color: 		'BFBFBF',
				f_color: 		'050001',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36008',
internalId:  '',
customField: '20100104-172918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1512',
internalId:  '',
customField: '20110729-103932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18912',
internalId:  '',
customField: '20100707-181203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3112',
internalId:  '',
customField: '20110427-003507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3133',
internalId:  '',
customField: '20110427-000734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1605',
internalId:  '',
customField: '20100222-161753'
};
webappMappings['7060']=webappMappings['7060-0b8bdba774470142536b71ef782564d4']={
webappId:    '7060',
documentId:  '1512',
internalId:  '0b8bdba774470142536b71ef782564d4',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-1438']={
webappId:    '7008',
documentId:  '34444',
internalId:  '1438',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34444',
internalId:  '',
customField: '20100104-165048'
};
webappMappings['1501']=webappMappings['1501-6237903']={
webappId:    '1501',
documentId:  '1512',
internalId:  '6237903',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36191',
internalId:  '',
customField: '20110427-003049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35446',
internalId:  '',
customField: '20110427-003550'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEKE7';
var companyName   = 'Rejoice%21+Studios+LLC';
var htmlTitle	  = 'Rejoice%21+Studios%2C+LLC';
var metaKeywords  = 'Rejoice%21+StudiosRejoice%21+Studios%2C+LLCChristian+mediaProduction+companiesVideo+productionTV+productionIndependent+movie+production';
var metaContents  = 'Christian+media+company+creating+original+content+and+assisting+clients+with+their+media+projects.';
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();
};

