/*
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 permits(code1,code2,rpt) {
	var okToContinue = "Yes";
    var url=null;
    xmlhttp=null;

    document.getElementById("page1").style.height = '675px';
    document.getElementById("page2").style.height = '1px';
    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=permits";
    
    /* 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") {
			  
/* Line Chart */
var g1 = new column_graph(3,"Single Family|Multi-Family|Mobile Home");                 
                  
if(rpt==1) {				  
g1.add("1980",Math.round(data[0].getAttribute("SF80")),0);
g1.add("1980",Math.round(data[0].getAttribute("MF80")),1);
g1.add("1980",Math.round(data[0].getAttribute("MH80")),2);		

g1.add("1981",Math.round(data[0].getAttribute("SF81")),0);
g1.add("1981",Math.round(data[0].getAttribute("MF81")),1);
g1.add("1981",Math.round(data[0].getAttribute("MH81")),2);	

g1.add("1982",Math.round(data[0].getAttribute("SF82")),0);
g1.add("1982",Math.round(data[0].getAttribute("MF82")),1);
g1.add("1982",Math.round(data[0].getAttribute("MH82")),2);		

g1.add("1983",Math.round(data[0].getAttribute("SF83")),0);
g1.add("1983",Math.round(data[0].getAttribute("MF83")),1);
g1.add("1983",Math.round(data[0].getAttribute("MH83")),2);			  

g1.add("1984",Math.round(data[0].getAttribute("SF84_OSP")),0);
g1.add("1984",Math.round(data[0].getAttribute("MF84_OSP")),1);
g1.add("1984",Math.round(data[0].getAttribute("MH84_OSP")),2);		

g1.add("1985",Math.round(data[0].getAttribute("SF85_OSP")),0);
g1.add("1985",Math.round(data[0].getAttribute("MF85_OSP")),1);
g1.add("1985",Math.round(data[0].getAttribute("MH85_OSP")),2);	

g1.add("1986",Math.round(data[0].getAttribute("SF86_OSP")),0);
g1.add("1986",Math.round(data[0].getAttribute("MF86_OSP")),1);
g1.add("1986",Math.round(data[0].getAttribute("MH86_OSP")),2);		

g1.add("1987",Math.round(data[0].getAttribute("SF87_OSP")),0);
g1.add("1987",Math.round(data[0].getAttribute("MF87_OSP")),1);
g1.add("1987",Math.round(data[0].getAttribute("MH87_OSP")),2);		

g1.add("1988",Math.round(data[0].getAttribute("SF88_OSP")),0);
g1.add("1988",Math.round(data[0].getAttribute("MF88_OSP")),1);
g1.add("1988",Math.round(data[0].getAttribute("MH88_OSP")),2);		

g1.add("1989",Math.round(data[0].getAttribute("SF89_OSP")),0);
g1.add("1989",Math.round(data[0].getAttribute("MF89_OSP")),1);
g1.add("1989",Math.round(data[0].getAttribute("MH89_OSP")),2);	

g1.add("1990",Math.round(data[0].getAttribute("SF90_OSP")),0);
g1.add("1990",Math.round(data[0].getAttribute("MF90_OSP")),1);
g1.add("1990",Math.round(data[0].getAttribute("MH90_OSP")),2);		

g1.add("1991",Math.round(data[0].getAttribute("SF91_OSP")),0);
g1.add("1991",Math.round(data[0].getAttribute("MF91_OSP")),1);
g1.add("1991",Math.round(data[0].getAttribute("MH91_OSP")),2);	
}
g1.add("1992",Math.round(data[0].getAttribute("SF92_OSP")),0);
g1.add("1992",Math.round(data[0].getAttribute("MF92_OSP")),1);
g1.add("1992",Math.round(data[0].getAttribute("MH92_OSP")),2);		

g1.add("1993",Math.round(data[0].getAttribute("SF93_OSP")),0);
g1.add("1993",Math.round(data[0].getAttribute("MF93_OSP")),1);
g1.add("1993",Math.round(data[0].getAttribute("MH93_OSP")),2);					
			
g1.add("1994",Math.round(data[0].getAttribute("SF94_OSP")),0);
g1.add("1994",Math.round(data[0].getAttribute("MF94_OSP")),1);
g1.add("1994",Math.round(data[0].getAttribute("MH94_OSP")),2);		

g1.add("1995",Math.round(data[0].getAttribute("SF95_OSP")),0);
g1.add("1995",Math.round(data[0].getAttribute("MF95_OSP")),1);
g1.add("1995",Math.round(data[0].getAttribute("MH95_OSP")),2);	

