/* [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','10901',jdecode('ABOUT+US'),jdecode(''), jdecode('%2F10901.html'), 'true',[],'',''],
	['PAGE','11343',jdecode('DESIGN+SERVICES'),jdecode(''), jdecode('%2F11343.html'), 'true',[],'',''],
	['PAGE','11101',jdecode('WALL+ART'),jdecode(''), jdecode('%2F11101%2Findex.html'), 'true',[ 
		['PAGE','11301',jdecode('GALLERY+-+1'),jdecode(''), jdecode('%2F11101%2F11301.html'), 'true',[],'',''],
		['PAGE','56581',jdecode('BLACK+%26+WHITE'),jdecode(''), jdecode('%2F11101%2F56581.html'), 'true',[],'','']
	],'',''],
	['PAGE','30683',jdecode('CONCEPT+CALENDARS'),jdecode(''), jdecode('%2F30683.html'), 'true',[],'',''],
	['PAGE','11501',jdecode('CONTACT+US'),jdecode(''), jdecode('%2F11501.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20111210-233039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100828-093906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20100804-124450'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11343',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11343',
internalId:  '',
customField: '20100804-125837'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10901',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100804-113025'
};
webappMappings['7008']=webappMappings['7008-29905']={
webappId:    '7008',
documentId:  '11501',
internalId:  '29905',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-31942569']={
webappId:    '1501',
documentId:  '10901',
internalId:  '31942569',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30683',
internalId:  '',
customField: '20110710-011815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56581',
internalId:  '',
customField: '20100828-094529'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '56581',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '30683',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11501',
internalId:  '',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INVH5X';
var companyName   = 'STYLE+and+FOCUS';
var htmlTitle	  = 'STYLE+and+FOCUS';
var metaKeywords  = '%3Cmeta+name%3D%22google-site-verification%22+content%3D%22XMjrUgsvmAEn33y9_rVjULal-xd2D1hi-HkLLS4Rn1M%22+%2F%3E%0AStyle+and+Focus%2C+Photography%2CStock+Photography%2C++Digital+images%2C+Fotosearch%2C+Black+and+White+Photography%2C+black+and+white+images%2C+proprietary+images%2C+Wall+Art%2C+Art%2C+Interior+Design%2C+Interior+Styling%2C+Styling+Services%2C+Interior+Decorator%2C+architecture%2C+Graphic%2C+Graphic+Design%2C+design+services%2C+printing%2C+design+consultants%2C+style%2C+focus%2C+wall+prints%2C+corporate+image%2C+corporate+marketing%2C+residential+styling%2C+Koh+Samui%2C+Thailand%2C+Asia%2C+beach+life%2C+Tourism+of+Thailand%2C+promotion%2C+marketing%2C+concept%2C+calendars%2C+art+calendars%2C+Illustration%2C+Publishing+and+Print%2C+oversize+prints%2C+prints+on+canvas%2C+stickers%2C+photographic+paper%2C+vinyl+banners%2C+media%2C++photo+source%2C+google%2C+bling%2C+yahoo%2C+safari%2C+mozilla';
var metaContents  = '%3Cmeta+name%3D%22google-site-verification%22+content%3D%22XMjrUgsvmAEn33y9_rVjULal-xd2D1hi-HkLLS4Rn1M%22+%2F%3E%0A+Style+and+Focus+offers+the+following+services%3A++Photographic+and+Digital+Wall+Art%2C+Over-sized+Prints+on+Photographic+Paper%2C+Canvas%2C+Vinyl+and+Sticker%3B+Colour+Consulting%2C++Interior+Styling+%28residential+and+corporate%29%2C+Interior+Design%2C+Consulting%2C+Graphic+Design%2C+Illustration+for+Publishing+and+Print%2C+Concept+Calendars';
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();
};

