arr = new Array(2);
$(function(){
	$(".Columns span").height(690);

	
	
		
$.get("/services/GetBlood.ashx", function(data){
	  
	  arr[0] = new Array(8);
	  arr[1] = new Array(8);
	  var lines = data.split("\n");
	  var j=0;
	  for(i=2; i<10; i++){
	    var values = lines[i].split(";");
	    arr[0][j] = trim(values[3]);
	    arr[1][j] = trim(values[2]);
	    j++;
	    
	  }
	  bloodLine();
	});
	
	if ($.browser.msie) {
    $(".Columns span").height(730);
	 }
	
});

function trim(str) {
        return Math.round(str.replace(/^\s+|\s+$/g,""));
}
	
function bloodLine(){
	var paper = Raphael("bars"),
	 fin = function () {
                        this.flag = paper.g.popup(this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this);
                    },
                    fout = function () {
                        this.flag.animate({opacity: 0}, 300, function () {this.remove();});
                    },
                    fin2 = function () {
                        var y = [], res = [];
                        for (var i = this.bars.length; i--;) {
                            y.push(this.bars[i].y);
                            res.push(this.bars[i].value || "0");
                        }
                        this.flag = paper.g.popup(this.bars[0].x, Math.min.apply(Math, y), res.join(", ")).insertBefore(this);
                    },
                    fout2 = function () {
                        this.flag.animate({opacity: 0}, 300, function () {this.remove();});
                    };

                    	
	paper.g.barchart(0, 00, 180, 95, arr, {stacked: true, type: "square"});
	}