function Leave(){

alert("You are now leaving the Department of Agricultural Commissioner/"+
"Weights & Measures Website and linking to a Website that may contain commercial "+  
"advertising. The County of Los Angeles does not endorse or support any of the "+ 
"advertising that may be contained on this site."); 
}



function myfooter(){

today = new Date();
theyear = today.getYear() + 1900;
nextyear = theyear + 1;
ie4 = (document.all)? true:false;
if (ie4)
  {
   theyear = theyear - 1900;
   nextyear = nextyear - 1900; 
  }
copyrightyear = theyear + ' - ' + nextyear;
document.write('<font size=-1>Copyright © '+ copyrightyear +' L.A. County Department of Agricultural Commissioner/Weights & Measures. <br> All Rights Reserved. <br> Please read our <a href="/scripts/copyr.htm"> Privacy Policy</a> </font>'); 

}


function myfooterdata(){

today = new Date();
theyear = today.getYear() + 1900;
nextyear = theyear + 1;
ie4 = (document.all)? true:false;
if (ie4)
  {
   theyear = theyear - 1900;
   nextyear = nextyear - 1900; 
  }
copyrightyear = theyear + ' - ' + nextyear;
document.write('<font size=-1>Copyright © '+ copyrightyear +'All Rights Reserved. <br>Please read our <a href="/scripts/copyr.htm"> Privacy Policy</a> </font>'); 

}



function mydate(){

myday = new Date();
theday = myday.getDay();
themonth = myday.getMonth();
thedate = myday.getDate();
theyear = myday.getYear() + 1900;
ie4 = (document.all)? true:false;
if (ie4)
  {
   theyear = theyear - 1900;
  }
weekdays = new Array('Sunday', 'Monday', 'Tuesday','Wednesday','Thursday','Friday',
'Saturday');
months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
document.write('<b>'+ weekdays[theday] + ',   ' + months[themonth]+ '  ' + thedate + ', ' + theyear );

}



