
//*********************************************************************
function setLOCBOX(whatLOC)
{
var thisForm = document.forms[0]
thisForm.LOCBOX.value=whatLOC;
disPOPa();
}
//*********************************************************************
function showMonth(whatDetail)
{
var thisForm = document.forms[0]
if (whatDetail != 'A'){
	document.getElementById("MONTH").style.display="block";
	thisForm.MONTH.style.display="block";
	}
else{
	document.getElementById("MONTH").style.display="none";
	thisForm.MONTH.style.display="block";
	}
}
//**************************************************************************
function setIBIF_ex(fex)
{
var thisForm = document.forms[0]
 thisForm.IBIF_ex.value = fex;
 showPSRadioButton();

}
//**************************************************************************
function showNextLayer(whatLayer)
{
var thisForm = document.forms[0]
thisForm.OFFBOX.style.display="none";
thisForm.ARRBOX.style.display="none";
thisForm.OFFCODE.style.display="none";
thisForm.HOMBOX.style.display="none";
thisForm.HOMTYPE.style.display="none";
thisForm.CIRCUML.style.display="none";
thisForm.CIRCUMA.style.display="none";
thisForm.CIRCUMB.style.display="none";
thisForm.CIRCUMC.style.display="none";
thisForm.CIRCUMD.style.display="none";
thisForm.WEAPON.style.display="none";
thisForm.ARSBOX.style.display="none";
thisForm.ARSBOX1.style.display="none";
thisForm.DOMBOX.style.display="none";	
thisForm.PROBOX.style.display="none";
thisForm.OFFBOX.style.display="none";
thisForm.LEOBOX.style.display="none";
thisForm.EMPBOX.style.display="none";
thisForm.COUNTY.style.display="none";
thisForm.CIRCUM.value="";
setPage('wf')	
switch(whatLayer)
	{
	case "OffTol":
		thisForm.OFFBOX.style.display="block";
		thisForm.OFFBOX.value="CJ550101";
		thisForm.OFFCODE.value="X";
		setIBIF_ex(thisForm.OFFBOX.value);
		thisForm.GEOSEL.style.display="block";
		break
	case "Arrest":
		thisForm.ARRBOX.style.display="block";
		thisForm.ARRBOX.value="CJ550201";
		setIBIF_ex(thisForm.ARRBOX.value);
		showNextLayer("CJ550201")
		thisForm.GEOSEL.style.display="block";
		break
	case "CJ550201":
		thisForm.ARRBOX.style.display="block";
		break
	case "CJ550202":
		thisForm.ARRBOX.style.display="block";
		thisForm.OFFCODE.style.display="block";
		break		
	case "CJ550203":
		thisForm.ARRBOX.style.display="block";
		break		
	case "SuppHom":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMBOX.value="CJ550301";
		setIBIF_ex(thisForm.HOMBOX.value);
		thisForm.GEOSEL.style.display="block";
		break
	case "CJ550301":
		thisForm.HOMBOX.style.display="block";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "CJ550302":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMTYPE.style.display="block";
		thisForm.HOMTYPE.value="L";
		thisForm.CIRCUML.style.display="block";
		thisForm.CIRCUML.value="00";
		thisForm.CIRCUM.value=thisForm.CIRCUML.value;
		thisForm.WEAPON.style.display="block";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "CJ550303":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMTYPE.style.display="block";
		thisForm.HOMTYPE.value="L";
		thisForm.CIRCUML.style.display="block";
		thisForm.CIRCUML.value="00";
		thisForm.CIRCUM.value=thisForm.CIRCUML.value;
		thisForm.WEAPON.style.display="block";
		thisForm.WEAPON.value="00";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "CJ550304":
		thisForm.HOMBOX.style.display="block";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "L":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMTYPE.style.display="block";
		thisForm.CIRCUML.style.display="block";
		thisForm.CIRCUML.value="00";
		thisForm.CIRCUM.value=thisForm.CIRCUML.value;
		thisForm.WEAPON.style.display="block";
		thisForm.WEAPON.value="00";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "A":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMTYPE.style.display="block";
		thisForm.CIRCUMA.style.display="block";
		thisForm.CIRCUMA.value="AA";
		thisForm.CIRCUM.value=thisForm.CIRCUMA.value;
		thisForm.WEAPON.style.display="block";
		thisForm.WEAPON.value="00";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "B":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMTYPE.style.display="block";
		thisForm.CIRCUMB.style.display="block";
		thisForm.CIRCUMB.value="BA";
		thisForm.CIRCUM.value=thisForm.CIRCUMB.value;
		thisForm.WEAPON.style.display="block";
		thisForm.WEAPON.value="00";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "C":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMTYPE.style.display="block";
		thisForm.CIRCUMC.style.display="block";
		thisForm.CIRCUMC.value="CA";
		thisForm.CIRCUM.value=thisForm.CIRCUMC.value;
		thisForm.WEAPON.style.display="block";
		thisForm.WEAPON.value="00";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "D":
		thisForm.HOMBOX.style.display="block";
		thisForm.HOMTYPE.style.display="block";
		thisForm.CIRCUMD.style.display="block";
		thisForm.CIRCUM.value=thisForm.CIRCUMD.value;
		thisForm.WEAPON.style.display="block";
		setIBIF_ex(thisForm.HOMBOX.value);
		break
	case "Arson":
		thisForm.ARSBOX.style.display="block";
		thisForm.ARSBOX.value="CJ550401";
		setIBIF_ex(thisForm.ARSBOX.value);
		thisForm.GEOSEL.style.display="block";
		break		
	case "CJ550401":
		thisForm.ARSBOX.style.display="block";
		setIBIF_ex(thisForm.ARSBOX.value);
		break			
	case "CJ550402":
		thisForm.ARSBOX.style.display="block";
		thisForm.ARSBOX1.style.display="block";
		thisForm.ARSBOX1.value="X";
		setIBIF_ex(thisForm.ARSBOX.value);
		break

	case "DomVio":
		thisForm.DOMBOX.style.display="block";
		setIBIF_ex(thisForm.DOMBOX.value);
		thisForm.GEOSEL.style.display="block";
		break
	case "Prop":
		thisForm.PROBOX.style.display="block";
		thisForm.PROBOX.value="CJ550601";
		setIBIF_ex(thisForm.PROBOX.value);
		thisForm.GEOSEL.style.display="block";
		break
	case "LEOKA":
		thisForm.LEOBOX.style.display="block";
		thisForm.LEOBOX.value="CJ550701";
		setIBIF_ex(thisForm.LEOBOX.value);
		thisForm.GEOSEL.style.display="block";
		break
	case "Empl":
		thisForm.EMPBOX.style.display="block";
		setIBIF_ex(thisForm.EMPBOX.value);
		thisForm.GEOSEL.style.display="block";
		break
	case "DrgLabMap":
		setPage('pdf')
		/*setYear('2009')*/
		thisForm.YEAR.style.display="block";
		thisForm.multipleYEAR.style.display="none";
		thisForm.pctchangeYEAR.style.display="none";
		thisForm.methYEAR.style.display="none";
		thisForm.PropertyCrime.style.display="none";
		thisForm.ViolentCrime.style.display="none";
		thisForm.MethLabs.style.display="none";
		break
	case "FatalsMap":
		setPage('pdf')
		setYear('2006')
		thisForm.YEAR.style.display="none";
		thisForm.singleYEAR.style.display="block";
		thisForm.multipleYEAR.style.display="none";		
		break
	case "CrimeIndexMaps":
			setPage('maps')
			setYear('2006')						
			thisForm.COUNTY.style.display="block";
			thisForm.COUNTY.value="All Counties";
			thisForm.YEAR.style.display="none";
			thisForm.singleYEAR.style.display="block";
			thisForm.PropertyCrime.style.display="none";
			thisForm.ViolentCrime.style.display="none";
			thisForm.MethLabs.style.display="none";
		break
	case "MethlabMaps":
			setPage('pdf')							
			thisForm.YEAR.style.display="none";
			thisForm.multipleYEAR.style.display="block";
			thisForm.pctchangeYEAR.style.display="none";
			thisForm.MethLabs.style.display="block";
			thisForm.MethLabs.value="meth_lab_totals";
			thisForm.PropertyCrime.style.display="none";
			thisForm.ViolentCrime.style.display="none";
		break
	case "PropertyCrimeMaps":
			setPage('pdf')
			setYear('2006')
			thisForm.PropertyCrime.style.display="block";
			thisForm.PropertyCrime.value="property_crime_rate";					
			thisForm.YEAR.style.display="block";
			thisForm.multipleYEAR.style.display="none";
			thisForm.pctchangeYEAR.style.display="none";
			thisForm.methYEAR.style.display="none";
			thisForm.ViolentCrime.style.display="none";
			thisForm.MethLabs.style.display="none";
		break
	case "ViolentCrimeMaps":
			setPage('pdf')
			setYear('2006')
			thisForm.ViolentCrime.style.display="block";
			thisForm.ViolentCrime.value="violent_crime_rate";					
			thisForm.YEAR.style.display="block";
			thisForm.multipleYEAR.style.display="none";
			thisForm.pctchangeYEAR.style.display="none";
			thisForm.methYEAR.style.display="none";
			thisForm.PropertyCrime.style.display="none";
			thisForm.MethLabs.style.display="none";
		break
	case "PropertyViolentCrimeMaps":
			setPage('troops')
			setYear('2006')
			thisForm.TROOP.style.display="block";
			thisForm.TROOP.value="All Troops";
		break
	case "PossVsSaleMfgDrugsMaps":
			setPage('troops')
			setYear('2006')
			thisForm.TROOP.style.display="block";
			thisForm.TROOP.value="All Troops";
		break
	case "AgcyStatus":
		setPage('pdf')
		break
	case "": //added
		setIBIF_ex("");
		thisForm.YEAR.style.display="block";
		thisForm.singleYEAR.style.display="none";
		thisForm.multipleYEAR.style.display="none";
		thisForm.PropertyCrime.style.display="none";
		thisForm.ViolentCrime.style.display="none";
		thisForm.MethLabs.style.display="none";
		break
	}
setLocation(); //added
disPOPa();
}
//*********************************************************************
function changeCir(whatCir)
{
var thisForm = document.forms[0];
thisForm.CIRCUM.value=whatCir;
}
//*********************************************************************

