//
function miniCart(){
var prdCount = 0, prdString = "", subTotal = (xmlConfig.cartSubTotal > 0)?xmlConfig.cartSubTotal:0;
	if(xmlOHeader.childNodes.length==0) subTotal = 0;
	for(var i=0;i<xmlOHeader.childNodes.length;i++){
		prdCount = prdCount+(parseInt(xmlOHeader.childNodes[i].QuantityAmount));
		};
	prdString += "Number:<strong>&nbsp;" + prdCount + "</strong><br>";
	prdString += "Subtotal:<strong>&nbsp;" + TFormatCurrency(subTotal, objPriCurrency) + "</strong><br><br>";
	prdString += "<a class=\"WAGRUNAV\" href=\"orderform." + xmlConfig.fileExtension + "\">";
	prdString += "<strong>" + '<img src="assets/images/bullet.gif" width="11" height="14" alt="Bullet.gif" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Go to the Itinerary</strong></a>";
	return(prdString);
	};
//
var TNavDropDownIndent = ".."
//
function NavLinkedDropDownList(){
	return(TNavDropDownList(true));
	};
//
function NavDropDownList(){
	return(TNavDropDownList(false));
	};
//
function storeSearchParameters(optionValueArray){
var xmlSearchEngine = xmlConfig.getFirstItem("SearchEngine");
	if(optionValueArray[0]!="null"&&optionValueArray[0]!="nada"){
		xmlSearchEngine.categoryIndex = optionValueArray[0];
		xmlSearchEngine.categoryId = optionValueArray[2];
		xmlSearchEngine.ByCategory = "1";
		}
	else{
		xmlSearchEngine.categoryIndex = "null";
		xmlSearchEngine.categoryId = "null";
		xmlSearchEngine.ByCategory = "0";
		};
	};
//
function TNavDropDownList(asLink){
var rString = "";
var myNavIndex = "";
	if(asLink) myNavIndex = xmlConfig.navIndex;
	else myNavIndex = xmlConfig.getFirstItem("SearchEngine").categoryIndex;
	if(!(myNavIndex=="null"||myNavIndex=="")){ navigation[parseInt(myNavIndex)].active = true; };
	if(asLink) rString += "<select name=\"navselect\" onChange=\"changeLoc(this[this.selectedIndex].value.split(';;')[0],this[this.selectedIndex].value.split(';;')[1])\">"
	else rString += "<select name=\"navselect\" onChange=\"storeSearchParameters(this[this.selectedIndex].value.split(';;'))\">";
	rString += "<option value=\"nada;;start.htm;;null\">Members</option>";
	for(var i=0; i<navigation.length; i++){
		if(navigation[i].parentId==null){
			rString += TNavDropDownItem(navigation[i], "");
			};
		};
	rString += "</select>";
	return(rString);
	};
//
function TNavDropDownItem(navItem, cptPreFix){
var rString = "";
	rString += "<option value=\"" + navItem.id + ";;" + navItem.linkUrl + ";;" + navItem.categoryId + "\"";
	if(navItem.active) rString += " selected";
	rString += ">" + cptPreFix + navItem.caption + "</option>";
	for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==navItem.id) rString += TNavDropDownItem(navigation[i], cptPreFix + TNavDropDownIndent);
	return(rString);	
	};
