Ellipse.Inherits(Shape);
function Ellipse(name){
	if(typeof(name) == "undefined"){
		name = "Ellipse";
	}
	
	this.Inherits(Shape, name);
}

Ellipse.prototype.create = function(id, radius, left, top){
	switch(getBrowser()){
		case "Explorer":{
			if(this.opacity != null){
				var fill = document.createElement("v:fill");
				fill.setAttribute("opacity", this.opacity);
			}
			this.ellipse = document.createElement("v:oval");
			this.ellipse.style.position = "relative";
			this.ellipse.style.width = radius * 2;
			this.ellipse.style.height = radius * 2;
			this.ellipse.style.left = top - radius;
			this.ellipse.style.top = left - radius;
			
			this.ellipse.setAttribute("Filled", (this.fillColor != null)? "true": "false");
			this.ellipse.setAttribute("FillColor", this.fillColor);
			this.ellipse.setAttribute("Stroked", (this.strokeColor != null)? true: false);
			this.ellipse.setAttribute("StrokeColor", this.strokeColor);
			this.ellipse.setAttribute("StrokeWeight", this.strokeSize);
			
			this.ellipse.appendChild(fill);
			
			break;
		}default:{
			var svgNS = 'http://www.w3.org/2000/svg'; 
			this.ellipse = document.createElementNS(svgNS, "circle");
			this.ellipse.setAttributeNS(null, "cx", top);
			this.ellipse.setAttributeNS(null, "cy", left);
			this.ellipse.setAttributeNS(null, "r", radius);
			this.ellipse.setAttributeNS(null, "fill", this.fillColor);
			this.ellipse.setAttributeNS(null, "stroke", this.strokeColor);
			this.ellipse.setAttributeNS(null, "stroke-width", this.strokeSize);
			this.ellipse.setAttributeNS(null, "fill-opacity", this.opacity);
			this.ellipse.setAttributeNS(null, "overflow", "visible");
			
			break;
		}
	}
}

Ellipse.prototype.fill = function(color, opacity){
	
	alert(this.ellipse);
	
}

Ellipse.prototype.create1 = function(id, size, left, top, obj){
	this.id = id;
	
	var clientBrowser = new ClientBrowser();
	clientBrowser.init();
	
	switch(clientBrowser.browser){
		case "Explorer":{
			shape = document.createElement("v:oval");
			shape.setAttribute("id", this.id);
			
			shape.style.position = "absolute";
			shape.style.zIndex = 2;
			shape.style.width = parseInt((size * 2) - 4) + "px";
			shape.style.height = parseInt((size * 2) - 4) + "px";
			shape.style.left = left;
			shape.style.top = top;
			shape.setAttribute("coordorigin", left + "," + top);
			shape.setAttribute("opacity", "1.0");
			shape.setAttribute("fill", "true");
			shape.setAttribute("fillColor", this.fillColor);
			shape.setAttribute("stroke", "true");
			shape.setAttribute("strokeColor", this.strokeColor);
			shape.setAttribute("strokeWeight", "1px");
			
			var fill = document.createElement("v:fill");
			fill.setAttribute("opacity", "0.4");
			
			shape.appendChild(fill);
			
		    return shape;
		}default:{
			var canvas = document.createElement("canvas");
			canvas.style.position = "absolute";
			canvas.setAttribute("id", this.id);
			
			var radians = (Math.PI / 180)* 0.1; 
			
			canvas.setAttribute("width", size * 2);
			canvas.setAttribute("height", size * 2);
			canvas.style.zIndex = 2;
			canvas.style.margin = "0px";
			canvas.style.padding = "0px";
			canvas.style.left = left + "px";
			canvas.style.top = top + "px";
			
			var ctx = canvas.getContext('2d');
			ctx.translate(size, size);
			ctx.fillStyle = this.fillColor;
			ctx.strokeStyle= this.strokeColor;
			
			ctx.lineWidth = 1;
			ctx.beginPath();
			ctx.arc(0, 0, size-1, 0, radians, true);
			ctx.stroke();
			ctx.globalAlpha = 0.4;
			ctx.fill();
			
			ctx.closePath();

			return canvas;
	    }
	}
}