/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','4201',jdecode('Who+am+I%3F'),jdecode(''),'/4201.html','true',[],''],
	['PAGE','2252',jdecode('images'),jdecode(''),'/2252.html','true',[],''],
	['PAGE','2294',jdecode('guestbook'),jdecode(''),'/2294.html','true',[],''],
	['PAGE','2315',jdecode('email+from'),jdecode(''),'/2315.html','true',[],''],
	['PAGE','2336',jdecode('filmakers'),jdecode(''),'/2336.html','true',[],''],
	['PAGE','2357',jdecode('blog'),jdecode(''),'/2357.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Plainly';
theSitetree.paletteFamily='DF506E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32114';
theSitetree.graphicsetId='13927';
theSitetree.contentColor='DF506E';
theSitetree.contentBGColor='fcf5f9';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Plainly',
				paletteFamily: 	'DF506E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32114',
				graphicsetId: 	'13927',
				contentColor: 	'DF506E',
				contentBGColor: 'fcf5f9',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20091020-032041'
};
webappMappings['1002']=webappMappings['1002-2294aendu0in362z']={
webappId:    '1002',
documentId:  '2294',
internalId:  '2294aendu0in362z',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-17828']={
webappId:    '7008',
documentId:  '2315',
internalId:  '17828',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-10274']={
webappId:    '7050',
documentId:  '2357',
internalId:  '10274',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20091027-015038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20091020-030410'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20091020-032225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20091020-031538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2336',
internalId:  '',
customField: '20091020-032312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20091020-032407'
};
webappMappings['1501']=webappMappings['1501-20187339']={
webappId:    '1501',
documentId:  '2201',
internalId:  '20187339',
customField: '1501'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2201',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4201',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2252',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2294',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2315',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2336',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2357',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN362Z';
var companyName   = 'GHOST+CAT+the+MANEATER';
var htmlTitle	  = 'ghost+cat+fantasy+horror+thriller+super+natural+killer+tiger+sexy+asian+woman+america+jungle+girl+blood+naked+woman+boobs+pussy+cat+michael+jackson+mick+garris+cheryl+ling+christopher+walkens+man+eater+monsters+mythology+shape+shifter+transformer';
var metaKeywords  = 'ghost+cat+the+maneater+Asian+actress+starring+gin+ling%2C+also+written+by+gin+ling+fuh%2C+as+Maui%2C+cheryl+ling+cheryl+monk+produced+by+Mick+Garris%2C+Jack+Murphy%2C+Chris+Roth%2C+Chinese+woman+who+transform+transformer+between+a+woman+and+tiger.+Man+eater%2C+sexy%2C+horny%2C+bloody%2C+ghost+God+angels%2C+demons%2C+she+possess+supernatural+power+cougar+cat+tiger+panther.+eats+chainsaw+guy+leatherface+horror+fantasy+Nicholas+Cage+type+actor+Christopher+Walkens+Comic+Con+drawings+for+superhero+hero+naked+woman+boobs+ass+fuck+horny+bitches+bitch+asian+woman+tits+boobs+pussey+wet+passionate+sex+drugs+rock+and+roll';
var metaContents  = 'ghost+cat+the+maneater+from+Asia+Asian+actress+starring+gin+ling%2C+also+written+by+gin+ling+fuh%2C+produced+by+Mick+Garris%2C+Jack+Murphy%2C+Chris+Roth%2C+Chinese+woman+who+transform+transformer+between+a+woman+and+tiger.+Man+eater%2C+sexy%2C+horny%2C+bloody%2C+ghost+God+angels%2C+demons%2C+she+possess+supernatural+power+cougar+cat+tiger+panther.+eats+chainsaw+guy+leatherface+horror+fantasy+Nicholas+Cage+type+actor+Christopher+Walkens+Comic+Con+drawings+for+superhero';
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();
};
