			window.status = "www.needapresent.com"
			
			/*	Popup window */	
			function openWindow(theURL,w,h)
			{
				var newwin;
				newWin = window.open(theURL,'basket','status=yes,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h +',top='+screen.availHeight/4+',left='+screen.availWidth/4);
				setTimeout('newWin.focus();',500);
			}
			
			
			
			/*	Status Bar Message On */
			function statusOn(msg)
			{
				window.status = msg; return true;			
			}
			
			
			
			/*	Status Bar Message Off */
			function statusOff()
			{
				window.status = "www.needapresent.com "; return true;			
			}	
			
			
			
			/* quick search form handler */
			function getSearch(v)
			{
				if (v == "a-z")
				{
					location.href='/a-z.asp'
				} else if(v == "men") {
					location.href='/shop/giftsForMen.asp'
				} else if(v == "women") {
					location.href='/shop/giftsForWomen.asp'
				} else if(v == "children") {
					location.href='/shop/giftsForKids.asp'					
				} else if(v) {
					location.href='/shop/get_Search_Results.asp?DID=100&SearchRange=' + v
				}
			}


			function goGiftSearch(e, sid)
			{ 			
				if (e.selectedIndex > 0)
				{
					if (e.name == "rcp")
						location.href='/shop/getSearchResults.aspx?rcp=' + e.value + '&key=&price=0&sid=' + sid
					else if (e.name == "price")
						location.href='/shop/getSearchResults.aspx?rcp=0&key=&price=' + e.value + '&sid=' + sid		
				}
			}
			
			
			function addToBasket(upid,prodname,price,stk)
			{
				
				// Set the form fields				
				document.frmAddToBasket.ProdUID.value = upid
				document.frmAddToBasket.ProdName.value = prodname
				document.frmAddToBasket.ProdPrice.value = price
				document.frmAddToBasket.ProdMaxStock.value = stk
				
				// open a blank window
				//openWindow('about:blank',580,450);
				
				// submit the basket form after .6 secs - gives window time to open
				setTimeout('document.frmAddToBasket.submit()',1000)
				//document.frmAddToBasket.submit()
			
			}
			


			//-------------------------------------------------------
			// Return true if a string contains only whitespace
			//-------------------------------------------------------		
			function isBlank(str)
			{
				for(var i = 0; i < str.length; i++)
				{
					var c = str.charAt(i);
					if((c != ' ') || (c != '\n') || (c != '\t') || (c)) return false;
				}
				return true;
			}







			//-------------------------------------------------------
			// Check to see if the value is all numeric
			//-------------------------------------------------------
			function IsNumeric(str)
			{
				var ValidChars = "0123456789";
				var IsNumber = true;
				var Char;
				
				for (i=0; i < str.length && IsNumber == true; i++) 
				{ 
					Char = str.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
					{
						IsNumber = false;
					}
				}				
				return IsNumber;				   
			}


			//-------------------------------------------------------
			// Check to see if the value is a valid email
			//-------------------------------------------------------			
			function isValidEmail(str)
			{
				var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i					
				if (filter.test(str))
				{					
					return true					
				} else {					
					return false
				}
			}			
			
			
			
			//-------------------------------------------------------
			// VALIDATE SEARCH BOX
			//-------------------------------------------------------			
			function validateSearchForm(e)
			{
			
				if ( (e.rcp.selectedIndex == 0) && (e.key.value == "" || e.key.value == " " || e.key.value == "Or keyword") )
				{
					
					alert("Please select a category or enter a keyword and then press \"GO\".")
					return false;
					
				}  else {
					
					return true;					
					
				}				
			}				
		
		
			