g1.add("1996",Math.round(data[0].getAttribute("SF96_OSP")),0);
g1.add("1996",Math.round(data[0].getAttribute("MF96_OSP")),1);
g1.add("1996",Math.round(data[0].getAttribute("MH96_OSP")),2);		

g1.add("1997",Math.round(data[0].getAttribute("SF97_OSP")),0);
g1.add("1997",Math.round(data[0].getAttribute("MF97_OSP")),1);
g1.add("1997",Math.round(data[0].getAttribute("MH97_OSP")),2);				
			
g1.add("1998",Math.round(data[0].getAttribute("SF98_OSP")),0);
g1.add("1998",Math.round(data[0].getAttribute("MF98_OSP")),1);
g1.add("1998",Math.round(data[0].getAttribute("MH98_OSP")),2);		

g1.add("1999",Math.round(data[0].getAttribute("SF99_OSP")),0);
g1.add("1999",Math.round(data[0].getAttribute("MF99_OSP")),1);
g1.add("1999",Math.round(data[0].getAttribute("MH99_OSP")),2);	

g1.add("2000",Math.round(data[0].getAttribute("SF00_OSP")),0);
g1.add("2000",Math.round(data[0].getAttribute("MF00_OSP")),1);
g1.add("2000",Math.round(data[0].getAttribute("MH00_OSP")),2);		

g1.add("2001",Math.round(data[0].getAttribute("SF01_OSP")),0);
g1.add("2001",Math.round(data[0].getAttribute("MF01_OSP")),1);
g1.add("2001",Math.round(data[0].getAttribute("MH01_OSP")),2);					
			
g1.add("2002",Math.round(data[0].getAttribute("SF02_OSP")),0);
g1.add("2002",Math.round(data[0].getAttribute("MF02_OSP")),1);
g1.add("2002",Math.round(data[0].getAttribute("MH02_OSP")),2);		

g1.add("2003",Math.round(data[0].getAttribute("SF03_OSP")),0);
g1.add("2003",Math.round(data[0].getAttribute("MF03_OSP")),1);
g1.add("2003",Math.round(data[0].getAttribute("MH03_OSP")),2);	

g1.add("2004",Math.round(data[0].getAttribute("SF04_OSP")),0);
g1.add("2004",Math.round(data[0].getAttribute("MF04_OSP")),1);
g1.add("2004",Math.round(data[0].getAttribute("MH04_OSP")),2);		
			
g1.add("2005",Math.round(data[0].getAttribute("SF05_OSP")),0);
g1.add("2005",Math.round(data[0].getAttribute("MF05_OSP")),1);
g1.add("2005",Math.round(data[0].getAttribute("MH05_OSP")),2);
	
g1.add("2006",Math.round(data[0].getAttribute("SF06_OSP")),0);
g1.add("2006",Math.round(data[0].getAttribute("MF06_OSP")),1);
g1.add("2006",Math.round(data[0].getAttribute("MH06_OSP")),2);

g1.add("2007",Math.round(data[0].getAttribute("SF07_OSP")),0);
g1.add("2007",Math.round(data[0].getAttribute("MF07_OSP")),1);
g1.add("2007",Math.round(data[0].getAttribute("MH07_OSP")),2);

g1.add("2008",Math.round(data[0].getAttribute("SF08_OSP")),0);
g1.add("2008",Math.round(data[0].getAttribute("MF08_OSP")),1);
g1.add("2008",Math.round(data[0].getAttribute("MH08_OSP")),2);

g1.add("2009",Math.round(data[0].getAttribute("SF09_OSP")),0);
g1.add("2009",Math.round(data[0].getAttribute("MF09_OSP")),1);
g1.add("2009",Math.round(data[0].getAttribute("MH09_OSP")),2);
				
		  var html1 = "<table><tr><td width='100%' valign='top'>" +
		  
		  		"<table width='960px' class='outside'><tr><td>" +
				    "<table width='100%' height='100%' class='inside'>" +
		   			"<tr><td valign='top' align='left'>" +	
					"<center><font size='5'><b>Housing Units Authorized by Permit</b></font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font></center>" +	

					"<div id='graphpage' style='position:relative;height:400px;width:900px;padding:0px;'>" +
				    "<div id='graph1' style='position:absolute;left:0px;padding:0px;'></div><br /><br />" +
 					"</div>";
					
