/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','34943',jdecode('Featured+Products'),jdecode(''),'/34943/index.html','true',[ 
		['PAGE','34964',jdecode('Home+Editions+'),jdecode(''),'/34943/34964.html','true',[],'',''],
		['PAGE','34985',jdecode('Solariums'),jdecode(''),'/34943/34985.html','true',[],'',''],
		['PAGE','35006',jdecode('Conservatories'),jdecode(''),'/34943/35006.html','true',[],'',''],
		['PAGE','35027',jdecode('Green+Houses'),jdecode(''),'/34943/35027.html','true',[],'',''],
		['PAGE','35048',jdecode('Skylights'),jdecode(''),'/34943/35048.html','true',[],'',''],
		['PAGE','35069',jdecode('Passive+Solar+Collectors'),jdecode(''),'/34943/35069.html','true',[],'',''],
		['PAGE','35090',jdecode('Canopies'),jdecode(''),'/34943/35090.html','true',[],'',''],
		['PAGE','39601',jdecode('Spa+and+Pool+Enclosures'),jdecode(''),'/34943/39601.html','true',[],'','']
	],'',''],
	['PAGE','11301',jdecode('Product+Inquiry'),jdecode(''),'/11301/index.html','true',[ 
		['PAGE','31601',jdecode('Heat+Sheild+Glass'),jdecode(''),'/11301/31601.html','true',[],'',''],
		['PAGE','31622',jdecode('Glazing+Options'),jdecode(''),'/11301/31622.html','true',[],'',''],
		['PAGE','31643',jdecode('Framing+'),jdecode(''),'/11301/31643.html','true',[],'','']
	],'',''],
	['PAGE','45001',jdecode('Upcoming+Events'),jdecode(''),'/45001.html','true',[],'',''],
	['PAGE','25601',jdecode('Our+Photo+Gallery'),jdecode(''),'/25601/index.html','true',[ 
		['PAGE','52001',jdecode('Before+and+After+Shoots'),jdecode(''),'/25601/52001.html','true',[],'',''],
		['PAGE','52501',jdecode('Finished+Projects+in+the+Greater+Toronto+Area'),jdecode(''),'/25601/52501.html','true',[],'',''],
		['PAGE','72401',jdecode('Pool+Enclosures'),jdecode(''),'/25601/72401.html','true',[],'',''],
		['PAGE','52022',jdecode('Current+Projects'),jdecode(''),'/25601/52022.html','true',[],'','']
	],'',''],
	['PAGE','47901',jdecode('Advertisement'),jdecode(''),'/47901.html','true',[],'',''],
	['PAGE','64501',jdecode('Customer+References'),jdecode(''),'/64501.html','true',[],'',''],
	['PAGE','8101',jdecode('Contact'),jdecode(''),'/8101.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='366';
theSitetree.graphicsetId='415';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='93A6CC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'366',
				graphicsetId: 	'415',
				contentColor: 	'FFFFFF',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100105-083458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20090306-085513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52001',
internalId:  '',
customField: '20090720-095306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52501',
internalId:  '',
customField: '20090306-085624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52022',
internalId:  '',
customField: '20090820-131238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34943',
internalId:  '',
customField: '20071219-114957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34964',
internalId:  '',
customField: '20080617-124029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34985',
internalId:  '',
customField: '20080306-132745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35006',
internalId:  '',
customField: '20080306-133245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35027',
internalId:  '',
customField: '20080306-130015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35048',
internalId:  '',
customField: '20080617-130259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35069',
internalId:  '',
customField: '20071219-133013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35090',
internalId:  '',
customField: '20080306-133404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39601',
internalId:  '',
customField: '20080617-131251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20080617-131416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20080618-073725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31622',
internalId:  '',
customField: '20080313-113058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31643',
internalId:  '',
customField: '20080313-113716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45001',
internalId:  '',
customField: '20100112-103503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47901',
internalId:  '',
customField: '20080306-123757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20080306-134136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72401',
internalId:  '',
customField: '20091005-073603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64501',
internalId:  '',
customField: '20091207-121557'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INVROE';
var companyName   = 'Florian+Sunrooms+Toronto+Inc.';
var htmlTitle	  = 'Florian+Sunrooms';
var metaKeywords  = 'floriansunroomstoronto+sunrooms+solariums+conservatories+kitchens+construction+sunrooms+solariums+solar+Florian+Sun+Rooms+Toronto+construction++skylights+sunrooms+glass+kitchens+kitchen+conservatories+kitchens+construction+Toronto+Renovations+mr+reno+thermally+broken+sealed+greenhouses+canopies+home+editions+pool+enclosures+patio+enclosures+spa+enclosures+passive+solar+collectors+heat+sheild+glass+glazing+framing+wood+aluminum+framing+PPG+pitsburg+paine+glass+florian+';
var metaContents  = 'floriansunroomstoronto+sunrooms+solariums+conservatories+kitchens+construction+spa+and+pool+enclosures+canapoies+skylights+greenhouses+conservatories+Florian+Sun+Rooms+Renovations+Mr.+Reno';
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();
};
