/**
 * @author MTB
 */
var MyIndex;

function Polygon (ThemeName, StdName, PolygonId, ArrPoints, DataActive, BorderColor, BorderWidth, BorderOpacity, FillColor, FillOpacity){
	this.ThemeName_ = ThemeName;
	this.StdName_ = StdName;
	if (PolygonId == undefined){
		if(MyIndex == null)
    		PolygonId = 0;
  		else
    		PolygonId = MyIndex;
	}
	this.PolygonId_ = PolygonId;
	if (ArrPoints != undefined && ArrPoints != null){
		if (ArrPoints.length >= 3){
			if (ArrPoints.length == 3){
				if (ArrPoints[0] == ArrPoints[ArrPoints.length - 1]){
					ArrPoints = null;
				}else{
					ArrPoints[ArrPoints.length] = ArrPoints[0];
				}
			}else{
				if (ArrPoints[0] != ArrPoints[ArrPoints.length - 1]){
					ArrPoints[ArrPoints.length] = ArrPoints[0];
				}
			}
		}else{
			ArrPoints = null;
		}
	}
	this.ArrPoints_ = ArrPoints || null;
	this.DataActive_ = DataActive || null;
	this.BorderColor_ = BorderColor || "#222222";
	if (BorderWidth == null){
		BorderWidth = 1;
	}
	if (BorderWidth <= 0){
		BorderWidth = 1;
	}
	this.Borderwidth_ = BorderWidth || 1;
	if (BorderOpacity == null){
		BorderOpacity = 0.5;
	}
	if (BorderOpacity < 0){
		BorderOpacity = 0.5;
	}
	this.BorderOpacity_ = BorderOpacity || 0.5;
	this.FillColor_ = FillColor || "#222222";
	if (FillOpacity == null){
		FillOpacity = 0.5;
	}
	if (FillOpacity < 0){
		FillOpacity = 0.5;
	}
	this.FillOpacity_ = FillOpacity || 0.5;
	if (MyIndex == null){
		MyIndex = 0;
	}else{
		MyIndex  +=1;
	}
}

Polygon.prototype.initialize = function(){}

