	

	function submitCartForm(product, quantity)
	{	
		document.cartForm.product.value = product;
		document.cartForm.quantity.value = quantity;
		document.cartForm.submit();
	}
	
	function showSubMenu(subID, menuItem)
	{
		var subMenu = document.getElementById('sub_' + subID);
		if(menuItem)
		{
			subMenu.style.left = (findLeft(menuItem) - 50) + 'px';
			subMenu.style.top = (findTop(menuItem) + menuItem.clientHeight - 22) + 'px';
			//alert(menuItem.clientHeight);
		}
		subMenu.style.visibility = 'visible';
	}

	function hideSubMenu(subID)
	{
		document.getElementById('sub_' + subID).style.visibility = 'hidden';
	}

	function hideDropdown(subID, parent1, parent2)
	{
		document.getElementById('sub_' + subID).style.visibility = 'hidden';
		if (parent1) hideSubMenu(parent1);
		if (parent2) hideSubMenu(parent2);
	}
	
	function showDropdown(subID, menuItem, parent1, parent2)
	{
		var subMenu = document.getElementById('sub_' + subID);
		if(menuItem)
		{
			subMenu.style.left = (findLeft(menuItem) + menuItem.offsetWidth) + 'px';
			subMenu.style.top = findTop(menuItem) + 'px';
		}
		if (parent1 && parent1 > 7) showSubMenu(parent1);
		if (parent2 && parent2 > 7) showSubMenu(parent2);
		subMenu.style.visibility = 'visible';
	}
	
	function findLeft(obj)
	{
		var curleft = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft;
			while (obj = obj.offsetParent) curleft += obj.offsetLeft;			
		}
		return curleft;
	}
	
	function findTop(obj)
	{
		var curtop = 0;
		if (obj.offsetParent) {
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {curtop += obj.offsetTop}
		}
		return curtop;
	}
	
	var newImage, imageList, preloadCount, preloadInterval;
	var preloadCount = 0;
	imageList = new Array();
	
	function addPreloadImage(url)
	{
		imageList[imageList.length] = url;
	}
	
	function startPreloading()
	{ 
		if(imageList.length != 0)
		{
			newImage = new Image;
			newImage.src = imageList[0]
			preloadInterval = setTimeout('preloadCheck()', 1000);
		}
	}
	
	function preloadCheck()
	{
		if (newImage.complete)
		{
			preloadCount += 1;
			if (preloadCount < imageList.length)
			{
				newImage.src = imageList[preloadCount];
				clearInterval(preloadInterval);
				preloadInterval = setTimeout('preloadCheck()', 1000);
			}
			else
			{
				clearInterval(preloadInterval);
			}
		}
	}
	
	function imageSwap(key, url)
	{
		eval('document.' + key + '.src = \'' + url + '\'');
	}
	

	function mailto(recipient)
	{
		document.location.href = 'mailto:' + recipient + '@andmeuk.com?subject=Website Enquiry';
	}
	
	function goTo(url)
	{
		document.location.href = url;
	}

	function openWindow(url, width, height, sizeable)
	{
		if (sizeable) sizeable = ',resizable,scrollbars'
		else sizeable = '';
		var openWin = window.open(url,'_blank','width=' + width + ',height=' + height + ',screenX=' + ((screen.availWidth-width)/2) + ',left=' + ((screen.availWidth-width)/2) + ',screenY=' + ((screen.availHeight-height)/2) + ',top=' + ((screen.availHeight-height)/2) + sizeable);
		openWin.focus();
	}
	
	function hideMiddleText()
	{
		var divStart = 'mid';
		document.getElementById(divStart + 'dleText').style.display = 'none';
	}
	
	
	function displayTip()
	{
	document.getElementById('tipstextHolder').style.height = '';	
	document.getElementById('payrolltip').style.visibility = '';	
	document.getElementById('tipsWrapperTop').style.height = '';
	
	//document.getElementById(bgDivToChange).style.backgroundImage = 'url(\'/images/Concept_new/'+ bgToChange +'.jpg\')';
	document.getElementById('adviceheader22').src='/images/latestnewsandadvice/payroll_advice_nrl.jpg';
	
	}
	
	function displayFAQMenu(sender, target){
		if(document.getElementById(target).style.display=='none'){
			document.getElementById(target).style.display='';
			sender.style.display='none';
			hideOtherFAQs(sender, target);
		}
		else{
			hideFAQMenu(sender, target);
		}
	}
	
	function hideFAQMenu(sender, target){
		document.getElementById(target).style.display='none';
		sender.style.display='';
	}
	
	function displayCartMenu(nameOfMenu, target)
	{
		if(document.getElementById(nameOfMenu).style.display=='none'){
			document.getElementById(nameOfMenu).style.display='';
			hideOtherCarts(nameOfMenu, target);
		}
		else{
			hideCartMenu(nameOfMenu, target);
		}
	}
	
	function hideCartMenu(nameOfMenu, target){
		document.getElementById(nameOfMenu).style.display='none';
	}
	
	function purchaseItem(target){
		document.getElementById(target).checked=true;
	}
	
	function hideOtherCarts(openMenu, target){
		
		var objList=document.getElementsByTagName("div");
		var arrObjects=new Array();
		
		for(var iCount=0;iCount<objList.length;iCount++){
			var oElement = objList[iCount];
			if(oElement.id.substr(0, 21)=="HrpopUpContainer_sub_" && oElement.id!="HrpopUpContainer_sub_Content" && oElement.id!=openMenu){
				hideCartMenu(oElement.id,target )
			}
		}
	}
	
	function hideOtherFAQs(sender, target){
		
		var objList=document.getElementsByTagName("div");
		
		for(var iCount=0;iCount<objList.length;iCount++){
			var oElement = objList[iCount];
			if(oElement.id.substr(0, 16)=="answerPanel_FAQ_" && oElement.id!=target){
				//hideFAQMenu(document.getElementById(target), sender.id)
				oElement.style.display='none';
			}
		}
		
		var objList=document.getElementsByTagName("p");
		
		for(var iCount=0;iCount<objList.length;iCount++){
			var oElement = objList[iCount];
			if(oElement.id.substr(0, 18)=="questionPanel_FAQ_" && oElement.id!=sender.id){
				oElement.style.display='';
			}
		}
	}
		
	
	
		
	
	