
	/* global declration of all menu items - define here and only here*/
	var arrMenus = new Array()

	arrMenus[0]  = "framessubmenu_ul"
	arrMenus[1]  = "mountssubmenu_ul"
	arrMenus[2]  = "helpsubmenu_ul"
	arrMenus[3]  = "servicessubmenu_ul"
	arrMenus[4]  = "coloursubmenu_ul"
	arrMenus[5]  = "widthsubmenu_ul"
	arrMenus[6]  = "pricesubmenu_ul"
	arrMenus[7]  = "profilesubmenu_ul"
	arrMenus[8]  = "mountcoloursubmenu_ul"
	arrMenus[9]  = "mounttypesubmenu_ul"
	arrMenus[10] = "artprintssubmenu_ul"
	arrMenus[11] = "categoriesubmenu_ul"
	arrMenus[12] = "artistssubmenu_ul"
	arrMenus[13] = "subjectsubmenu_ul"
	arrMenus[14] = "printcolourssubmenu_ul"
	arrMenus[15] = "picturemountssubmenu_ul"
	arrMenus[16] = "boardssubmenu_ul"
	arrMenus[17] = "sundryitemssubmenu_ul"
	arrMenus[18] = "sundrycatssubmenu_ul"
	arrMenus[19] = "framessizessubmenu_ul"
	arrMenus[20] = "ateamsubmenu_ul"
	arrMenus[21] = "imperialsubmenu_ul"
	arrMenus[22] = "metricsubmenu_ul"
	arrMenus[23] = "standardsizessubmenu_ul"
	arrMenus[24] = "framestylessubmenu_ul"
	arrMenus[25] = "multiopeningsubmenu_ul"
	arrMenus[26] = "mountimagesizesubmenu_ul"
	arrMenus[27] = "singleopeningsubmenu_ul"
	arrMenus[28] = "mountnumberofopeningssubmenu_ul"
	arrMenus[29] = "woodsubmenu_ul"
	arrMenus[30] = "alisubmenu_ul"
	arrMenus[31] = "alicoloursubmenu_ul"
	arrMenus[32] = "aliwidthsubmenu_ul"
	arrMenus[33] = "aliprofilesubmenu_ul"
	arrMenus[34] = "mirrorssubmenu_ul"
	arrMenus[35] = "mirrorcoloursubmenu_ul"
	arrMenus[36] = "mirrorwoodsubmenu_ul"
	arrMenus[37] = "mirroralisubmenu_ul"
	arrMenus[38] = "mirroralicoloursubmenu_ul"
	arrMenus[39] = "mirrorwidthsubmenu_ul"
	arrMenus[40] = "alimirrorwidthsubmenu_ul"
	arrMenus[41] = "alimirrorprofilesubmenu_ul"
	arrMenus[42] = "mirrorprofilesubmenu_ul"
	arrMenus[43] = "presssubmenu_ul"
	arrMenus[44] = "gettingstartedsubmenu_ul"
	arrMenus[45] = "readymadeproductitemssubmenu_ul"
	arrMenus[46] = "readymadeproductcatssubmenu_ul"
	arrMenus[47] = "collectionssubmenu_ul"
	arrMenus[48] = "decorativesubmenu_ul"
	
	
	/*************************************************************************** 
	generic function - works with all elements
	************************************************************************** */
	function showHide(strname, bShow)
	{
	
		var obj = document.getElementById(strname);

		if (obj != null)
		{
		
			oElement = obj.style
	
			if (bShow == true)
			{
				//alert("Opening menu: " + strname);
				oElement.display = "block"
				createCookie(strname,"open",1) 
				createCookie("expanded","true",1) 
				changeText("TreeExpander", "Collapse All")
			}
			else
			{
				//alert("Closing menu: " + strname)
				oElement.display = "none"
				createCookie(strname,"closed",1) 
				createCookie("expanded","false",1) 
				changeText("TreeExpander", "Show All")
			}
		
		}
		
	}

	/*************************************************************************** 
	generic function - works with all elements
	************************************************************************** */
	function changeText(elementName, str)
	{
		var eL = document.getElementById(elementName)
		eL.innerText = str
	}
	
	/*************************************************************************** 
	Add in all new click to expand menu items
	************************************************************************** */
	function ShowAll()
	{
	
		var bShow = readCookie("expanded")
		if (bShow == "true")
		{
			for (i=0;i<arrMenus.length;i++)
			{
				showHide(arrMenus[i], false)
			}	
		}
		else
		{
			for (i=0;i<arrMenus.length;i++)
			{
				showHide(arrMenus[i], true)
			}	
		}
	}

	/*************************************************************************** 
	Add in all new click to expand menu items
	************************************************************************** */
	function CollapseAll()
	{
	
			//alert("CollapseAll()");
			
			for (i=0;i<arrMenus.length;i++)
			{
				showHide(arrMenus[i], false)
			}	

	}

	
	/*************************************************************************** 
	Add in all new click to expand menu items
	************************************************************************** */
