/**
 * hml_shapes.js (2008-oct-28)
 * (c) by Alejandro Gudiel
 * All Rights Reserved
 * License does not permit use by third parties
**/

// Globals
var boolHMLShapesIsIE = false;
var boolHMLShapesUseMicrosoftVectors = false;
var boolHMLShapesUseCanvasVectors = false;

var objTMP = document.createElement('canvas');
var boolHMLShapesIsIE = window.navigator.systemLanguage?1:0;
var boolHMLShapesUseMicrosoftVectors = document.namespaces?1:0;
var boolHMLShapesUseCanvasVectors = objTMP.getContext?1:0;
var strGlobalCoordSize = "1000,1000";

if(boolHMLShapesUseMicrosoftVectors) {
	if(document.namespaces['v'] == null) {
		var objStyleSheet = document.createStyleSheet();
        objStyleSheet.addRule("v\\:*", "behavior: url(#default#VML); antialias:false;");

        /*
        objStyleSheet.addRule("v\\:shape", "behavior:url(#default#VML); display:inline-block; antialias:true");
        objStyleSheet.addRule("v\\:group", "behavior:url(#default#VML); display:inline-block; antialias:true");
        objStyleSheet.addRule("v\\:polyline", "behavior:url(#default#VML); display:inline-block; antialias:true");
        objStyleSheet.addRule("v\\:stroke", "behavior:url(#default#VML); display:inline-block; antialias:true");
        objStyleSheet.addRule("v\\:fill", "behavior:url(#default#VML); display:inline-block; antialias:true");
        objStyleSheet.addRule("v\\:rect", "behavior:url(#default#VML); display:inline-block; antialias:true");
        objStyleSheet.addRule("v\\:oval", "behavior:url(#default#VML); display:inline-block; antialias:true");
        */

		document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
	}
}
var sinAppVersion = 0;
if (boolHMLShapesIsIE) {
	sinAppVersion = navigator.appVersion;
	sinAppVersion = sinAppVersion.split(" ");
	sinAppVersion = sinAppVersion[3];
	sinAppVersion = sinAppVersion.substr(0, 3);
	sinAppVersion = 1*sinAppVersion;
}

// Line functions
function objHMLShapeLine(strID, varContainer, strCoords, strPath, intLeft, intTop, intWidth, intHeight, strStrokeColor, intStrokeWeight, intAlpha) {
	if (!strID || !varContainer || !strPath) {
		alert("Falta ID o Container o Path");
		return false;
	}

	this.strID = strID;
	if (!varContainer.tagName) {
		this.objContainer = document.getElementById(varContainer);
	}
	else {
		this.objContainer = varContainer;
	}

	this.objVector = false;
	this.objCanvasContext = false;

	this.intLeft = (intLeft)?intLeft:0;
	this.intTop = (intTop)?intTop:0;

	this.intWidth = (intWidth)?intWidth:100;
	this.intHeight = (intHeight)?intHeight:100;

	this.strStrokeColor = (strStrokeColor)?strStrokeColor:"black";
	this.intStrokeWeight = (intStrokeWeight)?intStrokeWeight:1;

	this.intAlpha = (intAlpha)?intAlpha:100;

	this.boolHasContents = false;

	this.boolStroked = false;
	this.boolShow = false;

	this.strPath = strPath;
	this.strCoords = (strCoords)?strCoords:this.intWidth+","+this.intHeight;

	this.stroke = objHMLShapesAnyShape_stroke;
	this.digestPath = objHMLShapesAnyShape_digestPath;
	this.show = objHMLShapes_show;
	this.hide = objHMLShapes_hide;
	this.fadein = objHMLShapes_fadein;
	this.fadeout = objHMLShapes_fadeout;
	this.moveTo = objHMLShapes_moveTo;
	this.moveRel = objHMLShapes_moveRel;
	this.resize = objHMLShapes_resize;
	this.redefine = objHMLShapes_redefine;
	this.addContents = function () {return false;}
}

// Rect functions
function objHMLShapesRect(strID, varContainer, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolIsRound, boolHasContents, strContents) {
	if (!strID || !varContainer) {
		alert("Falta ID o Container");
		return false;
	}

	this.strID = strID;
	if (!varContainer.tagName) {
		this.objContainer = document.getElementById(varContainer);
	}
	else {
		this.objContainer = varContainer;
	}

	this.objVector = false;
	this.objCanvasContext = false;

	this.intLeft = (intLeft)?intLeft:0;
	this.intTop = (intTop)?intTop:0;

	this.intWidth = (intWidth)?intWidth:100;
	this.intHeight = (intHeight)?intHeight:100;

	this.strFillColor = (strFillColor)?strFillColor:"";
	this.strStrokeColor = (strStrokeColor)?strStrokeColor:"black";
	this.intStrokeWeight = (intStrokeWeight)?intStrokeWeight:1;

	this.intAlpha = (intAlpha)?intAlpha:100;

	this.boolHasContents = (boolHasContents)?boolHasContents:false;
	this.strContents = (strContents)?strContents:"";
	this.objContents = false;

	this.objBackFrame = false;

	this.arrContentsDivs = new Array();

	this.boolStroked = false;
	this.boolShow = false;

	this.boolIsRound = (boolIsRound)?boolIsRound:false;
	this.sinArcPCT = 0.2;

	this.stroke = objHMLShapesRect_stroke;
	this.show = objHMLShapes_show;
	this.hide = objHMLShapes_hide;
	this.fadein = objHMLShapes_fadein;
	this.fadeout = objHMLShapes_fadeout;
	this.moveTo = objHMLShapes_moveTo;
	this.moveRel = objHMLShapes_moveRel;
    this.resize = objHMLShapes_resize;
	this.redefine = objHMLShapesRect_redefine;
	this.addContents = objHMLShapes_addContents;
}

function objHMLShapesRect_stroke() {
	if (this.boolStroked) {
		this.show();
	}
	else {
		if (boolHMLShapesUseMicrosoftVectors) {
			if (!this.objVector) {
				if (this.boolIsRound) {
					this.objVector = document.createElement("v:roundrect");
					this.objVector.arcSize = this.sinArcPCT;
				}
				else {
					this.objVector = document.createElement("v:rect");
				}
				this.objVector.shapeObject = this;
			}
			this.objVector.style.filter = "Alpha(opacity=" + this.intAlpha + ")";
			this.objVector.style.width = this.intWidth;
			this.objVector.style.height = this.intHeight;

			this.objVector.filled = (this.strFillColor == "" || this.strFillColor == "transparent")?"f":"t";
			this.objVector.stroked = (this.strStrokeColor == "" || this.strStrokeColor == "transparent" || this.intStrokeWeight <= 0)?"f":"t";

			if (!(this.strFillColor == "" || this.strFillColor == "transparent")) {
				this.objVector.fillcolor = this.strFillColor;
			}
			if (!(this.strStrokeColor == "" || this.strStrokeColor == "transparent" || this.intStrokeWeight <= 0)) {
				this.objVector.strokecolor = this.strStrokeColor;
				this.objVector.strokeweight = this.intStrokeWeight;
			}
		}
		else if (boolHMLShapesUseCanvasVectors) {
			if (!this.objVector) {
				this.objVector = document.createElement('canvas');
				this.objVector.shapeObject = this;
			}

			var intOpacity = this.intAlpha/100;
			this.objVector.style.MozOpacity = intOpacity;
			this.objVector.style.KhtmlOpacity = intOpacity;
			this.objVector.width = this.intWidth;
			this.objVector.height = this.intHeight;

			if (!this.objCanvasContext) {
				this.objCanvasContext = this.objVector.getContext("2d");
			}

			this.objVector.stroked = (this.strStrokeColor == "" || this.strStrokeColor == "transparent" || this.intStrokeWeight <= 0)?"f":"t";

			if (this.strFillColor != "" && this.strFillColor != "transparent") {
				this.objCanvasContext.fillStyle = this.strFillColor;
			}
			if (this.objVector.stroked == "t") {
				this.objCanvasContext.lineWidth = this.intStrokeWeight;
				this.objCanvasContext.strokeStyle = this.strStrokeColor;
			}

			if (this.boolIsRound) {
				var intSmallerSide = (this.intWidth > this.intHeight)?this.intHeight:this.intWidth;
				var intRadio = Math.round(this.sinArcPCT*(1.1*intSmallerSide));

				this.objCanvasContext.beginPath();
				this.objCanvasContext.moveTo(0, intRadio);
				this.objCanvasContext.lineTo(0, this.intHeight - intRadio);
				this.objCanvasContext.quadraticCurveTo(0, this.intHeight, intRadio, this.intHeight);
				this.objCanvasContext.lineTo(this.intWidth - intRadio, this.intHeight);
				this.objCanvasContext.quadraticCurveTo(this.intWidth, this.intHeight, this.intWidth, this.intHeight - intRadio);
				this.objCanvasContext.lineTo(this.intWidth, intRadio);
				this.objCanvasContext.quadraticCurveTo(this.intWidth, 0, this.intWidth - intRadio, 0);
				this.objCanvasContext.lineTo(intRadio, 0);
				this.objCanvasContext.quadraticCurveTo(0, 0, 0, intRadio);
				if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
				if (this.objVector.stroked == "t") this.objCanvasContext.stroke();
			}
			else {
				if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fillRect(0, 0, this.intWidth, this.intHeight);
			    if (this.objVector.stroked == "t") this.objCanvasContext.strokeRect(0, 0, this.intWidth, this.intHeight);
			}
		}
		else {
			//Navegador no implementado
		}
		this.objVector.id = this.strID;

		this.objVector.style.zoom = 1;
		this.objVector.style.margin = 0;
		this.objVector.style.padding = 0;
		this.objVector.style.position = "absolute";
		this.objVector.style.zIndex = "2";

		this.objVector.style.left = this.intLeft;
		this.objVector.style.top = this.intTop;

		this.boolShow = true;
		this.boolStroked = true;

		this.objContainer.appendChild(this.objVector);

		if ((boolHMLShapesIsIE && sinAppVersion < 7)) {
			this.objBackFrame = document.createElement("iframe"); //Objeto con el iframe que hace el elemento visible sobre los selects en IE 6
			this.objBackFrame.src = "core/index.php";
			this.objBackFrame.scrolling = "no";
			this.objBackFrame.frameBorder = "0";
			this.objBackFrame.style.position = "absolute";
			this.objBackFrame.style.zIndex = 1;
			//this.objBackFrame.allowTransparency = "true";
			this.objBackFrame.style.width = this.intWidth;
			this.objBackFrame.style.height = this.intHeight;
			this.objBackFrame.style.left = this.objVector.style.left;
			this.objBackFrame.style.top = this.objVector.style.top;

			this.objContainer.appendChild(this.objBackFrame);
		}

		this.addContents();
	}
}

