/* [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','2201',jdecode('Why+Clear+View+'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','2294',jdecode('Retractable+Doors'),jdecode(''), jdecode('%2F2294%2Findex.html'), 'true',[ 
		['PAGE','52901',jdecode('Go+Green%21%21%21'),jdecode(''), jdecode('%2F2294%2F52901.html'), 'true',[],'',''],
		['PAGE','79601',jdecode('Product+Features'),jdecode(''), jdecode('%2F2294%2F79601.html'), 'true',[],'',''],
		['PAGE','63101',jdecode('Our+Patents'),jdecode(''), jdecode('%2F2294%2F63101.html'), 'true',[],'',''],
		['PAGE','8401',jdecode('FAQ'),jdecode(''), jdecode('%2F2294%2F8401.html'), 'true',[],'',''],
		['PAGE','3901',jdecode('Warranty'),jdecode(''), jdecode('%2F2294%2F3901.html'), 'true',[],'',''],
		['PAGE','4201',jdecode('Gallery'),jdecode(''), jdecode('%2F2294%2F4201.html'), 'true',[],'',''],
		['PAGE','2252',jdecode('Maintenance'),jdecode(''), jdecode('%2F2294%2F2252.html'), 'true',[],'',''],
		['PAGE','4222',jdecode('Standard+Colors'),jdecode(''), jdecode('%2F2294%2F4222.html'), 'true',[],'','']
	],'',''],
	['PAGE','54601',jdecode('Retractable+Windows'),jdecode(''), jdecode('%2F54601%2Findex.html'), 'true',[ 
		['PAGE','57501',jdecode('Design+Specs'),jdecode(''), jdecode('%2F54601%2F57501.html'), 'true',[],'','']
	],'',''],
	['PAGE','4243',jdecode('MotionScreen'),jdecode(''), jdecode('%2F4243%2Findex.html'), 'true',[ 
		['PAGE','55701',jdecode('Go+Green%21%21%21'),jdecode(''), jdecode('%2F4243%2F55701.html'), 'true',[],'',''],
		['PAGE','51801',jdecode('Features'),jdecode(''), jdecode('%2F4243%2F51801.html'), 'true',[],'',''],
		['PAGE','54201',jdecode('Standard+Colors'),jdecode(''), jdecode('%2F4243%2F54201.html'), 'true',[],'',''],
		['PAGE','55722',jdecode('Design+Specs'),jdecode(''), jdecode('%2F4243%2F55722.html'), 'true',[],'','']
	],'',''],
	['PAGE','64901',jdecode('Buy+Wholesale'),jdecode(''), jdecode('%2F64901.html'), 'true',[],'',''],
	['PAGE','72401',jdecode('Canada'),jdecode(''), jdecode('%2F72401.html'), 'true',[],'',''],
	['PAGE','86701',jdecode('International'),jdecode(''), jdecode('%2F86701.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('ONLINE+COUPONS'),jdecode(''), jdecode('%2F7001%2Findex.html'), 'false',[ 
		['PAGE','50801',jdecode('Home+Shows'),jdecode(''), jdecode('%2F7001%2F50801.html'), 'false',[],'','']
	],'',''],
	['PAGE','96301',jdecode('Online+Coupons'),jdecode(''), jdecode('%2F96301.html'), 'false',[],'',''],
	['PAGE','96201',jdecode('ONLINE+COUPONS'),jdecode(''), jdecode('%2F96201.html'), 'false',[],'',''],
	['PAGE','2273',jdecode('Contact+Us'),jdecode(''), jdecode('%2F2273.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Daily';
theSitetree.paletteFamily='AED0E8';
theSitetree.keyvisualId='7297';
theSitetree.keyvisualName='kv_7297.jpg';
theSitetree.fontsetId='16457';
theSitetree.graphicsetId='12151';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'brinkster',
  product: 'WSCSYSSSSLYTCVUO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Daily',
				paletteFamily: 	'AED0E8',
				keyvisualId: 	'7297',
				keyvisualName: 	'kv_7297.jpg',
				fontsetId: 		'16457',
				graphicsetId: 	'12151',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20111118-102906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20110922-113520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20110922-102305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2273',
internalId:  '',
customField: '20110922-112739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20110324-162721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20110324-161910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4222',
internalId:  '',
customField: '20110324-162844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4243',
internalId:  '',
customField: '20110401-134430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20110211-133339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20110922-113303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50801',
internalId:  '',
customField: '20100308-100321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51801',
internalId:  '',
customField: '20110922-113818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20110324-163030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54201',
internalId:  '',
customField: '20110401-134631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54601',
internalId:  '',
customField: '20110401-141924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55701',
internalId:  '',
customField: '20110322-135618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55722',
internalId:  '',
customField: '20100208-142342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57501',
internalId:  '',
customField: '20100208-155514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63101',
internalId:  '',
customField: '20110324-144933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64901',
internalId:  '',
customField: '20110922-113910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72401',
internalId:  '',
customField: '20111118-101507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79601',
internalId:  '',
customField: '20110922-102720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86701',
internalId:  '',
customField: '20110922-114020'
};
webappMappings['1501']=webappMappings['1501-18302403']={
webappId:    '1501',
documentId:  '2201',
internalId:  '18302403',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96301',
internalId:  '',
customField: '20111118-110758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96201',
internalId:  '',
customField: '20111118-104521'
};
var webAppHostname = 'wsc.brinkster.com:80';
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INLWNG';
var companyName   = 'Clear+View+Retractable+Screen%E2%84%A2Systems.+Life+Just+Got+A+Little+Better%21';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

