/* [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','1701',jdecode('Home'),jdecode(''),'/1701.html','true',[],'',''],
	['PAGE','57001',jdecode('Policies'),jdecode(''),'/57001.html','true',[],'',''],
	['PAGE','1752',jdecode('About+us'),jdecode(''),'/1752.html','true',[],'',''],
	['PAGE','1773',jdecode('Products'),jdecode(''),'/1773.html','true',[],'',''],
	['PAGE','1815',jdecode('Seiko'),jdecode(''),'/1815.html','true',[],'',''],
	['PAGE','1836',jdecode('Citizen'),jdecode(''),'/1836.html','true',[],'',''],
	['PAGE','25422',jdecode('Casio'),jdecode(''),'/25422.html','true',[],'',''],
	['PAGE','25485',jdecode('Other+items'),jdecode(''),'/25485.html','true',[],'',''],
	['PAGE','17601',jdecode('Our+Trade-me'),jdecode(''),'/17601.html','true',[],'',''],
	['PAGE','1920',jdecode('Watch++FAQs'),jdecode(''),'/1920.html','true',[],'',''],
	['PAGE','1941',jdecode('Contact+Us'),jdecode(''),'/1941.html','true',[],'',''],
	['PAGE','1983',jdecode('Warranty'),jdecode(''),'/1983.html','true',[],'',''],
	['PAGE','2004',jdecode('Links'),jdecode(''),'/2004.html','true',[],'',''],
	['PAGE','46801',jdecode('Watch+Scams'),jdecode(''),'/46801.html','true',[],'',''],
	['PAGE','76501',jdecode('Survey+prize+draw'),jdecode(''),'/76501.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='FFCC33';
theSitetree.keyvisualId='938';
theSitetree.keyvisualName='seerose.jpg';
theSitetree.fontsetId='166';
theSitetree.graphicsetId='199';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'FFCC33',
				keyvisualId: 	'938',
				keyvisualName: 	'seerose.jpg',
				fontsetId: 		'166',
				graphicsetId: 	'199',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000066',
				b_color: 		'FFCC33',
				c_color: 		'000000',
				d_color: 		'406BC0',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20100810-021919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20091012-200419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20091012-210001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1815',
internalId:  '',
customField: '20091012-205938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1836',
internalId:  '',
customField: '20091012-210110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25422',
internalId:  '',
customField: '20091012-210531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76501',
internalId:  '',
customField: '20100802-011853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25485',
internalId:  '',
customField: '20091012-204837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20091012-204938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1920',
internalId:  '',
customField: '20091012-201334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1941',
internalId:  '',
customField: '20091012-201502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1983',
internalId:  '',
customField: '20100411-015755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2004',
internalId:  '',
customField: '20091012-202138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20091012-202623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57001',
internalId:  '',
customField: '20100411-020110'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN36QR';
var companyName   = 'Eurowatches%3A+ph+0800-100-935';
var htmlTitle	  = 'Eurowatches+Limited+-+Discount+watches';
var metaKeywords  = 'Ladies+watches+Mens+watches+mens+watches+kids+watches+cheap+watches+Seiko+watches+Citizen+watches+Casio+Protrek+G-Shock+g+shock+Kinetic+Velatura+Arctura+Premier+Sportura+Spring+Drive+Ananta+ECO+Drive+Pathfinder+watch+watches+wristwatch+wristwatches+discount+parallel+imported+Riseman+Gulfman+Mudman+chronograph+Jeweller+jewler+titanium+gold+silver+diamond+eurowatches+TradeMe+Sella+auctions+quartz+chronograph+automatic+Omega+Tissot+Tag+Heuer+Suunto+GPS+Longines+Pulsar+Lorus+Timex+Rolex';
var metaContents  = 'Seiko+watches%2C+Citizen+ECO+Drive+watches%2C+Casio+watches+-+always+on+sale+all+year+round%21+Eurowatches%3A+A+trusted+New+Zealand+online+retailer+who+offers+brand+name+wristwatches+at+30-70%25+off+the+recommended+retail+price.';
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();
};