function objHMLShapesRect_redefine(intWidth, intHeight, boolIsRound, sinArcPCT) {
    if (!boolIsRound) boolIsRound = this.boolIsRound;
    if (!sinArcPCT) sinArcPCT = this.sinArcPCT;

    this.intWidth = intWidth;
    this.intHeight = intHeight;
    this.boolIsRound = boolIsRound;
    this.sinArcPCT = sinArcPCT;

    if (!this.boolStroked) {
        this.stroke();
    }
    else {
        if (boolHMLShapesUseMicrosoftVectors) {
            if (!this.objVector) {
                if (this.boolIsRound) {
                    this.objVector = document.createElement("v:roundrect");
                    this.objVector.arcSize = this.sinArcPCT;
                }
                else {
                    this.objVector = document.createElement("v:rect");
                }
                this.objVector.shapeObject = this;
            }
            this.objVector.style.filter = "Alpha(opacity=" + this.intAlpha + ")";
            this.objVector.style.width = this.intWidth;
            this.objVector.style.height = this.intHeight;

            this.objVector.filled = (this.strFillColor == "" || this.strFillColor == "transparent")?"f":"t";
            this.objVector.stroked = (this.strStrokeColor == "" || this.strStrokeColor == "transparent" || this.intStrokeWeight <= 0)?"f":"t";

            if (!(this.strFillColor == "" || this.strFillColor == "transparent")) {
                this.objVector.fillcolor = this.strFillColor;
            }
            if (!(this.strStrokeColor == "" || this.strStrokeColor == "transparent" || this.intStrokeWeight <= 0)) {
                this.objVector.strokecolor = this.strStrokeColor;
                this.objVector.strokeweight = this.intStrokeWeight;
            }
        }
        else if (boolHMLShapesUseCanvasVectors) {
            if (!this.objVector) {
                this.objVector = document.createElement('canvas');
                this.objVector.shapeObject = this;
            }

            var intOpacity = this.intAlpha/100;
            this.objVector.style.MozOpacity = intOpacity;
            this.objVector.style.KhtmlOpacity = intOpacity;

            this.objVector.width = this.intWidth;
            this.objVector.height = this.intHeight;

            if (!this.objCanvasContext) {
                this.objCanvasContext = this.objVector.getContext("2d");
            }

            this.objVector.stroked = (this.strStrokeColor == "" || this.strStrokeColor == "transparent" || this.intStrokeWeight <= 0)?"f":"t";

            if (this.strFillColor != "" && this.strFillColor != "transparent") {
                this.objCanvasContext.fillStyle = this.strFillColor;
            }
            if (this.objVector.stroked == "t") {
                this.objCanvasContext.lineWidth = this.intStrokeWeight;
                this.objCanvasContext.strokeStyle = this.strStrokeColor;
            }

            if (this.boolIsRound) {
                var intSmallerSide = (this.intWidth > this.intHeight)?this.intHeight:this.intWidth;
                var intRadio = Math.round(this.sinArcPCT*(1.1*intSmallerSide));

                this.objCanvasContext.beginPath();
                this.objCanvasContext.moveTo(0, intRadio);
                this.objCanvasContext.lineTo(0, this.intHeight - intRadio);
                this.objCanvasContext.quadraticCurveTo(0, this.intHeight, intRadio, this.intHeight);
                this.objCanvasContext.lineTo(this.intWidth - intRadio, this.intHeight);
                this.objCanvasContext.quadraticCurveTo(this.intWidth, this.intHeight, this.intWidth, this.intHeight - intRadio);
                this.objCanvasContext.lineTo(this.intWidth, intRadio);
                this.objCanvasContext.quadraticCurveTo(this.intWidth, 0, this.intWidth - intRadio, 0);
                this.objCanvasContext.lineTo(intRadio, 0);
                this.objCanvasContext.quadraticCurveTo(0, 0, 0, intRadio);
                if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
                if (this.objVector.stroked == "t") this.objCanvasContext.stroke();
            }
            else {
                if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fillRect(0, 0, this.intWidth, this.intHeight);
                if (this.objVector.stroked == "t") this.objCanvasContext.strokeRect(0, 0, this.intWidth, this.intHeight);
            }
        }
        else {
            //Navegador no implementado
        }
        this.objVector.id = this.strID;

        this.objVector.style.zoom = 1;
        this.objVector.style.margin = 0;
        this.objVector.style.padding = 0;
        this.objVector.style.position = "absolute";
        this.objVector.style.zIndex = "2";

        this.objVector.style.left = this.intLeft;
        this.objVector.style.top = this.intTop;

        this.boolStroked = true;

        this.resize(this.intWidth, this.intHeight);
    }
}

// Otras formas
function objHMLShapesCircle() {
	alert("Figura no implementada");
}

function objHMLShapesEllipse() {
	alert("Figura no implementada");
}

function objHMLShapesPolygon() {
	alert("Figura no implementada");
}

// AnyShape functions
function objHMLShapesAnyShape(strID, varContainer, strCoords, strPath, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolHasContents, strContents) {
	if (!strID || !varContainer || !strPath) {
		alert("Falta ID o Container o Path");
		return false;
	}

	this.strID = strID;
	if (!varContainer.tagName) {
		this.objContainer = document.getElementById(varContainer);
	}
	else {
		this.objContainer = varContainer;
	}

	this.objVector = false;
	this.objCanvasContext = false;

	this.intLeft = (intLeft)?intLeft:0;
	this.intTop = (intTop)?intTop:0;

	this.intWidth = (intWidth)?intWidth:100;
	this.intHeight = (intHeight)?intHeight:100;

	this.strFillColor = (strFillColor)?strFillColor:"";
	this.strStrokeColor = (strStrokeColor)?strStrokeColor:"black";
	this.intStrokeWeight = (intStrokeWeight)?intStrokeWeight:1;

	this.intAlpha = (intAlpha)?intAlpha:100;

	this.boolHasContents = (boolHasContents)?boolHasContents:false;
	this.strContents = (strContents)?strContents:"";
	this.objContents = false;

	this.objBackFrame = false;

	this.arrContentsDivs = new Array();

	this.boolStroked = false;
	this.boolShow = false;

	this.strPath = strPath;
	this.strCoords = (strCoords)?strCoords:this.intWidth+","+this.intHeight;

	this.stroke = objHMLShapesAnyShape_stroke;
	this.digestPath = objHMLShapesAnyShape_digestPath;
	this.show = objHMLShapes_show;
	this.hide = objHMLShapes_hide;
	this.fadein = objHMLShapes_fadein;
	this.fadeout = objHMLShapes_fadeout;
	this.moveTo = objHMLShapes_moveTo;
	this.moveRel = objHMLShapes_moveRel;
	this.resize = objHMLShapes_resize;
	this.redefine = objHMLShapes_redefine;
	this.addContents = objHMLShapes_addContents;
}

function objHMLShapesAnyShape_stroke() {
	if (this.boolStroked) {
		this.show();
	}
	else {
		if (boolHMLShapesUseMicrosoftVectors) {
			if (!this.objVector) {
				this.objVector = document.createElement("v:shape");
				this.objVector.shapeObject = this;
			}
			this.objVector.coordsize = this.strCoords;

			this.objVector.style.filter = "Alpha(opacity=" + this.intAlpha + ")";
			this.objVector.style.width = this.intWidth;
			this.objVector.style.height = this.intHeight;

			if (this.strFillColor) this.objVector.fillcolor = this.strFillColor;
			this.objVector.strokecolor = this.strStrokeColor;
			this.objVector.strokeweight = this.intStrokeWeight;

			this.objVector.filled = (!this.strFillColor || this.strFillColor == "" || this.strFillColor == "transparent")?"f":"t";
			this.objVector.stroked = (this.strStrokeColor == "" || this.strStrokeColor == "transparent")?"f":"t";

			this.objVector.path = this.strPath;
		}
		else if (boolHMLShapesUseCanvasVectors) {
			if (!this.objVector) {
				this.objVector = document.createElement('canvas');
				this.objVector.shapeObject = this;
			}

			var intOpacity = this.intAlpha/100;
			this.objVector.style.MozOpacity = intOpacity;
			this.objVector.style.KhtmlOpacity = intOpacity;
			this.objVector.width = this.intWidth;
			this.objVector.height = this.intHeight;

			if (!this.objCanvasContext) this.objCanvasContext = this.objVector.getContext("2d");

			if (this.strFillColor && (this.strFillColor != "" && this.strFillColor != "transparent")) {
				this.objCanvasContext.fillStyle = this.strFillColor;
			}
			if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") {
				this.objCanvasContext.lineWidth = this.intStrokeWeight;
				this.objCanvasContext.strokeStyle = this.strStrokeColor;
			}

			this.digestPath(this.strPath);
			if (this.strFillColor && this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
			if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") this.objCanvasContext.stroke();
		}
		else {
			alert("Navegador no implementado");
		}

		this.objVector.id = this.strID;

		this.objVector.style.zoom = 1;
		this.objVector.style.margin = 0;
		this.objVector.style.padding = 0;
		this.objVector.style.position = "absolute";
		this.objVector.style.zIndex = "2";

		this.objVector.style.left = this.intLeft;
		this.objVector.style.top = this.intTop;

		this.objContainer.appendChild(this.objVector);

		if ((boolHMLShapesIsIE && sinAppVersion < 7)) {
			this.objBackFrame = document.createElement("iframe"); //Objeto con el iframe que hace el elemento visible sobre los selects en IE 6
			this.objBackFrame.src = "core/index.php";
			this.objBackFrame.scrolling = "no";
			this.objBackFrame.frameBorder = "0";
			this.objBackFrame.style.position = "absolute";
			this.objBackFrame.style.zIndex = 1;
			//this.objBackFrame.allowTransparency = "true";
			this.objBackFrame.style.width = this.intWidth;
			this.objBackFrame.style.height = this.intHeight;
			this.objBackFrame.style.left = this.objVector.style.left;
			this.objBackFrame.style.top = this.objVector.style.top;

			this.objContainer.appendChild(this.objBackFrame);
		}

		this.boolShow = true;
		this.boolStroked = true;

		this.addContents();
	}
}

