//
// Detect browser type 
//        browser version
//        browser capabilities
//
// written by Bugimus
//

function getoOpacity() {
	if(bugimus.IE5) return this.filters.alpha.opacity
	else if(bugimus.NN6) return this.style.MozOpacity
}
function setoOpacity(c) {
	if(bugimus.IE5) this.filters.alpha.opacity = c
	else if(bugimus.NN6)this.style.MozOpacity = c + "%"
}
function getoX() {
	if(bugimus.IE5)return parseInt(this.style.pixelLeft)
	else if(bugimus.NN4)return parseInt(this.style.left)
	else if(bugimus.NN6||bugimus.OPA)return parseInt(this.style.left)
}
function getoY() {
	if(bugimus.IE5)return parseInt(this.style.pixelTop)
	else if(bugimus.NN4)return parseInt(this.style.top)
	else if(bugimus.NN6||bugimus.OPA)return parseInt(this.style.top)
}
function setoX(x) {
	if(bugimus.IE5)this.style.left=x + "px"
	else if(bugimus.NN4)this.style.left=x
	else if(bugimus.NN6||bugimus.OPA)this.style.left=x + "px"
}
function setoY(y) {
	if(bugimus.IE5)this.style.top=y + "px"
	else if(bugimus.NN4)this.style.top=y
	else if(bugimus.NN6||bugimus.OPA)this.style.top=y + "px"
}
function showoDiv() {
	this.style.visibility = "visible";
}
function hideoDiv() {
	this.style.visibility = "hidden";
}
function getoWidth() {
	return parseInt(this.style.width)
}
function getoHeight() {
	return parseInt(this.style.height)
}
function setoWidth(w) {
	this.style.width=w + "px"
}
function setoHeight(h) {
	this.style.height=h + "px"
}
function setoZindex( z ) {
	this.style.zIndex = z
}
function getoZindex() {
	return this.style.zIndex
}
function clipoDiv(top,right,bottom,left){
	if(bugimus.IE5) {
		this.style.clip="rect("+top+","+right+","+bottom+","+left+")"
	} else {
		this.style.clip.top=top
		this.style.clip.right=right
		this.style.clip.bottom=bottom
		this.style.clip.left=left
	}
}

function getoPadding() {
	return parseInt(this.style.padding)
}
function setoPadding(s) {
	this.style.padding=s
}
function getoBorderWidth() {
	return parseInt(this.style.borderWidth)
}
function setoBorderWidth(s) {
	this.style.borderWidth=s+"px"
}

function warpoTo(x,y) {
	if(bugimus.IE5) {
		this.style.left = x + "px"
		this.style.top = y + "px"
	} else if(bugimus.NN4) {
		this.style.moveTo(x,y)
	} else if(bugimus.NN6||bugimus.OPA) {
		this.style.left = x + "px"
		this.style.top = y + "px"
	}
}

function getOffsetTops(pRef) {
	try {
		// work way up node tree summing offsetTops as you go
		var totalTop=0
		while(pRef.nodeName != "BODY") {
			//alert(pRef.nodeName+" : top = "+pRef.offsetTop+"  left = "+pRef.offsetLeft)
			if(pRef.offsetTop) totalTop += pRef.offsetTop
			

//================
debugArray = new Array (
"pRef.offsetTop"
,"pRef.style.borderWidth"
,"pRef.style.border"
 )
	try {
		debugString = "meSee::"
		for(i=0; i<debugArray.length; i++) {
			debugString += "\n  " + debugArray[i] + " = " + eval(debugArray[i])
		}
	
//		alert( debugString )
	} catch (err) {
		alert("bugUtils::meSee: "+err)
	}
//================
			
			pRef = pRef.parentNode
		}
		return totalTop
	} catch (err) {
		alert("bugPositions::getOffsetTops: "+err)
	}
}

function getOffsetLefts(pRef) {
	try {
		// work way up node tree summing offsetTops as you go
		var totalLeft=0
		while(pRef.nodeName != "BODY") {
			//alert(pRef.nodeName+" : top = "+pRef.offsetTop+"  left = "+pRef.offsetLeft)
			if(pRef.offsetLeft) totalLeft += pRef.offsetLeft
			pRef = pRef.parentNode
		}
		return totalLeft
	} catch (err) {
		alert("bugPositions::getOffsetLefts: "+err)
	}
}

// ========== DEPRECATED ====================
//
function getX() {
	if(bugimus.IE5)return parseInt(this.obj.style.pixelLeft)
	else if(bugimus.NN4)return parseInt(this.obj.style.left)
	else if(bugimus.NN6)return parseInt(this.obj.style.left)
}
function getY() {
	if(bugimus.IE5)return parseInt(this.obj.style.pixelTop)
	else if(bugimus.NN4)return parseInt(this.obj.style.top)
	else if(bugimus.NN6)return parseInt(this.obj.style.top)
}
function setX(x) {
	if(!this.constrainX) {
		if(bugimus.IE5)this.obj.style.left=x + "px"
		else if(bugimus.NN4)this.obj.style.left=x
		else if(bugimus.NN6)this.obj.style.left=x + "px"
	}
}
function setY(y) {
	if(!this.constrainY) {
		if(bugimus.IE5)this.obj.style.top=y + "px"
		else if(bugimus.NN4)this.obj.style.top=y
		else if(bugimus.NN6)this.obj.style.top=y + "px"
	}
}
function getWidth() {
	return parseInt(this.obj.style.width)
}
function getHeight() {
	return parseInt(this.obj.style.height)
}
function setWidth(w) {
	this.obj.style.width=w
}
function setHeight(h) {
	this.obj.style.height=h
}
function setZindex( z ) {
	this.obj.style.zIndex = z
}
function getZindex() {
	return this.obj.style.zIndex
}
function showDiv() {
	this.obj.style.visibility = "visible";
}
function hideDiv() {
	this.obj.style.visibility = "hidden";
}
function clipDiv(top,right,bottom,left){
	if(bugimus.IE5) {
		this.obj.style.clip="rect("+top+","+right+","+bottom+","+left+")"
	} else {
		this.obj.style.clip.top=top
		this.obj.style.clip.right=right
		this.obj.style.clip.bottom=bottom
		this.obj.style.clip.left=left
	}
}
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// ========== DEPRECATED ====================

