/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','34315',jdecode('Our+Team'),jdecode(''),'/34315.html','true',[],''],
	['PAGE','31515',jdecode('Workhops+%26+Parties'),jdecode(''),'/31515.html','true',[],''],
	['PAGE','2052',jdecode('Classes'),jdecode(''),'/2052/index.html','true',[ 
		['PAGE','2701',jdecode('Salsa+Dance+%26+Rates'),jdecode(''),'/2052/2701.html','true',[],'']
	],''],
	['PAGE','6401',jdecode('Photo+%26+Videos'),jdecode(''),'/6401.html','true',[],''],
	['PAGE','2094',jdecode('Class+Schedule+Downloads'),jdecode(''),'/2094.html','true',[],''],
	['PAGE','7301',jdecode('Your+feedback'),jdecode(''),'/7301.html','true',[],''],
	['PAGE','2136',jdecode('Contact'),jdecode(''),'/2136.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='1284';
theSitetree.keyvisualName='trampolin.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='232';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Profile',
				paletteFamily: 	'990000',
				keyvisualId: 	'1284',
				keyvisualName: 	'trampolin.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'232',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'990000',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100227-153655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20100125-132547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20100227-155001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34315',
internalId:  '',
customField: '20100207-141623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20100202-142035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20091220-052654'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31515',
internalId:  '',
customField: '20100125-132333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20091116-122757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20090623-171930'
};
webappMappings['7008']=webappMappings['7008-9148']={
webappId:    '7008',
documentId:  '7301',
internalId:  '9148',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2AX1';
var companyName   = 'Salsa+Dance+Academy+%28Salsa+Nepal%29';
var htmlTitle	  = 'SALSA+DANCE+ACADEMY+%28P%29+Ltd.';
var metaKeywords  = 'salsa%2C+kathmandu%2C+nepal%2C+binayek%2C+ayush%2C+subha%2C+latin%2C+latino%2C+salsa+instructor%2C+events%2C+salsa+classes%2C+dance%2C+dance+class%2C+latin+quarter%2C+salsa+bar%2C+photo+gallary%2C+bombay+rockers%2C+party%2C+shrestha%2C+dj+binayek%2C+dj+guido%2C+dj+harkey%2C+partynepal.com%2C+partynepal%2C+firday%2C+friday+fiesta%2C+wendnesday+night+salsa%2C++party+pictures%2C+binayek+das+shrestha%2C+baber+mahal+revisited%2C+babar+mahal%2C+south+east+asia%2C+latin+dance%2C+dancing+latino%2C+nepali%2C+salsanepal%2C+salsanepal+news%2C+latest+news%2C+latest+news+on+salsanepal%2C+friday+night%2C+salseros%2C+salseras%2C+salsera%2C+salseros+of+the+month%2C+salseras+of+the+month%2C+katia';
var metaContents  = 'With+over+2000+plus+enthusiastic+students%2C+SALSA+DANCE+ACADEMY+is+only+place+where+you+can+learn+SALSA+in+KATHMANDU.+SALSANEPAL.COM+completes+its+one+year+success%2C+providing+viewers+to+view+salseros+of+the+month%2C+party+pictures+and+classes+schedules.+SALSANEPAL.COM+is+associated+with+LATIN+QUARTER+SALSA+BAR.';
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();
};
