/*
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 cchousing(code1,code2) {
	var okToContinue = "Yes";
    var url=null;
    xmlhttp=null;
   
    document.getElementById("page1").style.height = '500px';
    document.getElementById("page2").style.height = '400px';
    document.getElementById("page3").style.height = '1px';
    document.getElementById("page4").style.height = '1px';
    document.getElementById("page5").style.height = '1px';
    document.getElementById("page6").style.height = '1px';   
    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=cchousing";
    
    /* 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;
	    var Groups=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 g1 = new column_graph(2,"Owner Occupied Housing Units|Renter Occupied Housing Units");                 

					g1.add("Belknap County",Math.round(Math.round(data[0].getAttribute("BelknapOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);	
					g1.add("Carroll County",Math.round(Math.round(data[0].getAttribute("CarrollOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);	
					g1.add("Cheshire County",Math.round(Math.round(data[0].getAttribute("CheshireOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);	
					g1.add("Coos County",Math.round(Math.round(data[0].getAttribute("CoosOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);					  
					g1.add("Grafton County",Math.round(Math.round(data[0].getAttribute("GraftonOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);	
					g1.add("Hillsborough County",Math.round(Math.round(data[0].getAttribute("HillsboroughOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);						  
					g1.add("Merrimack County",Math.round(Math.round(data[0].getAttribute("MerrimackOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);	
					g1.add("Rockingham County",Math.round(Math.round(data[0].getAttribute("RockinghamOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);					  
					g1.add("Strafford County",Math.round(Math.round(data[0].getAttribute("StraffordOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);	
					g1.add("Sullivan County",Math.round(Math.round(data[0].getAttribute("SullivanOwnOccHU"))/Math.round(data[0].getAttribute("TotalOwnOccHU"))*10000)/100,0);						  					
					
					g1.add("Belknap County",Math.round(Math.round(data[0].getAttribute("BelknapRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);	
					g1.add("Carroll County",Math.round(Math.round(data[0].getAttribute("CarrollRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);	
					g1.add("Cheshire County",Math.round(Math.round(data[0].getAttribute("CheshireRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);	
					g1.add("Coos County",Math.round(Math.round(data[0].getAttribute("CoosRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);					  
					g1.add("Grafton County",Math.round(Math.round(data[0].getAttribute("GraftonRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);	
					g1.add("Hillsborough County",Math.round(Math.round(data[0].getAttribute("HillsboroughRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);						  
					g1.add("Merrimack County",Math.round(Math.round(data[0].getAttribute("MerrimackRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);	
					g1.add("Rockingham County",Math.round(Math.round(data[0].getAttribute("RockinghamRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);					  
					g1.add("Strafford County",Math.round(Math.round(data[0].getAttribute("StraffordRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);	
					g1.add("Sullivan County",Math.round(Math.round(data[0].getAttribute("SullivanRentOccHU"))/Math.round(data[0].getAttribute("TotalRentOccHU"))*10000)/100,1);			

					var html1 = "<table><tr><td width='100%' height='475px' valign='top'>" +
					
								"<table width='960px' height='100%' class='outside'><tr><td>" +
								 "<table width='100%' height='100%' class='inside'>" +
									"<tr><td valign='top' align='left'>" +	
								    "<center><font size='5'><b>Percent of Occupied Housing Units in New Hampshire By Tenure</b></font><br>" +
									"<font size='2'><b>"+code1+": "+code2+"</b></font></center><br>" +		
								
								    "<div id='graphs' style='position:relative;width:900px;height:400px;padding:0px;'>" +
								    "<div id='graph1' style='position:absolute;padding:0px;'></div>" +
									"</div>" +		
														
								"</td></tr>" +
								"</table>" +
								"</td></tr></table>" +
								
								"</td></tr></table>";							
					
					var html2 = "<table><tr><td width='100%' height='375px' valign='top'>" +
					
								"<table width='960px' height='100%' class='outside'><tr><td>" +
								 "<table width='100%' height='100%' class='inside'>" +
									"<tr><td valign='top' align='left'>" +	
								    "<center><font size='5'><b>Percent of Occupied Housing Units in New Hampshire By Tenure</b></font><br>" +
									"<font size='2'><b>"+code1+": "+code2+"</b></font></center><br>" +		
								
									"<table class='data'>" +
									
									"<tr class='head'>" +
									"<td>&nbsp;</td>" +
									"<td style='text-align:right;vertical-align:bottom;'>Total Housing Units</td>" +					
									"<td style='text-align:right;vertical-align:bottom;'>% of Total</td>" +				
									"<td style='text-align:right;vertical-align:bottom;'>Owner Occ. Units</td>" +
									"<td style='text-align:right;vertical-align:bottom;'>% of Total</td>" +					
									"<td style='text-align:right;vertical-align:bottom;'>Renter Occ. Units</td>" +					
									"<td style='text-align:right;vertical-align:bottom;'>% of Total</td>" +					
									"<td style='text-align:right;vertical-align:bottom;'>Vacant Units For Sale</td>" +
									"<td style='text-align:right;vertical-align:bottom;'>% of Total</td>" +
									"<td style='text-align:right;vertical-align:bottom;'>Vacant Units For Rent</td>" +	
									"<td style='text-align:right;vertical-align:bottom;'>% of Total</td>" +				
									"<td style='text-align:right;vertical-align:bottom;'>Vacant Units Seasonal</td>" +				
									"<td style='text-align:right;vertical-align:bottom;'>% of Total</td>" +
									"<td style='width:15px;'>&nbsp;</td></tr>" +									
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Belknap County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("BelknapHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("BelknapHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("BelknapOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("BelknapOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("BelknapRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("BelknapRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("BelknapVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("BelknapVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("BelknapVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("BelknapVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("BelknapVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("BelknapVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
											
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Carroll County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CarrollHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CarrollHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CarrollOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CarrollOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CarrollRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CarrollRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CarrollVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CarrollVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CarrollVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CarrollVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CarrollVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CarrollVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Cheshire County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CheshireHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CheshireHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CheshireOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CheshireOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CheshireRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CheshireRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CheshireVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CheshireVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CheshireVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CheshireVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CheshireVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CheshireVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Coos County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CoosHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CoosHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CoosOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CoosOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CoosRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CoosRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CoosVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CoosVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CoosVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CoosVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("CoosVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("CoosVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Grafton County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("GraftonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("GraftonHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("GraftonOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("GraftonOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("GraftonRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("GraftonRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("GraftonVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("GraftonVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("GraftonVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("GraftonVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("GraftonVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("GraftonVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Hillsborough County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("HillsboroughHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("HillsboroughHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("HillsboroughOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("HillsboroughOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("HillsboroughRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("HillsboroughRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("HillsboroughVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("HillsboroughVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("HillsboroughVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("HillsboroughVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("HillsboroughVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("HillsboroughVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Merrimack County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MerrimackHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MerrimackHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MerrimackOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MerrimackOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MerrimackRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MerrimackRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MerrimackVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MerrimackVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MerrimackVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MerrimackVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("MerrimackVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("MerrimackVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Rockingham County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RockinghamHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RockinghamHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RockinghamOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RockinghamOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RockinghamRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RockinghamRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RockinghamVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RockinghamVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RockinghamVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RockinghamVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("RockinghamVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("RockinghamVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Strafford County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("StraffordHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("StraffordHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("StraffordOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("StraffordOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("StraffordRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("StraffordRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("StraffordVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("StraffordVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("StraffordVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("StraffordVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("StraffordVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("StraffordVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +
									
									"<tr class='body'>" +
									"<td style='width:115px;text-align:left;'>Sullivan County</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SullivanHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SullivanHU")) / Math.round(data[0].getAttribute("TotalHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SullivanOwnOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SullivanOwnOccHU")) / Math.round(data[0].getAttribute("TotalOwnOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SullivanRentOccHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SullivanRentOccHU")) / Math.round(data[0].getAttribute("TotalRentOccHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SullivanVacForSaleHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SullivanVacForSaleHU")) / Math.round(data[0].getAttribute("TotalVacForSaleHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SullivanVacForRentHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SullivanVacForRentHU")) / Math.round(data[0].getAttribute("TotalVacForRentHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:75px;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("SullivanVacSeasonHU")),"","") + "</td>" +
									"<td style='width:65px;text-align:right;'>" + chkValue(Math.round(Math.round(data[0].getAttribute("SullivanVacSeasonHU")) / Math.round(data[0].getAttribute("TotalVacSeasonHU")) * 1000) / 10,"","%") + "</td>" +
									"<td style='width:5px;'>&nbsp;</td></tr>" +																																																																																			
																																
									"<tr class='body'>" +
									"<td style='width:120px;height:35px;vertical-align:bottom;text-align:left;'>New Hampshire</td>" +
									"<td style='width:75px;height:35px;vertical-align:bottom;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalHU")),"","") + "</td>" +
									"<td style='width:70px;height:35px;vertical-align:bottom;text-align:right;'>&nbsp;</td>" +
									"<td style='width:75px;height:35px;vertical-align:bottom;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalOwnOccHU")),"","") + "</td>" +
									"<td style='width:70px;height:35px;vertical-align:bottom;text-align:right;'>&nbsp;</td>" +
									"<td style='width:75px;height:35px;vertical-align:bottom;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalRentOccHU")),"","") + "</td>" +
									"<td style='width:70px;height:35px;vertical-align:bottom;text-align:right;'>&nbsp;</td>" +
									"<td style='width:75px;height:35px;vertical-align:bottom;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalVacForSaleHU")),"","") + "</td>" +
									"<td style='width:70px;height:35px;vertical-align:bottom;text-align:right;'>&nbsp;</td>" +
									"<td style='width:75px;height:35px;vertical-align:bottom;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalVacForRentHU")),"","") + "</td>" +
									"<td style='width:70px;height:35px;vertical-align:bottom;text-align:right;'>&nbsp;</td>" +
									"<td style='width:75px;height:35px;vertical-align:bottom;text-align:right;'>" + chkValue(Math.round(data[0].getAttribute("TotalVacSeasonHU")),"","") + "</td>" +
									"<td style='width:70px;height:35px;vertical-align:bottom;text-align:right;'>&nbsp;</td>" +
									"<td style='width:10px;height:35px;vertical-align:bottom;'>&nbsp;</td></tr>" +	
																																			
									"</table><br>" +							
									
									"<font size='1' color='red'>Source: US Census 2000, Summary File 1, Table H1, H4, H5</font><br>" +							
									
								
								"</td></tr>" +
								"</table>" +
								"</td></tr></table>" +
								
								"</td></tr></table>";

					
					document.getElementById("page1").innerHTML = html1;	 
					    g1.build("graph1","",300,32,"","%");	 
					
					document.getElementById("page2").innerHTML = html2;
}					
					document.getElementById("pwait").innerHTML = ""; 

               }
            }
        };
        xmlhttp.send(null); 
    }
}