// Picobox functions
function objHMLShapesPicoBox(strID, varContainer, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolHasContents, strContents) {
	if (!strID || !varContainer) {
		alert("Falta ID o Container");
		return false;
	}

	intLeft = (intLeft)?intLeft:0;
	intTop = (intTop)?intTop:0;

	intWidth = (intWidth)?intWidth:100;
	intHeight = (intHeight)?intHeight:100;

	strFillColor = (strFillColor)?strFillColor:"";
	strStrokeColor = (strStrokeColor)?strStrokeColor:"black";

	intStrokeWeight = (intStrokeWeight)?intStrokeWeight:1;

	intAlpha = (intAlpha)?intAlpha:100;

	boolHasContents = (boolHasContents)?boolHasContents:false;
	strContents = (strContents)?strContents:"";

	var intSmallerSide = (intWidth > intHeight)?intHeight:intWidth;
	var intCurveRadius = Math.round(intSmallerSide/10);
	if (intCurveRadius > 15) intCurveRadius = 15;
	var intPicoLength = Math.round(intSmallerSide/10);
	if (intPicoLength > 40) intPicoLength = 40;
	var intPicoPosition = Math.round((intHeight-intPicoLength)/2);
	var intCuadroSide = intWidth - intPicoLength;
	var strDefaultPath = "";
	strDefaultPath += " M"+intCurveRadius+",0";
	strDefaultPath += " L"+(intCuadroSide-intCurveRadius)+",0";
	strDefaultPath += " C"+(intCuadroSide-intCurveRadius)+",0 "+intCuadroSide+",0 "+intCuadroSide+","+intCurveRadius+"";
	strDefaultPath += " L"+intCuadroSide+","+intPicoPosition;

	strDefaultPath += " L"+(intCuadroSide+intPicoLength)+","+(intPicoPosition+intPicoLength);
	strDefaultPath += " L"+intCuadroSide+","+(intPicoPosition+2*intPicoLength);
	strDefaultPath += " L"+intCuadroSide+","+(intHeight-intCurveRadius);
	strDefaultPath += " C"+intCuadroSide+","+(intHeight-intCurveRadius)+" "+intCuadroSide+","+intHeight+" "+(intCuadroSide-intCurveRadius)+","+intHeight;
	strDefaultPath += " L"+intCurveRadius+","+intHeight;
	strDefaultPath += " C"+intCurveRadius+","+intHeight+" 0,"+intHeight+" 0,"+(intHeight-intCurveRadius);
	strDefaultPath += " L0,"+intCurveRadius;
	strDefaultPath += " C0,"+intCurveRadius+" 0,0 "+intCurveRadius+",0";
	strDefaultPath += " z";

	var objTMP = new objHMLShapesAnyShape(strID, varContainer, false, strDefaultPath, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolHasContents, strContents);
	objTMP.strPicoDirection = "right";
	objTMP.boolPicoSharp = true;
	objTMP.boolRoundCorners = true;
	objTMP.intCurveRadius = intCurveRadius;
	objTMP.intPicoLength = intPicoLength;
	objTMP.intPicoPosition = intPicoPosition;
	objTMP.strPath = strDefaultPath;

	objTMP.resize = objHMLShapesPicoBox_redefine;
	objTMP.redefine = objHMLShapesPicoBox_redefine;
	objTMP.addContents = objHMLShapesPicoBox_addContents;
	return objTMP;
}

