/* [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','3301',jdecode('A-D+Home'),jdecode(''), jdecode('%2F3301.html'), 'true',[],'',''],
	['PAGE','12401',jdecode('3-D+Photo+Samples'),jdecode(''), jdecode('%2F12401.html'), 'true',[],'',''],
	['PAGE','45001',jdecode('Birth+of+3-D'),jdecode(''), jdecode('%2F45001.html'), 'true',[],'',''],
	['PAGE','47901',jdecode('In+the+Spotlight'),jdecode(''), jdecode('%2F47901.html'), 'true',[],'',''],
	['PAGE','26901',jdecode('3-D+4-U'),jdecode(''), jdecode('%2F26901.html'), 'true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='7179A3';
theSitetree.keyvisualId='7078';
theSitetree.keyvisualName='kv_7078.jpg';
theSitetree.fontsetId='16379';
theSitetree.graphicsetId='12122';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7179A3';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'verizon',
  product: 'WSCSYSSSSLYTCPXC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Billy',
				paletteFamily: 	'7179A3',
				keyvisualId: 	'7078',
				keyvisualName: 	'kv_7078.jpg',
				fontsetId: 		'16379',
				graphicsetId: 	'12122',
				contentColor: 	'FFFFFF',
				contentBGColor: '7179A3',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20100304-073028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45001',
internalId:  '',
customField: '20111212-140416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47901',
internalId:  '',
customField: '20110511-064851'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3301',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-b0d52771ac2ebbf3e3c9e491d6910ccc']={
webappId:    '7060',
documentId:  '12401',
internalId:  'b0d52771ac2ebbf3e3c9e491d6910ccc',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20110205-215600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20111211-212123'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INLS3I';
var companyName   = 'Added-Dimensions';
var htmlTitle	  = 'Added-Dimensions';
var metaKeywords  = 'Nick+Brienza%2C+nbrienza%2C+Anachrome%2C+3-D+services%2C+3-D+photography%2C+stereo+photography%2C+3-D%2C+stereo%2C+Red+Cyan%2C+Stereoscopic%2C+3D+Glasses%2C+Anaglyph%2C+Anaglyphic%2C+3D+stereo%2C+plastic+Anaglyph+Glasses%2C+Stereo+Glasses%2C+Red%2FCyan%2C+Red+Cyan+3D+Glasses%2C+3D+Television%2C+3D+TV%2C+Digital+3D+Photos%2C+3D+Online+Promotion%2C+Color+3D%2C+3D+Photos%2C3D+Photography%2C+Stereo+Images%2C+Stereovision%2C+Stereo+Vision%2C+3D+Cinema%2C+3D+DVD%2C+3D+Movies%2C+3D+Animation%2C+3D+Display%2C+Depth+Perception%2C+3D+Productions%2C+3D+Entertainment%2C+3D+Fashion%2C+3D+Educational%2C+3D+training%2C+3D+Film%2C+3D+Cinema%2C+3D+Simulation%2C+Stereo+Plastic+Glasses%2C+Plastic+Anaglyph+Glasses%2C+Acrylic+3D+Glasses%2C+Color+Anaglyph%2C+Anaglyph+Photos%2C+Stereoscopic+Glasses%2C+Anaglyph+Movies%2C+3D+DVD+Glasses%2C+3D+Motion+Pictures%2C+Free+3-D+glasses%2C+3D+Anaglyph+DVD%2C+3D+TV+Glasses%2C+3D+DVD+Glasses%2C+3D+Theater%2C+3D+Computer+Animation%2C+3D+cameras%2C+3D+stereo+movies%2C+dual+35mm+3d%2C+polarized+3d%2C+high-def+3d+video%2C+broadcast+3d%2C+3d+stereo+animation%2C+3D+Hi-definition+video%2C+full+color+stereo%2C+full+color+anaglyph%2C+3D+conversion%2C+red%2Fblue%2C+Liquid+Crystal+3D%2C+IMAX+3D%2C+3D+stereo+links%2C+3D+comics%2C+3D+stereoscopic+photography%2C+3D+digital+stills%2C+3D+HDTV%2C+3D+Internet%2C+3D+print';
var metaContents  = 'Nick+Brienza+is+a+3-D+photographer+who+works+on+assignment+providing+stereo+photography+services.+The+3-D+images+can+be+used+for+marketing+and+promotions+on+websites+and+through+mailings.Possible+venues%3A+travel%2C+real+estate%2C+architecture%2C+museums%2C+aquariums%2C+theme+parks%2C+resorts%2C+lodging%2FBB%2C+golf+course%2Fcommunity%2C+transportation%2C+nature%2C+sculpture%2C+people%2C+sports';
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();
};

