//	This is now alphabetized.  Please keep it this way.

	if (navigator.appname == "Netscape") 
		{
			onresize = reDo;
			origWidth = innerWidth;
			origHeight = innerHeight;
	    }
	    
	var preloadFlag = false;
	
	var helpPopup = window.createPopup();
	
//
//
//
//	C
	function changeImages()
	{
		if (document.images && (preloadFlag == true))
		{
			for (var i=0; i<changeImages.arguments.length; i+=2)
			{
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}

	function CheckCapsLock( e )
	{
		var myKeyCode	= 0;
		var myShiftKey	= false;
		var myMsg		= 'Caps Lock is On.\n\nTo prevent entering your password incorrectly,\nyou should press Caps Lock to turn it off.';

		// Internet Explorer 4+
		if ( document.all )
			{
				myKeyCode	= e.keyCode;
				myShiftKey	= e.shiftKey;

			
			}
		// Netscape 4
		else if ( document.layers )
			{
				myKeyCode	= e.which;
				myShiftKey	= ( myKeyCode == 16 ) ? true : false;
			}
		// Netscape 6
		else if ( document.getElementById )
			{
				myKeyCode	= e.which;
				myShiftKey	= ( myKeyCode == 16 ) ? true : false;
			}

		// Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
		if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey )
			{
				alert( myMsg );
			}
		// Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
		else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey )
			{
				alert( myMsg );
			}
	}
//
//
//
//	H

	function HextoDec(num)
		{
			var digit;
			var decval = new Number(0);
			var digitval;
			for (x=1;x<num.length+1;x++)
			{
				digit = num.substr(num.length-x,1).toUpperCase();
				switch (digit)
				{
					case "A":	digitval=10;
							break;
					case "B":	digitval=11;
							break;
					case "C":	digitval=12;
							break;
					case "D":	digitval=13;
							break;
					case "E":	digitval=14;
							break;
					case "F":	digitval=15;
							break;
					default :	digitval=digit;
				}
				decval += digitval*Math.pow(16,x-1);	
			}
			return decval;
		}
		
	function hideHelp(helpID) 
	{
		helpPopup.hide();
    }


//
//
//
//	I
	function isNumericValue(textpassed){
		if (isNaN(textpassed)) {
			return "";
		} else {
			return textpassed;
		}
	}
	
	function IsZip(val)
		{
			var zipcode = new RegExp("\\d{5}","g");
			val = val.match(zipcode);
			var num = Number(val);
			if (num < 10000)
			{
				alert("You need to enter a valid zipcode!");
			} 
			if (num > 9999)
			{
				document.forms['FindLocation'].submit();
			}
			return false;
		}


//
//
//
//	M

	function Menu( MenuLink, CancelFlag )
		{
			if ( CancelFlag != "" )
				{
					DoubleCheck = confirm("Your current return will be canceled.\nAre you sure?\n\nClick OK to cancel the return and continue.\n\nClick Cancel to go back.");
					if ( DoubleCheck == false )
						{
							return false;
						}
				}

			self.location.href = MenuLink;			return true;
		}
		
		
	function merchantSelected()
		{
			if ( document.MerchantSelected.MerchantID.options[document.MerchantSelected.MerchantID.selectedIndex].value != 0)
				{
					document.MerchantSelected.submit();
				}
			else
				{
					alert("Please select a retailer from the list.");
					document.MerchantSelected.MerchantID.focus();
					return false;
				}
		}



	function mOut(src,clrIn)
		{
			if (!src.contains(event.toElement))
				{
					src.style.cursor = 'default';
					src.bgColor = clrIn;
		 		}
		}
		

	function mOvr(src, clrOver)
		{
			if (!src.contains(event.fromElement))
				{
					src.style.cursor = 'default';
					src.bgColor = clrOver;
	 			}
		}
		


//
//
//
//	N

	function newImage(arg)
	{
	if (document.images)
		{
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}
	function NumbersAndLetters( textpassed )
		{
			var NumbersAndLetters = textpassed;
			if ( NumbersAndLetters != "" )
				{
					NandL = new RegExp("\\w","g");
					var test = NumbersAndLetters.match(NandL);
					if (test)
						{
							return test.join("");
						}
					else
						{
							return "";
						}
				}
			else
				{
					return "";
				}

		}
	
//
// 
//
//	O
	
	
	function onlynumbers(textpassed){
		if (textpassed != ""){
			numberreg = new RegExp("\\D","g");
			textpassed = textpassed.replace(numberreg,"");
			return textpassed;
		} else {
			return "";
		}
	}

//
// 
//
//	P	

	function preloadImages()
	{
		if (document.images)
		{
			tb_smartlabel_over = newImage("/images/tb_smartlabel_over.gif");
			tb_faq_over = newImage("/images/tb_faq_over.gif");
			tb_contact_over = newImage("/images/tb_contact_over.gif");
			preloadFlag = true;
		}
	}

//
// 
//
//	R

	function reDo() 
		{
		if (navigator.appname == "Netscape"){
	        if ((innerWidth != origWidth) || (innerHeight != origHeight)){
	            location.reload();
	            }
			}
		}




	function RequiredField( FormField )
		{
			FormField.style.cssText = 'background-color:InfoBackground';
		}


//
//
//
//	S

	function SelectTask(http) 
		{
			var selection;
			selection = document.taskForm.taskSelect[document.taskForm.taskSelect.selectedIndex].value;
			document.location.href=http + "&taskId=" + selection;
		}

	function scrolltobottom()
		{
			window.scroll(0,100000);
		}
		
	function showHelp(helpID) 
	{
        divHelp = document.getElementById(helpID);
        
        var helpPopBody = helpPopup.document.body;
        helpPopBody.style.backgroundColor = 'lightyellow';
        helpPopBody.style.border = 'solid black 1px';
        helpPopBody.style.padding = '5px';
        helpPopBody.style.fontFamily = 'Arial';
        helpPopBody.style.fontSize = '12px';
        helpPopBody.innerHTML = divHelp.innerHTML;

        // this hidden popup is used to calculate the height
        helpPopup.show(0, 0, 200, 0);
        
        var realHeight = helpPopBody.scrollHeight;
        // Hides the dimension detector popup object.
        helpPopup.hide();

        // Shows the actual popup object with correct height.
        helpPopup.show(20, -10, 200, realHeight, event.srcElement);            
    }
	
//
//
//
//  T	
	function trim(str)
		{ 
			str.replace(/^\s*/, '').replace(/\s*$/, '');
			return str;
		} 
	function infoWindow(path, name)
	{
        newWindow = window.open(path, name, 'menubar=no,location=no,toolbar=no,status=no,titlebar=no,scrollbars=yes,resizable=no,left=300,top=300,width=450,height=345,');	
	}
//
//
//
//	U

	function UnEnableField( FormField )
		{
			FormField.style.cssText = "background-color:ActiveWindow";
		}

//
//
//
//	V

	function ValidateEmail( Email )
		{
			var pattern=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/;
			var result=pattern.test(Email);
			return result;
		}

	function ValidatePhone( Phone )
		{
			var pattern=/^([\(]{1}[0-9]{3}[\)]{1}[ |\-]{0,1}|^[0-9]{3}[\-| ])?[0-9]{3}(\-| ){1}[0-9]{4}$/;
			var result=pattern.test(Phone);
			return result;
		}


	
	function ValidateZip(Zip)
		{
			var pattern=/^\d{5}$|^\d{5}\-\d{4}$/;
			var result=pattern.test(Zip);
			return result;
		}