function mylinks(){

document.write('<FORM value=GO>');
document.write('<SELECT NAME="MENU" onchange="setLink(this.selectedIndex)">');
document.write('<OPTION SELECTED>--- SELECT A NEW PAGE SITE HERE ---');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>A');
document.write('<OPTION>About Us');
document.write('<OPTION>Administrative Services Bureau (Form)');
document.write('<OPTION>Africanized Honey Bee');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>B');
document.write('<OPTION>Buyer Beware Program');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>C');
document.write('<OPTION>Certified Farmers Markets in L.A. County');
document.write('<OPTION>Consumer Concerns');
document.write('<OPTION>Contact Us');
document.write('<OPTION>Coyote');
document.write('<OPTION>Current Job Openings');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>D');
document.write('<OPTION>Desaster Relief Programs');
document.write('<OPTION>Detailed Information on New Pests in Southern California');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>E');
document.write('<OPTION>Environmental Toxicology Bureau (Form)');
document.write('<OPTION>Environmental Toxicology Lab Services');
document.write('<OPTION>Environmental Protection Bureau (Form)');
document.write('<OPTION>Eucalyptus Psyllid');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>F');
document.write('<OPTION>Functional Organization Chart');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>G');
document.write('<OPTION>Gasoline Consumer Complaint Form');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>H');
document.write('<OPTION>Home');
document.write('<OPTION>How to Bee-Proof Your Home');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>M');
document.write('<OPTION>Maps');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>O');
document.write('<OPTION>Office Locations & Telephones Numbers');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>P');
document.write('<OPTION>Pest Exclusion and Produce Quality Bureau (Form)');
document.write('<OPTION>Pesticide Regulation');
document.write('<OPTION>Public Records');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>R');
document.write('<OPTION>Red Imported Fire Ant');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>S');
document.write('<OPTION>Scanner Overcharge Information');
document.write('<OPTION>Site Map');
document.write('<OPTION>Sites of Interest');
document.write('<OPTION>Strategic Plan 2001');
document.write('<OPTION>Structural Fumigation Notice of Intent');
document.write('<OPTION>Sudden Oak Death and Care of Native Oaks');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>T');
document.write('<OPTION>Termite & Fumigation');
document.write('<OPTION>The Los Angeles County Urban Wildlife Management Area');
document.write('<OPTION>__________________________________________________');
document.write('<OPTION>W');

document.write('<OPTION>Weed Hazard and Pest Management Bureau (Form)');
document.write('<OPTION>Weights and Measures Bureau (Form)');
document.write('</SELECT>');
document.write('</FORM>');
document.write('<SCRIPT LANGUAGE = "JAVASCRIPT">');
document.write('function setLink(num) {');
document.write('if (num ==0) {self.location="#"}');
document.write('if (num ==1) {self.location="#"}');
document.write('if (num ==2) {self.location="#"}');
document.write('if (num ==3) {self.location="http://acwm.lacounty.gov/scripts/aboutus.htm"}');
document.write('if (num ==4) {self.location="http://acwm.lacounty.gov/scripts/fbasb.cfm"}');
document.write('if (num ==5) {self.location="http://acwm.lacounty.gov/scripts/ahb.htm"}');
document.write('if (num ==6) {self.location="#"}');
document.write('if (num ==7) {self.location="#"}');
document.write('if (num ==8) {self.location="http://acwm.lacounty.gov/scripts/attscan.htm"}');
document.write('if (num ==9) {self.location="#"}');
document.write('if (num ==10) {self.location="#"}');
document.write('if (num ==11) {self.location="http://acwm.lacounty.gov/scripts/cfm.htm"}');
document.write('if (num ==12) {self.location="http://acwm.lacounty.gov/scripts/consumer.htm"}');
document.write('if (num ==13) {self.location="http://acwm.lacounty.gov/scripts/feedback.cfm"}');
document.write('if (num ==14) {self.location="http://acwm.lacounty.gov/scripts/coyo.htm"}');
document.write('if (num ==15) {self.location="http://acwm.lacounty.gov/scripts/position.htm"}');
document.write('if (num ==16) {self.location="#"}');
document.write('if (num ==17) {self.location="#"}');
document.write('if (num ==18) {self.location="http://acwm.lacounty.gov/scripts/DesasterRelief.htm"}');
document.write('if (num ==19) {self.location="http://acwm.lacounty.gov/scripts/pestpdf.htm"}');
document.write('if (num ==20) {self.location="#"}');
document.write('if (num ==21) {self.location="#"}');
document.write('if (num ==22) {self.location="http://acwm.lacounty.gov/scripts/fbetb.cfm"}');
document.write('if (num ==23) {self.location="http://acwm.lacounty.gov/scripts/etlb.htm"}');
document.write('if (num ==24) {self.location="http://acwm.lacounty.gov/scripts/fbepb.cfm"}');
document.write('if (num ==25) {self.location="http://acwm.lacounty.gov/scripts/lerpsum.htm"}');
document.write('if (num ==26) {self.location="#"}');
document.write('if (num ==27) {self.location="#"}');
document.write('if (num ==28) {self.location="http://acwm.lacounty.gov/scripts/chart.htm"}');
document.write('if (num ==29) {self.location="#"}');
document.write('if (num ==30) {self.location="#"}');
document.write('if (num ==31) {self.location="http://acwm.lacounty.gov/scripts/gasform.cfm"}');
document.write('if (num ==32) {self.location="#"}');
document.write('if (num ==33) {self.location="#"}');
document.write('if (num ==34) {self.location="http://acwm.lacounty.gov"}');
document.write('if (num ==35) {self.location="http://acwm.lacounty.gov/scripts/proofing.htm"}');
document.write('if (num ==36) {self.location="#"}');
document.write('if (num ==37) {self.location="#"}');
document.write('if (num ==38) {self.location="http://acwm.lacounty.gov/scripts/map.htm"}');
document.write('if (num ==39) {self.location="#"}');
document.write('if (num ==40) {self.location="#"}');
document.write('if (num ==41) {self.location="http://acwm.lacounty.gov/scripts/office.htm"}');
document.write('if (num ==42) {self.location="#"}');
document.write('if (num ==43) {self.location="#"}');
document.write('if (num ==44) {self.location="http://acwm.lacounty.gov/scripts/fbpep.cfm"}');
document.write('if (num ==45) {self.location="http://acwm.lacounty.gov/scripts/pesticide.htm"}');
document.write('if (num ==46) {self.location="http://acwm.lacounty.gov/scripts/board.cfm"}');
document.write('if (num ==47) {self.location="#"}');
document.write('if (num ==48) {self.location="#"}');
document.write('if (num ==49) {self.location="http://acwm.lacounty.gov/scripts/rifa.htm"}');
document.write('if (num ==50) {self.location="#"}');
document.write('if (num ==51) {self.location="#"}');
document.write('if (num ==52) {self.location="http://acwm.lacounty.gov/scripts/attscan.htm"}');
document.write('if (num ==53) {self.location="http://acwm.lacounty.gov/scripts/sitemap.htm"}');
document.write('if (num ==54) {self.location="http://acwm.lacounty.gov/scripts/sites.htm"}');
document.write('if (num ==55) {self.location="http://acwm.lacounty.gov/pdf/stplan.pdf"}');
document.write('if (num ==56) {self.location="http://acwm.lacounty.gov/scripts/stbrows.htm"}');
document.write('if (num ==57) {self.location="http://acwm.lacounty.gov/scripts/SuddenOakD.htm"}');
document.write('if (num ==58) {self.location="#"}');
document.write('if (num ==59) {self.location="#"}');
document.write('if (num ==60) {self.location="http://acwm.lacounty.gov/scripts/terfumi.htm"}');
document.write('if (num ==61) {self.location="http://acwm.lacounty.gov/scripts/uwma.htm"}');
document.write('if (num ==62) {self.location="#"}');
document.write('if (num ==63) {self.location="#"}');

document.write('if (num ==65) {self.location="http://acwm.lacounty.gov/scripts/fbwhp.cfm"}');
document.write('if (num ==66) {self.location="http://acwm.lacounty.gov/scripts/fbwmb.cfm"}}');

document.write('</SCRIPT>');

}


