
function drawGraph(pc) {

        var cur = pc[1];
	var max = 0;

        var hour = new Array( 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 );

        var html = "<div style=\"width:640px;height:160px;background-color: #EEEEEE;font: 12px bold Arial;\">\n";

        html += "<table width=\"100%\" height=\"160\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr>\n";

        for( x = 2; x < pc.length; x++ ) {
                if( x % 2 ) {
			max = ( max < pc[x] )? pc[x] : max;
		}
	}

        for( x = 2; x < pc.length; x++ ) {


                if( x % 2 ) {


                        if( pc[x-1] == cur  ) {
                                color="#CCCCCC";
                        } else {
                                color="#EEEEEE";
                        }

                        html += "<td><table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"1\" border=\"0\">\n";
                        html += "<tr><td align=\"center\" valign=\"bottom\" style=\"border-bottom:2px solid #000000;background-color:"+color +";font: normal 12px Arial;\" >\n";
			if( pc[x] > 9 ) {
                        	html += pc[x] + "%<BR>\n";
			} else {
                        	html += "&nbsp;"+ pc[x] + "%<BR>\n";
			}

                        if( pc[x] > 0 ) {
                                html += "<div style=\"width:95%;background-color:#FF0000;height:" + parseInt ( ( ( ( pc[x] / max ) * 100 ) ) ) + "px;\"></div>\n";
                        }

                        html += "</td></tr>";
                        html += "<tr><td align=\"center\" style=\"color:#00AA00;height:20px;width:4%;background-color:"+ color +";font: bold 12px Arial;\">\n";
                        if( hour[ pc[x-1] ] ) {
                                html += hour[ pc[x-1] ] +"\n";
                        }
			if( pc[x-1] == 26 ) {
				if( dst() == 0 ) {
                                        html += "EDT\n";
                                } else {
                                        html += "EST\n";
                                }
			}
                        html += "</td></tr>\n";

                        html += "<tr><td align=\"center\" style=\"color:#0000FF;height:20px;width:4%;background-color:"+ color +";font: bold 12px Arial;\">\n";
			if( hour[ (pc[x-1] - 3 ) ] ) {
                        	html += hour[ (pc[x-1]-3) ] +"\n";
			}
			if( ( pc[x-1] - 3 ) == -3 ) {
				if( dst() == 0 ) {
                                	html += "PDT\n";
				} else {
                                	html += "PST\n";
				}
			}
                       	html += "</td></tr>\n";
                        html += "</table></td>\n";

                }

        }

        html += "</tr></table>\n";

        html += "</div>\n";

	document.write( html );

}
function drawBar( pc, height, width ){ 

	var inw = 0;

	if( pc[0] != 0 ) {
		inw = parseInt ( ( width * ( pc[0] / 100 ) ) ) ; 
	}

	html = "<div style=\"width:"+width+";height:"+height+";border:1px solid #000000;\">";

	html += "<div style=\"width:"+inw+";height:"+height+";background-color:#FF0000;\"></div>";

	html += "</div>";

	document.write( html ); 
	
}
function dst() {
	var gmt = new Date;

	var lsm = new Date;

	var lso = new Date;

	lsm.setMonth(2); // March

	lsm.setDate(31);

	var day = lsm.getDay();// day of week of 31st

	lsm.setDate(31-day); // last Sunday

	lso.setMonth(9); // October

	lso.setDate(31);

	day = lso.getDay();

	lso.setDate(31-day);

	if (gmt < lsm || gmt >= lso) {

		return 1;

	} else {

		return 0;

	}

}