//
	function openItem(itemId){
	var objActiveItem = null;
		if(itemId!=null){
			objActiveItem = navigation[itemId];
			if(objActiveItem!=null){
				objActiveItem.open = true;
				openItem(objActiveItem.parentId);
				};
			};
		};
		
	function activateItem(itemId){
	var objActiveItem = null;
		if(itemId!=null){
			objActiveItem = navigation[itemId];
			if(objActiveItem!=null){
				objActiveItem.active = true;
				openItem(objActiveItem.parentId);
				};
			};
		};
		
	function itemHasSubelems(itemId){
		for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==itemId) return(true);
		return(false);
		};
	
	function TNavLinkList(){
	var strHTML = "";
		for(var i=0; i<navigation.length; i++) if(navigation[i].parentId==null) strHTML += printItem(navigation[i], 0);
		return(strHTML);
		};	
		
	function printItem(navItem, depth){
	var strHTML = "";
	var elemWidth = 1;
		strHTML += '<table width="100%" class="CATLINKS1STPARENT" border="0" cellpadding="1" cellspacing="0" >';
		strHTML += "<tr>"
		for(var i=0; i<depth; i++){
			strHTML += "<td";
			if(navItem.active) strHTML += " class=\"ACTIVECATEGORY\""
			else strHTML += " class=\"CATLINKS1STBULLET\"";
			strHTML += ' width="1%"><img src="assets/images/spacer.gif" width="11" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="11" height="14" alt="BulletCatAct.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else if(navItem.open&&itemHasSubelems(navItem.id)) strHTML += '<td width="1%" class="CATLINKS1STBULLET"><img src="assets/images/bulletcat1stcls.gif" width="11" height="14" alt="BulletCat1stCls.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bulletcat1st.gif" width="11" height="14" alt="BulletCat1st.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		strHTML += "<td";
		if(navItem.active) strHTML += " class=\"ACTIVECATEGORY\""
		else strHTML += " class=\"CATLINKS1STBULLET\"";
		strHTML += "width=\"" + ( 100 - ( depth + 1 ) ) + "%\">"
			+ "<a href=\"" + navItem.linkUrl + "?categoryId=" + escape(navItem.id) + "\" class=\"WAGRUNAV\">"
			+ navItem.caption
			+ "</a>"
			+ "</td>";
		strHTML += "</tr>"
		strHTML += "</table>"
		depth++;
		if(navItem.active||navItem.open){
			for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==navItem.id) strHTML += printItem(navigation[i], depth);
			};
		return(strHTML);
		};


//

// navElem
	function navElem(id,caption,linkUrl,parentId,categoryId){
		this.id = id;
		this.caption = caption;
		this.linkUrl = linkUrl;
		this.parentId = parentId;
		this.active = false;
		this.open = false;
		this.categoryId = categoryId;
		};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"Accommodation","pi1172741102.htm",null,"A");
