function shapeAll(isAll) {
  $(".shapelegendbox input").attr("checked",isAll);
  shapeConfigure();
}

function shapeConfigure() {
  var cfg = {};
  $(".shapelegendbox input").each(function() {
    var shape  = $(this).attr('id').substring(3);
    cfg[shape] = $(this).attr('checked');
  });
  var flash = $('#flash, #flashavg').each(function() {
	  this.configure(cfg);
  });
}


function shapeInit(disabledShapes) {
    $(".shapelegendbox input").each(function() {
	    var checked = true;
	    if (disabledShapes) {
		for (var i = 0; i < disabledShapes.length; i++) {
		    if (disabledShapes[i] == $(this).attr('id').substring(3)) {
			checked = false;
			break;
		    }
		}
	    }
	    $(this).attr("checked",checked);
	}).click(shapeConfigure);
}

function shapeInitDemo() {
    $(".shapelegendbox input").attr("checked",false).click(shapeConfigure);
}

