/*
This code was created by the New Hampshire Housing and Finance Authority. 
Use of any part of this code is prohibited without written permission.
http://www.nhhfa.org
Created: 12/2006
By: Sean Vickers
*/
function housing(code1,code2) {
	var okToContinue = "Yes";
    var url=null;
    xmlhttp=null;
     
    document.getElementById("page1").style.height = '350px';
    document.getElementById("page2").style.height = '500px';
    document.getElementById("page3").style.height = '350px';
    document.getElementById("page4").style.height = '550px';
    document.getElementById("page5").style.height = '375px';
    document.getElementById("page6").style.height = '600px';   
    document.getElementById("page7").style.height = '1px';    
   
    document.getElementById("pwait").innerHTML = "<img src='images/wait.gif' alt='' width='150' border='0'>";
   
    url = "http://www.nhhfa.org/oppweb/xml.asp?code1=" + code1 + "&code2=" + code2 + "&code3=housing";
    
    /* Check for running connections */
    if (xmlhttp != null && xmlhttp.readyState != 0 && xmlhttp.readyState != 4){
       xmlhttp.abort();
    }

    // code for Mozilla, etc.
    if (window.XMLHttpRequest) { 
    	try { xmlhttp=new XMLHttpRequest(); }
    	catch(e) { xmlhttp=null; }
    }
 
    // code for IE
    else if (window.ActiveXObject) {
    	try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
    	catch(e) {
    	   try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
    	   catch(e) { xmlhttp=null; }
    	}
    }

    if (xmlhttp) {
        xmlhttp.open("GET",url,true);
        xmlhttp.setRequestHeader('content-type', 'text/xml'); 
        xmlhttp.onreadystatechange=function () {

	    var xml=null;
	    var html=null;
	    var data=null;

	    // if xmlhttp shows "loaded"
	    if (xmlhttp.readyState==4) {
  
	       // if "OK"
               if (xmlhttp.status==200) {

try {			   
	          xml  = xmlhttp.responseXML;
              data = xml.documentElement.getElementsByTagName("CODE2");	  
} catch(e) {
	alert("There Is No Data Available For This Area!");
	okToContinue = "No";
}
if(data.length == 0) {
	alert("There Is No Data Available For This Area!");
	okToContinue = "No";
}
			  
if(okToContinue == "Yes") {
		  
		  var html2 = "<table><tr><td width='100%' valign='top'>" +
		  
		  		"<table width='725px' class='outside'><tr><td>" +
				    "<table width='100%' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					
					"<table class='data'>" +
					"<tr class='head'><td colspan='7' style='text-align:center;'>" +
					"<font size='5'>Units by Tenure & Vacancy</font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font><br><br></td></tr>" +
					"<tr class='head'>" +
					"<td style='width:250px;text-align:left;'>" +
					"Housing Units</td>" +
					"<td style='text-align:right;'>1990</td><td style='text-align:center;'>%</td>" +
					"<td style='text-align:right;'>2000</td><td style='text-align:center;'>%</td>" +
					"<td style='text-align:center;'>% Change</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +
					"<td style='width:250px;text-align:left;'>" +
					"Total Units</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalHousingUnits1990")),"","") + "</td>" +
					"<td>&nbsp;</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalHousingUnits2000")),"","") + "</td>" +
					"<td>&nbsp;</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("TotalHousingUnits2000"))-Math.round(data[0].getAttribute("TotalHousingUnits1990")))/Math.round(data[0].getAttribute("TotalHousingUnits1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Occupied Units</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("OccupiedHousingUnits1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("OccupiedHousingUnits1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + " of Total</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("OccupiedHousingUnits2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("OccupiedHousingUnits2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + " of Total</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("OccupiedHousingUnits2000"))-Math.round(data[0].getAttribute("OccupiedHousingUnits1990")))/Math.round(data[0].getAttribute("OccupiedHousingUnits1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Owner Occupied</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("OwnerOccHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("OwnerOccHU1990")) / Math.round(data[0].getAttribute("OccupiedHousingUnits1990")) * 1000) / 10,"","%") + " of Occ.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("OwnerOccHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("OwnerOccHU2000")) / Math.round(data[0].getAttribute("OccupiedHousingUnits2000")) * 1000) / 10,"","%") + " of Occ.</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("OwnerOccHU2000"))-Math.round(data[0].getAttribute("OwnerOccHU1990")))/Math.round(data[0].getAttribute("OwnerOccHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +					
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Renter Occupied</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RenterOccHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RenterOccHU1990")) / Math.round(data[0].getAttribute("OccupiedHousingUnits1990")) * 1000) / 10,"","%") + " of Occ.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RenterOccHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RenterOccHU2000")) / Math.round(data[0].getAttribute("OccupiedHousingUnits2000")) * 1000) / 10,"","%") + " of Occ.</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("RenterOccHU2000"))-Math.round(data[0].getAttribute("RenterOccHU1990")))/Math.round(data[0].getAttribute("RenterOccHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +					
										
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Vacant Units</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantHousingUnits1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantHousingUnits1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + " of Total</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantHousingUnits2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantHousingUnits2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + " of Total</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("VacantHousingUnits2000"))-Math.round(data[0].getAttribute("VacantHousingUnits1990")))/Math.round(data[0].getAttribute("VacantHousingUnits1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +					
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Vacant For Sale</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantForSale1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantForSale1990")) / Math.round(data[0].getAttribute("VacantHousingUnits1990")) * 1000) / 10,"","%") + " of Vac.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantForSale2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantForSale2000")) / Math.round(data[0].getAttribute("VacantHousingUnits2000")) * 1000) / 10,"","%") + " of Vac.</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("VacantForSale2000"))-Math.round(data[0].getAttribute("VacantForSale1990")))/Math.round(data[0].getAttribute("VacantForSale1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +		
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Vacant For Rent</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantForRent1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantForRent1990")) / Math.round(data[0].getAttribute("VacantHousingUnits1990")) * 1000) / 10,"","%") + " of Vac.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantForRent2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantForRent2000")) / Math.round(data[0].getAttribute("VacantHousingUnits2000")) * 1000) / 10,"","%") + " of Vac.</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("VacantForRent2000"))-Math.round(data[0].getAttribute("VacantForRent1990")))/Math.round(data[0].getAttribute("VacantForRent1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +							
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Vacant Seasonal</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantSeasonalRec1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantSeasonalRec1990")) / Math.round(data[0].getAttribute("VacantHousingUnits1990")) * 1000) / 10,"","%") + " of Vac.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("VacantSeasonalRec2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("VacantSeasonalRec2000")) / Math.round(data[0].getAttribute("VacantHousingUnits2000")) * 1000) / 10,"","%") + " of Vac.</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("VacantSeasonalRec2000"))-Math.round(data[0].getAttribute("VacantSeasonalRec1990")))/Math.round(data[0].getAttribute("VacantSeasonalRec1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +												

					"</tr></table><br>" +							
					
					"<font size='1' color='red'>Source: US Census</font><br>" +
					
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +	

			    "</td></tr><tr><td width='100%' valign='top'>" +						
					
		  		"<table width='725px' class='outside'><tr><td>" +
				    "<table width='100%' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					
					"<table class='data'>" +
					"<tr class='head'><td colspan='7' style='text-align:center;'>" +
					"<font size='5'>Units by Number of Bedrooms</font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font><br><br></td></tr>" +
					"<tr class='head'>" +
					"<td style='width:250px;text-align:left;'>" +
					"Bedrooms</td>" +
					"<td style='text-align:right;'>1990</td><td style='text-align:center;'>% of Total</td>" +
					"<td style='text-align:right;'>2000</td><td style='text-align:center;'>% of Total</td>" +
					"<td style='text-align:center;'>% Change</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"No Bedrooms</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units0Bedroom1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units0Bedroom1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units0Bedroom2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units0Bedroom2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("Units0Bedroom2000"))-Math.round(data[0].getAttribute("Units0Bedroom1990")))/Math.round(data[0].getAttribute("Units0Bedroom1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1 Bedrooms</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units1Bedroom1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units1Bedroom1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units1Bedroom2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units1Bedroom2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("Units1Bedroom2000"))-Math.round(data[0].getAttribute("Units1Bedroom1990")))/Math.round(data[0].getAttribute("Units1Bedroom1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +			
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"2 Bedrooms</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units2Bedroom1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units2Bedroom1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units2Bedroom2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units2Bedroom2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("Units2Bedroom2000"))-Math.round(data[0].getAttribute("Units2Bedroom1990")))/Math.round(data[0].getAttribute("Units2Bedroom1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +			
										
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"3 Bedrooms</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units3Bedroom1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units3Bedroom1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units3Bedroom2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units3Bedroom2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("Units3Bedroom2000"))-Math.round(data[0].getAttribute("Units3Bedroom1990")))/Math.round(data[0].getAttribute("Units3Bedroom1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +				
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"4+ Bedrooms</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units4PLUSBedroom1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units4PLUSBedroom1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("Units4PLUSBedroom2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("Units4PLUSBedroom2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("Units4PLUSBedroom2000"))-Math.round(data[0].getAttribute("Units4PLUSBedroom1990")))/Math.round(data[0].getAttribute("Units4PLUSBedroom1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr></table><br>" +							
					
					"<font size='1' color='red'>Source: US Census</font><br>" +
					
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +						
					
					
				"</td></tr></table>";			
			
		  var html4 = "<table><tr><td width='100%' valign='top'>" +
		  
		  		"<table width='725px' class='outside'><tr><td>" +
				    "<table width='100%' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					
					"<table class='data'>" +
					"<tr class='head'><td colspan='7' style='text-align:center;'>" +
					"<font size='5'>Units by Type</font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font><br><br></td></tr>" +
					"<tr class='head'>" +
					"<td style='width:250px;text-align:left;'>" +
					"Type</td>" +
					"<td style='text-align:right;'>1990</td><td style='text-align:center;'>% of Total</td>" +
					"<td style='text-align:right;'>2000</td><td style='text-align:center;'>% of Total</td>" +
					"<td style='text-align:center;'>% Change</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +
					"<td style='width:250px;text-align:left;'>" +
					"Total Units</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalHousingUnits1990")),"","") + "</td>" +
					"<td>&nbsp;</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalHousingUnits2000")),"","") + "</td>" +
					"<td>&nbsp;</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("TotalHousingUnits2000"))-Math.round(data[0].getAttribute("TotalHousingUnits1990")))/Math.round(data[0].getAttribute("TotalHousingUnits1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Single Family Units</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SingFamHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SingFamHU1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SingFamHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SingFamHU2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("SingFamHU2000"))-Math.round(data[0].getAttribute("SingFamHU1990")))/Math.round(data[0].getAttribute("SingFamHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"SF Owner Occ.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SingFamOwnHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SingFamOwnHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("SingFamOwnHU2000"))-Math.round(data[0].getAttribute("SingFamOwnHU1990")))/Math.round(data[0].getAttribute("SingFamOwnHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +					
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"SF Renter Occ.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SingFamRntrHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SingFamRntrHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("SingFamRntrHU2000"))-Math.round(data[0].getAttribute("SingFamRntrHU1990")))/Math.round(data[0].getAttribute("SingFamRntrHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +					
										
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Multi-Family Units</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MultiFamHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MultiFamHU1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MultiFamHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MultiFamHU2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("MultiFamHU2000"))-Math.round(data[0].getAttribute("MultiFamHU1990")))/Math.round(data[0].getAttribute("MultiFamHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +				
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"MF Owner Occ.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MultiFamOwnHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MultiFamOwnHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("MultiFamOwnHU2000"))-Math.round(data[0].getAttribute("MultiFamOwnHU1990")))/Math.round(data[0].getAttribute("MultiFamOwnHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +					
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"MF Renter Occ.</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MultiFamRntrHU1990")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MultiFamRntrHU2000")),"","") + "</td>" +
					"<td style='text-align:center;'>&nbsp;</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("MultiFamRntrHU2000"))-Math.round(data[0].getAttribute("MultiFamRntrHU1990")))/Math.round(data[0].getAttribute("MultiFamRntrHU1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +						
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
					"Mobile Home & Other</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MobileHom1990")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MobileHom1990")) / Math.round(data[0].getAttribute("TotalHousingUnits1990")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MobileHom2000")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MobileHom2000")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round((Math.round(data[0].getAttribute("MobileHom2000"))-Math.round(data[0].getAttribute("MobileHom1990")))/Math.round(data[0].getAttribute("MobileHom1990"))*1000)/10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +											

					"</tr></table><br>" +							
					
					"<font size='1' color='red'>Source: US Census</font><br>" +
					
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +	

			    "</td></tr><tr><td width='100%' valign='top'>" +						
					
		  		"<table width='725px' class='outside'><tr><td>" +
				    "<table width='100%' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					
					"<table class='data'>" +
					"<tr class='head'><td colspan='4' style='text-align:center;'>" +
					"<font size='5'>Units by Year Built</font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font><br><br></td></tr>" +
					"<tr class='head'>" +
					"<td style='width:250px;text-align:left;'>" +
					"Year Built</td>" +
					"<td style='text-align:right;'>Units</td><td style='text-align:center;'>% of Total</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1995 to 2000</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("YearBuilt95to00")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("YearBuilt95to00")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1990 through 1994</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("YearBuilt90to94")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("YearBuilt90to94")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +		
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1980 through 1989</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("YearBuilt80to89")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("YearBuilt80to89")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +	
										
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1970 through 1979</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("YearBuilt70to79")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("YearBuilt70to79")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +				
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1960 through 1969</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("YearBuilt60to69")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("YearBuilt60to69")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +	
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1940 through 1959</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("YearBuilt40to59")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("YearBuilt40to59")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +						
					
					"</tr><tr class='body'>" +					
					"<td style='width:250px;text-align:left;'>" +
					"1939 and earlier</td>" +
					"<td style='text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("YearBuilt39orEarlier")),"","") + "</td>" +
					"<td style='text-align:center;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("YearBuilt39orEarlier")) / Math.round(data[0].getAttribute("TotalHousingUnits2000")) * 1000) / 10,"","%") + "</td>" +
					"<td style='width:25px;'>&nbsp;</td>" +							
					
					"</tr></table><br>" +							
					
					"<font size='1' color='red'>Source: 2000 Census</font><br>" +
					
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +						
					
					
				"</td></tr></table>";				
			
	var html1 =	"<table><tr><td>" +				
				
		  			"<table width='100%' height='325px' class='outside'><tr><td>" +
				    	"<table width='725px' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					"<center><font size='5'><b>Units By Tenure</b></font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font></center>" +						
				
				    "<div id='graphpage1' style='position:relative;width:625px;height:275px;padding:0px;'>" +
				    "<div id='graph1' style='position:absolute;left:75px;padding:0px;'></div>" +
					"</div>" +
										
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +	
									
				"</td></tr></table>";
					
	var html3 =	"<table><tr><td>" +				
				
		  			"<table width='100%' height='325px' class='outside'><tr><td>" +
				    	"<table width='725px' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					"<center><font size='5'><b>Units By Type</b></font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font></center>" +						
				
				    "<div id='graphpage2' style='position:relative;width:625px;height:275px;padding:0px;'>" +
				    "<div id='graph2' style='position:absolute;left:75px;padding:0px;'></div>" +
					"</div>" +
										
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +	
									
				"</td></tr></table>";					
					
	var html5 =	"<table><tr><td>" +				
				
		  			"<table width='725px' height='350px' class='outside'><tr><td>" +
				    	"<table width='100%' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					"<center><font size='5'><b>Housing Units By Type</b></font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font></center>" +						
				
				    "<div id='graphs' style='position:relative;width:625px;height:300px;padding:0px;'>" +
				    "<div id='graph3' style='position:absolute;top:25px;left:75px;'></div>" +
				    "<div id='graph4' style='position:absolute;top:25px;left:350px;'></div>" +
					"</div>" +				
										
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +	
									
				"</td></tr></table>";						
					
    var html6 = "<table><tr><td>" +	
					"<table width='725px' class='outside'><tr><td>" +
				    "<table width='100%' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					
					"<center><font size='5'><b>Estimated Occupied Housing Units</b></font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font></center>" +	
					
					"<div id='graphpage4' style='position:relative;width:700px;height:450px;padding:0px;'>" +
					"<div id='graph5' style='position:absolute;left:0px;padding:0px;'></div>" +
					"<div id='chart' style='position:absolute;left:0px;bottom:10px;padding:0px;'>" + 
					
					"<table width='725' class='data'>" +
					"<tr class='head'><td colspan='7' style='height:30px;text-align:center;'>Occupied Housing Units</td></tr>" +
					"<tr class='head'><td>2000</td>" +
					"<td>2001</td><td>2002</td><td>2003</td><td>2004</td>" +
					"<td>2005</td><td>2006</td><td style='width:80px;'>&nbsp;</td></tr>" +
					"<tr class='body'>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("NumHH00")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("NumHH01")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("NumHH02")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("NumHH03")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("NumHH04")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("NumHH05")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("NumHH06")),"","") + "</td>" +

					"<td>&nbsp;</td></tr>" +
					"</table><br /><br />" +					
					
					"<font size='1' color='red'>Note: All units are estimates with the " +
					"exception of the Year 2000, which are Census Numbers. All estimates " +
					"are from OEP</font><br>" +
					
					"</div>" +
					"</div>" +
					
					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +	
									
				"</td></tr></table>";						
					
					
