var CUSTOM_MESSAGE = "";

// no spiders!
var samco = "samco";
var domain = "sporthoses.com";

function placeFocus() {
    if (document.forms.length > 0) {
    var field = document.forms[0];
    for (i = 0; i < field.length; i++) {
        if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
            document.forms[0].elements[i].focus();
            break;
        }
      }
   }
}

// Popup window
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height) {
  if(popUpWin) {
    if(!popUpWin.closed) popUpWin.focus();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=yes,copyhistory=yes,width='
      +width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function setMessage() {
	CUSTOM_MESSAGE = "Please allow up to 4-6 weeks for the delivery this\nnon-stocked color, as it is specially ordered from the\nmanufacturer.";
}

/*
 * Displays message for colors that need special ordering.
 */
function processColor(type) {
	setMessage();
	var color = document.orderForm.color.value;
	if (isSpecialColor(color)) {
		return false;
	}
	if ((color != "Blue") && (color != "Black") && (color != "Red")) {
		CUSTOM_MESSAGE += " Please note that hoses in " + color + " are\nnon-returnable/refundable."
	}
	if (color != "Blue") {
		if (type != "Coupler" && type != "Kit") {
			alert(CUSTOM_MESSAGE);
		} else if (color != "Black" && color != "Red") {
			alert(CUSTOM_MESSAGE);
		}
	}
    return false;
}