/* [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','6401',jdecode('Ace+Tattoo+and+Body+Piercing'),jdecode(''), jdecode('%2F6401.html'), 'true',[],'',''],
	['PAGE','6452',jdecode('Skull%2C+Flowers%2C+Joe+Di+Poalo'),jdecode(''), jdecode('%2F6452.html'), 'true',[],'',''],
	['PAGE','8012',jdecode('Kaos%2C+the+Elephant'),jdecode(''), jdecode('%2F8012.html'), 'true',[],'',''],
	['PAGE','10012',jdecode('Starz%2C+Cover+up.'),jdecode(''), jdecode('%2F10012.html'), 'true',[],'',''],
	['PAGE','8212',jdecode('New+Blossoms%2C+Lizard+Tattoo'),jdecode(''), jdecode('%2F8212.html'), 'true',[],'',''],
	['PAGE','8612',jdecode('Happy+Feet%2C+Autoclave+'),jdecode(''), jdecode('%2F8612.html'), 'true',[],'',''],
	['PAGE','9612',jdecode('Neck+Tree%2C'),jdecode(''), jdecode('%2F9612.html'), 'true',[],'',''],
	['PAGE','9812',jdecode('Can+you+hear+me+now%3F'),jdecode(''), jdecode('%2F9812.html'), 'true',[],'',''],
	['PAGE','10312',jdecode('+Map%2C++Joe+Di+Paolo'),jdecode(''), jdecode('%2F10312.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20120106-134742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6452',
internalId:  '',
customField: '20111231-091257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8012',
internalId:  '',
customField: '20111231-091354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8212',
internalId:  '',
customField: '20111231-091613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8612',
internalId:  '',
customField: '20120209-231831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9612',
internalId:  '',
customField: '20120209-231807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9812',
internalId:  '',
customField: '20111231-090506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10012',
internalId:  '',
customField: '20120209-231919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10312',
internalId:  '',
customField: '20120209-231714'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INVJ9L';
var companyName   = 'Ace+Tattoo+and+Body+Peircing';
var htmlTitle	  = 'Ace+Tattoo+%26+Piercing+Establishment';
var metaKeywords  = 'Tattooing+Minneapolis%2C+Body+Piercing%2C+Laser+Tattoo+Removal%2C+Maple+Grove%2C+Plymouth%2C+Body+Piercing+Jewelry%2C+Golden+Valley%2C+Permanent+Make-up%2C+Cosmetic+Tattooing+with+Anesthetic%2C+Custom+Cover-up+tattoo%2C+Tattoo+Art+Designs%2C+Tattoo+Art+Gallery%2C+laser+tattoo+removal%2C+kanji+tattoos%2C+Irish+tattoos%2C+Floral+tattoos%2C+Cross+tattoos%2C+body+piercing+jewelery%2C+Jack+Sparrow+tattoos%2C+tattoo+art+gallery%2C+feminine+tattoos%2C+horse+tattoos%2C+neck+tattoos%2C+original+tattoo+designs%2C+Chinese+luck+tattoos%2C+Foot+tattoos%2C+Knuckle+tattoos%2C+eye+liner+tattoos%2C+lettering+tattoos%2C+Wing+tattoos%2C+back+tattoos%2C+Permanent+Eye+liner+laser+Removal%2C+Permanent+make-up+laser+removal%2C+State+of+Minnesota+tattoo+laws%2C+Minor+tattooing%2C+Minor+Body+Piercing%2C+Tattoo+Price+Quotes%2C+Tattoo+Parties%2C+Body+Piercing+Prices%2C+Robinsdale%2C+Wazata%2C+Gang+Tattoo+Removal%2C';
var metaContents  = '+ACE+TATTOO+and+BODY+PIERCING+is+a+full+service+Body+Art+Establishment+offering%2C+LASER+TATTOO+REMOVAL%2C+ORIGINAL+TATTOO+ART%2C+PERMANENT+MAKE-UP%2C+and+CUSTOM+COVER-UP+Serving+Minneapolis%2C+Bloomington%2C+Saint+Louis+Park%2C+New+Hope%2C+Crystal%2C+Golden+Valley%2C+Plymouth%2C+Maple+Grove%2C+Eden+Prairie%2C+Brooklyn+Center%2C';
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();
};