if(rpt==1) {					
					html1 += "<table class='data'>" +
					"<tr class='head1'><td colspan='29' style='text-align:center;'>" +
					"<font size='4'><b>Housing Units Authorized by Permit</b></font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font><br><br></td></tr>" +
					
					"<tr class='head1' style='width:100px;'><td>Year</td>" +
					"<td>1980</td><td>1981</td><td>1982</td><td>1983</td><td>1984</td>" +
					"<td>1985</td><td>1986</td><td>1987</td><td>1988</td><td>1989</td>" +
					"<td>1990</td><td>1991</td><td>1992</td><td>1993</td><td>1994</td>" +
					"<td>1995</td><td>1996</td><td>1997</td><td>1998</td><td>1999</td>" +	
					"<td>2000</td><td>2001</td><td>2002</td><td>2003</td><td>2004</td>" +	
					"<td>2005</td><td>Change</td>" +									
					"<td>&nbsp;</td></tr>" +
					
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Single Family</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF80")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF81")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF82")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF83")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF84_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF85_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF86_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF87_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF88_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF89_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF90_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF91_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF96_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF99_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF00_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF05_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF80"))+Math.round(data[0].getAttribute("SF81"))+
												Math.round(data[0].getAttribute("SF82"))+Math.round(data[0].getAttribute("SF83"))+
												Math.round(data[0].getAttribute("SF84_OSP"))+Math.round(data[0].getAttribute("SF85_OSP"))+
												Math.round(data[0].getAttribute("SF86_OSP"))+Math.round(data[0].getAttribute("SF87_OSP"))+
												Math.round(data[0].getAttribute("SF88_OSP"))+Math.round(data[0].getAttribute("SF89_OSP"))+
												Math.round(data[0].getAttribute("SF90_OSP"))+Math.round(data[0].getAttribute("SF91_OSP"))+
												Math.round(data[0].getAttribute("SF92_OSP"))+Math.round(data[0].getAttribute("SF93_OSP"))+
												Math.round(data[0].getAttribute("SF94_OSP"))+Math.round(data[0].getAttribute("SF95_OSP"))+
												Math.round(data[0].getAttribute("SF96_OSP"))+Math.round(data[0].getAttribute("SF97_OSP"))+
												Math.round(data[0].getAttribute("SF98_OSP"))+Math.round(data[0].getAttribute("SF99_OSP"))+
												Math.round(data[0].getAttribute("SF00_OSP"))+Math.round(data[0].getAttribute("SF01_OSP"))+
												Math.round(data[0].getAttribute("SF02_OSP"))+Math.round(data[0].getAttribute("SF03_OSP"))+
												Math.round(data[0].getAttribute("SF04_OSP"))+Math.round(data[0].getAttribute("SF05_OSP")),"","") + 
												"</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>" +
					
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Multi-Family</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF80")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF81")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF82")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF83")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF84_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF85_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF86_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF87_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF88_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF89_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF90_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF91_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF96_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF99_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF00_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF05_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF80"))+Math.round(data[0].getAttribute("MF81"))+
												Math.round(data[0].getAttribute("MF82"))+Math.round(data[0].getAttribute("MF83"))+
												Math.round(data[0].getAttribute("MF84_OSP"))+Math.round(data[0].getAttribute("MF85_OSP"))+
												Math.round(data[0].getAttribute("MF86_OSP"))+Math.round(data[0].getAttribute("MF87_OSP"))+
												Math.round(data[0].getAttribute("MF88_OSP"))+Math.round(data[0].getAttribute("MF89_OSP"))+
												Math.round(data[0].getAttribute("MF90_OSP"))+Math.round(data[0].getAttribute("MF91_OSP"))+
												Math.round(data[0].getAttribute("MF92_OSP"))+Math.round(data[0].getAttribute("MF93_OSP"))+
												Math.round(data[0].getAttribute("MF94_OSP"))+Math.round(data[0].getAttribute("MF95_OSP"))+
												Math.round(data[0].getAttribute("MF96_OSP"))+Math.round(data[0].getAttribute("MF97_OSP"))+
												Math.round(data[0].getAttribute("MF98_OSP"))+Math.round(data[0].getAttribute("MF99_OSP"))+
												Math.round(data[0].getAttribute("MF00_OSP"))+Math.round(data[0].getAttribute("MF01_OSP"))+
												Math.round(data[0].getAttribute("MF02_OSP"))+Math.round(data[0].getAttribute("MF03_OSP"))+
												Math.round(data[0].getAttribute("MF04_OSP"))+Math.round(data[0].getAttribute("MF05_OSP")),"","") + 
												"</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>" +					
										
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Mobile Home</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH80")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH81")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH82")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH83")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH84_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH85_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH86_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH87_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH88_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH89_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH90_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH91_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH96_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH99_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH00_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH05_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH80"))+Math.round(data[0].getAttribute("MH81"))+
												Math.round(data[0].getAttribute("MH82"))+Math.round(data[0].getAttribute("MH83"))+
												Math.round(data[0].getAttribute("MH84_OSP"))+Math.round(data[0].getAttribute("MH85_OSP"))+
												Math.round(data[0].getAttribute("MH86_OSP"))+Math.round(data[0].getAttribute("MH87_OSP"))+
												Math.round(data[0].getAttribute("MH88_OSP"))+Math.round(data[0].getAttribute("MH89_OSP"))+
												Math.round(data[0].getAttribute("MH90_OSP"))+Math.round(data[0].getAttribute("MH91_OSP"))+
												Math.round(data[0].getAttribute("MH92_OSP"))+Math.round(data[0].getAttribute("MH93_OSP"))+
												Math.round(data[0].getAttribute("MH94_OSP"))+Math.round(data[0].getAttribute("MH95_OSP"))+
												Math.round(data[0].getAttribute("MH96_OSP"))+Math.round(data[0].getAttribute("MH97_OSP"))+
												Math.round(data[0].getAttribute("MH98_OSP"))+Math.round(data[0].getAttribute("MH99_OSP"))+
												Math.round(data[0].getAttribute("MH00_OSP"))+Math.round(data[0].getAttribute("MH01_OSP"))+
												Math.round(data[0].getAttribute("MH02_OSP"))+Math.round(data[0].getAttribute("MH03_OSP"))+
												Math.round(data[0].getAttribute("MH04_OSP"))+Math.round(data[0].getAttribute("MH05_OSP")),"","") + 
												"</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>" +	
					
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Total</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF80"))+Math.round(data[0].getAttribute("MF80"))+Math.round(data[0].getAttribute("MH80")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF81"))+Math.round(data[0].getAttribute("MF81"))+Math.round(data[0].getAttribute("MH81")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF82"))+Math.round(data[0].getAttribute("MF82"))+Math.round(data[0].getAttribute("MH82")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF83"))+Math.round(data[0].getAttribute("MF83"))+Math.round(data[0].getAttribute("MH83")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF84_OSP"))+Math.round(data[0].getAttribute("MF84_OSP"))+Math.round(data[0].getAttribute("MH84_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF85_OSP"))+Math.round(data[0].getAttribute("MF85_OSP"))+Math.round(data[0].getAttribute("MH85_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF86_OSP"))+Math.round(data[0].getAttribute("MF86_OSP"))+Math.round(data[0].getAttribute("MH86_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF87_OSP"))+Math.round(data[0].getAttribute("MF87_OSP"))+Math.round(data[0].getAttribute("MH87_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF88_OSP"))+Math.round(data[0].getAttribute("MF88_OSP"))+Math.round(data[0].getAttribute("MH88_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF89_OSP"))+Math.round(data[0].getAttribute("MF89_OSP"))+Math.round(data[0].getAttribute("MH89_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF90_OSP"))+Math.round(data[0].getAttribute("MF90_OSP"))+Math.round(data[0].getAttribute("MH90_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF91_OSP"))+Math.round(data[0].getAttribute("MF91_OSP"))+Math.round(data[0].getAttribute("MH91_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF92_OSP"))+Math.round(data[0].getAttribute("MF92_OSP"))+Math.round(data[0].getAttribute("MH92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF93_OSP"))+Math.round(data[0].getAttribute("MF93_OSP"))+Math.round(data[0].getAttribute("MH93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF94_OSP"))+Math.round(data[0].getAttribute("MF94_OSP"))+Math.round(data[0].getAttribute("MH94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF95_OSP"))+Math.round(data[0].getAttribute("MF95_OSP"))+Math.round(data[0].getAttribute("MH95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF96_OSP"))+Math.round(data[0].getAttribute("MF96_OSP"))+Math.round(data[0].getAttribute("MH96_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF97_OSP"))+Math.round(data[0].getAttribute("MF97_OSP"))+Math.round(data[0].getAttribute("MH97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF98_OSP"))+Math.round(data[0].getAttribute("MF98_OSP"))+Math.round(data[0].getAttribute("MH98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF99_OSP"))+Math.round(data[0].getAttribute("MF99_OSP"))+Math.round(data[0].getAttribute("MH99_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF00_OSP"))+Math.round(data[0].getAttribute("MF00_OSP"))+Math.round(data[0].getAttribute("MH00_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF01_OSP"))+Math.round(data[0].getAttribute("MF01_OSP"))+Math.round(data[0].getAttribute("MH01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF02_OSP"))+Math.round(data[0].getAttribute("MF02_OSP"))+Math.round(data[0].getAttribute("MH02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF03_OSP"))+Math.round(data[0].getAttribute("MF03_OSP"))+Math.round(data[0].getAttribute("MH03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF04_OSP"))+Math.round(data[0].getAttribute("MF04_OSP"))+Math.round(data[0].getAttribute("MH04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF05_OSP"))+Math.round(data[0].getAttribute("MF05_OSP"))+Math.round(data[0].getAttribute("MH05_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF80"))+Math.round(data[0].getAttribute("MF80"))+Math.round(data[0].getAttribute("MH80"))+
					Math.round(data[0].getAttribute("SF81"))+Math.round(data[0].getAttribute("MF81"))+Math.round(data[0].getAttribute("MH81"))+
					Math.round(data[0].getAttribute("SF82"))+Math.round(data[0].getAttribute("MF82"))+Math.round(data[0].getAttribute("MH82"))+
					Math.round(data[0].getAttribute("SF83"))+Math.round(data[0].getAttribute("MF83"))+Math.round(data[0].getAttribute("MH83"))+	
					Math.round(data[0].getAttribute("SF84_OSP"))+Math.round(data[0].getAttribute("MF84_OSP"))+Math.round(data[0].getAttribute("MH84_OSP"))+
					Math.round(data[0].getAttribute("SF85_OSP"))+Math.round(data[0].getAttribute("MF85_OSP"))+Math.round(data[0].getAttribute("MH85_OSP"))+
					Math.round(data[0].getAttribute("SF86_OSP"))+Math.round(data[0].getAttribute("MF86_OSP"))+Math.round(data[0].getAttribute("MH86_OSP"))+
					Math.round(data[0].getAttribute("SF87_OSP"))+Math.round(data[0].getAttribute("MF87_OSP"))+Math.round(data[0].getAttribute("MH87_OSP"))+	
					Math.round(data[0].getAttribute("SF88_OSP"))+Math.round(data[0].getAttribute("MF88_OSP"))+Math.round(data[0].getAttribute("MH88_OSP"))+
					Math.round(data[0].getAttribute("SF89_OSP"))+Math.round(data[0].getAttribute("MF89_OSP"))+Math.round(data[0].getAttribute("MH89_OSP"))+
					Math.round(data[0].getAttribute("SF90_OSP"))+Math.round(data[0].getAttribute("MF90_OSP"))+Math.round(data[0].getAttribute("MH90_OSP"))+
					Math.round(data[0].getAttribute("SF91_OSP"))+Math.round(data[0].getAttribute("MF91_OSP"))+Math.round(data[0].getAttribute("MH91_OSP"))+		
					Math.round(data[0].getAttribute("SF92_OSP"))+Math.round(data[0].getAttribute("MF92_OSP"))+Math.round(data[0].getAttribute("MH92_OSP"))+
					Math.round(data[0].getAttribute("SF93_OSP"))+Math.round(data[0].getAttribute("MF93_OSP"))+Math.round(data[0].getAttribute("MH93_OSP"))+
					Math.round(data[0].getAttribute("SF94_OSP"))+Math.round(data[0].getAttribute("MF94_OSP"))+Math.round(data[0].getAttribute("MH94_OSP"))+
					Math.round(data[0].getAttribute("SF95_OSP"))+Math.round(data[0].getAttribute("MF95_OSP"))+Math.round(data[0].getAttribute("MH95_OSP"))+	
					Math.round(data[0].getAttribute("SF96_OSP"))+Math.round(data[0].getAttribute("MF96_OSP"))+Math.round(data[0].getAttribute("MH96_OSP"))+
					Math.round(data[0].getAttribute("SF97_OSP"))+Math.round(data[0].getAttribute("MF97_OSP"))+Math.round(data[0].getAttribute("MH97_OSP"))+
					Math.round(data[0].getAttribute("SF98_OSP"))+Math.round(data[0].getAttribute("MF98_OSP"))+Math.round(data[0].getAttribute("MH98_OSP"))+
					Math.round(data[0].getAttribute("SF99_OSP"))+Math.round(data[0].getAttribute("MF99_OSP"))+Math.round(data[0].getAttribute("MH99_OSP"))+	
					Math.round(data[0].getAttribute("SF00_OSP"))+Math.round(data[0].getAttribute("MF00_OSP"))+Math.round(data[0].getAttribute("MH00_OSP"))+
					Math.round(data[0].getAttribute("SF01_OSP"))+Math.round(data[0].getAttribute("MF01_OSP"))+Math.round(data[0].getAttribute("MH01_OSP"))+
					Math.round(data[0].getAttribute("SF02_OSP"))+Math.round(data[0].getAttribute("MF02_OSP"))+Math.round(data[0].getAttribute("MH02_OSP"))+
					Math.round(data[0].getAttribute("SF03_OSP"))+Math.round(data[0].getAttribute("MF03_OSP"))+Math.round(data[0].getAttribute("MH03_OSP"))+
					Math.round(data[0].getAttribute("SF04_OSP"))+Math.round(data[0].getAttribute("MF04_OSP"))+Math.round(data[0].getAttribute("MH04_OSP"))+
					Math.round(data[0].getAttribute("SF05_OSP"))+Math.round(data[0].getAttribute("MF05_OSP"))+Math.round(data[0].getAttribute("MH05_OSP")),"","") + "</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>";					
					
					
					
					
					
} else {
					html1 += "<table class='data'>" +
					"<tr class='head1'><td colspan='19' style='text-align:center;'>" +
					"<font size='4'><b>Housing Units Authorized by Permit</b></font><br>" +
					"<font size='2'>"+code1+": "+code2+"</font><br><br></td></tr>" +
					
					"<tr class='head1' style='width:100px;'><td>Year</td>" +
					"<td>1992</td><td>1993</td><td>1994</td>" +
					"<td>1995</td><td>1996</td><td>1997</td><td>1998</td><td>1999</td>" +	
					"<td>2000</td><td>2001</td><td>2002</td><td>2003</td><td>2004</td>" +	
					"<td>2005</td><td>2006</td><td>2007</td><td>2008</td><td>2009</td><td>Change</td>" +									
					"<td>&nbsp;</td></tr>" +
					
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Single Family</td>" +
					
							
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF96_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF99_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF00_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF05_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF06_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF07_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF08_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF09_OSP")),"","") + "</td>" +
					
"<td>" + 
chkValue(Math.round(data[0].getAttribute("SF92_OSP"))+

Math.round(data[0].getAttribute("SF93_OSP"))+
												Math.round(data[0].getAttribute("SF94_OSP"))+Math.round(data[0].getAttribute("SF95_OSP"))+
												Math.round(data[0].getAttribute("SF96_OSP"))+Math.round(data[0].getAttribute("SF97_OSP"))+
												Math.round(data[0].getAttribute("SF98_OSP"))+Math.round(data[0].getAttribute("SF99_OSP"))+
												Math.round(data[0].getAttribute("SF00_OSP"))+Math.round(data[0].getAttribute("SF01_OSP"))+
												Math.round(data[0].getAttribute("SF02_OSP"))+Math.round(data[0].getAttribute("SF03_OSP"))+
												Math.round(data[0].getAttribute("SF04_OSP"))+Math.round(data[0].getAttribute("SF05_OSP"))+
												Math.round(data[0].getAttribute("SF06_OSP"))+Math.round(data[0].getAttribute("SF07_OSP"))+

Math.round(data[0].getAttribute("SF08_OSP"))+Math.round(data[0].getAttribute("SF09_OSP")),"","") + 
												"</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>" +
					
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Multi-Family</td>" +
							
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF96_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF99_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF00_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF05_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF06_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF07_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF08_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MF09_OSP")),"","") + "</td>" +
					"<td>" + 
chkValue(Math.round(data[0].getAttribute("MF92_OSP"))+
Math.round(data[0].getAttribute("MF93_OSP"))+
												Math.round(data[0].getAttribute("MF94_OSP"))+Math.round(data[0].getAttribute("MF95_OSP"))+
												Math.round(data[0].getAttribute("MF96_OSP"))+Math.round(data[0].getAttribute("MF97_OSP"))+
												Math.round(data[0].getAttribute("MF98_OSP"))+Math.round(data[0].getAttribute("MF99_OSP"))+
												Math.round(data[0].getAttribute("MF00_OSP"))+Math.round(data[0].getAttribute("MF01_OSP"))+
												Math.round(data[0].getAttribute("MF02_OSP"))+Math.round(data[0].getAttribute("MF03_OSP"))+
												Math.round(data[0].getAttribute("MF04_OSP"))+Math.round(data[0].getAttribute("MF05_OSP"))+
												Math.round(data[0].getAttribute("MF06_OSP"))+Math.round(data[0].getAttribute("MF07_OSP"))+ 

Math.round(data[0].getAttribute("MF09_OSP"))+Math.round(data[0].getAttribute("MF09_OSP")),"","") +
												"</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>" +					
										
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Mobile Home</td>" +
					
							
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH96_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH99_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH00_OSP")),"","") + "</td>" +		
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH05_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH06_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH07_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH08_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("MH09_OSP")),"","") + "</td>" +	
					"<td>" + 

