			function hideElement(IDIN)
			{
				if(document.getElementById)
				{
					// this is the way the standards work
					if(document.getElementById(IDIN))document.getElementById(IDIN).style.display = "none";
				}
				else if(document.all)
				{
					// this is the way old msie versions work
					document.all[IDIN].style.display = "none";
				}
				//alert("Did it hide?");
			}// hideElement

			function showElement(IDIN)
			{
				if(document.getElementById)
				{
					// this is the way the standards work
					document.getElementById(IDIN).style.display = "block";
				}
				else if(document.all)
				{
					// this is the way old msie versions work
					document.all[IDIN].style.display = "block";
				}
				//alert("Did it show?");
			}// showElement

			function getWindowWidth() 
			{
				var MyWidth=0, MyHeight=0;
				
				if(typeof(window.innerWidth)=='number') 
				{
					// Non-IE
					MyWidth = window.innerWidth;
					MyHeight = window.innerHeight;
				} 
				else if(document.documentElement &&(document.documentElement.clientWidth || document.documentElement.clientHeight))
				{
					// IE 6+ in 'standards compliant mode'
					MyWidth = document.documentElement.clientWidth;
					MyHeight = document.documentElement.clientHeight;
				} 
				else if(document.body &&(document.body.clientWidth || document.body.clientHeight)) 
				{
					// IE 4 compatible
					MyWidth = document.body.clientWidth;
					MyHeight = document.body.clientHeight;
				}
				
				//window.alert( 'Width = ' + myWidth );
				
				return MyWidth;
			}// getWindowWidth

			function removeSuffix(StringIN, SuffixIN)
			{	
				TempIndex = StringIN.lastIndexOf(SuffixIN);				
				return StringIN.substring(0,TempIndex);				
			}// removeSuffix


			function getImageX(ImageNameIN)
			{
				var obj = document.images[ImageNameIN];
				var CurrentX = 0;
				
				if(!document.images[ImageNameIN])
				{ 
					alert("Did not find image named "+ImageNameIN);
					return -1;
				}
					
				if (obj.offsetParent)
				{
					while (obj.offsetParent)
					{
						CurrentX += obj.offsetLeft
						obj = obj.offsetParent;
					}
				}
				else if (obj.x) CurrentX += obj.x;
				return CurrentX;
			}// getImageX
			
			function getImageY(ImageNameIN)
			{
				var obj = document.images[ImageNameIN];
				var YOUT = 0;
				
				if(!document.images[ImageNameIN])
				{ 
					alert("Did not find image named "+ImageNameIN);
					return -1;
				}
					
				if (obj.offsetParent)
				{
					while (obj.offsetParent)
					{
						YOUT += obj.offsetTop
						obj = obj.offsetParent;
					}
				}
				else if (obj.y) YOUT += obj.y;
				return YOUT;
			}// getImageY

			function trim(StringIN)
			{
				return StringIN.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
			}// trim




			function toggle_search_tabs( show ) 
			{
				var cat = document.getElementById('search_categories');
				var cat_tab = document.getElementById('search_categories_tab');
				var brand = document.getElementById('search_brand');
				var brand_tab = document.getElementById('search_brand_tab');

				if( !cat || !brand ) {
					return;
				}

				if( show == 'brand' ) {
					// hide
					cat.style.display = 'none';
					cat_tab.className = 'tab tab_inactive';

					// show
					brand.style.display = 'block';
					brand_tab.className = 'tab';


				} else {
					// hide
					brand.style.display = 'none';
					brand_tab.className = 'tab tab_inactive';

					// show
					cat.style.display = 'block';
					cat_tab.className = 'tab';
				}

			}// toggle_search_tabs


			function same_address( prefix ) 
			{
				document.getElementById('bill_name').value = document.getElementById(prefix + 'name').value;
				document.getElementById('bill_address1').value = document.getElementById(prefix + 'address1').value;
				document.getElementById('bill_address2').value = document.getElementById(prefix + 'address2').value;
				document.getElementById('bill_city').value = document.getElementById(prefix + 'city').value;
				document.getElementById('bill_state').value = document.getElementById(prefix + 'state').value;
				document.getElementById('bill_zip').value = document.getElementById(prefix + 'zip').value;
			}

			function corp_ship_address( el, prefix) {
				if(!el)
					return;
				var value = el.options[el.selectedIndex].value;
				if(!value)
					return;
				eval(value);
				document.getElementById(prefix+'name').value = name;
				document.getElementById(prefix+'address1').value = address1;
				document.getElementById(prefix+'address2').value = address2;
				document.getElementById(prefix+'city').value = city;
				document.getElementById(prefix+'state').value = state;
				document.getElementById(prefix+'zip').value = zip;
			}

			function any_event( name, params ) {
				if( name != '') {
					var img = new Image(1,1);
					img.src = "/et/"+ name +"?"+ params;
				}
			}

			var submitted = 0;
			function single_click() {
				submitted++;
				if( submitted == 1 ) {
					return true;
				}
				return false;
			}