function changeLoc(whatLoc)
{
var thisForm = document.forms[0];
thisForm.CTYBOX.style.display="none";
thisForm.COLBOX.style.display="none";

switch(whatLoc)
	{
	case "S":
		thisForm.LOCBOX.value='';
		thisForm.CTYBOX.value='';
		thisForm.COLBOX.value='';
		break
	case "Y":
		thisForm.CTYBOX.style.display="block";
		thisForm.CTYBOX.value='ALL';
		thisForm.LOCBOX.value='';
		thisForm.COLBOX.value='';

		break
	case "L":
		setLocation()
		thisForm.CTYBOX.value='';
		thisForm.COLBOX.value='';
		break
	case "C":
		thisForm.COLBOX.style.display="block";
		thisForm.COLBOX.value='ALL';
		thisForm.LOCBOX.value='';

		break
	}
setLocation()
disPOPa();
}
//*********************************************************************
function disPOPa() {
var thisForm = document.forms[0]
if (thisForm.GEOSEL.value=="S") 
  	{
	thisForm.POPBOX.selectedIndex=0;
	thisForm.POPBOX.style.display="none";
	thisForm.POPBOX.value="99";
    } 
else if (thisForm.GEOSEL.value=="C") 
  	{
	thisForm.POPBOX.selectedIndex=0;
	thisForm.POPBOX.style.display="none";
	thisForm.POPBOX.value="99";
    } 
else if ((thisForm.GEOSEL.value=="Y") && (thisForm.CTYBOX.value!="ALL")) 
  	{
	thisForm.POPBOX.selectedIndex=0;
	thisForm.POPBOX.style.display="none";
	thisForm.POPBOX.value="99";
    } 
else if ((thisForm.GEOSEL.value=="L") && (thisForm.LOCBOX.value!="ALL")) 
  	{
	thisForm.POPBOX.selectedIndex=0;
	thisForm.POPBOX.style.display="none";
	thisForm.POPBOX.value="99";
    } 
else if (((thisForm.GEOSEL.value=="Y") || (thisForm.GEOSEL.value=="L")) &&
 ((thisForm.IBIF_ex.value =="CJ550201") || (thisForm.IBIF_ex.value =="CJ550202"))) 
        {
		thisForm.POPBOX.selectedIndex=0;
		thisForm.POPBOX.style.display="none";
		thisForm.POPBOX.value="99";
    	}

else if (thisForm.IBIF_ex.value =="CJ550301") 
  	{
	thisForm.POPBOX.selectedIndex=0;
	thisForm.POPBOX.style.display="none";
	thisForm.POPBOX.value="99";
    }  
else if (thisForm.IBIF_ex.value =="CJ550702") 
  	{
	thisForm.POPBOX.selectedIndex=0;
	thisForm.POPBOX.style.display="none";
	thisForm.POPBOX.value="99";
    }  
else 
	{
	thisForm.POPBOX.style.display="block";
    }
}
//*********************************************************************