chkValue(Math.round(data[0].getAttribute("MH92_OSP"))+

Math.round(data[0].getAttribute("MH93_OSP"))+
												Math.round(data[0].getAttribute("MH94_OSP"))+Math.round(data[0].getAttribute("MH95_OSP"))+
												Math.round(data[0].getAttribute("MH96_OSP"))+Math.round(data[0].getAttribute("MH97_OSP"))+
												Math.round(data[0].getAttribute("MH98_OSP"))+Math.round(data[0].getAttribute("MH99_OSP"))+
												Math.round(data[0].getAttribute("MH00_OSP"))+Math.round(data[0].getAttribute("MH01_OSP"))+
												Math.round(data[0].getAttribute("MH02_OSP"))+Math.round(data[0].getAttribute("MH03_OSP"))+
												Math.round(data[0].getAttribute("MH04_OSP"))+Math.round(data[0].getAttribute("MH05_OSP"))+
												Math.round(data[0].getAttribute("MH06_OSP"))+Math.round(data[0].getAttribute("MH07_OSP"))+ 

Math.round(data[0].getAttribute("MH08_OSP"))+Math.round(data[0].getAttribute("MH09_OSP")),"","") + 
												"</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>" +	
					
					"<tr class='body1'>" +					
					"<td style='width:100px;'>Total</td>" +
					
							
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF92_OSP"))+Math.round(data[0].getAttribute("MF92_OSP"))+Math.round(data[0].getAttribute("MH92_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF93_OSP"))+Math.round(data[0].getAttribute("MF93_OSP"))+Math.round(data[0].getAttribute("MH93_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF94_OSP"))+Math.round(data[0].getAttribute("MF94_OSP"))+Math.round(data[0].getAttribute("MH94_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF95_OSP"))+Math.round(data[0].getAttribute("MF95_OSP"))+Math.round(data[0].getAttribute("MH95_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF96_OSP"))+Math.round(data[0].getAttribute("MF96_OSP"))+Math.round(data[0].getAttribute("MH96_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF97_OSP"))+Math.round(data[0].getAttribute("MF97_OSP"))+Math.round(data[0].getAttribute("MH97_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF98_OSP"))+Math.round(data[0].getAttribute("MF98_OSP"))+Math.round(data[0].getAttribute("MH98_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF99_OSP"))+Math.round(data[0].getAttribute("MF99_OSP"))+Math.round(data[0].getAttribute("MH99_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF00_OSP"))+Math.round(data[0].getAttribute("MF00_OSP"))+Math.round(data[0].getAttribute("MH00_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF01_OSP"))+Math.round(data[0].getAttribute("MF01_OSP"))+Math.round(data[0].getAttribute("MH01_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF02_OSP"))+Math.round(data[0].getAttribute("MF02_OSP"))+Math.round(data[0].getAttribute("MH02_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF03_OSP"))+Math.round(data[0].getAttribute("MF03_OSP"))+Math.round(data[0].getAttribute("MH03_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF04_OSP"))+Math.round(data[0].getAttribute("MF04_OSP"))+Math.round(data[0].getAttribute("MH04_OSP")),"","") + "</td>" +	
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF05_OSP"))+Math.round(data[0].getAttribute("MF05_OSP"))+Math.round(data[0].getAttribute("MH05_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF06_OSP"))+Math.round(data[0].getAttribute("MF06_OSP"))+Math.round(data[0].getAttribute("MH06_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF07_OSP"))+Math.round(data[0].getAttribute("MF07_OSP"))+Math.round(data[0].getAttribute("MH07_OSP")),"","") + "</td>" +

