// *****************************************************************************		
function nigpSearch() {
  var desc = trim(window.document.nigpsearchform.desc.value);
  var code = trim(window.document.nigpsearchform.code.value);

  if (desc.length < 1 && code.length < 1) {
	alert("Please enter a Description AND/OR a Category Code");
	return false;
  } else if (desc.length > 0 && desc.length < 3) {
	alert("Please enter a Description of 3 characters or more");
	return false;
  } else if (code.length > 0 && (code.length != 3)) {
	alert("Please enter a 3 digit Category Code");
	return false;
  } else {
    window.open('http://www.nysthruway.gov/nigp/index.jsp?desc='+desc+'&code='+code,'nigpwindow','top=0,left=0,width=800,height=600,scrollbars,resizable,status');
	return false; // fake out form submit
  }
}  // end function

function nigpList(argBeg, argEnd) {
  var w = window.open('http://www.nysthruway.gov/nigp/list.jsp?beg='+argBeg+'&end='+argEnd,'nigpwindow','top=0,left=0,width=800,height=600,scrollbars,resizable,status');
  w.focus();  // need to set focus because window can be minimized
}  // end function
// *****************************************************************************		
function trim(strIn) { 	return strIn.replace(/^\s+|\s+$/g,""); }
// *****************************************************************************		
