

function openWin(){
   window.open("","agtWin","width=600, height=600, resizeable=yes");

}

function validateBlankField(string) {
	  var charBlank = "                                                  ";
	  if (string.substr(0,string.length)==charBlank.substr(0,string.length)) {
         return false;
	  }}
function validateBoxes() {
var b = document.boxes;
   if (b.lifeInsBox2.checked==false && 
       b.annBox.checked==false &&
       b.finExpBox.checked==false &&
       b.preNeedBox.checked==false &&
       b.grpInsBox.checked==false){
	   window.alert ("Select at least 1 Product");
	   b.lifeInsBox2.focus();
         return false;
   } else {
     if (validateBlankField(b.clientZip.value) == false) {
	    window.alert ("Zip Code Must Be Entered.");
	    b.clientZip.focus();
	    return false;
     }}}

function checkType() {
var b = document.boxes;
 if (validateBoxes() != false) { 
  if (b.lifeInsBox2.checked || b.annBox.checked || b.finExpBox.checked) {
     b.agtType.value = 'L';
  } else {
     b.agtType.value = ' ';
  }
  if (b.preNeedBox.checked)  {
     b.typePre.value = 'P';
  } else {
     b.typePre.value = ' ';
  }
  if (b.grpInsBox.checked)  {
     b.typeGroup.value = 'G';
  } else {
     b.typeGroup.value = ' ';
  }
//  openWin();
  return true;
 } else {
  return false;
 }
 
 }


     function checkState(){
  
    if (document.selectPCState.pcState.options[0].selected==true){
      alert("Please choose a state from the P&C Locator list");
      document.selectPCState.pcState.focus();
      return false;
    }else{
	  if (document.selectPCState.pcState.options[1].selected==true){
      document.selectPCState.action="javascript:launchIdaho();"
	  }else{
	    if (document.selectPCState.pcState.options[2].selected==true){
		document.selectPCState.action="javascript:launchOregon();"
}else{
	    if (document.selectPCState.pcState.options[3].selected==true){
		document.selectPCState.action="javascript:launchUtah();"
	    } }}

	  document.selectPCState.buttonsearch.submit();
	}}
function launchOregon(){
//resetState();
window.open('/Portfolio/launchLocator_OR.html', 'Locator','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=650,height=550');	
}
function launchIdaho(){	  
//resetState();
window.open('/Portfolio/launchLocator.html', 'Locator','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=650,height=550');
}
function launchUtah(){	  
//resetState();
window.open('/Portfolio/launchLocatorUT.html', 'Locator','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=550,height=550');
}
function resetState(){	   
document.selectPCState.pcState.selectedIndex=0;
}