		  function SetLevel(idx) {
			  var f = document.forms[0]
				f.level.value = idx
				f.submit()
			}

	// Image Swape functions
	function imgOn(imgName) {
		window.document.images[imgName].src = eval(imgName + "On.src");
	}
	
	function imgOff(imgName) {
		window.document.images[imgName].src = eval(imgName + "Off.src");
	}

		// Preload
		cvxBrandOn = new Image();
		cvxBrandOn.src = "/texaco/graphics/cvx_brand_on.gif";
	
		cvxBrandOff = new Image();
		cvxBrandOff.src = "/texaco/graphics/cvx_brand_off.gif";


	var bad_Chars = "/$`~!%^*()+=\\|[]{}?<>\"";

    function isValidChar(testStr) {
      var t, n
      n = testStr.toString();
      for (var i = 0; i < n.length; i++) {
        t= n.charAt(i)
	    if(bad_Chars.indexOf(t) > -1) { return false; }
      }
      return true
    }
  
    function isBlank(testStr) {
 	  var n = testStr;
 	  n = n.toString();
  	  if (n.length == 0)
        return true
  	  for (var i = 0; i <= n.length-1; i++) {
    	if (n.charAt(i) != " ")
          return false
      }
      return true
    }
	

// Preload Top Nav Images - Off States

texacoHomeOn = new Image();
texacoHomeOn.src = "/sitelets/images/nav_texacohome_on.gif";

texacoHomeOff = new Image();
texacoHomeOff.src = "/sitelets/images/nav_texacohome_off.gif";

cvxBrandOn = new Image();
cvxBrandOn.src = "/sitelets/images/cvx_brand_on.gif";

cvxBrandOff = new Image();
cvxBrandOff.src = "/sitelets/images/cvx_brand_off.gif";



	// Image Swape functions
	function imgOn(imgName) {
		window.document.images[imgName].src = eval(imgName + "On.src");
	}
	
	function imgOff(imgName) {
		window.document.images[imgName].src = eval(imgName + "Off.src");
	}

		// Preload
		cvxBrandOn = new Image();
		cvxBrandOn.src = "/findatexaco/graphics/cvx_brand_on.gif";
	
		cvxBrandOff = new Image();
		cvxBrandOff.src = "/findatexaco/graphics/cvx_brand_off.gif";


	var bad_Chars = "/$`~!%^*()+=\\|[]{}?<>\"";

    function isValidChar(testStr) {
      var t, n
      n = testStr.toString();
      for (var i = 0; i < n.length; i++) {
        t= n.charAt(i)
	    if(bad_Chars.indexOf(t) > -1) { return false; }
      }
      return true
    }
  
    function isBlank(testStr) {
 	  var n = testStr;
 	  n = n.toString();
  	  if (n.length == 0)
        return true
  	  for (var i = 0; i <= n.length-1; i++) {
    	if (n.charAt(i) != " ")
          return false
      }
      return true
    }
	
	function validateForm() {

	  var f = document.forms[0]
	  var c = 0;
	  var t = ""
	  var nm = Array("fa","fc","zip")
	  var sc = Array(4)
		
		f.queryRadius.value = f.miles.options[f.miles.selectedIndex].value		
		
           sc[0] = f.elements[nm[0]].value
           sc[1] = f.elements[nm[1]].value
           sc[2] = f.elements[nm[2]].value

		if (!isValidChar(sc[0])) {
		  alert("No special characters allow for address field")
			f.elements[nm[0]].focus()
			return false
		}
		
		if (!isValidChar(sc[1])) {
		  alert("No special characters allow for City field")
			f.elements[nm[1]].focus()
			return false
		}

		if (!isValidChar(sc[2])) {
		  alert("No special characters allow for Zip code field")
			f.elements[nm[2]].focus()
			return false
		}
    			 
	   t = f.fs.options.selectedIndex
	   if ( (t!=0 && !isBlank(sc[1])) || !isBlank(sc[2])) c++;
	   
	  if (c > 0)
	    return true
	  else {
	    alert("Please fill in at least a city and state or zip code")	    
	    return false
          }
	}


    function goValidateForm() {
      var f = document.forms[0]
      if(validateForm()) {
         f.submit()
      } else {
         return false
      }
         
    }

var newWindow = null; 
function openWindow(contentURL,windowName,windowWidth,windowHeight) { 
        widthHeight = 'height=' + windowHeight + ',width=' + windowWidth + ',menubar=no,scrollbars=yes,resizable=yes,top=20,left=20';

        newWindow = window.open(contentURL,windowName,widthHeight); 

        newWindow.focus() 
} 

function goPrint(toTemplate) {
  loc = document.location + '';
  loc = loc.replace('ph=250', 'ph=525');
  loc = loc.replace('pw=315', 'pw=525');
  location=loc+'&template='+toTemplate;
}

function goBack(fromTemplate) {
  loc = document.location + '';
  loc = loc.replace('ph=525', 'ph=250');
  loc = loc.replace('pw=525', 'pw=315');
  location=loc.replace('&template='+fromTemplate, '');
}
