/* [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(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','452',jdecode('Quem+somos'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','473',jdecode('Reprodutores'),jdecode(''), jdecode('%2F473%2Findex.html'), 'true',[ 
		['PAGE','494',jdecode('Beagle'),jdecode(''), jdecode('%2F473%2F494.html'), 'true',[],'',''],
		['PAGE','515',jdecode('Lhasa+Apso'),jdecode(''), jdecode('%2F473%2F515.html'), 'true',[],'',''],
		['PAGE','42501',jdecode('Shih+Tzu'),jdecode(''), jdecode('%2F473%2F42501.html'), 'true',[],'','']
	],'',''],
	['PAGE','578',jdecode('Dispon%C3%ADveis'),jdecode(''), jdecode('%2F578%2Findex.html'), 'true',[ 
		['PAGE','599',jdecode('Beagle'),jdecode(''), jdecode('%2F578%2F599.html'), 'true',[],'',''],
		['PAGE','620',jdecode('Lhasa+Apso'),jdecode(''), jdecode('%2F578%2F620.html'), 'true',[],'',''],
		['PAGE','42522',jdecode('Shih+Tzu'),jdecode(''), jdecode('%2F578%2F42522.html'), 'true',[],'','']
	],'',''],
	['PAGE','13301',jdecode('Instala%C3%A7%C3%B5es'),jdecode(''), jdecode('%2F13301.html'), 'true',[],'',''],
	['PAGE','12001',jdecode('%C3%81lbum+de+Fotos'),jdecode(''), jdecode('%2F12001.html'), 'true',[],'',''],
	['PAGE','21001',jdecode('News'),jdecode(''), jdecode('%2F21001.html'), 'true',[],'',''],
	['PAGE','16701',jdecode('Links+'),jdecode(''), jdecode('%2F16701.html'), 'true',[],'',''],
	['PAGE','16722',jdecode('Contato'),jdecode(''), jdecode('%2F16722.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7112';
theSitetree.keyvisualId='8815';
theSitetree.keyvisualName='KV_01.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12654';
theSitetree.contentColor='FF7112';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7112',
				keyvisualId: 	'8815',
				keyvisualName: 	'KV_01.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12654',
				contentColor: 	'FF7112',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-785049b691cec1d450e53d6b61a377b2']={
webappId:    '7060',
documentId:  '12001',
internalId:  '785049b691cec1d450e53d6b61a377b2',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-b8eca44c8ae0cd1671db294ff470c5d9']={
webappId:    '7060',
documentId:  '13301',
internalId:  'b8eca44c8ae0cd1671db294ff470c5d9',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-1747']={
webappId:    '7008',
documentId:  '16722',
internalId:  '1747',
customField: 'language:pt;country:BR;'
};
webappMappings['1501']=webappMappings['1501-8201985']={
webappId:    '1501',
documentId:  '401',
internalId:  '8201985',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20111108-154935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20110104-173715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20110104-173841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20110104-174031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20110104-174209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20110104-174644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20111031-170302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20110426-185554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20111211-123510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42522',
internalId:  '',
customField: '20110907-142658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20090209-174818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20090209-174908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20111031-155615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20111031-155525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16722',
internalId:  '',
customField: '20070803-123940'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INL5CV';
var companyName   = 'CANIL+FLAGSTAFF';
var htmlTitle	  = 'www.canilflagstaff.com';
var metaKeywords  = 'canil%2C+kennel%2C+criador%2C+breeder%2C+c%C3%A3o%2C+dog%2C+beagle%2C+lhasa+apso%2C+lhasa%2C+pug%2C+york%2C+yorkshire+terrier%2C+cachorro%2C+filhote%2C+puppy%2C+estima%C3%A7%C3%A3o%2C+cria%C3%A7%C3%A3o%2C+perro%2C+chien';
var metaContents  = 'canil%2C+kennel%2C+criador%2C+breeder%2C+c%C3%A3o%2C+dog%2C+lhasa+apso%2C+beagle%2C+pug+yorkshire+terrier%2C+filhote%2C+puppy%2C+perro%2C+chien%2C+';
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();
};