function objHMLShapesPicoBox_redefine(intWidth, intHeight, strPicoDirection, boolRoundPico, boolSquareCorners, intCurveRadius, intPicoPosition, intPicoLength) {
	if (!intWidth) intWidth = this.intWidth;
	if (!intHeight) intHeight = this.intHeight;
	if (!strPicoDirection) strPicoDirection = this.strPicoDirection;
	if (!boolRoundPico) boolRoundPico = !this.boolPicoSharp;
	if (!boolSquareCorners) boolSquareCorners = !this.boolRoundCorners;
	if (!intCurveRadius || intCurveRadius <= 0) intCurveRadius = 0;
	if (!intPicoPosition) intPicoPosition = this.intPicoPosition;
	if (!intPicoLength) intPicoLength = this.intPicoLength;

	this.intSmallerSide = (intWidth > intHeight)?intHeight:intWidth;
	this.intCurveRadius = Math.round(this.intSmallerSide/10);
	if (this.intCurveRadius > 15) this.intCurveRadius = 15;
	this.intPicoLength = Math.round(this.intSmallerSide/10);
	if (this.intPicoLength > 40) this.intPicoLength = 40;

	if (intCurveRadius == 0) intCurveRadius = this.intCurveRadius;

	if (this.intWidth != intWidth || this.intHeight != intHeight || this.strPicoDirection == strPicoDirection || this.boolPicoSharp == boolRoundPico || this.boolRoundCorners == boolSquareCorners || this.intCurveRadius != intCurveRadius || this.intPicoPosition != intPicoPosition || this.intPicoLength != intPicoLength) {
		this.intWidth = intWidth;
		this.intHeight = intHeight;

		this.strPicoDirection = strPicoDirection;
		this.boolPicoSharp = !boolRoundPico;
		this.boolRoundCorners = !boolSquareCorners;
		this.intCurveRadius = (this.boolRoundCorners)?intCurveRadius:0;
		this.intPicoPosition = intPicoPosition;
		this.intPicoLength = intPicoLength;

		if (this.intPicoPosition < this.intCurveRadius) this.intPicoPosition = this.intCurveRadius;
		if (this.strPicoDirection == "right" || this.strPicoDirection == "left") {
			if (this.intPicoPosition > (this.intHeight - 2*this.intPicoLength - this.intCurveRadius)) this.intPicoPosition = (this.intHeight - 2*this.intPicoLength - this.intCurveRadius);
		}
		else if (this.strPicoDirection == "up" || this.strPicoDirection == "down") {
			if (this.intPicoPosition > (this.intWidth - 2*this.intPicoLength - this.intCurveRadius)) this.intPicoPosition = (this.intWidth - 2*this.intPicoLength - this.intCurveRadius);
		}

		this.strCoords = this.intWidth+","+this.intHeight;
		this.strPath = "";
		if (this.strPicoDirection == "right") {
			this.intCuadroSide = this.intWidth - this.intPicoLength;

			this.strPath += " M"+this.intCurveRadius+",0";
			this.strPath += " L"+(this.intCuadroSide-this.intCurveRadius)+",0";
			this.strPath += " C"+(this.intCuadroSide-this.intCurveRadius)+",0 "+this.intCuadroSide+",0 "+this.intCuadroSide+","+this.intCurveRadius+"";
			this.strPath += " L"+this.intCuadroSide+","+this.intPicoPosition;
			if (this.boolPicoSharp) {
				this.strPath += " L"+(this.intCuadroSide+this.intPicoLength)+","+(this.intPicoPosition+this.intPicoLength);
				this.strPath += " L"+this.intCuadroSide+","+(this.intPicoPosition+2*this.intPicoLength);
			}
			else {
				this.strPath += " C"+this.intCuadroSide+","+this.intPicoPosition+" "+this.intCuadroSide+","+(this.intPicoPosition+this.intPicoLength)+" "+(this.intCuadroSide+this.intPicoLength)+","+(this.intPicoPosition+this.intPicoLength);
				this.strPath += " C"+(this.intCuadroSide+this.intPicoLength)+","+(this.intPicoPosition+this.intPicoLength)+" "+this.intCuadroSide+","+(this.intPicoPosition+this.intPicoLength)+" "+this.intCuadroSide+","+(this.intPicoPosition+2*this.intPicoLength);
			}
			this.strPath += " L"+this.intCuadroSide+","+(intHeight-this.intCurveRadius);
			this.strPath += " C"+this.intCuadroSide+","+(intHeight-this.intCurveRadius)+" "+this.intCuadroSide+","+intHeight+" "+(this.intCuadroSide-this.intCurveRadius)+","+intHeight;
			this.strPath += " L"+this.intCurveRadius+","+intHeight;
			this.strPath += " C"+this.intCurveRadius+","+intHeight+" 0,"+intHeight+" 0,"+(intHeight-this.intCurveRadius);
			this.strPath += " L0,"+this.intCurveRadius;
			this.strPath += " C0,"+this.intCurveRadius+" 0,0 "+this.intCurveRadius+",0";
			this.strPath += " z";
		}
		else if (this.strPicoDirection == "left") {
			this.intCuadroSide = this.intWidth - this.intPicoLength;

			this.strPath += " M"+(this.intPicoLength+this.intCurveRadius)+",0";
			this.strPath += " L"+(this.intWidth-this.intCurveRadius)+",0";
			this.strPath += " C"+(this.intWidth-this.intCurveRadius)+",0 "+(this.intWidth)+",0 "+(this.intWidth)+","+this.intCurveRadius+"";
			this.strPath += " L"+this.intWidth+","+(this.intHeight-this.intCurveRadius);
			this.strPath += " C"+this.intWidth+","+(this.intHeight-this.intCurveRadius)+" "+this.intWidth+","+this.intHeight+" "+(this.intWidth-this.intCurveRadius)+","+this.intHeight;
			this.strPath += " L"+(this.intPicoLength+this.intCurveRadius)+","+this.intHeight;
			this.strPath += " C"+(this.intPicoLength+this.intCurveRadius)+","+this.intHeight+" "+this.intPicoLength+","+this.intHeight+" "+this.intPicoLength+","+(this.intHeight-this.intCurveRadius);
			this.strPath += " L"+this.intPicoLength+","+(this.intPicoPosition+2*this.intPicoLength);
			if (this.boolPicoSharp) {
				this.strPath += " L0,"+(this.intPicoPosition+this.intPicoLength);
				this.strPath += " L"+this.intPicoLength+","+this.intPicoPosition;
			}
			else {
				this.strPath += " C"+this.intPicoLength+","+(this.intPicoPosition+2*this.intPicoLength)+" "+this.intPicoLength+","+(this.intPicoPosition+this.intPicoLength)+" 0,"+(this.intPicoPosition+this.intPicoLength);
				this.strPath += " C0,"+(this.intPicoPosition+this.intPicoLength)+" "+this.intPicoLength+","+(this.intPicoPosition+this.intPicoLength)+" "+this.intPicoLength+","+this.intPicoPosition;
			}
			this.strPath += " L"+this.intPicoLength+","+this.intCurveRadius;
			this.strPath += " C"+this.intPicoLength+","+this.intCurveRadius+" "+intPicoLength+",0 "+(this.intPicoLength+this.intCurveRadius)+",0";
			this.strPath += " z";
		}
		else if (this.strPicoDirection == "up") {
			this.intCuadroSide = this.intHeight - this.intPicoLength;

			this.strPath += " M"+this.intCurveRadius+","+this.intPicoLength;
			this.strPath += " L"+this.intPicoPosition+","+this.intPicoLength;
			if (this.boolPicoSharp) {
				this.strPath += " L"+(this.intPicoPosition+this.intPicoLength)+",0";
				this.strPath += " L"+(this.intPicoPosition+2*this.intPicoLength)+","+this.intPicoLength;
			}
			else {
				this.strPath += " C"+this.intPicoPosition+","+this.intPicoLength+" "+(this.intPicoPosition+this.intPicoLength)+","+this.intPicoLength+" "+(this.intPicoPosition+this.intPicoLength)+",0";
				this.strPath += " C"+(this.intPicoPosition+this.intPicoLength)+",0 "+(this.intPicoPosition+this.intPicoLength)+","+this.intPicoLength+" "+(this.intPicoPosition+2*this.intPicoLength)+","+this.intPicoLength;
			}
			this.strPath += " L"+(this.intWidth-this.intCurveRadius)+","+this.intPicoLength;
			this.strPath += " C"+(this.intWidth-this.intCurveRadius)+","+this.intPicoLength+" "+this.intWidth+","+this.intPicoLength+" "+this.intWidth+","+(this.intPicoLength+this.intCurveRadius);
			this.strPath += " L"+this.intWidth+","+(this.intHeight-this.intCurveRadius);
			this.strPath += " C"+this.intWidth+","+(this.intHeight-this.intCurveRadius)+" "+this.intWidth+","+this.intHeight+" "+(this.intWidth-this.intCurveRadius)+","+this.intHeight;
			this.strPath += " L"+this.intCurveRadius+","+this.intHeight;
			this.strPath += " C"+this.intCurveRadius+","+this.intHeight+" 0,"+this.intHeight+" 0,"+(this.intHeight-this.intCurveRadius);
			this.strPath += " L0,"+(this.intPicoLength+this.intCurveRadius);
			this.strPath += " C0,"+(this.intPicoLength+this.intCurveRadius)+" 0,"+this.intPicoLength+" "+this.intCurveRadius+","+this.intPicoLength;
			this.strPath += " z";
		}
		else if (this.strPicoDirection == "down") {
			this.intCuadroSide = this.intHeight - this.intPicoLength;

			this.strPath += " M"+this.intCurveRadius+",0";
			this.strPath += " L"+(this.intWidth-this.intCurveRadius)+",0";
			this.strPath += " C"+(this.intWidth-this.intCurveRadius)+",0 "+this.intWidth+",0 "+this.intWidth+","+this.intCurveRadius;
			this.strPath += " L"+this.intWidth+","+this.intCuadroSide;
			this.strPath += " L"+(this.intPicoPosition+2*this.intPicoLength)+","+this.intCuadroSide;
			if (this.boolPicoSharp) {
				this.strPath += " L"+(this.intPicoPosition+this.intPicoLength)+","+this.intHeight;
				this.strPath += " L"+this.intPicoPosition+","+this.intCuadroSide;
			}
			else {
				this.strPath += " C"+(this.intPicoPosition+2*this.intPicoLength)+","+this.intCuadroSide+" "+(this.intPicoPosition+this.intPicoLength)+","+this.intCuadroSide+" "+(this.intPicoPosition+this.intPicoLength)+","+this.intHeight;
				this.strPath += " C"+(this.intPicoPosition+this.intPicoLength)+","+this.intHeight+" "+(this.intPicoPosition+this.intPicoLength)+","+this.intCuadroSide+" "+this.intPicoPosition+","+this.intCuadroSide;
			}
			this.strPath += " L"+this.intCurveRadius+","+this.intCuadroSide;
			this.strPath += " C"+this.intCurveRadius+","+this.intCuadroSide+" 0,"+this.intCuadroSide+" 0,"+(this.intCuadroSide-this.intCurveRadius);
			this.strPath += " L0,"+this.intCurveRadius;
			this.strPath += " C0,"+this.intCurveRadius+" 0,0 "+this.intCurveRadius+",0";
			this.strPath += " z";
		}

		if (this.boolStroked) {
			if (boolHMLShapesUseMicrosoftVectors) {
				this.objVector.style.width = this.intWidth;
				this.objVector.style.height = this.intHeight;

				this.objVector.coordsize = this.strCoords;
				this.objVector.path = this.strPath;
			}
			else if (boolHMLShapesUseCanvasVectors) {
				this.objVector.width = this.intWidth;
				this.objVector.height = this.intHeight;

				this.objCanvasContext.fillStyle = this.strFillColor;
				this.objCanvasContext.lineWidth = this.intStrokeWeight;
				this.objCanvasContext.strokeStyle = this.strStrokeColor;

				this.digestPath(this.strPath);
				if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
				if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") this.objCanvasContext.stroke();
			}

			if (this.objBackFrame) {
				this.objBackFrame.style.width = this.intWidth;
				this.objBackFrame.style.height = this.intHeight;
				this.objBackFrame.style.left = this.objVector.style.left;
				this.objBackFrame.style.top = this.objVector.style.top;
			}
		}

		if (this.boolHasContents) {
			this.addContents();
		}
	}
}

function objHMLShapesPicoBox_addContents(strContents) {
	if (!strContents) strContents = this.strContents;
	this.strContents = strContents;

	if (this.strContents != "") {
		this.boolHasContents = true;
		if (!this.objContents) {
			this.objContents = document.createElement("div");
			this.objContents.shapeObject = this;
			this.objContainer.appendChild(this.objContents);
			this.objContents.innerHTML = this.strContents;

			this.arrContentsDivs["contents"] = this.objContents;
		}
	}

	if (this.boolHasContents) {
		this.objContents.style.display = (this.boolShow)?"":"none";
		this.objContents.style.margin = 0;
		this.objContents.style.padding = 0;
		this.objContents.style.position = "absolute";
		this.objContents.style.zIndex = "3";

		var intTMP = Math.round(this.intCurveRadius/4);
		if (this.strPicoDirection == "right") {
			this.objContents.intLeft = this.intLeft + intTMP + 2*this.intStrokeWeight;
			this.objContents.intTop = this.intTop + intTMP + 2*this.intStrokeWeight;

			this.objContents.intWidth = this.intWidth - 2*intTMP - this.intPicoLength - 4*this.intStrokeWeight;
			this.objContents.intHeight = this.intHeight - 2*intTMP - 4*this.intStrokeWeight;
		}
		else if (this.strPicoDirection == "left") {
			this.objContents.intLeft = this.intLeft + intTMP + this.intPicoLength + 2*this.intStrokeWeight;
			this.objContents.intTop = this.intTop + intTMP + 2*this.intStrokeWeight;

			this.objContents.intWidth = this.intWidth - 2*intTMP - this.intPicoLength - 4*this.intStrokeWeight;
			this.objContents.intHeight = this.intHeight - 2*intTMP - 4*this.intStrokeWeight;
		}
		else if (this.strPicoDirection == "up") {
			this.objContents.intLeft = this.intLeft + intTMP + 2*this.intStrokeWeight;
			this.objContents.intTop = this.intTop + intTMP + this.intPicoLength + 2*this.intStrokeWeight;

			this.objContents.intWidth = this.intWidth - 2*intTMP - 4*this.intStrokeWeight;
			this.objContents.intHeight = this.intHeight - 2*intTMP - this.intPicoLength - 4*this.intStrokeWeight;
		}
		else if (this.strPicoDirection == "down") {
			this.objContents.intLeft = this.intLeft + intTMP + 2*this.intStrokeWeight;
			this.objContents.intTop = this.intTop + intTMP + 2*this.intStrokeWeight;

			this.objContents.intWidth = this.intWidth - 2*intTMP - 4*this.intStrokeWeight;
			this.objContents.intHeight = this.intHeight - 2*intTMP - this.intPicoLength - 4*this.intStrokeWeight;
		}

		this.objContents.style.left = this.objContents.intLeft;
		this.objContents.style.top = this.objContents.intTop;
		this.objContents.style.width = this.objContents.intWidth;
		this.objContents.style.height = this.objContents.intHeight;
	}
}