function validateForSubmit()
{
var thisForm = document.forms[0];
if(thisForm.IBIF_ex.value=='')
	{
	alert("please select a report");
    return false;
    }
}
//*********************************************************************
function onSubmit() {
var thisForm = document.forms[0];
  //displayFields(); // Used to display values in fields before the form is submitted


	var loadingPage='data_and_statistics_ucr_query_wait.html';
	var w='800';
	var h='400';
  	var winl = (screen.width-w)/2;
  	var wint = (screen.height-h)/2;
 	var settings  ='height='+h+',';
      	settings +='width='+w+',';
      	settings +='top='+wint+',';
      	settings +='left='+winl+',';
      	settings +='menubar=yes,';
      	settings +='toolbar=yes,';
      	settings +='scrollbars=yes,';
      	settings +='location=yes,';
      	settings +='resizable=yes,';

 if (thisForm.RPTSELECT.value=="DrgLabMap")
 	{  	
  	site = "/MSHPWeb/Publications/Reports/";
 	site += thisForm.YEAR.value  + "StatewideLabIncidents.pdf";
     win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 if (thisForm.RPTSELECT.value=="FatalsMap")
 	{  	
  	site = "http://isd132:9081/eCrashMaps/MapInitialAction";
 	//site += thisForm.singleYEAR.value  + "StatewideLabIncidents.pdf";
     win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 if (thisForm.RPTSELECT.value=="CrimeIndexMaps")
  	{   	
   	site = "/MSHPWeb/Publications/Reports/CrimeIndexMaps/";
  	site += thisForm.singleYEAR.value + thisForm.COUNTY.value  + "_crime.pdf";
      win=window.open(site,'UCRReport',settings);
   	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
  	return false;
 	}
 if (thisForm.RPTSELECT.value=="PropertyViolentCrimeMaps")
  	{
   	site = "/MSHPWeb/Publications/Reports/";
  	site += "troop_violent_vs_property_troop" + thisForm.TROOP.value + "_" + thisForm.YEAR.value + ".pdf";
      win=window.open(site,'UCRReport',settings);
   	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
  	return false;
 	}
 if (thisForm.RPTSELECT.value=="PossVsSaleMfgDrugsMaps")
  	{
   	site = "/MSHPWeb/Publications/Reports/";
  	site += "troop_poss_vs_salemfg_troop" + thisForm.TROOP.value + "_" + thisForm.YEAR.value + ".pdf";
      win=window.open(site,'UCRReport',settings);
   	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
  	return false;
 	}
 if (thisForm.RPTSELECT.value=="PropertyCrimeMaps")
 	{  	
  	//site = "/MSHPWeb/Publications/Reports/";
 	if(thisForm.PropertyCrime.value=="property_crime_rate") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.PropertyCrime.value + "_std_" + thisForm.YEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 	else if(thisForm.PropertyCrime.value=="property_norm_by_total") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.PropertyCrime.value + "_" + thisForm.YEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}else if(thisForm.PropertyCrime.value=="property_pct_change_01to") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.PropertyCrime.value + thisForm.pctchangeYEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	} 
     
 	}
 if (thisForm.RPTSELECT.value=="ViolentCrimeMaps")
 	{  	
  	//site = "/MSHPWeb/Publications/Reports/";
 	if(thisForm.ViolentCrime.value=="violent_crime_rate") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.ViolentCrime.value + "_std_" + thisForm.YEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 	else if(thisForm.ViolentCrime.value=="violent_norm_by_total") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.ViolentCrime.value + "_" + thisForm.YEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}else if(thisForm.ViolentCrime.value=="violent_pct_change_01to") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.ViolentCrime.value + thisForm.pctchangeYEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}  
     
 	}
 if (thisForm.RPTSELECT.value=="MethlabMaps")
 	{  	
  	//site = "/MSHPWeb/Publications/Reports/";
 	if(thisForm.MethLabs.value=="meth_lab_totals") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.MethLabs.value + "_" + thisForm.multipleYEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 	else if(thisForm.MethLabs.value=="norm_nazi_meth_labs") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.MethLabs.value + "_" + thisForm.multipleYEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	} 
    else if(thisForm.MethLabs.value=="norm_red_meth_labs") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.MethLabs.value + "_" + thisForm.multipleYEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 	else if(thisForm.MethLabs.value=="norm_tablet_meth_labs") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.MethLabs.value + "_" + thisForm.multipleYEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}else if(thisForm.MethLabs.value=="meth_pct_change_03") {
 	site = "/MSHPWeb/Publications/Reports/";
 	site += "state_" + thisForm.MethLabs.value + "_" + thisForm.methYEAR.value + ".pdf";
 	win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 	}
 if (thisForm.RPTSELECT.value=="AgcyStatus")
 	{
 	site = "/MSHPWeb/Publications/Reports/Agency_Status_";
 	site += thisForm.YEAR.value  + ".pdf";
     win=window.open(site,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 	return false;
 	}
 if (validateForSubmit() == false)
	{
	return false;
	}
	win=window.open(loadingPage,'UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
  	win=window.open('','UCRReport',settings);
  	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
  	document.forms[0].target='UCRReport';
  	document.forms[0].submit();
	return false;
}
//*************************************************************8
function displayFields()
{
var thisForm = document.forms[0]
msg='';
msg+= "FEX: "+thisForm.IBIF_ex.value;

msg+= "\n\nDETAIL: "+thisForm.DETAIL.value;

msg+= "\n\nOFFCODE: "+thisForm.OFFCODE.value;

msg+= "\n\nCIRCUM: "+thisForm.CIRCUM.value;

msg+= "\n\nCIRCUML: "+thisForm.CIRCUML.value;
msg+= "\nCIRCUMA: "+thisForm.CIRCUMA.value;
msg+= "\nCIRCUMB: "+thisForm.CIRCUMB.value;
msg+= "\nCIRCUMC: "+thisForm.CIRCUMC.value;
msg+= "\nCIRCUMD: "+thisForm.CIRCUMD.value;

msg+= "\n\nARSBOX1: "+thisForm.ARSBOX1.value;

msg+= "\n\nYEAR: "+thisForm.YEAR.value;
msg+= "\nMONTH: "+thisForm.MONTH.value;

//msg+= "\n\nPublic: "+thisForm.OCI[0].checked;
//msg+= "\nSecure: "+thisForm.OCI[1].checked;

msg+= "\n\nGEOSEL: "+thisForm.GEOSEL.value;
msg+= "\nLOCBOX: "+thisForm.LOCBOX.value;
msg+= "\nCTYBOX: "+thisForm.CTYBOX.value;
msg+= "\nCOLBOX: "+thisForm.COLBOX.value;
msg+= "\nPOPBOX: "+thisForm.POPBOX.value;
msg+= "\n\nFORMAT: "+thisForm.FORMAT.value;

alert(msg);
}
//*****************************************************************


function setYear(year)
{
var thisForm = document.forms[0];
var fld = thisForm.YEAR;
var oldYear = fld.value;
var y = false;
thisForm.YEAR.length=null;

if (year=='all')
	{
	var thisDateTime;
	thisDateTime = new Date();
	year=new Date().getFullYear();
	}

var newOption;
thisDateTime = new Date();
for (year; year >= 2001; year--)
	{
	var newOption = new Option(year.toString(), year.toString(), "", "");
	fld.options[fld.options.length] = newOption;
	}
for (i=0; i < fld.options.length; i++)
	{
	if (thisForm.YEAR.options[i].value == oldYear)
		{
		y = true;
		}
	}
	if (y == true)
	{
	thisForm.YEAR.value = oldYear;
	}
	else
	{
	alert("The year you selected is not valid for this report");
	
	}
}
//*****************************************************************
function setPage(whatReport)
{
var thisForm = document.forms[0];
if (whatReport=="pdf")
	{
	document.getElementById("WFDetail").style.display="none";
	document.getElementById("PDFDetail").style.display="block";
	document.getElementById("WebFOCUSArea").style.display="none";
	document.getElementById("RptFormat").style.display="none";
	document.getElementById("PDFArea").style.display="block";
	document.getElementById("MapsArea").style.display="none";
	document.getElementById("YearDetail").style.display="block";
	
	}
else if (whatReport=="maps")
	{
		document.getElementById("WFDetail").style.display="none";
		document.getElementById("PDFDetail").style.display="block";
		document.getElementById("WebFOCUSArea").style.display="none";
		document.getElementById("RptFormat").style.display="none";
		document.getElementById("PDFArea").style.display="none";
		document.getElementById("MapsArea").style.display="block";
		document.getElementById("YearDetail").style.display="block";
					
	}
else if (whatReport=="troops")
	{
		document.getElementById("WFDetail").style.display="none";
		document.getElementById("PDFDetail").style.display="block";
		document.getElementById("WebFOCUSArea").style.display="none";
		document.getElementById("RptFormat").style.display="none";
		document.getElementById("PDFArea").style.display="none";
		document.getElementById("MapsArea").style.display="none";
		document.getElementById("TroopsArea").style.display="block";
		document.getElementById("YearDetail").style.display="block";
		
	}
else 
	{
	document.getElementById("WFDetail").style.display="block";
	document.getElementById("PDFDetail").style.display="none";
	document.getElementById("WebFOCUSArea").style.display="block";
	document.getElementById("RptFormat").style.display="block";
	document.getElementById("PDFArea").style.display="none";
	document.getElementById("MapsArea").style.display="none";
	document.getElementById("YearDetail").style.display="block";
	
	}
setYear('all');

}
//*****************************************************************
function setMethYear(){
var thisForm = document.forms[0]
if(thisForm.MethLabs.value == "meth_pct_change_03")
	{
		thisForm.multipleYEAR.style.display = "none";
		thisForm.methYEAR.style.display = "block";
		thisForm.pctchangeYEAR.style.display = "none";
	}
else if(thisForm.MethLabs.value == "meth_lab_totals")
	{
		thisForm.multipleYEAR.style.display = "block";
		thisForm.methYEAR.style.display = "none";
		thisForm.pctchangeYEAR.style.display = "none";
	}
else if(thisForm.MethLabs.value == "norm_nazi_meth_labs")
	{
		thisForm.multipleYEAR.style.display = "block";
		thisForm.methYEAR.style.display = "none";
		thisForm.pctchangeYEAR.style.display = "none";
	}
else if(thisForm.MethLabs.value == "norm_red_meth_labs")
	{
		thisForm.multipleYEAR.style.display = "block";
		thisForm.methYEAR.style.display = "none";
		thisForm.pctchangeYEAR.style.display = "none";
	}
else if(thisForm.MethLabs.value == "norm_tablet_meth_labs")
	{
		thisForm.multipleYEAR.style.display = "block";
		thisForm.methYEAR.style.display = "none";
		thisForm.pctchangeYEAR.style.display = "none";
	}
}
//*****************************************************************

function setPropertyYear(){
var thisForm = document.forms[0]
if(thisForm.PropertyCrime.value == "property_crime_rate")
	{
		thisForm.YEAR.style.display = "block";
		thisForm.pctchangeYEAR.style.display = "none";
		thisForm.multipleYEAR.style.display = "none";
		thisForm.methYEAR.style.display = "none";
	}
else if(thisForm.PropertyCrime.value == "property_norm_by_total")
	{
		thisForm.YEAR.style.display = "block";
		thisForm.pctchangeYEAR.style.display = "none";
		thisForm.multipleYEAR.style.display = "none";
		thisForm.methYEAR.style.display = "none";
	}
else if(thisForm.PropertyCrime.value == "property_pct_change_01to")
	{
		thisForm.YEAR.style.display = "none";
		thisForm.pctchangeYEAR.style.display = "block";
		thisForm.multipleYEAR.style.display = "none";
		thisForm.methYEAR.style.display = "none";
	}
}
//*****************************************************************

function setViolentYear(){
var thisForm = document.forms[0]
if(thisForm.ViolentCrime.value == "violent_crime_rate")
	{
		thisForm.YEAR.style.display = "block";
		thisForm.pctchangeYEAR.style.display = "none";
		thisForm.multipleYEAR.style.display = "none";
		thisForm.methYEAR.style.display = "none";
	}
else if(thisForm.ViolentCrime.value == "violent_norm_by_total")
	{
		thisForm.YEAR.style.display = "block";
		thisForm.pctchangeYEAR.style.display = "none";
		thisForm.multipleYEAR.style.display = "none";
		thisForm.methYEAR.style.display = "none";
	}
else if(thisForm.ViolentCrime.value == "violent_pct_change_01to")
	{
		thisForm.YEAR.style.display = "none";
		thisForm.pctchangeYEAR.style.display = "block";
		thisForm.multipleYEAR.style.display = "none";
		thisForm.methYEAR.style.display = "none";
	}
}