function checkuncheck(containerID, checker) { 
var container = document.getElementById(containerID); 
var curobj = container.getElementsByTagName("input"); 
for (var i = 0; i < curobj.length; i++) 
if (curobj[i].type == "checkbox") 
curobj[i].checked = checker; 
} 

function validatecounties() {
 var box = document.select_county.county_select;
 for(i=0;i<box.length;i++)
   if(box[i].checked == true)
     return true;
 alert("You must select at lease one County.")
 return false;
} //end validate

function validate() {
 
 //get number of form elements
// var cnt_of_controls = formRef.elements.length; 
var cnt_of_controls = document.form1.zipselect.length; 
//define counter
var cnt_of_selectedboxes=0;

//loop through form items
  for(i=0;i<cnt_of_controls;i++){
   //see if it's a checkbox
   if(document.form1.zipselect[i].type == "checkbox"){
       // see if it's checked
      if(document.form1.zipselect[i].checked == true){
          //count it
        cnt_of_selectedboxes ++;
      }
    }
  }

// if too many selections
if (cnt_of_selectedboxes>90)
{
  //cancel submit
  alert("Please reduce the number of regions selected.")
 return false;
}
//end max regions validate

var box = document.form1.zipselect;
   atLeastOneSelected = false ;
   for( i = 0 ; i < box.length ; i++ )
   {
      if(box[i].checked == true)
      {
         atLeastOneSelected = true ;
         break ;
      }
   } 
   if( !atLeastOneSelected )
   {
      alert("You must select at least one region.")    
      return false;
   }

//end zipselect validate
	var box1 = document.form1.ptype;
	   atLeastOnePtypeSelected = false ;
	   for( i = 0 ; i < box1.length ; i++ )
	   {
		  if(box1[i].checked == true)
		  {
			 atLeastOnePtypeSelected = true ;
			 break ;
		  }
	   } 
	   if( !atLeastOnePtypeSelected )
	   {
		  alert("You must select at least one property type.")    
		  return false;
	   }
}

//end ptype validate


function validate2() {
 
 //get number of form elements
// var cnt_of_controls = formRef.elements.length; 
var cnt_of_controls = document.form1.zipselect.length; 
//define counter
var cnt_of_selectedboxes=0;

//loop through form items
  for(i=0;i<cnt_of_controls;i++){
   //see if it's a checkbox
   if(document.form1.zipselect[i].type == "checkbox"){
       // see if it's checked
      if(document.form1.zipselect[i].checked == true){
          //count it
        cnt_of_selectedboxes ++;
      }
    }
  }

// if too many selections
if (cnt_of_selectedboxes>90)
{
  //cancel submit
  alert("Please reduce the number of regions selected.")
 return false;
}

 
var box = document.form1.zipselect;
   atLeastOneSelected = false ;
   for( i = 0 ; i < box.length ; i++ )
   {
      if(box[i].checked == true)
      {
         atLeastOneSelected = true ;
         break ;
      }
   } 
   if( !atLeastOneSelected )
   {
      alert("You must select at least one region.")    
      return false;
   }


//end zipselect validate
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


//end commptype validate
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

