function MyBrowser(){
	this.setWindowOffsets()
	this.setScrollOffsets()
	this.setPageOffsets()
	this.centre=[this.windowWidth/2,this.windowHeight/2]
}
MyBrowser.prototype.setWindowOffsets=
function setWindowOffsets(){
	if (self.innerHeight) // all except Explorer
	{
		this.windowWidth = self.innerWidth;
		this.windowHeight = self.innerHeight;
		if(self.scrollMaxY)this.windowWidth-=16
		if(self.scrollMaxX)this.windowHeight-=16
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		this.windowWidth = document.documentElement.clientWidth;
		this.windowHeight = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		this.windowHeight = document.body.clientWidth;
		this.windowHeight = document.body.clientHeight;
	}
}
MyBrowser.prototype.setScrollOffsets=
function setScrollOffsets(){
	if (self.pageYOffset) // all except Explorer
	{
		this.scrollX = self.pageXOffset;
		this.scrollY = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		this.scrollX = document.documentElement.scrollLeft;
		this.scrollY = document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		this.scrollX = document.body.scrollLeft;
		this.scrollY = document.body.scrollTop;
	}
}
MyBrowser.prototype.setPageOffsets=
function setPageOffsets(){
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		this.pageWidth = document.body.scrollWidth;
		this.pageHeight = document.body.scrollHeight;
	}
	else // Explorer Mac;
	     //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		this.pageWidth = document.body.offsetWidth;
		this.pageHeight = document.body.offsetHeight;
	}
}

function MyDocument(){
}

/*
MyDocument.prototype.insertBefore=
function insertBefore(element,type){
	var newElement=document.createElement(type)
	element.insertBefore(newElement
*/
	

MyDocument.prototype.removeElement=
function removeElement(element){
	this.removeChildren(element)
	element.parentNode.removeChild(element)
}
MyDocument.prototype.removeChildren=
function removeChildren(element){
	for(var x=0;x<element.childNodes.length;x++){
		this.removeChildren(element.childNodes[x])
		element.childNodes[x].parentNode.removeChild(
element.childNodes[x])
	}
}

////////////////////////////////////////

function MyElement(element){
	this.element=element
}
MyElement.prototype.findPos=
function findPos() {
	var curleft = curtop = 0;
	if (this.element.offsetParent) {
		curleft = this.element.offsetLeft
		curtop = this.element.offsetTop
		while (this.element = this.element.offsetParent) {
			curleft += this.element.offsetLeft
			curtop += this.element.offsetTop
		}
	}
	return [curleft,curtop];
}
MyElement.prototype.getStylePixelValue=
function getStylePixelValue(style){
	if(str=this.element.style[style])
		return parseInt(str.substr(0,str.length-2))
	return 0
}
MyElement.prototype.setFloat=
function setFloat(val){
	switch(bd.browser){
	case "Netscape":this.element.style["cssFloat"]=val;break
	default:this.element.style["styleFloat"]=val
	}
}

///////////////////////////////////////

MyDiv.deriveFrom(MyElement)
function MyDiv(element){
	this.MyElement(element)
}

MySelect.deriveFrom(MyElement)
function MySelect(element){
	this.MyElement(element)
}
//this.element.selectedIndex
//this.element.options[this.element.selectedIndex].text
//this.element.options[ind].selected=true;
MySelect.prototype.addOption=
function addOption(text){
	var option=document.createElement("option");
	option.appendChild(document.createTextNode(text));
	this.element.appendChild(option);
	return option;
}
MySelect.prototype.addOptions=
function addOptions(optionTexts){
	for(var z=0;z<optionTexts.length;z++){
		this.addOption(optionTexts[z]);
	}
}
MySelect.prototype.removeOption=
function removeOption(content){
	for(var x=0;x<this.element.options.length;x++){
		if(this.element.options[x].text==content){
			this.element.removeChild(
					this.element.childNodes[x]);
			return
		}
	}	
}	
MySelect.prototype.removeOptions=
function removeOptions(){
	while(this.element.firstChild){
		this.element.removeChild(this.
								element.firstChild);
	}
}	
MySelect.prototype.setSelectedByText=
function(text){
	for(var x=0;x<this.element.options.length;x++){
		if(this.element.options[x].text==text){
			this.element.options[x].selected=true;
			return 1
		}
	}	
}

MySpan.deriveFrom(MyElement)
function MySpan(element){
	this.MyElement(element)
}
