function Vml()
{
	var self = this;
	
	this.strokeColor;
	this.fillColor;
	this.isFill = false;
		
	this.drawPolygon = drawPolygon;
	this.drawRectangle = drawRectangle;
	this.drawPolyline = drawPolyline;
	this.drawLine = drawLine;
	this.clear = clear;
	this.setStrokeColor = setStrokeColor;
	this.getStrokeColor = getStrokeColor;
	this.setFillColor = setFillColor;
	this.getFillColor = getFillColor;
	
	function drawPolygon()
	{
		
	}
	
	function drawRectangle(x1, y1, x2, y2)
	{
		var theLine = document.getElementById("theLine");
		var fill = document.getElementById("fill");
		
		fill.color = self.getFillColor();
		theLine.strokeColor = self.getStrokeColor();
		fill.on = self.isFill;
		theLine.path.value = "m " + x1 + "," + y1 + " l " + x1 + "," + y2 + " l " + x2 + "," + y2 + " l " + x2 + "," + y1 + "x e";
	}
	
	function drawPolyline(pts, currentX, currentY) // take array of points (x,y)
	{
		var theLine = document.getElementById("theLine");
		var fill = document.getElementById("fill");
		
		fill.color = self.getFillColor();
		theLine.strokeColor = self.getStrokeColor();
		fill.on = self.isFill;
		
		var str = "m " + pts[0].split(',')[0] + "," + pts[0].split(',')[1] + " l";
		
		for( var i = 1; i < pts.length; i++ )
		{
			str += " " + pts[i].split(',')[0] + "," + pts[i].split(',')[1] + " l";
		}
		
		if( currentX != null && currentY != null )
			str += " " + currentX + "," + currentY + " l";
			
		str = str.substr(0, str.lastIndexOf('l'));
		str += "x e";
		
		theLine.path.value = str;
	}
	
	function drawLine(x1, y1, x2, y2)
	{
		var theLine = document.getElementById("theLine");
		var fill = document.getElementById("fill");
		
		fill.color = self.getFillColor();
		theLine.strokeColor = self.getStrokeColor();
		fill.on = self.isFill;
		theLine.path.value = "m " + x1 + "," + y2 + " l " + x2 + "," + y2 + "x e";
	}
	
	function clear()
	{
		var theLine = document.getElementById("theLine");
		var fill = document.getElementById("fill");
		
		fill.on = false;
		theLine.path.value = "m 1,1x e";
	}
	
	function getStrokeColor() { return self.strokeColor; }
	function setStrokeColor(strokeColor) { self.strokeColor = strokeColor; }
	
	function getFillColor() { return self.fillColor; }
	function setFillColor(fillColor) { self.fillColor = fillColor; }
}