var b1 = new bar_chart(2,"1990|2000");
var b2 = new bar_chart(2,"1990|2000");

b1.add("Owner Occupied",Math.round(data[0].getAttribute("OwnerOccHU1990")),0);
b1.add("Renter Occupied",Math.round(data[0].getAttribute("RenterOccHU1990")),0);
b1.add("Vacant Units",Math.round(data[0].getAttribute("VacantHousingUnits1990")),0);
b1.add("Owner Occupied",Math.round(data[0].getAttribute("OwnerOccHU2000")),1);
b1.add("Renter Occupied",Math.round(data[0].getAttribute("RenterOccHU2000")),1);
b1.add("Vacant Units",Math.round(data[0].getAttribute("VacantHousingUnits2000")),1);

b2.add("Single Family",Math.round(data[0].getAttribute("SingFamHU1990")),0);
b2.add("Multi-Family",Math.round(data[0].getAttribute("MultiFamHU1990")),0);
b2.add("Mobile Home",Math.round(data[0].getAttribute("MobileHom1990")),0);
b2.add("Single Family",Math.round(data[0].getAttribute("SingFamHU2000")),1);
b2.add("Multi-Family",Math.round(data[0].getAttribute("MultiFamHU2000")),1);
b2.add("Mobile Home",Math.round(data[0].getAttribute("MobileHom2000")),1);