// Tab functions
function objHMLShapesTab(strID, varContainer, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolHasContents, strContents) {
	if (!strID || !varContainer) {
		alert("Falta ID o Container");
		return false;
	}

	intLeft = (intLeft)?intLeft:0;
	intTop = (intTop)?intTop:0;

	intWidth = (intWidth)?intWidth:100;
	intHeight = (intHeight)?intHeight:100;

	strFillColor = (strFillColor)?strFillColor:"";
	strStrokeColor = (strStrokeColor)?strStrokeColor:"black";

	intStrokeWeight = (intStrokeWeight)?intStrokeWeight:1;

	intAlpha = (intAlpha)?intAlpha:100;

	boolHasContents = (boolHasContents)?boolHasContents:false;
	strContents = (strContents)?strContents:"";

	var intCurveRadius = Math.round(intWidth/10);
	if (intCurveRadius > 15) intCurveRadius = 15;
	var strDefaultPath = "";
	strDefaultPath += " M0,"+intHeight;
	strDefaultPath += " L0,"+intCurveRadius;
	strDefaultPath += " C0,"+intCurveRadius+" 0,0 "+intCurveRadius+",0";
	strDefaultPath += " L"+(intWidth-intCurveRadius)+",0";
	strDefaultPath += " C"+(intWidth-intCurveRadius)+",0 "+intWidth+",0 "+intWidth+","+intCurveRadius+"";
	strDefaultPath += " L"+intWidth+","+intHeight;
	strDefaultPath += " z";

	var objTMP = new objHMLShapesAnyShape(strID, varContainer, false, strDefaultPath, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolHasContents, strContents);
	objTMP.intCurveRadius = intCurveRadius;
	objTMP.strPath = strDefaultPath;

	objTMP.resize = objHMLShapesTab_redefine;
	objTMP.redefine = objHMLShapesTab_redefine;

	return objTMP;
}

function objHMLShapesTab_redefine(intWidth, intHeight, intCurveRadius) {
	if (!intWidth) intWidth = this.intWidth;
	if (!intHeight) intHeight = this.intHeight;
	if (!intCurveRadius || intCurveRadius <= 0) intCurveRadius = 0;

	this.intCurveRadius = Math.round(intWidth/10);
	if (this.intCurveRadius > 15) this.intCurveRadius = 15;
	if (intCurveRadius == 0) intCurveRadius = this.intCurveRadius;

	if (this.intWidth != intWidth || this.intHeight != intHeight || this.intCurveRadius != intCurveRadius) {
		this.intWidth = intWidth;
		this.intHeight = intHeight;
		this.intCurveRadius = intCurveRadius;
		this.strCoords = this.intWidth+","+this.intHeight;
		this.strPath = "";

		this.strPath += " M0,"+this.intHeight;
		this.strPath += " L0,"+this.intCurveRadius;
		this.strPath += " C0,"+this.intCurveRadius+" 0,0 "+this.intCurveRadius+",0";
		this.strPath += " L"+(this.intWidth-this.intCurveRadius)+",0";
		this.strPath += " C"+(this.intWidth-this.intCurveRadius)+",0 "+this.intWidth+",0 "+this.intWidth+","+this.intCurveRadius+"";
		this.strPath += " L"+this.intWidth+","+this.intHeight;
		this.strPath += " z";

		if (this.boolStroked) {
			if (boolHMLShapesUseMicrosoftVectors) {
				this.objVector.style.width = this.intWidth;
				this.objVector.style.height = this.intHeight;

				this.objVector.coordsize = this.strCoords;
				this.objVector.path = this.strPath;
			}
			else if (boolHMLShapesUseCanvasVectors) {
				this.objVector.width = this.intWidth;
				this.objVector.height = this.intHeight;

				this.objCanvasContext.fillStyle = this.strFillColor;
				this.objCanvasContext.lineWidth = this.intStrokeWeight;
				this.objCanvasContext.strokeStyle = this.strStrokeColor;

				this.digestPath(this.strPath);
				if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
				if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") this.objCanvasContext.stroke();
			}

			if (this.objBackFrame) {
				this.objBackFrame.style.width = this.intWidth;
				this.objBackFrame.style.height = this.intHeight;
				this.objBackFrame.style.left = this.objVector.style.left;
				this.objBackFrame.style.top = this.objVector.style.top;
			}
		}

		if (this.boolHasContents) {
			this.addContents();
		}
	}
}

// TabBox functions
function objHMLShapesTabBox(strID, varContainer, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolHasContents, strContents) {
	if (!strID || !varContainer) {
		alert("Falta ID o Container");
		return false;
	}

	intLeft = (intLeft)?intLeft:0;
	intTop = (intTop)?intTop:0;

	intWidth = (intWidth)?intWidth:100;
	intHeight = (intHeight)?intHeight:100;

	strFillColor = (strFillColor)?strFillColor:"";
	strStrokeColor = (strStrokeColor)?strStrokeColor:"black";

	intStrokeWeight = (intStrokeWeight)?intStrokeWeight:1;

	intAlpha = (intAlpha)?intAlpha:100;

	boolHasContents = (boolHasContents)?boolHasContents:false;
	strContents = (strContents)?strContents:"";

	var intCurveRadius = Math.round(intWidth/10);
	if (intCurveRadius > 15) intCurveRadius = 15;
	var intTabPosition = 0;
	var intTabWidth = 100;

	var strDefaultPath = "";
	strDefaultPath += " M"+(intTabPosition+intTabWidth)+",0";
	strDefaultPath += " L"+(intWidth-intCurveRadius)+",0";
	strDefaultPath += " C"+(intWidth-intCurveRadius)+",0 "+intWidth+",0 "+intWidth+","+intCurveRadius;
	strDefaultPath += " L"+intWidth+","+(intHeight-intCurveRadius);
	strDefaultPath += " C"+intWidth+","+(intHeight-intCurveRadius)+" "+intWidth+","+intHeight+" "+(intWidth-intCurveRadius)+","+intHeight;
	strDefaultPath += " L"+intCurveRadius+","+intHeight;
	strDefaultPath += " C"+intCurveRadius+","+intHeight+" 0,"+intHeight+" 0,"+(intHeight-intCurveRadius);
	if (intTabPosition == 0) {
		strDefaultPath += " L0,0";
	}
	else {
		strDefaultPath += " L0,"+intCurveRadius;
		strDefaultPath += " C0,"+intCurveRadius+ " 0,0 "+intCurveRadius+",0";
		strDefaultPath += " L"+intTabPosition+",0";
	}
	strDefaultPath += " z";

	var objTMP = new objHMLShapesAnyShape(strID, varContainer, false, strDefaultPath, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha, boolHasContents, strContents);
	objTMP.intTabPosition = intTabPosition;
	objTMP.intTabWidth = intTabWidth;
	objTMP.intCurveRadius = intCurveRadius;
	objTMP.strPath = strDefaultPath;

	objTMP.resize = objHMLShapesTabBox_redefine;
	objTMP.redefine = objHMLShapesTabBox_redefine;

	return objTMP;
}

function objHMLShapesTabBox_redefine(intWidth, intHeight, intCurveRadius, intTabPosition, intTabWidth) {
	if (!intWidth) intWidth = this.intWidth;
	if (!intHeight) intHeight = this.intHeight;
	if (!intCurveRadius || intCurveRadius <= 0) intCurveRadius = 0;
	if (!intTabPosition) intTabPosition = this.intTabPosition;
	if (!intTabWidth) intTabWidth = this.intTabWidth;

	this.intCurveRadius = Math.round(intWidth/10);
	if (this.intCurveRadius > 15) this.intCurveRadius = 15;
	if (intCurveRadius == 0) intCurveRadius = this.intCurveRadius;


	if (this.intWidth != intWidth || this.intHeight != intHeight || this.intCurveRadius != intCurveRadius || this.intTabPosition != intTabPosition || this.intTabWidth != intTabWidth) {
		this.intWidth = intWidth;
		this.intHeight = intHeight;
		this.intCurveRadius = intCurveRadius;
		this.intTabPosition = intTabPosition;
		this.intTabWidth = intTabWidth;
		this.strCoords = this.intWidth+","+this.intHeight;

		this.strPath = "";
		this.strPath += " M"+(this.intTabPosition+this.intTabWidth)+",0";
		this.strPath += " L"+(this.intWidth-this.intCurveRadius)+",0";
		this.strPath += " C"+(this.intWidth-this.intCurveRadius)+",0 "+this.intWidth+",0 "+this.intWidth+","+this.intCurveRadius;
		this.strPath += " L"+this.intWidth+","+(this.intHeight-this.intCurveRadius);
		this.strPath += " C"+this.intWidth+","+(this.intHeight-this.intCurveRadius)+" "+this.intWidth+","+this.intHeight+" "+(this.intWidth-this.intCurveRadius)+","+this.intHeight;
		this.strPath += " L"+this.intCurveRadius+","+this.intHeight;
		this.strPath += " C"+this.intCurveRadius+","+this.intHeight+" 0,"+this.intHeight+" 0,"+(this.intHeight-this.intCurveRadius);
		if (intTabPosition == 0) {
			this.strPath += " L0,0";
		}
		else {
			this.strPath += " L0,"+this.intCurveRadius;
			this.strPath += " C0,"+this.intCurveRadius+ " 0,0 "+this.intCurveRadius+",0";
			this.strPath += " L"+this.intTabPosition+",0";
		}
		this.strPath += " z";

		if (this.boolStroked) {
			if (boolHMLShapesUseMicrosoftVectors) {
				this.objVector.style.width = this.intWidth;
				this.objVector.style.height = this.intHeight;

				this.objVector.coordsize = this.strCoords;
				this.objVector.path = this.strPath;
			}
			else if (boolHMLShapesUseCanvasVectors) {
				this.objVector.width = this.intWidth;
				this.objVector.height = this.intHeight;

				this.objCanvasContext.fillStyle = this.strFillColor;
				this.objCanvasContext.lineWidth = this.intStrokeWeight;
				this.objCanvasContext.strokeStyle = this.strStrokeColor;

				this.digestPath(this.strPath);
				if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
				if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") this.objCanvasContext.stroke();
			}

			if (this.objBackFrame) {
				this.objBackFrame.style.width = this.intWidth;
				this.objBackFrame.style.height = this.intHeight;
				this.objBackFrame.style.left = this.objVector.style.left;
				this.objBackFrame.style.top = this.objVector.style.top;
			}
		}

		if (this.boolHasContents) {
			this.addContents();
		}
	}
}

