// polyframe.js - definition of the polyframe class
// (c) 2000 Gareth Richards
// garethrichards@gersolutions.com

function polyframe(){
	this.pool=null;
	this.pGroup=null;
	this.polys=null;
}

function AAinit(parentName,oid){
	var parentobj=document.getElementById(parentName);
	this.pGroup = document.createElement("v:group");
	this.pGroup.style.position="absolute";
	this.pGroup.style.top=0;
	this.pGroup.style.left=0;
	this.pGroup.style.width=parentobj.style.width;
	this.pGroup.style.height=parentobj.style.height;
	this.pGroup.coordsize="1000,1000";
	this.pGroup.coordorigin="-500,-500";
	this.pGroup.id="vmlgroup";
	parentobj.insertBefore(this.pGroup,null);
}

function AloadObject(dataSource,scale)
{
	this.polys=new polypool();

	var xobj=dataSource.XMLDocument;
	this.polys.createObject(xobj,scale);

	this.polys.w=this.pGroup.style.width;
	this.polys.h=this.pGroup.style.height;

// perspective point
	this.polys.cx=0;
	this.polys.cy=0;

	this.polys.transformPoints(0,0,0,0,0,0);
	this.polys.perspTransform();

	this.polys.createDomObjects(this.pGroup);
}

polyframe.prototype.init=AAinit;
polyframe.prototype.loadObject=AloadObject;