var p1 = new pieChart();
var p2 = new pieChart();

p1.add("Single Family",Math.round(data[0].getAttribute("SingFamHU1990")));
p1.add("Multi-Family",Math.round(data[0].getAttribute("MultiFamHU1990")));
p1.add("Mobile Home<br>& Other",Math.round(data[0].getAttribute("MobileHom1990")));

p2.add("Single Family",Math.round(data[0].getAttribute("SingFamHU2000")));
p2.add("Multi-Family",Math.round(data[0].getAttribute("MultiFamHU2000")));
p2.add("Mobile Home<br>& Other",Math.round(data[0].getAttribute("MobileHom2000"))); 
	  
var l1 = new line_chart(1);	  
	  
l1.add("2000",Math.round(data[0].getAttribute("NumHH00")),0);		  
l1.add("2001",Math.round(data[0].getAttribute("NumHH01")),0);		  
l1.add("2002",Math.round(data[0].getAttribute("NumHH02")),0);		  
l1.add("2003",Math.round(data[0].getAttribute("NumHH03")),0);			  
l1.add("2004",Math.round(data[0].getAttribute("NumHH04")),0);		  
l1.add("2005",Math.round(data[0].getAttribute("NumHH05")),0);	
l1.add("2006",Math.round(data[0].getAttribute("NumHH06")),0);	
	  
		  document.getElementById("page1").innerHTML = html1;	  
		  	  b1.build("graph1","",600,5);
			  			  
		  document.getElementById("page2").innerHTML = html2;  
		  
		  document.getElementById("page3").innerHTML = html3;	  
		  	  b2.build("graph2","",600,5);		  
						
		  document.getElementById("page4").innerHTML = html4; 						
						 
		  document.getElementById("page5").innerHTML = html5;	  
		  	  p1.build("graph3", "1990");
			  p2.build("graph4", "2000");						 
				
		  document.getElementById("page6").innerHTML = html6;	 
	          l1.build("graph5","","","",250,55,125,0,"Yes");					
}						  
		  document.getElementById("pwait").innerHTML = ""; 
               }
            }
        };
        xmlhttp.send(null); 
    }
}

