/* [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','5301',jdecode('Home'),jdecode(''), jdecode('%2F5301.html'), 'true',[],'',''],
	['PAGE','29322',jdecode('About+Irish+Dance'),jdecode(''), jdecode('%2F29322.html'), 'true',[],'',''],
	['ITEM','229823',jdecode('Hard+Shoes'),jdecode(''), jdecode('http%3A%2F%2Fwww.redheaddancer.com%2Fstore%2Firish_dance_hard_shoes.html'), 'true',[],'',''],
	['ITEM','229824',jdecode('Soft+Shoes'),jdecode(''), jdecode('http%3A%2F%2Fwww.redheaddancer.com%2Fstore%2Firish_dance_soft_shoes.html'), 'true',[],'',''],
	['ITEM','229825',jdecode('Poodle+Socks'),jdecode(''), jdecode('http%3A%2F%2Fwww.redheaddancer.com%2Fstore%2Firish_dance_socks.html'), 'true',[],'',''],
	['ITEM','229826',jdecode('Exchanges'),jdecode(''), jdecode('http%3A%2F%2Fwww.redheaddancer.com%2Fstore%2Fexchanges.html'), 'true',[],'',''],
	['ITEM','229827',jdecode('Contact+Us'),jdecode(''), jdecode('http%3A%2F%2Fwww.redheaddancer.com%2Fstore%2Fcontact_us.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='BB9C60';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='365';
theSitetree.graphicsetId='417';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='BB9C60';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'BB9C60',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'365',
				graphicsetId: 	'417',
				contentColor: 	'FFFFFF',
				contentBGColor: 'BB9C60',
				a_color: 		'BB9C60',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20120118-182549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29322',
internalId:  '',
customField: '20101211-194850'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '29322',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5301',
internalId:  '',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEN41';
var companyName   = 'IRISH+DANCE+SHOE+-+Manufacture+%26+Sales';
var htmlTitle	  = 'IRISH+DANCE+SHOES+by+Redhead+Industries';
var metaKeywords  = 'Irish+dance+shoes%2C+Irish+dancing+shoes%2C+discount+Irish+dance+shoes%2C+hard+shoes%2C+soft+shoes%2C+step+dancing+shoes%2C+jig+shoes%2C++reel+shoes%2C+Irish+step+shoes%2C+poodle+socks%2C+irish+dance+socks%2C+dance+ghillies%2C+Irish+dance+pumps%2C+heavy+dance+shoes%2C+slip+jig+shoes%2C+treble+jig+shoes%2C+Irish+dance+shoe+history%2C+Advanced+beginner+dance+shoes%2C++Irish+dance+novice%2C+irish+dancer%2C+open+championship%2Cirish+shoe+chart%2C+Irish+tap+shoes%2C++boys+Irish+reel+shoes%2C+men+irish+dance+shoes%2C+girls+irish+dance+shoes+%2C+child+dance+shoes%2C+irish+dance+supply%2C+irish+dance+supplies%2C+irish+dance+socks%2C+dance+socks%2C+popcorn+socks%2C+antonio+pacelli%2C+AP+socks%2C++irish+dance%2Cirish+fesianna%2C+all+worlds+irish+dance%2C+nationals+irish+dance%2C+irish+dance+competitions%2C+rutherford+products%2C+redhead+industries%2C+redhead+irish+dance+shoes%2C+Riverdance%2C+Lord+Dance%2C+Rose+White%2C+Francis+White%2C+red+head+dancer%2C+red+head+shoes%2C+redhead+shoes%2C+redhead+irish+shoes%2C+rpshoes%2C+rp+irish+shoes%2C+Erin%2C+Ireland%2C+Celtic%2C+Irish';
var metaContents  = 'Irish+Dance+Shoe+Manufacture+and+Sales+Wholesale+Retail.';
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();
};

