/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('About+us'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','494',jdecode('Opening+hours'),jdecode(''),'/452/494.html','true',[],'','']
	],'',''],
	['PAGE','536',jdecode('Service+Menu'),jdecode(''),'/536/index.html','true',[ 
		['PAGE','13501',jdecode('Hairdressing'),jdecode(''),'/536/13501.html','true',[],'',''],
		['PAGE','32301',jdecode('Make+Up+Artist'),jdecode(''),'/536/32301.html','true',[],'','']
	],'',''],
	['PAGE','515',jdecode('Monthly+Promotions'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','88343',jdecode('Formal+Packages'),jdecode(''),'/88343.html','true',[],'',''],
	['PAGE','31801',jdecode('Hair+Extensions'),jdecode(''),'/31801.html','true',[],'',''],
	['PAGE','31301',jdecode('Photo+Gallery'),jdecode(''),'/31301.html','true',[],'',''],
	['PAGE','74843',jdecode('Bronzed+Babes'),jdecode(''),'/74843.html','true',[],'',''],
	['PAGE','77543',jdecode('Ipswich+Cup'),jdecode(''),'/77543.html','true',[],'',''],
	['PAGE','557',jdecode('Contact'),jdecode(''),'/557.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='D24C59';
theSitetree.keyvisualId='606';
theSitetree.keyvisualName='federn.jpg';
theSitetree.fontsetId='126';
theSitetree.graphicsetId='143';
theSitetree.contentColor='F877A1';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kreis',
				paletteFamily: 	'D24C59',
				keyvisualId: 	'606',
				keyvisualName: 	'federn.jpg',
				fontsetId: 		'126',
				graphicsetId: 	'143',
				contentColor: 	'F877A1',
				contentBGColor: '000000',
				a_color: 		'D24C59',
				b_color: 		'F877A1',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4900503']={
webappId:    '1501',
documentId:  '401',
internalId:  '4900503',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100830-091409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20100207-091228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100118-081401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74843',
internalId:  '',
customField: '20100131-003802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20090920-094259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20090920-100005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20090920-195945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88343',
internalId:  '',
customField: '20100412-051212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20100830-090800'
};
webappMappings['7060']=webappMappings['7060-bf1fc0c1fb4b4aa823d6cedbe41adc96']={
webappId:    '7060',
documentId:  '31301',
internalId:  'bf1fc0c1fb4b4aa823d6cedbe41adc96',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31301',
internalId:  '',
customField: '20080630-063912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20100207-081727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20080630-071523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77543',
internalId:  '',
customField: '20100213-052939'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN25M9';
var companyName   = 'P+I+N+K+++Z+O+M+B+I+E++++hair+designers';
var htmlTitle	  = 'Pink+Zombie+Hair+Designers';
var metaKeywords  = 'hair%2C+hairdresser%2C+hair+stylist%2C+acrylic+nails%2C+nail+Tech%2C+hair+extensions%2C+salon%2C+extensions%2C+dreadlocks%2C+ipswich+hairdresser%2C+straightening%2C+waxing%2C+ipswich+salon';
var metaContents  = 'Pink+Zombie+is+Ipswichs+Premier+Hairdressing+Salon.++Hair+Extensions%2C+Dreadlocks%2C+Colours%2C+Fashion+Style+Cuts%2C+Chemical+Straightening%2C+Weddngs%2C+Formals%2C+Acrylic+and+Gel+Nails...++we+are+situated+on+84+Cemetery+Rd%2C+Raceview...phone+%2807%29+3202+4727...www.pinkzombie.com.au';
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();
};