navigation[1] = new navElem(1,"Bed & Breakfasts","pi1810557795.htm",0,"BB");
navigation[2] = new navElem(2,"Hotels","pi1179759386.htm",0,"H");
navigation[3] = new navElem(3,"Restaurant with Rooms","pi-190452663.htm",0,"RR");
navigation[4] = new navElem(4,"Self Catering","pi-574043349.htm",0,"SA");
navigation[5] = new navElem(5,"Art","pi-1856183074.htm",null,"G");
navigation[6] = new navElem(6,"Artists","pi865884195.htm",5,"A-A");
navigation[7] = new navElem(7,"Galleries","pi-249258006.htm",5,"A-G");
navigation[8] = new navElem(8,"Picture Framers","pi211820395.htm",5,"PF");
navigation[9] = new navElem(9,"Business Services","pi937104194.htm",null,"BS");
navigation[10] = new navElem(10,"Printers","pi-1420841317.htm",9,"PT");
navigation[11] = new navElem(11,"Charities","pi-1149472799.htm",null,"CH");
navigation[12] = new navElem(12,"Education, Training & Learning","pi1249905467.htm",null,"T-E-L");
navigation[13] = new navElem(13,"Nursery School","pi1271018506.htm",12,"N");
navigation[14] = new navElem(14,"Fashion","pi-347627886.htm",null,"C-F");
navigation[15] = new navElem(15,"Childrens Fashion","pi-624530498.htm",14,"CF");
navigation[16] = new navElem(16,"Dress Making","pi-1212350061.htm",14,"DM");
navigation[17] = new navElem(17,"Mens Fashion","pi1209572369.htm",14,"M-F");
navigation[18] = new navElem(18,"Womens Fashion","pi936031486.htm",14,"W-F");
navigation[19] = new navElem(19,"Florists","pi1841094079.htm",null,"F");
navigation[20] = new navElem(20,"Food & Drink","pi1234286241.htm",null,"FD");
navigation[21] = new navElem(21,"Breweries","pi1659160025.htm",20,"BW");
navigation[22] = new navElem(22,"Chocolates & Confectionary","pi-967214713.htm",20,"ChC");
navigation[23] = new navElem(23,"Coffee","pi-2023075741.htm",20,"CFF");
navigation[24] = new navElem(24,"Farm Shops","pi1182451754.htm",20,"FS");
navigation[25] = new navElem(25,"Preservaments","pi153147582.htm",20,"PV");
navigation[26] = new navElem(26,"Where to Drink","pi1049336888.htm",20,"WD");
navigation[27] = new navElem(27,"Cafes","pi-2121373344.htm",26,"CAF");
navigation[28] = new navElem(28,"Pubs","pi1843466797.htm",26,"P");
navigation[29] = new navElem(29,"Where to Eat","pi1264373363.htm",20,"WE");
navigation[30] = new navElem(30,"Restaurants","pi-2105137348.htm",29,"Rest");
navigation[31] = new navElem(31,"Chinese","pi-1885738571.htm",30,"C");
navigation[32] = new navElem(32,"French","pi407601254.htm",30,"R-F");
navigation[33] = new navElem(33,"Traditional","pi-1239337489.htm",30,"R-T");
navigation[34] = new navElem(34,"Government Surplus","pi-61686913.htm",null,"GS");
navigation[35] = new navElem(35,"Health & Beauty","pi805480873.htm",null,"HB");
navigation[36] = new navElem(36,"Hearing Care","pi1235056862.htm",35,"HC");
navigation[37] = new navElem(37,"Homeopathy","pi1945767493.htm",35,"HB-H");
navigation[38] = new navElem(38,"Massage","pi1199727337.htm",35,"HB-M");
navigation[39] = new navElem(39,"House and Home","pi700768695.htm",null,"HH");
navigation[40] = new navElem(40,"Antiques","pi1250787076.htm",39,"AN");
navigation[41] = new navElem(41,"Child Care","pi1207838465.htm",39,"CC");
navigation[42] = new navElem(42,"Clothing Alterations","pi-513582888.htm",39,"CA");
navigation[43] = new navElem(43,"Gardens & Nurseries","pi1215491898.htm",39,"GN");
navigation[44] = new navElem(44,"Hobbies","pi-398457783.htm",39,"HBS");
navigation[45] = new navElem(45,"Interior Design","pi837658197.htm",39,"ID");
navigation[46] = new navElem(46,"Jewellers & Watchmakers","pi2067035234.htm",39,"JWM");
navigation[47] = new navElem(47,"Land Scaping","pi-392819249.htm",39,"LS");
navigation[48] = new navElem(48,"Properties for Sale","pi-2061865143.htm",39,"PR");
navigation[49] = new navElem(49,"Barn Conversions","pi1256269270.htm",48,"BC");
navigation[50] = new navElem(50,"Index","pi2131956623.htm",null,"I");
navigation[51] = new navElem(51,"Local Attractions","pi468828238.htm",null,"AT");
navigation[52] = new navElem(52,"Churches","pi-1557829537.htm",51,"CHU");
navigation[53] = new navElem(53,"Wild Life","pi1247134203.htm",51,"WL");
navigation[54] = new navElem(54,"Motoring","pi1246554485.htm",null,"M");
navigation[55] = new navElem(55,"Car Sales","pi600334197.htm",54,"CTR");
navigation[56] = new navElem(56,"Motorcyles","pi-41670766.htm",54,"MB");
navigation[57] = new navElem(57,"Sports & Leisure","pi1267025985.htm",null,"S-R");

// getNavElementByCatID
function getNavElementByCatID(categoryId){
	for(var i=0; i<navigation.length; i++){
		if(navigation[i].categoryId==categoryId){
			return(navigation[i]);
			break;
			};
		};
		return(null);
	};
// changeLoc
function changeLoc(id,linkUrl){
	if(id!="nada"){
		xmlConfig.navIndex = id.toString();
		if(xmlConfig.getFirstItem("SearchEngine").ByCategory == "1"){
			if(id=="null") xmlConfig.getFirstItem("SearchEngine").categoryId = "null"
			else xmlConfig.getFirstItem("SearchEngine").categoryId = navigation[id].categoryId;
			xmlConfig.getFirstItem("SearchEngine").categoryIndex = id;
			}
		else{
			xmlConfig.getFirstItem("SearchEngine").categoryId = "null";
			xmlConfig.getFirstItem("SearchEngine").categoryIndex = "null";
			};
		safeData();
		location.href = linkUrl + "?categoryId=" + id.toString();
		};
	};
// searchOnEnterNavi
function searchOnEnterNavi(){
	if(window.event.keyCode==13){
		xmlConfig.getFirstItem('SearchEngine').term=document.searchEngine.searchTerm.value;
		location.href = "search.htm";
		};
	};
// activates entries for categories
activateItem(getParameterFromURL("categoryId"));