// FullTab functions
function objHMLShapesFullTab(strID, varContainer, intLeft, intTop, intWidth, intHeight, intTabPos, intTabWidth, intTabHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha) {
	if (!strID || !varContainer) {
		alert("Falta ID o Container");
		return false;
	}

	intLeft = (intLeft)?intLeft:0;
	intTop = (intTop)?intTop:0;

	intWidth = (intWidth)?intWidth:300;
	intHeight = (intHeight)?intHeight:200;

	intTabPos = (intTabPos)?intTabPos:50;
	intTabWidth = (intTabWidth)?intTabWidth:50;
	intTabHeight = (intTabHeight)?intTabHeight:30;

	strFillColor = (strFillColor)?strFillColor:"";
	strStrokeColor = (strStrokeColor)?strStrokeColor:"black";

	intStrokeWeight = (intStrokeWeight)?intStrokeWeight:1;

	intAlpha = (intAlpha)?intAlpha:100;

	var intCurveRadius = Math.round(intTabWidth/10);
	if (intCurveRadius > 15) intCurveRadius = 15;

	var strDefaultPath = "";
	strDefaultPath += " M"+(intTabPos+intTabWidth)+","+intTabHeight;
	strDefaultPath += " L"+(intWidth-intCurveRadius)+","+intTabHeight;
	strDefaultPath += " C"+(intWidth-intCurveRadius)+","+intTabHeight+" "+intWidth+","+intTabHeight+" "+intWidth+","+(intCurveRadius+intTabHeight);
	strDefaultPath += " L"+intWidth+","+(intHeight-intCurveRadius);
	strDefaultPath += " C"+intWidth+","+(intHeight-intCurveRadius)+" "+intWidth+","+intHeight+" "+(intWidth-intCurveRadius)+","+intHeight;
	strDefaultPath += " L"+intCurveRadius+","+intHeight;
	strDefaultPath += " C"+intCurveRadius+","+intHeight+" 0,"+intHeight+" 0,"+(intHeight-intCurveRadius);
	if (intTabPos == 0) {
		strDefaultPath += " L0,"+intTabHeight;
	}
	else {
		strDefaultPath += " L0,"+(intCurveRadius+intTabHeight);
		strDefaultPath += " C0,"+(intCurveRadius+intTabHeight)+ " 0,"+intTabHeight+" "+intCurveRadius+","+intTabHeight;
		strDefaultPath += " L"+intTabPos+","+intTabHeight;
	}
	strDefaultPath += " L"+intTabPos+","+intCurveRadius;
	strDefaultPath += " C"+intTabPos+","+intCurveRadius+" "+intTabPos+",0 "+(intTabPos+intCurveRadius)+",0";
	strDefaultPath += " L"+(intTabPos+intTabWidth-intCurveRadius)+",0";
	strDefaultPath += " C"+(intTabPos+intTabWidth-intCurveRadius)+",0 "+(intTabPos+intTabWidth)+",0 "+(intTabPos+intTabWidth)+","+intCurveRadius+"";
	strDefaultPath += " L"+(intTabPos+intTabWidth)+","+intTabHeight;
	strDefaultPath += " z";

	var objTMP = new objHMLShapesAnyShape(strID, varContainer, false, strDefaultPath, intLeft, intTop, intWidth, intHeight, strFillColor, strStrokeColor, intStrokeWeight, intAlpha);
	objTMP.intTabPos = intTabPos;
	objTMP.intTabWidth = intTabWidth;
	objTMP.intTabHeight = intTabHeight;
	objTMP.intCurveRadius = intCurveRadius;
	objTMP.strPath = strDefaultPath;

	objTMP.resize = objHMLShapesFullTab_redefine;
	objTMP.redefine = objHMLShapesFullTab_redefine;
	objTMP.addContents = objHMLShapesFullTab_addContents;
	objTMP.addTabText = objHMLShapesFullTab_addTabText;

	return objTMP;
}

