	/**
	 * 将canvas画布导出为图片
	 */
	function canvasToImageIpal(name,type) {
	    var canvas = document.getElementById("canvasipal");
	    var imgdata = canvas.toDataURL(type);
	    var fixtype = function (type) {
	        type = type.toLocaleLowerCase().replace(/jpg/i, 'jpeg');
	        var r = type.match(/png|jpeg|bmp|gif/)[0];
	        return 'image/' + r;
	    }
	    imgdata = imgdata.replace(fixtype(type), 'image/octet-stream')
	    var saveFile = function (data, filename) {
	        var link = document.createElement('a');
	        link.href = data;
	        link.download = filename;
	        var event = document.createEvent('MouseEvents');
	        event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
	        link.dispatchEvent(event);
	    }
	    var filename = name+'.' + type;
	    saveFile(imgdata, filename);
	}
	