/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','752',jdecode('Products'),jdecode(''),'/752/index.html','true',[ 
		['PAGE','773',jdecode('Kids+Chess+Set'),jdecode(''),'/752/773.html','true',[],''],
		['PAGE','794',jdecode('Building+Blocks'),jdecode(''),'/752/794.html','true',[],''],
		['PAGE','8001',jdecode('Online+Store'),jdecode(''),'/752/8001.html','true',[],'']
	],''],
	['PAGE','857',jdecode('Puzzles+%26+Graphics'),jdecode(''),'/857.html','true',[],''],
	['PAGE','878',jdecode('Free+Chessblocks'),jdecode(''),'/878.html','true',[],''],
	['PAGE','35501',jdecode('Contact+Us'),jdecode(''),'/35501.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='9241';
theSitetree.keyvisualName='kv3.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12763';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Transluszent',
				paletteFamily: 	'660000',
				keyvisualId: 	'9241',
				keyvisualName: 	'kv3.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12763',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090213-133001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20090205-181211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20090213-133512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20090203-172301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20090205-185810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20090129-190331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20090203-172704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20090131-192016'
};
webappMappings['7008']=webappMappings['7008-13089']={
webappId:    '7008',
documentId:  '35501',
internalId:  '13089',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INXFQ0';
var companyName   = 'Modern+Chess+Set+%26+Building+Blocks';
var htmlTitle	  = 'Chessblocks+-+Modern+Chess+Set++Building+Blocks';
var metaKeywords  = 'Innovative+chess+education%2C+Chess+pieces%2C+chess+set%2C+chessmen%2C+new+in+chess%2C+updated+chess%2C+geometric+chess%2C+chess+games%2C+building+blocks%2C+wooden+blocks%2C+universal%2C+amazing%2C+futuristic%2C+modern+chess%2C+unique+and+novelty+product%2C+free+chess%2C+innovative++chess+design%2C+children+chess%2C+chess+beginner%2C+chess+kids%2C+beginner+learning+tool%2C+family+chess%2C+geometric%2C+solids%2C+artistic+chess+design%2C+chess+education%2C+chess+toys%2C+chess+graphics%2C+chess+art%2C+best+in+chess%2C+chess+champion%2C+Staunton+style%2C+universal%2C+twin+towers%2C+rangle%2C+tangle%2C+cross%2C+geometric%2C+cross%2C+star%2C+cube%2C+cubic+design%2C+cubism+beautiful%2C+design%2C+graphic+chess%2C+chess+notation%2C+chess+diagrams%2C+chess+pictures%2C+chess+origins%2C+history+of+chess%2C+future+of+chess%2C+smart+chess%2C+chess+solutions%2C+chess+in+education%2C+educational+toys+and+games';
var metaContents  = 'META+content%3Ddocument+name%3Dresource-type++META+content%3Dchessblo+Tag+Generator+name%3DGenerator++META+content%3D10+name%3Drevisit-after++META+content%3DHobbies+name%3Dclassification++META+content%3DChessblocks%2C+innovative+chess+educational+toys+and+games+for+a+chess+beginner+and+children%2C+serve+double+duty+of+being+building+blocks+and+chess+pieces.++The+geometric+shapes+hint+the+way+they+move+and+give+clearer+understanding+of+the+basics+and+movements+of+pieces.++name%3Ddescription++META+content%3Dinnovative+chess+education%2C+modern+chess+set%2C+chess+pieces%2C+free+chessblocks%2C+children+games+and+toys%2C+educational+games+and+toys%2C+kids+smarter+starter%2C+geometry%2C+geometric%2C+futuristic+design%2C+Parent+and+child+interactive+game%2C+universal+chess%2C+chess+evolution%2C+intuitive+chess+set%2C+building+blocks%2C+wooden+blocks%2C+chess+pieces%2C+chess+learning%2C+chess+beginner%2C+chess+puzzles%2C+stauton+variations%2C+strategic+games+and+toys%2C+logical+thinking+develope%2C+chess+and+math+skills%2C+chessblocks%2C+notation%2C++name%3Dkeywords++META+content%3DALL+name%3Drobots++META+content%3DGlobal+name%3Ddistribution++META+content%3DSafe+For+Kids+name%3Drating++META+content%3DU-MAN+GAMES+name%3Dcopyright++META+content%3DJames+Coady+name%3Dauthor++META+http-equiv%3Dreply-to+content%3Dgizmogames%40gmail.com++META+http-equiv%3DContent-Language+content%3DEnglish++';
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();
};