function objHMLShapesFullTab_redefine(intWidth, intHeight, intCurveRadius, intTabPos, intTabWidth, intTabHeight) {
	if (!intWidth) intWidth = this.intWidth;
	if (!intHeight) intHeight = this.intHeight;
	if (!intCurveRadius || intCurveRadius <= 0) intCurveRadius = 0;
	if (!intTabPos) intTabPos = this.intTabPos;
	if (!intTabWidth) intTabWidth = this.intTabWidth;
	if (!intTabHeight) intTabHeight = this.intTabHeight;

	this.intCurveRadius = Math.round(intWidth/10);
	if (this.intCurveRadius > 15) this.intCurveRadius = 15;
	if (intCurveRadius == 0) intCurveRadius = this.intCurveRadius;

	if (this.intWidth != intWidth || this.intHeight != intHeight || this.intCurveRadius != intCurveRadius || this.intTabPos != intTabPos || this.intTabWidth != intTabWidth || this.intTabHeight != intTabHeight) {
		this.intWidth = intWidth;
		this.intHeight = intHeight;
		this.intCurveRadius = intCurveRadius;
		this.intTabPos = intTabPos;
		this.intTabWidth = intTabWidth;
		this.intTabHeight = intTabHeight;
		this.intCurveRadius = intCurveRadius;
		this.strCoords = this.intWidth+","+this.intHeight;

		this.strPath = "";
		this.strPath += " M"+(this.intTabPos+this.intTabWidth)+","+this.intTabHeight;
		this.strPath += " L"+(this.intWidth-this.intCurveRadius)+","+this.intTabHeight;
		this.strPath += " C"+(this.intWidth-this.intCurveRadius)+","+this.intTabHeight+" "+this.intWidth+","+this.intTabHeight+" "+this.intWidth+","+(this.intCurveRadius+this.intTabHeight);
		this.strPath += " L"+this.intWidth+","+(this.intHeight-this.intCurveRadius);
		this.strPath += " C"+this.intWidth+","+(this.intHeight-this.intCurveRadius)+" "+this.intWidth+","+this.intHeight+" "+(this.intWidth-this.intCurveRadius)+","+this.intHeight;
		this.strPath += " L"+this.intCurveRadius+","+this.intHeight;
		this.strPath += " C"+this.intCurveRadius+","+this.intHeight+" 0,"+this.intHeight+" 0,"+(this.intHeight-this.intCurveRadius);
		if (this.intTabPos == 0) {
			this.strPath += " L0,"+this.intTabHeight;
		}
		else {
			this.strPath += " L0,"+(this.intCurveRadius+this.intTabHeight);
			this.strPath += " C0,"+(this.intCurveRadius+this.intTabHeight)+ " 0,"+this.intTabHeight+" "+this.intCurveRadius+","+this.intTabHeight;
			this.strPath += " L"+this.intTabPos+","+this.intTabHeight;
		}
		this.strPath += " L"+this.intTabPos+","+this.intCurveRadius;
		this.strPath += " C"+this.intTabPos+","+this.intCurveRadius+" "+this.intTabPos+",0 "+(this.intTabPos+this.intCurveRadius)+",0";
		this.strPath += " L"+(this.intTabPos+this.intTabWidth-this.intCurveRadius)+",0";
		this.strPath += " C"+(this.intTabPos+this.intTabWidth-this.intCurveRadius)+",0 "+(this.intTabPos+this.intTabWidth)+",0 "+(this.intTabPos+this.intTabWidth)+","+this.intCurveRadius+"";
		this.strPath += " L"+(this.intTabPos+this.intTabWidth)+","+this.intTabHeight;
		this.strPath += " z";

		if (this.boolStroked) {
			if (boolHMLShapesUseMicrosoftVectors) {
				this.objVector.style.width = this.intWidth;
				this.objVector.style.height = this.intHeight;

				this.objVector.coordsize = this.strCoords;
				this.objVector.path = this.strPath;
			}
			else if (boolHMLShapesUseCanvasVectors) {
				this.objVector.width = this.intWidth;
				this.objVector.height = this.intHeight;

				this.objCanvasContext.fillStyle = this.strFillColor;
				this.objCanvasContext.lineWidth = this.intStrokeWeight;
				this.objCanvasContext.strokeStyle = this.strStrokeColor;

				this.digestPath(this.strPath);
				if (this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
				if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") this.objCanvasContext.stroke();
			}

			if (this.objBackFrame) {
				this.objBackFrame.style.width = this.intWidth;
				this.objBackFrame.style.height = this.intHeight;
				this.objBackFrame.style.left = this.objVector.style.left;
				this.objBackFrame.style.top = this.objVector.style.top;
			}
		}

		if (this.boolHasContents) {
			this.addContents();
			this.addTabText();
		}
	}
}

function objHMLShapesFullTab_addContents(strContents) {
	if (!strContents) strContents = this.strContents;
	this.strContents = strContents;

	if (this.strContents != "") {
		this.boolHasContents = true;
		if (!this.objContents) {
			this.objContents = document.createElement("div");
			this.objContainer.appendChild(this.objContents);
			this.objContents.shapeObject = this;
			this.objContents.innerHTML = this.strContents;

			this.arrContentsDivs["contents"] = this.objContents;
		}
	}

	if (this.boolHasContents) {
		this.objContents.style.display = (this.boolShow)?"":"none";
		this.objContents.style.margin = 0;
		this.objContents.style.padding = 0;
		this.objContents.style.position = "absolute";
		this.objContents.style.zIndex = "3";

		if (this.intCurveRadius) {
			var intTMP = Math.round(this.intCurveRadius/8);
			this.objContents.intLeft = this.intLeft + intTMP + 2*this.intStrokeWeight;
			this.objContents.intTop = this.intTop + this.intTabHeight + intTMP + 2*this.intStrokeWeight;

			this.objContents.intWidth = this.intWidth - 2*intTMP - 4*this.intStrokeWeight;
			this.objContents.intHeight = this.intHeight - this.intTabHeight - 2*intTMP - 4*this.intStrokeWeight;
		}
		else {
			this.objContents.intLeft = this.intLeft + 2*this.intStrokeWeight;
			this.objContents.intTop = this.intTop + this.intTabHeight + 2*this.intStrokeWeight;

			this.objContents.intWidth = this.intWidth - 4*this.intStrokeWeight;
			this.objContents.intHeight = this.intHeight - this.intTabHeight - 4*this.intStrokeWeight;
		}

		this.objContents.style.left = this.objContents.intLeft;
		this.objContents.style.top = this.objContents.intTop;
		this.objContents.style.width = this.objContents.intWidth;
		this.objContents.style.height = this.objContents.intHeight;
	}
}

function objHMLShapesFullTab_addTabText(strTabText) {
	if (!strTabText) strTabText = this.strTabText;
	this.strTabText = strTabText;

	if (this.strTabText != "") {
		this.boolHasTabText = true;
		if (!this.objTabText) {
			this.objTabText = document.createElement("div");
			this.objContainer.appendChild(this.objTabText);
			this.objTabText.shapeObject = this;
			this.objTabText.innerHTML = this.strTabText;

			this.arrContentsDivs["tabtext"] = this.objTabText;
		}
	}

	if (this.boolHasTabText) {
		this.objTabText.style.display = (this.boolShow)?"":"none";
		this.objTabText.style.margin = 0;
		this.objTabText.style.padding = 0;
		this.objTabText.style.position = "absolute";
		this.objTabText.style.zIndex = "3";

		if (this.intCurveRadius) {
			var intTMP = Math.round(this.intCurveRadius/8);
			this.objTabText.intLeft = this.intLeft + this.intTabPos + intTMP + 2*this.intStrokeWeight;
			this.objTabText.intTop = this.intTop + intTMP + 2*this.intStrokeWeight;

			this.objTabText.intWidth = this.intTabWidth - 2*intTMP - 4*this.intStrokeWeight;
			this.objTabText.intHeight = this.intTabHeight - 2*intTMP - 4*this.intStrokeWeight;
		}
		else {
			this.objTabText.intLeft = this.intLeft + this.intTabPos + 2*this.intStrokeWeight;
			this.objTabText.intTop = this.intTop + 2*this.intStrokeWeight;

			this.objTabText.intWidth = this.intTabWidth - 4*this.intStrokeWeight;
			this.objTabText.intHeight = this.intTabHeight - this.intTabHeight - 4*this.intStrokeWeight;
		}

		this.objTabText.style.left = this.objTabText.intLeft;
		this.objTabText.style.top = this.objTabText.intTop;
		this.objTabText.style.width = this.objTabText.intWidth;
		this.objTabText.style.height = this.objTabText.intHeight;
	}
}

// Shared Functions
function objHMLShapes_show() {
	if (!this.boolShow) {
		if (!this.boolStroked) {
			this.stroke();
			this.boolShow = true;
		}
		else {
			this.boolShow = true;
			this.objVector.style.display = "";
			if (this.boolHasContents) {
				for (strKey in this.arrContentsDivs) {
					this.arrContentsDivs[strKey].style.display = "";
				}
			}

			if (this.objBackFrame) {
				this.objBackFrame.style.display = "";;
			}
		}
	}
}

function objHMLShapes_hide() {
	if (this.boolStroked && this.boolShow) {
		this.boolShow = false;
		this.objVector.style.display = "none";
		if (this.boolHasContents) {
			for (strKey in this.arrContentsDivs) {
				this.arrContentsDivs[strKey].style.display = "none";
			}
		}

		if (this.objBackFrame) {
			this.objBackFrame.style.display = "none";
		}
	}
}

// NO enviar parametros!!!
function objHMLShapes_fadein(strID, intAlphaA, intAlphaB) {
	if (!this.boolStroked) this.stroke();
	if (!this.boolShow) this.show();
	if (this.fadeOutTimer) clearTimeout(this.fadeOutTimer);

	if (!strID) strID = this.objVector.id;
	if (!intAlphaA) intAlphaA = 0;
	if (!intAlphaB) intAlphaB = 0;

	objHMLShapes_fadeinInternal(strID, intAlphaA, intAlphaB);
}
function objHMLShapes_fadeinInternal(strID, intAlphaA, intAlphaB) {
	var objVector = document.getElementById(strID);
	if (objVector == null) return;

	var objShape = objVector.shapeObject;
	var intDeltaA = Math.ceil(objShape.intAlpha/3);
	var intDeltaB = Math.ceil(100/3);
	var boolLastCicle = false;

	if (intAlphaA > objShape.intAlpha) intAlphaA = objShape.intAlpha;
	if (intAlphaB > 100) intAlphaB = 100;

	boolLastCicle = (intAlphaA == objShape.intAlpha || intAlphaB == 100);

	if (boolHMLShapesUseMicrosoftVectors) {
		objShape.objVector.style.filter = "Alpha(opacity=" + intAlphaA + ")";
		if (objShape.boolHasContents) {
			for (strKey in objShape.arrContentsDivs) {
				objShape.arrContentsDivs[strKey].style.filter = "Alpha(opacity=" + intAlphaB + ")";
			}
		}
	}
	else if (boolHMLShapesUseCanvasVectors) {
		var intOpacityA = intAlphaA/100;
		var intOpacityB = intAlphaB/100;

		objShape.objVector.style.MozOpacity = intOpacityA;
		objShape.objVector.style.KhtmlOpacity = intOpacityA;
		if (objShape.boolHasContents) {
			for (strKey in objShape.arrContentsDivs) {
				objShape.arrContentsDivs[strKey].style.MozOpacity = intOpacityB;
				objShape.arrContentsDivs[strKey].style.KhtmlOpacity = intOpacityB;
			}
		}
	}

	if (!boolLastCicle) {
		intAlphaA += intDeltaA;
		intAlphaB += intDeltaB;
		objShape.fadeInTimer = setTimeout("objHMLShapes_fadeinInternal('"+strID+"',"+intAlphaA+","+intAlphaB+")", 33, "JavaScript");
	}
	else {
		if (objShape.fadeInTimer) clearTimeout(objShape.fadeInTimer);

		if (!objShape.afterFadeIn) objShape.afterFadeIn = function () {return false;}
		objShape.afterFadeIn();
	}
}
// NO enviar parametros!!!
function objHMLShapes_fadeout(strID, intAlphaA, intAlphaB) {
	if (!this.boolStroked) return;
	if (!this.boolShow) return;
	if (this.fadeInTimer) clearTimeout(this.fadeInTimer);

	if (!strID) strID = this.objVector.id;
	if (!intAlphaA) intAlphaA = this.intAlpha;
	if (!intAlphaB) intAlphaB = 100;

	objHMLShapes_fadeoutInternal(strID, intAlphaA, intAlphaB);
}
function objHMLShapes_fadeoutInternal(strID, intAlphaA, intAlphaB) {
	var objVector = document.getElementById(strID);
	if (objVector == null) return;

	var objShape = objVector.shapeObject;
	var intDeltaA = Math.ceil(objShape.intAlpha/3);
	var intDeltaB = Math.ceil(100/3);
	var boolLastCicle = false;

	if (intAlphaA < 0) intAlphaA = 0;
	if (intAlphaB < 0) intAlphaB = 0;

	boolLastCicle = (intAlphaA == 0 || intAlphaB == 0);

	if (boolHMLShapesUseMicrosoftVectors) {
		objShape.objVector.style.filter = "Alpha(opacity=" + intAlphaA + ")";
		if (objShape.boolHasContents) {
			for (strKey in objShape.arrContentsDivs) {
				objShape.arrContentsDivs[strKey].style.filter = "Alpha(opacity=" + intAlphaB + ")";
			}
		}
	}
	else if (boolHMLShapesUseCanvasVectors) {
		var intOpacityA = intAlphaA/100;
		var intOpacityB = intAlphaB/100;

		objShape.objVector.style.MozOpacity = intOpacityA;
		objShape.objVector.style.KhtmlOpacity = intOpacityA;
		if (objShape.boolHasContents) {
			for (strKey in objShape.arrContentsDivs) {
				objShape.arrContentsDivs[strKey].style.MozOpacity = intOpacityB;
				objShape.arrContentsDivs[strKey].style.KhtmlOpacity = intOpacityB;
			}
		}
	}

	if (!boolLastCicle) {
		intAlphaA -= intDeltaA;
		intAlphaB -= intDeltaB;
		objShape.fadeOutTimer = setTimeout("objHMLShapes_fadeoutInternal('"+strID+"',"+intAlphaA+","+intAlphaB+")", 33, "JavaScript");
	}
	else {
		if (objShape.fadeOutTimer) clearTimeout(objShape.fadeOutTimer);
		objShape.hide();

		if (!objShape.afterFadeOut) objShape.afterFadeOut = function () {return false;};
		objShape.afterFadeOut();
	}
}


function objHMLShapes_moveTo(intLeft, intTop) {
	this.moveRel(intLeft - this.intLeft, intTop - this.intTop);
}

function objHMLShapes_moveRel(intX, intY) {
	this.intLeft = this.intLeft + intX;
	this.intTop = this.intTop + intY;

	if (this.boolStroked) {
		this.objVector.style.left = this.intLeft;
		this.objVector.style.top = this.intTop;

		if (this.boolHasContents) {
			for (strKey in this.arrContentsDivs) {
				this.arrContentsDivs[strKey].intLeft = this.arrContentsDivs[strKey].intLeft + intX;
				this.arrContentsDivs[strKey].intTop = this.arrContentsDivs[strKey].intTop + intY;

				this.arrContentsDivs[strKey].style.left = this.arrContentsDivs[strKey].intLeft;
				this.arrContentsDivs[strKey].style.top = this.arrContentsDivs[strKey].intTop;
			}
		}

		if (this.objBackFrame) {
			this.objBackFrame.style.left = this.objVector.style.left;
			this.objBackFrame.style.top = this.objVector.style.top;
		}
	}
}

function objHMLShapes_resize(intWidth, intHeight) {
	this.intWidth = intWidth;
	this.intHeight = intHeight;

	if (this.boolStroked) {
		if (this.intWidth != intWidth || this.intHeight != intHeight) {
			if (boolHMLShapesUseMicrosoftVectors) {
				this.objVector.style.width = this.intWidth;
				this.objVector.style.height = this.intHeight;
			}
			else if (boolHMLShapesUseCanvasVectors) {
				this.objVector.width = this.intWidth;
				this.objVector.height = this.intHeight;
			}
		}
		if (this.boolHasContents) {
            if (this.intCurveRadius) {
                var intTMP = Math.round(this.intCurveRadius/8);
                this.objContents.intLeft = this.intLeft + intTMP;
                this.objContents.intTop = this.intTop + intTMP;

                this.objContents.intWidth = this.intWidth - 2*intTMP;
                this.objContents.intHeight = this.intHeight - 2*intTMP;
            }
            else {
                if (this.sinArcPCT) {
                    var intMaxSize = (this.intWidth > this.intHeight)?this.intWidth:this.intHeight;
					var intMinSize = (this.intWidth < this.intHeight)?this.intWidth:this.intHeight;

                    var intTMP = Math.round((intMinSize * this.sinArcPCT)/4);

                    this.objContents.intLeft = this.intLeft + intTMP;
                    this.objContents.intTop = this.intTop + intTMP;

                    this.objContents.intWidth = this.intWidth - 2*intTMP;
                    this.objContents.intHeight = this.intHeight - 2*intTMP;
                }
                else {
                    this.objContents.intLeft = this.intLeft;
                    this.objContents.intTop = this.intTop;

                    this.objContents.intWidth = this.intWidth;
                    this.objContents.intHeight = this.intHeight;
                }
            }
            if (this.objContents.intWidth < 0) this.objContents.intWidth = 0;
            if (this.objContents.intHeight < 0) this.objContents.intHeight = 0;

            this.objContents.style.left = this.objContents.intLeft;
            this.objContents.style.top = this.objContents.intTop;
            this.objContents.style.width = this.objContents.intWidth;
            this.objContents.style.height = this.objContents.intHeight;
		}

		if (this.objBackFrame) {
			this.objBackFrame.style.width = this.intWidth;
			this.objBackFrame.style.height = this.intHeight;
		}
	}
}

function objHMLShapes_redefine(intWidth, intHeight, strPath, strCoords) {
	this.resize(intWidth, intHeight);
	this.strPath = strPath;
	this.strCoords = (strCoords)?strCoords:this.intWidth+","+this.intHeight;

	if (boolHMLShapesUseMicrosoftVectors) {
		if (!this.objVector) {
			this.objVector = document.createElement("v:shape");
			this.objVector.shapeObject = this;
		}
		this.objVector.coordsize = this.strCoords;

		if (this.strFillColor) this.objVector.fillcolor = this.strFillColor;
		this.objVector.strokecolor = this.strStrokeColor;
		this.objVector.strokeweight = this.intStrokeWeight;

		this.objVector.filled = (!this.strFillColor || this.strFillColor == "" || this.strFillColor == "transparent")?"f":"t";
		this.objVector.stroked = (this.strStrokeColor == "" || this.strStrokeColor == "transparent")?"f":"t";

		this.objVector.path = this.strPath;
	}
	else if (boolHMLShapesUseCanvasVectors) {
		if (!this.objVector) {
			this.objVector = document.createElement('canvas');
			this.objVector.shapeObject = this;
		}

		if (!this.objCanvasContext) this.objCanvasContext = this.objVector.getContext("2d");

		if (this.strFillColor && (this.strFillColor != "" && this.strFillColor != "transparent")) {
			this.objCanvasContext.fillStyle = this.strFillColor;
		}
		if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") {
			this.objCanvasContext.lineWidth = this.intStrokeWeight;
			this.objCanvasContext.strokeStyle = this.strStrokeColor;
		}

		this.digestPath(this.strPath);
		if (this.strFillColor && this.strFillColor != "" && this.strFillColor != "transparent") this.objCanvasContext.fill();
		if (this.strStrokeColor != "" && this.strStrokeColor != "transparent") this.objCanvasContext.stroke();
	}
	else {
		alert("Navegador no implementado");
	}
}