function myfootermenu(){

document.write('<style>');
document.write('a {text-decoration:none}');
document.write('</style>');
document.write('<table width="95%" border="0">');

document.write('<tr>');
document.write('<td align="center" valign="middle">'); 
document.write('<div align="center"><font size="2">');
document.write('<a href="http://acwm.lacounty.gov">Home</a> | ');
document.write('<a href="http://acwm.lacounty.gov/scripts/copyr.htm">Privacy Policy</a> | ');
document.write('<a href="http://acwm.lacounty.gov/scripts/sitemap.htm">Site Map</a> | '); 
document.write('<a href="http://acwm.lacounty.gov/scripts/feedback.cfm">Contact Us</a> | ');
document.write('<a href="http://acwm.lacounty.gov/scripts/board.htm">Public Records</a> | ');
document.write('<a href="http://acwm.lacounty.gov/acwmpriv/data_web.cfm">Private</a>');
document.write('</font></div>');
document.write('</td>');
document.write('</tr>');

document.write('</table>');
document.write('<P>');
}



function myagriculturalimage(){
document.write('<img src="../images/AgriLogo.gif" width="97" height="98">');
}


function myseallogo(){
document.write('<A href="http://lacounty.gov/"><IMG src="../images/1LACo_SEAL_color.gif" width="97" height="98" BORDER="0" ALT="L.A. County Online">');
}

function mytop(){
document.write('<a href="#Top"><img border="1" src="../images/top3.gif" width="100" height="30">');
}


function mycontactus(){
document.write('<A href="http://acwm.lacounty.gov/scripts/feedback.cfm"> <IMG BORDER="0" src="../images/contact1.gif" ALT="Contact Us"');
}


function mychildcare(){
document.write('<A href="http://childcare.co.la.ca.us" onclick="Leave()"> <IMG BORDER="1" width="200" height="40" '); 
document.write('img src="../images/kidcar.gif" ALT="L.A. County Child Care Directory"> ');
}

function mylacountyimage(){
document.write('<A href="http://countyofla.org" onclick="Leave()"> <IMG BORDER="1" width="103" height="26" '); 
document.write('img src="../images/home_collage.jpg" ALT="L.A. County Online"> ');
}

