/* [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','7501',jdecode('Home'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','7552',jdecode('Contact%2FOrder'),jdecode(''),'/7552.html','true',[],'',''],
	['PAGE','7657',jdecode('Party%2FClass+Your+Area'),jdecode(''),'/7657.html','true',[],'',''],
	['PAGE','7573',jdecode('Events'),jdecode(''),'/7573.html','true',[],'',''],
	['PAGE','28701',jdecode('World+of+Fitness+%26+Dance'),jdecode(''),'/28701.html','true',[],'',''],
	['PAGE','10901',jdecode('HOT+Sites'),jdecode(''),'/10901.html','true',[],'',''],
	['PAGE','7615',jdecode('Survey%2FProducts'),jdecode(''),'/7615.html','true',[],'',''],
	['PAGE','7594',jdecode('Glamour+Pole+DVD'),jdecode(''),'/7594.html','true',[],'',''],
	['PAGE','10922',jdecode('Conditions%2FPrivacy'),jdecode(''),'/10922.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Hollywood';
theSitetree.paletteFamily='614DBB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26580';
theSitetree.graphicsetId='13396';
theSitetree.contentColor='2A2A9D';
theSitetree.contentBGColor='F0F2C4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Hollywood',
				paletteFamily: 	'614DBB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26580',
				graphicsetId: 	'13396',
				contentColor: 	'2A2A9D',
				contentBGColor: 'F0F2C4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-12442']={
webappId:    '7008',
documentId:  '7552',
internalId:  '12442',
customField: 'language:en;country:US;'
};
webappMappings['7005']=webappMappings['7005-1513']={
webappId:    '7005',
documentId:  '7615',
internalId:  '1513',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20100825-234246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20100825-233734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7552',
internalId:  '',
customField: '20100723-221940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7573',
internalId:  '',
customField: '20100825-234202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7594',
internalId:  '',
customField: '20090421-205650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7615',
internalId:  '',
customField: '20100519-223923'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '28701',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7657',
internalId:  '',
customField: '20100825-233849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100402-220200'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14895109']={
webappId:    '1501',
documentId:  '7501',
internalId:  '14895109',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10922',
internalId:  '',
customField: '20090121-201051'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INE3S3';
var companyName   = 'Pole+Dance+Factory';
var htmlTitle	  = 'Pole+dancing+DVDs%2C+classes%2C+stages+and+dance+pole+sales.';
var metaKeywords  = 'pole+dancing%2C+pole+dance%2C+dance+poles%2C+stage%2C+stages%2C+pole+stages%2C+pole+dance+classes%2C+pole+dance+lessons%2C+stripper%2C+stripper+poles%2C+exotic+dance%2C+vixen%2C+fitness%2C+weight+loss%2C+dance+pole+stages%2C+platforms%2C+';
var metaContents  = 'Welcome+to+WORLD+OF+POLE+DANCING+for+Every+Day+Women%21DETROIT%2C+WAYNE%2C+OAKLAND%2C+WASHTENAW++MACOMB+MICHIGAN+.+OHIO++ILLINOIS%2C+MAINE.+Pennsylvania+POLE+DANCING+CLASSES+-+POLE+DANCE+LESSONS+-+DANCE+POLE+SALES+-+POLE+STAGES+-+POLE+PARTIES+stripper+poles+-+pole+dancing+DVD+dvds+';
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();
};