"<td>" + chkValue(Math.round(data[0].getAttribute("SF08_OSP"))+Math.round(data[0].getAttribute("MF08_OSP"))+Math.round(data[0].getAttribute("MH08_OSP")),"","") + "</td>" +
"<td>" + chkValue(Math.round(data[0].getAttribute("SF09_OSP"))+Math.round(data[0].getAttribute("MF09_OSP"))+Math.round(data[0].getAttribute("MH09_OSP")),"","") + "</td>" +
					"<td>" + chkValue(Math.round(data[0].getAttribute("SF09_OSP"))+Math.round(data[0].getAttribute("MF09_OSP"))+Math.round(data[0].getAttribute("MH09_OSP"))+
					
	
					Math.round(data[0].getAttribute("SF92_OSP"))+Math.round(data[0].getAttribute("MF92_OSP"))+Math.round(data[0].getAttribute("MH92_OSP"))+
					Math.round(data[0].getAttribute("SF93_OSP"))+Math.round(data[0].getAttribute("MF93_OSP"))+Math.round(data[0].getAttribute("MH93_OSP"))+
					Math.round(data[0].getAttribute("SF94_OSP"))+Math.round(data[0].getAttribute("MF94_OSP"))+Math.round(data[0].getAttribute("MH94_OSP"))+
					Math.round(data[0].getAttribute("SF95_OSP"))+Math.round(data[0].getAttribute("MF95_OSP"))+Math.round(data[0].getAttribute("MH95_OSP"))+	
					Math.round(data[0].getAttribute("SF96_OSP"))+Math.round(data[0].getAttribute("MF96_OSP"))+Math.round(data[0].getAttribute("MH96_OSP"))+
					Math.round(data[0].getAttribute("SF97_OSP"))+Math.round(data[0].getAttribute("MF97_OSP"))+Math.round(data[0].getAttribute("MH97_OSP"))+
					Math.round(data[0].getAttribute("SF98_OSP"))+Math.round(data[0].getAttribute("MF98_OSP"))+Math.round(data[0].getAttribute("MH98_OSP"))+
					Math.round(data[0].getAttribute("SF99_OSP"))+Math.round(data[0].getAttribute("MF99_OSP"))+Math.round(data[0].getAttribute("MH99_OSP"))+	
					Math.round(data[0].getAttribute("SF00_OSP"))+Math.round(data[0].getAttribute("MF00_OSP"))+Math.round(data[0].getAttribute("MH00_OSP"))+
					Math.round(data[0].getAttribute("SF01_OSP"))+Math.round(data[0].getAttribute("MF01_OSP"))+Math.round(data[0].getAttribute("MH01_OSP"))+
					Math.round(data[0].getAttribute("SF02_OSP"))+Math.round(data[0].getAttribute("MF02_OSP"))+Math.round(data[0].getAttribute("MH02_OSP"))+
					Math.round(data[0].getAttribute("SF03_OSP"))+Math.round(data[0].getAttribute("MF03_OSP"))+Math.round(data[0].getAttribute("MH03_OSP"))+
					Math.round(data[0].getAttribute("SF04_OSP"))+Math.round(data[0].getAttribute("MF04_OSP"))+Math.round(data[0].getAttribute("MH04_OSP"))+
					Math.round(data[0].getAttribute("SF05_OSP"))+Math.round(data[0].getAttribute("MF05_OSP"))+Math.round(data[0].getAttribute("MH05_OSP"))+
					Math.round(data[0].getAttribute("SF06_OSP"))+Math.round(data[0].getAttribute("MF06_OSP"))+Math.round(data[0].getAttribute("MH06_OSP"))+ 
					Math.round(data[0].getAttribute("SF07_OSP"))+Math.round(data[0].getAttribute("MF07_OSP"))+Math.round(data[0].getAttribute("MH07_OSP"))+

Math.round(data[0].getAttribute("SF08_OSP"))+Math.round(data[0].getAttribute("MF08_OSP"))+Math.round(data[0].getAttribute("MH08_OSP"))+

Math.round(data[0].getAttribute("SF09_OSP"))+Math.round(data[0].getAttribute("MF09_OSP"))+Math.round(data[0].getAttribute("MH09_OSP")),"","") +
					"</td>" +												
					"<td style='width:25px;'>&nbsp;</td></tr>";
}

					html1 += "</table><br /><br />" +			

					"</td></tr>" +
					"</table>" +
					"</td></tr></table>" +

				"</td></tr></table>";
					
		  document.getElementById("page1").innerHTML = html1;	
		  if(rpt==1) g1.build("graph1", "<br />Year",250,8);
		  else g1.build("graph1", "<br />Year",250,13); 
}
		  document.getElementById("pwait").innerHTML = ""; 
               }
            }
        };
        xmlhttp.send(null); 
    }
}