// 	function loadNow()
// 	{
// 			for (i=0;i<arrMenus.length;i++)
// 			{
// 				loadMenu(arrMenus[i])
// 			}	
// 	}
	
	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function loadMenu(strName)
	{
			/* menu */
			
			
			oElement = document.getElementById(strName)
			if (oElement != null)
			{
				abra = oElement.style
				if (readCookie(strName) == "open")
					//alert("Displaying menu: " + strName + ". Cookie value: " + readCookie(strName));
				
				if (readCookie(strName) == "open")
				{
					showHide(strName, true)
				}
				else
				{
					showHide(strName, false)
				}
			}
		
	}

	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function createCookie(name,value,days)
	{

	
	  var nameEQ = name + "=";
	  var ca = document.cookie.split(';');
	  for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	  }
	  return null;

/*		if (name == "38382")
			;//alert("About to write cookie 38382 with a value: " + value);
			
		//name = "menus['"+name+"']"
	
		if (days)
		{
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		
		document.cookie = name+"="+value+expires+"; path=/";
	*/
	}
	
	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function readCookie(name)
	{
		n = name;
		//name = "menus['"+name+"']";
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		
		for(var i=0;i < ca.length;i++)
		{
			var c = ca[i];
			while (c.charAt(0)==' ') 
			{
				c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) 
				{
					retVal = c.substring(nameEQ.length,c.length);
					return retVal;
				}
			}
		}
		return null;
	}
	
	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function eraseCookie(name)
	{
		createCookie(name,"",-1);
	}

	/*************************************************************************** 
	preload images 
	************************************************************************** */
	function loadLHMImages()
	{
		
		//alert("Preloader running")
		
		/*throwaway = new Image().src = "../images/icons/blue_tick.gif";
		throwaway = new Image().src = "../images/icons/blue_box.gif";
	
		throwaway = new Image().src = "../images/icons/red_tick.gif";
		throwaway = new Image().src = "../images/icons/red_box.gif";
	
		throwaway = new Image().src = "../images/icons/green_tick.gif";
		throwaway = new Image().src = "../images/icons/green_box.gif";
	
		throwaway = new Image().src = "../images/icons/yellow_tick.gif";
		throwaway = new Image().src = "../images/icons/yellow_box.gif";
	
		throwaway = new Image().src = "../images/icons/orange_tick.gif";
		throwaway = new Image().src = "../images/icons/orange_box.gif";
	
		throwaway = new Image().src = "../images/icons/beige_tick.gif";
		throwaway = new Image().src = "../images/icons/beige_box.gif";
	
		throwaway = new Image().src = "../images/icons/gold_tick.gif";
		throwaway = new Image().src = "../images/icons/gold_box.gif";
	
		throwaway = new Image().src = "../images/icons/purple_tick.gif";
		throwaway = new Image().src = "../images/icons/purple_box.gif";
	
		throwaway = new Image().src = "../images/icons/brown_tick.gif";
		throwaway = new Image().src = "../images/icons/brown_box.gif";
	
		throwaway = new Image().src = "../images/icons/pink_tick.gif";
		throwaway = new Image().src = "../images/icons/pink_box.gif";
	
		throwaway = new Image().src = "../images/icons/maroon_tick.gif";
		throwaway = new Image().src = "../images/icons/maroon_box.gif";
	
		throwaway = new Image().src = "../images/icons/grey_tick.gif";
		throwaway = new Image().src = "../images/icons/grey_box.gif";
	
		throwaway = new Image().src = "../images/icons/darkgrey_tick.gif";
		throwaway = new Image().src = "../images/icons/darkgrey_box.gif";
	
		throwaway = new Image().src = "../images/icons/black_tick.gif";
		throwaway = new Image().src = "../images/icons/black_box.gif";
		
		throwaway = new Image().src = "../images/icons/printsbluegrad.jpg";
		throwaway = new Image().src = "../images/icons/printsredgrad.jpg";
		throwaway = new Image().src = "../images/icons/printsgreengrad.jpg";
		throwaway = new Image().src = "../images/icons/printsyellowgrad.jpg";
		throwaway = new Image().src = "../images/icons/printsbeigegrad.jpg";
		throwaway = new Image().src = "../images/icons/printsorangegrad.jpg";
		throwaway = new Image().src = "../images/icons/printsgoldgrad.jpg";
		throwaway = new Image().src = "../images/icons/printspurplegrad.jpg";
		throwaway = new Image().src = "../images/icons/printsbrowngrad.jpg";
		throwaway = new Image().src = "../images/icons/printsmaroongrad.jpg";
		throwaway = new Image().src = "../images/icons/printswhitegrad.jpg";
		throwaway = new Image().src = "../images/icons/printslightgreygrad.jpg";
		throwaway = new Image().src = "../images/icons/printsdarkgreygrad.jpg";
		throwaway = new Image().src = "../images/icons/printsblackgrad.jpg";
		
		throwaway = new Image().src = "../images/Shadows/Shadow_RightTop.jpg";
		throwaway = new Image().src = "../images/Shadows/Shadow_BottomLeft.jpg";
		throwaway = new Image().src = "../images/Shadows/Shadow_BottomRight.jpg";
		throwaway = new Image().src = "../images/Shadows/Shadow_BottomRight.jpg";
		throwaway = new Image().src = "../images/icons/addtocartsmall.jpg";
		throwaway = new Image().src = "../images/icons/addtocartsmall_ro.jpg";
		throwaway = new Image().src = "../images/icons/zoomsmall.jpg";
		throwaway = new Image().src = "../images/icons/zoomsmall_ro.jpg";
		throwaway = new Image().src = "../images/icons/frameitsmall.jpg";
		throwaway = new Image().src = "../images/icons/frameitsmall_ro.jpg";
		throwaway = new Image().src = "../images/icons/favessmall_ro.jpg";
		throwaway = new Image().src = "../images/icons/favessmall_ro.jpg";*/
	}

	function openwin(url, width, height) 
	{
		var name = "popup"; // popup name
		var width = width; // popup width
		var height = height; // popup height
		var left = (screen.width - width) / 2 ;
		var top = (screen.height - height) / 2;
		var windowproperties = "width="+ width +",height="+ height +",left="+ left +",top="+ top +",scrollbars=1";
		window.open(url, name, windowproperties);
	}



		/***********************************************
		* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
		* This notice MUST stay intact for legal use
		* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
		***********************************************/
		
			/* Modified to support Opera */
			function bookmarksite()
			{
			if (window.sidebar) // firefox
				window.sidebar.addPanel(document.title, window.location, "");
			else if(window.opera && window.print)
				{ // opera
				var elem = document.createElement('a');
				elem.setAttribute('href',window.location);
				elem.setAttribute('title',document.title);
				elem.setAttribute('rel','sidebar');
				elem.click();
				} 
			else if(document.all)// ie
				window.external.AddFavorite(window.location, document.title);
			}

			function addToSocialNetworkSite(p)
			{
			
				var fullStoryUrl = window.location;
				
				var o = new Object();
			
				var servUrl = "";
				
				if (p == "Delicious")
				{
					servUrl = "http://del.icio.us/post?v=4&noui&jump=close&url=" + fullStoryUrl + "&title=" + document.title;
				}
				
				
				if (p == "Digg")
				{
					servUrl = "http://digg.com/submit?url=" + fullStoryUrl + "&title=" + document.title;
				}
			
				if (p == "reddit")
				{
					servUrl = "http://reddit.com/submit?url=" + fullStoryUrl + "&title=" + document.title;
				}

				if (p == "Facebook")
				{
					servUrl = "http://www.facebook.com/sharer.php?u=" + fullStoryUrl;
				}

				if (p == "StumbleUpon")
				{
					servUrl = "http://stumbleupon.com/submit?url=" + fullStoryUrl + "&title=" + document.title;
				}


				o.url = servUrl;
			
				o.resizable = 1;
			
				o.scrollbars = 1;
			
				o.width = 700;
			
				window.open(o.url,"ssss","ssss");
				
			}

