/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','573',jdecode('Products'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','594',jdecode('Soap+Stamping+'),jdecode(''),'/573/594.html','true',[],''],
		['PAGE','615',jdecode('Hotel+Soap+Stamping'),jdecode(''),'/573/615.html','true',[],''],
		['PAGE','636',jdecode('Cutting+Machines'),jdecode(''),'/573/636.html','true',[],''],
		['PAGE','657',jdecode('Roll+Mills+Plodders+and+Pumps'),jdecode(''),'/573/657.html','true',[],'']
	],''],
	['PAGE','552',jdecode('Soaps+%26+Dies'),jdecode(''),'/552.html','true',[],''],
	['PAGE','678',jdecode('Services'),jdecode(''),'/678.html','true',[],''],
	['PAGE','699',jdecode('Contact'),jdecode(''),'/699.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Cuy';
theSitetree.paletteFamily='F8FCF2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='386';
theSitetree.graphicsetId='435';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F8FCF2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Cuy',
				paletteFamily: 	'F8FCF2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'386',
				graphicsetId: 	'435',
				contentColor: 	'000000',
				contentBGColor: 'F8FCF2',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'F8FCF2',
				b_color: 		'BECDA9',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100729-130104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20090419-011802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090207-182358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20090419-012624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20090419-004958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20090419-014114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20090207-182037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20080512-224010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20080512-224759'
};
var canonHostname = 'cm4all01.carrierzone.com';
var accountId     = 'AAPLU0INE7RP';
var companyName   = 'Greg-Vin+Engineers++++++++++++++++++++++++++++++Soap+Machinery+since+1986';
var htmlTitle	  = 'Greg-Vin+Engineers%3A+Soap+Stamping+Machines+India+for+Hotel+and+Bath+Soaps+Multi-cavity+Soap+Stamping+Machines+Soap+Stamping+Machine+Soap+Stamping+Machines+Soap+Stamping+Machinery+soap+stampers+soap+making+machines+soap+plant+machines+toilet+soap+machines+';
var metaKeywords  = 'soap+stamping+machine%2C+soap+stamping+machines%2C+soap+stamping+machinery%2C+soap+stampers%2C+soap+making+machines%2C+soap+plant+machines%2C+toilet+soap+machines%2C+laundry+soap+machines%2C+detergent+soap+machines%2C+herbal+soap+machines%2C+medical+soap+machines%2C+bath+soap+machines%2C+soap+dies%2C+soap+die+moulds%2C+soap+cutting+machines%2C+soap+embossing+machines%2C+toilet+soap+stampers%2C+pilot+plants+for+soap%2C+laundry+soap+stamper%2C+soap+and+detergent+plodders%2C+soap+and+detergent+mixers%2C+soap+and+detergent+roll+mill%2C+soap+roller+millers%2C+foot+operated+soap+stamping%2C+automatic+soap+stamping+press+machine%2C+laundry+soap+machines%2C+Hotel+soap+stamping+machine%2C+Hotel+soap+machine%2C+Hotel+soap+stamping+machine+India%2C+Hotel+soap+stamping+machine+Mumbai%2C+India+soap+stamping+machines%2C+Soap+machine+manufacturers+Mumbai%2C+Soap+machines+Mumbai%2C+Soap+machines+Bombay%2C+Soap+Machinery+India%2C+Soap+machinery+Mumbai%2C+Soap+machinery+Bombay%2C+Gregvin+Engineers%2C+Greg-Vin+Engineers%2C+GVE+Stamping+machines%2C+GVE+soaps%2C+Multi+cavity+soap+stamping+machines%2C+ep6%2C+ep7%2C+ep8%2C+ep10%2C+multi+soap+stamping+machines%2C+Hand+soap+manufacturers%2C+bath+soap+manufacturing%2C+soap+manufacturers%2C+soap+machine%2C+soap+machines%2C+soap+manufacture%2C+soap+manufacturing%2C+soap+manufacturers%2C+hand+soap+manufacturing%2C+Soap+stamping+machines';
var metaContents  = 'soap+stamping+machine%2C+soap+stamping+machines%2C+soap+stamping+machinery%2C+soap+stampers%2C+soap+making+machines%2C+soap+plant+machines%2C+toilet+soap+machines%2C+laundry+soap+machines%2C+detergent+soap+machines%2C+herbal+soap+machines%2C+medical+soap+machines%2C+bath+soap+machines%2C+soap+dies%2C+soap+die+moulds%2C+soap+cutting+machines%2C+soap+embossing+machines%2C+toilet+soap+stampers%2C+pilot+plants+for+soap%2C+laundry+soap+stamper%2C+soap+and+detergent+plodders%2C+soap+and+detergent+mixers%2C+soap+and+detergent+roll+mill%2C+soap+roller+millers%2C+foot+operated+soap+stamping%2C+automatic+soap+stamping+press+machine%2C+laundry+soap+machines%2C+Hotel+soap+stamping+machine%2C+Hotel+soap+machine%2C+Hotel+soap+stamping+machine+India%2C+Hotel+soap+stamping+machine+Mumbai%2C+India+soap+stamping+machines%2C+Soap+machine+manufacturers+Mumbai%2C+Soap+machines+Mumbai%2C+Soap+machines+Bombay%2C+Soap+Machinery+India%2C+Soap+machinery+Mumbai%2C+Soap+machinery+Bombay%2C+Gregvin+Engineers%2C+Greg-Vin+Engineers%2C+GVE+Stamping+machines%2C+GVE+soaps%2C+Multi+cavity+soap+stamping+machines%2C+ep6%2C+ep7%2C+ep8%2C+ep10%2C+multi+soap+stamping+machines%2C+Hand+soap+manufacturers%2C+bath+soap+manufacturing%2C+soap+manufacturers%2C+soap+machine%2C+soap+machines%2C+soap+manufacture%2C+soap+manufacturing%2C+soap+manufacturers%2C+hand+soap+manufacturing%2C+Soap+stamping+machines';
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();
};
