function go(form) {
   window.location = form.range.options[form.range.selectedIndex].value;

}
   
function preload_images () {
   var d = document;
	 if (!d.imgs) { d.imgs = new Array(); }
	 var j = d.imgs.length, args = preload_images.arguments, i;
	 for (i = 0; i < args.length; i++) {
		  d.imgs[j] = new Image;
			d.imgs[j].src = args[i];
			j++;
	 }
}


 function bookmark(title)
 {

   var urlAddress = location.href;
   var pageName = title;
   var browser = navigator.appName;

  if (browser == 'Microsoft Internet Explorer')
  {
     window.external.AddFavorite(urlAddress,pageName)
  }
  else if (browser == 'Netscape')
  { 
     alert("Your browser does not support this feature.  Use CTRL-D to bookmark this page");
  }
  else
  { 
   alert("Your browser does not support this feature.");
  }
 }


function addbookmark()
{
bookmarkurl="http://www.hartfordyork.com"
bookmarktitle="Hartford York Hats, the worlds finest hats and accessories!"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function stateField(theForm) {
 var cntForm = theForm.length;
 for(var i=0;i<cntForm;i++) {
  item = theForm.elements[i];
  if(item.name.substr(0,7) == 's_state') {
   newItem = item.value.split('.');
   var cntItems = newItem.length; var fixedST = '';
   for(var x=0;x<cntItems;x++) {
    if(newItem[x] != '.') {
     fixedST = fixedST + newItem[x];
    }
   }
   item.value = fixedST;
  }
 }
 return true;
}

function checkCC(cField) {
  ccField = document.getElementById('ccField');
  for(var i=0,n=cField.options.length;i<n;i++) {
    ccField.options[0] = null;
  }
  if(cField.value != 'United States') {
    ccField.options[0] = new Option('American Express','AX');
  } else {
    ccField.options[0] = new Option('Visa','VI');
    ccField.options[1] = new Option('Mastercard','MC');
    ccField.options[2] = new Option('American Express','AX');
    ccField.options[3] = new Option('Discover','DI');
  }
}
//This is used to hide/expand any div you want
//here you place the ids of every element you want. For example: Array('a1','a2','a3','thiscanbeanything')
var ids=new Array('shipping_form');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}