function mydelinquent(){
document.write('<A href="http://cssd.lacounty.gov/wps/portal/cssd/parents/mostwanted" onclick="Leave()"> <IMG BORDER=0 ');
document.write('img src="../images/dalink.gif" ALT="LA County Most Wanted: Delinquent Parents"> ');
}


//************************************************************************************************************

function myweedprogramcheck(){ 
 
if   (document.weedprogram.name.value == "" ||
      document.weedprogram.phoneA.value == ""  ||        
	  document.weedprogram.phoneB.value == ""  ||    
	  document.weedprogram.response.value == "" ){ 


     
        while(document.weedprogram.name.value == ""){
        document.weedprogram.name.value = window.prompt("Please fill in a: NAME or press CANCEL.","");
         } 
        while(document.weedprogram.response.value == ""){
        document.weedprogram.response.value = window.prompt("Please fill in a: RESPONSE or press CANCEL.","");
         }   
		while(document.weedprogram.phoneA.value == "") {
        document.weedprogram.phoneA.value = window.prompt("Please fill in a: AREA PHONE NUMBER or press CANCEL.","");
         } 
		while(document.weedprogram.phoneB.value == ""){
        document.weedprogram.phoneB.value = window.prompt("Please fill in a: PHONE NUMBER (THE LAST 7 DIGITS ONLY) or press CANCEL.","");}
	
  }
}

//************************************************************************************************************