function objHMLShapes_addContents(strContents) {
	if (!strContents) strContents = this.strContents;
	this.strContents = strContents;

	this.boolHasContents = false;
	if (this.strContents != "") {
		this.boolHasContents = true;
		if (!this.objContents) {
			this.objContents = document.createElement("div");
			this.objContainer.appendChild(this.objContents);
			this.objContents.shapeObject = this;
			this.objContents.innerHTML = this.strContents;

			this.arrContentsDivs["contents"] = this.objContents;
		}
	}

	if (this.boolHasContents) {
		this.objContents.style.display = (this.boolShow)?"":"none";
		this.objContents.style.margin = 0;
		this.objContents.style.padding = 0;
		this.objContents.style.position = "absolute";
		this.objContents.style.zIndex = "3";

		if (this.intCurveRadius) {
			var intTMP = Math.round(this.intCurveRadius/8);
			this.objContents.intLeft = this.intLeft + intTMP;
			this.objContents.intTop = this.intTop + intTMP;

			this.objContents.intWidth = this.intWidth - 2*intTMP;
			this.objContents.intHeight = this.intHeight - 2*intTMP;
		}
		else {
			if (this.sinArcPCT) {
				var intMaxSize = (this.intWidth > this.intHeight)?this.intWidth:this.intHeight;
				var intMinSize = (this.intWidth < this.intHeight)?this.intWidth:this.intHeight;

				var intTMP = Math.round((intMinSize * this.sinArcPCT)/4);

				this.objContents.intLeft = this.intLeft + intTMP;
				this.objContents.intTop = this.intTop + intTMP;

				this.objContents.intWidth = this.intWidth - 2*intTMP;
				this.objContents.intHeight = this.intHeight - 2*intTMP;
			}
			else {
				this.objContents.intLeft = this.intLeft;
				this.objContents.intTop = this.intTop;

				this.objContents.intWidth = this.intWidth;
				this.objContents.intHeight = this.intHeight;
			}
		}
		if (this.objContents.intWidth < 0) this.objContents.intWidth = 0;
		if (this.objContents.intHeight < 0) this.objContents.intHeight = 0;

		this.objContents.style.left = this.objContents.intLeft;
		this.objContents.style.top = this.objContents.intTop;
		this.objContents.style.width = this.objContents.intWidth;
		this.objContents.style.height = this.objContents.intHeight;
	}
}

function objHMLShapesAnyShape_digestPath(strPath) {
	strPathern = /(\s+\D+)/g;
	strPath = strPath.replace(strPathern, ";$1");

	var arrPath = strPath.split("; ");
	var strTMP = "";
	var strCommand = "";
	var strParams = "";
	var arrTMP = false;
	this.objCanvasContext.beginPath();
	for (intKey in arrPath) {
		strTMP = arrPath[intKey];
		strCommand = strTMP.substr(0, 1);
		if (strCommand != "" && strCommand != " ") {
			strParams = strTMP.substr(1);
			if (strCommand == "M" || strCommand == "m") {
				arrTMP = strParams.split(",");
				this.objCanvasContext.moveTo(arrTMP[0], arrTMP[1]);
			}
			else if(strCommand == "L" || strCommand == "l") {
				arrTMP = strParams.split(",");
				this.objCanvasContext.lineTo(arrTMP[0], arrTMP[1]);
			}
			else if(strCommand == "C" || strCommand == "c") {
				strParams = strParams.replace(/,/g, " ");
				arrTMP = strParams.split(" ");
				this.objCanvasContext.bezierCurveTo(arrTMP[0], arrTMP[1], arrTMP[2], arrTMP[3], arrTMP[4], arrTMP[5]);
			}
			else if(strCommand == "Z" || strCommand == "z") {
				//this.objCanvasContext.closePath();
			}
		}
	}

	return arrPath;
}