/* [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 theSitetree=[ 
	['PAGE','5601',jdecode('Home'),jdecode(''),'/5601.html','true',[],''],
	['PAGE','19101',jdecode('Products'),jdecode(''),'/19101.html','true',[],''],
	['PAGE','5652',jdecode('News'),jdecode(''),'/5652.html','true',[],''],
	['PAGE','5673',jdecode('Contact'),jdecode(''),'/5673.html','true',[],''],
	['PAGE','5736',jdecode('Imprint'),jdecode(''),'/5736.html','true',[],''],
	['PAGE','18801',jdecode('You+Tube+Me'),jdecode(''),'/18801.html','true',[],''],
	['PAGE','18822',jdecode('Unethical+Judges+'),jdecode(''),'/18822.html','true',[],''],
	['PAGE','17301',jdecode('Chief+Misconduct'),jdecode(''),'/17301.html','true',[],''],
	['PAGE','19122',jdecode('Fun+Page'),jdecode(''),'/19122.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Citylights';
theSitetree.paletteFamily='333366';
theSitetree.keyvisualId='10436';
theSitetree.keyvisualName='kv_10436.jpg';
theSitetree.fontsetId='26570';
theSitetree.graphicsetId='13392';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333366';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Citylights',
				paletteFamily: 	'333366',
				keyvisualId: 	'10436',
				keyvisualName: 	'kv_10436.jpg',
				fontsetId: 		'26570',
				graphicsetId: 	'13392',
				contentColor: 	'FFFFFF',
				contentBGColor: '333366',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3E3535',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20090811-193244'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20090429-232407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5673',
internalId:  '',
customField: '20090111-042204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19122',
internalId:  '',
customField: '20090611-082100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090928-052301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5736',
internalId:  '',
customField: '20090427-112157'
};
webappMappings['1501']=webappMappings['1501-13764323']={
webappId:    '1501',
documentId:  '5601',
internalId:  '13764323',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20090111-035328'
};
webappMappings['7050']=webappMappings['7050-6826']={
webappId:    '7050',
documentId:  '18822',
internalId:  '6826',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20090609-100439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18822',
internalId:  '',
customField: '20090928-050235'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '19122',
internalId:  'search',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEIV6';
var companyName   = 'Ultra+Great+Gifts';
var htmlTitle	  = 'Ultra+Great+Gifts';
var metaKeywords  = 'local+sweet+stop%2C+UGG+TV%2C+music%2C+Emerson+Sending+All+My+Love+Out%2C+clayton+county%2C+news%2C+great%2C+court%2C+chief%2C+jeffrey+turner%2C+gifts%2C+arrested%2C+ultra%2C+global%2C+tv+listings%2C+leora%2C+chief%2C+arrested%2C+shopping%2C+Jeff+Turner%2C+clayton%2C+county%2Csuit%2C+gifts%2C+marketing%2C+jobs%2C+pbs+kids%2C+great+prices%2C+dvds%2C+dollar+store%2C+l+a+s%2C+free+advertising%2C+downloads%2C+ultra%2C+Americas+dying%2C+batteries%2C+books%2C+jokes%2Cfun%2C+facts%2C+get+the+dirt%2C+a1scoops';
var metaContents  = 'Internet+shopping+center%2C+news%2C+LAS+Records%2C+ga%2C+great%2C+Emerson%2C+Sending+All+My+Love+Out%2C+court%2C+chief%2C+jeffrey+turner%2C+corrution+reporter+here%2C+son%2C+arrested%2C+ultra%2C+global%2C+tv+listings%2C+leora%2C+usb+cables%2C+arrested%2C+shopping%2C+car+sterio+parts%2C+america+curruption%2C+county%2C+suit%2C+gifts%2C+marketing%2C+jobs%2C+pbs+kids%2C+great+prices%2C+dvds%2C+dollar+store%2C+l+a+s%2C+free+advertising%2C+downloads%2C+is+America+safe%2C+police%2C+batteries%2C+books%2C+jokes%2C+facts%2C+movies%2C+puppet+power%2C+clayton+county';
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();
};