function myweedformcheck(){ 

 valid = true;
  
  if   (document.form1.zone1.selectedIndex == 0){
	 alert ( "Please fill in the 'ZONE' box." );
     focus(); 
	 valid = false;
     }
  
  if   (document.form1.mapbook1.selectedIndex == 0){
	 alert ( "Please fill in the 'MAPBOOK #1' box." );
     focus(); 
	 valid = false;
     }


  if   (document.form1.mapbook2.selectedIndex == 0){
	 alert ( "Please fill in the 'MAPBOOK #2' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (document.form1.mapbook3.selectedIndex == 0){
	 alert ( "Please fill in the 'MAPBOOK #3' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (document.form1.mapbook4.selectedIndex == 0){
	 alert ( "Please fill in the 'MAPBOOK #4' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (document.form1.page1.selectedIndex == 0){
	 alert ( "Please fill in the 'PAGE #1' box." );
     focus(); 
	 valid = false;
     }
	 
	 
    if   (document.form1.page2.selectedIndex == 0){
	 alert ( "Please fill in the 'PAGE #2' box." );
     focus(); 
	 valid = false;
     }
	 
	 
    if   (document.form1.page3.selectedIndex == 0){
	 alert ( "Please fill in the 'PAGE #3' box." );
     focus(); 
	 valid = false;
     }
	 
	 
    if   (document.form1.parcel1.selectedIndex == 0){
	 alert ( "Please fill in the 'PARCEL #1' box." );
     focus(); 
	 valid = false;
     }
	 
	 
    if   (document.form1.parcel2.selectedIndex == 0){
	 alert ( "Please fill in the 'PARCEL #2' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (document.form1.parcel3.selectedIndex == 0){
	 alert ( "Please fill in the 'PARCEL #3' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (document.form1.name.value == ""){
	 alert ( "Please fill in the 'NAME' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (document.form1.mailaddress.value == ""){
	 alert ( "Please fill in the 'MAIL ADDRESS' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (document.form1.mailcity.value == ""){
	 alert ( "Please fill in the 'MAIL CITY' box." );
     focus(); 
	 valid = false;
     }
	 
	 
  if   (document.form1.mailstate.selectedIndex == 0){
	 alert ( "Please fill in the 'STATE' box." );
     focus(); 
	 valid = false;
     }
  
	  
	  
  if   (document.form1.mailzip.value == ""){
	 alert ( "Please fill in the 'ZIP CODE' box." );
     focus(); 
	 valid = false;
     }
    
return valid;
}


//***************************************************************************************************************



function mynewURLA(url){
window.open(url,'myWin','height=580,width=600,scrollbars=yes');
}


function mynewURL(url, height, width){
window.open(url,'myWin','height='+ height +',width='+ width +', scrollbars=no, resizable=no, titlebar=yes, menubar=no');
}




function mynewURLNew(url){
window.open(url);
}



//**********************************************************************************************

var r={
  'special':/[\W]/g,
  'quotes':/['\''&'\"']/g,
  'notnumbers':/[^\d]/g
}

function valid(o,w){
  o.value = o.value.replace(r[w],'');
}



//**********************************************************************************************



  function ownercomments(mycount)
 {
   var old = document.form1.counter.value;
   document.form1.counter.value=document.form1.ownerresponse.value.length;
   if(document.form1.counter.value > 100 && old <= 100) {
     alert('Too much data in the text box!');
     if(document.styleSheets) {
       document.form1.counter.style.fontWeight = 'bold';
       document.form1.counter.style.color = '#ff0000'; } }
   else if(document.form1.counter.value <= 100 && old > 100
	   && document.styleSheets ) {
       document.form1.counter.style.fontWeight = 'normal';
       document.form1.counter.style.color = '#000000'; } 
 }
 


//*************************************************************************************************



function checkMaxLength (textarea, evt, maxLength) {
  if (textarea.selected && evt.shiftKey) 
    // ignore shift click for select
    return true;
  var allowKey = false;
  if (textarea.selected && textarea.selectedLength > 0)
    allowKey = true;
  else {
    var keyCode = 
      document.layers ? evt.which : evt.keyCode;
    if (keyCode < 32 && keyCode != 13)
      allowKey = true;
    else           
      allowKey = textarea.value.length < maxLength;
  }
  textarea.selected = false;
  return allowKey;
}


//***********************************************************************************************


function storeSelection (field) {
  if (document.all) {
    field.selected = true;
    field.selectedLength = 
      field.createTextRange ?
        document.selection.createRange().text.length : 1;
  }
}


//**************************************************************************************************





  function WeedHazard(mycount)
 {
   var old = document.form1.counter.value;
   document.form1.counter.value=document.form1.WHComments.value.length;
   if(document.form1.counter.value > 100 && old <= 100) {
     alert('Too much data in the text box!');
     if(document.styleSheets) {
       document.form1.counter.style.fontWeight = 'bold';
       document.form1.counter.style.color = '#ff0000'; } }
   else if(document.form1.counter.value <= 100 && old > 100
	   && document.styleSheets ) {
       document.form1.counter.style.fontWeight = 'normal';
       document.form1.counter.style.color = '#000000'; } 
 }
 


//**********************************************************************************************



function numbersonly(myfield, e, dec) {
  var key;
  var keychar;

  if (window.event)
    key = window.event.keyCode;
  else if (e)
    key = e.which;
  else
    return true;
  keychar = String.fromCharCode(key);

  // control keys
  if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
    return true;

  // numbers
  else if ((("0123456789").indexOf(keychar) > -1))
    return true;

  // decimal point jump
  else if (dec && (keychar == ".")) {
    myfield.form.elements[dec].focus();
    return false;
  } else
    return false;
}


//**************************************************************************************************


function myWHCheck(){ 

 valid = true;
  
  if   (!(document.form1.WHDate.value)){
	 alert ( "Please fill in the 'DATE' box." );
     focus(); 
	 valid = false;
     }
  
  if   (!(document.form1.WHLocation.value)){
	 alert ( "Please fill in the 'Address/Location' box." );
     focus(); 
	 valid = false;
     }


  if   (!(document.form1.WHCross.value)){
	 alert ( "Please fill in the 'Cross Streets' box." );
     focus(); 
	 valid = false;
     }
	 
	 
   if   (!(document.form1.WHComments.value)){
	 alert ( "Please fill in the 'Nature of the Hazard' box." );
     focus(); 
	 valid = false;
     }
	
	
return valid;
}


//*********************************************************************************************************


function printDate()
{
  var today = new Date();
  var day=today.getDate();
  var month = today.getMonth() + 1;
  var year = today.getFullYear().toString();
  var box=document.form1.WHDate;//this is where we want to print the date
  if ( ( month /10 ) < 1 )
  {
    month=("0" + month).toString(); //add the leading 0 -- looks more professional
  }
  if ( (day/10)<1)
  {
    day=("0" + today.getDate()).toString();//add the leading 0 -- looks better
  }
  box.value=month + "/" + day + "/" + year;
}



//************************************************************************************





