/* [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','5101',jdecode('Message+to+You'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','5152',jdecode('Meet+Emma'),jdecode(''), jdecode('%2F5152.html'), 'true',[],'',''],
	['PAGE','41501',jdecode('More+Details'),jdecode(''), jdecode('%2F41501.html'), 'true',[],'',''],
	['PAGE','50901',jdecode('Mediterranean+'),jdecode(''), jdecode('%2F50901.html'), 'true',[],'',''],
	['PAGE','78101',jdecode('Middle+Eastern'),jdecode(''), jdecode('%2F78101.html'), 'true',[],'',''],
	['PAGE','122384',jdecode('Mood+Nursery'),jdecode(''), jdecode('%2F122384.html'), 'true',[],'',''],
	['PAGE','50943',jdecode('Mood+Board'),jdecode(''), jdecode('%2F50943.html'), 'true',[],'',''],
	['PAGE','56101',jdecode('Media+'),jdecode(''), jdecode('%2F56101.html'), 'true',[],'',''],
	['PAGE','54901',jdecode('Memorable+Words'),jdecode(''), jdecode('%2F54901.html'), 'true',[],'',''],
	['PAGE','42501',jdecode('Message+Us'),jdecode(''), jdecode('%2F42501.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Startup';
theSitetree.paletteFamily='978561';
theSitetree.keyvisualId='1400';
theSitetree.keyvisualName='rose.jpg';
theSitetree.fontsetId='235';
theSitetree.graphicsetId='290';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netfirms',
  product: 'WSCSYSSSSLY0XYND'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Startup',
				paletteFamily: 	'978561',
				keyvisualId: 	'1400',
				keyvisualName: 	'rose.jpg',
				fontsetId: 		'235',
				graphicsetId: 	'290',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'978561',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FF0000',
				e_color: 		'FF0000',
				f_color: 		'FF0000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20110104-103359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20111011-033336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50901',
internalId:  '',
customField: '20100325-055000'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41501',
internalId:  '',
customField: '20100324-204811'
};
webappMappings['7008']=webappMappings['7008-915']={
webappId:    '7008',
documentId:  '42501',
internalId:  '915',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20100622-041129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78101',
internalId:  '',
customField: '20100325-050126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50943',
internalId:  '',
customField: '20100325-053235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54901',
internalId:  '',
customField: '20100325-055253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20100622-034643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122384',
internalId:  '',
customField: '20111011-081600'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'ANFI10INXVR0';
var companyName   = '';
var htmlTitle	  = 'Mood+Group+Interiors';
var metaKeywords  = 'Interiors%2C+Interior+Design%2C+Cyprus%2C+Paphos%2C+Resdiential+Property%2C+Kitchens%2C+Bathrooms%2C+Bedrooms%2C+Living+Rooms%2C+Building%2C+Construction%2C+Furniture%2C+Limassol%2C+Turnkey+Interiors%2C+Architecture%2C+New+Build+Property%2C+Dubai%2C+Abu+Dhabi%2C+Lighting%2C+Tiling%2C+Flooring%2C+Home+Staging%2C+Show+Homes%2C+Hotel+Bedrooms%2C+Hotel+Bathrooms%2C++Property+search%2C+property+sales%2C+Land%2C+Recruitment%2C+LEED+training%2C+Energy+Performance+Certificates%2C+Free+Lance+Interior+Design%2C+Art+Selection';
var metaContents  = 'Mood+Group+Interiors+is+a+Boutique+design+practice+which+provides+Interior+Design+and+Property+related+services%2C+to+clients+across+the+Mediterranean+and+the+Middle+East.+Our+aim+is+to+create+and+execute+elegant%2C+stylish+and+functional+Interiors%2C+whilst+delivering+the+maximum+value+to+our+clients+and+their+chosen+spaces.';
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();
};

