
function BrowserObject(){

//membervariablen
	this.isNav4 = false
	this.isW3C = false
	this.isIE = false
	
	this.mdE=new Array()
	this.muE=new Array()
	this.mmE=new Array()

	this.mouseX = null 
	this.mouseY = null
	this.isloaded=false

	this.dragging=false

//memberfunktionen- prototypen
	this.getInnerWidth=getInnerWidth
	this.getInnerHeight=getInnerHeight
	this.getScrollLeft=getScrollLeft
	this.getScrollTop=getScrollTop

	this.init=init

	this.mouseDown=mouseDown
	this.mouseUp=mouseUp
	this.mouseMove=mouseMove

	this.addMouseMoveEvent=addMouseMoveEvent
	this.addMouseUpEvent=addMouseUpEvent
	this.addMouseDownEvent=addMouseDownEvent
	this.removeMouseMoveEvent=removeMouseMoveEvent
	this.removeMouseUpEvent=removeMouseUpEvent
	this.removeMouseDownEvent=removeMouseDownEvent
	
	
	this.addToArray=addToArray
	this.removeFromArray=removeFromArray

// BROWSER bestimmen
	if (navigator.appName.indexOf("Netscape") != -1) {
		if (parseInt(navigator.appVersion) == 4) 				// Netscape Communicator 4.x
		this.isNav4 = true
		else if (parseInt(navigator.appVersion) >= 5) 		// Netscape 6 oder Mozilla
		this.isW3C = true
	} 
	else { 
		if ((parseInt(navigator.appVersion) >= 4) 
		 && (navigator.appName.indexOf("Microsoft") != -1)) 	// MSIE 4.x oder hoeher
		this.isIE = true
		if (navigator.userAgent.indexOf("Opera 5") != -1) 	// Opera 5.x - wird wie MSIE behandelt
		this.isIE = true	
	}


	function getInnerWidth() {return this.isIE?document.body.clientWidth:this.isNav4?window.innerWidth:this.isW3C?window.clientX:0}
	function getInnerHeight() {return this.isIE?document.body.clientHeight:this.isNav4?window.innerHeight:this.isW3C?window.clientY:0}
	function getScrollLeft() {return this.isIE?document.body.scrollLeft:this.isNav4?window.pageXOffset:this.isW3C?window.scrollX:0}
	function getScrollTop(){return this.isIE?document.body.scrollTop:this.isNav4?window.pageYOffset:this.isW3C?window.scrollY:0}


	function addToArray(oldArray,newValue){
		var ec=new Array()
		ec[0]=newValue
		for (var i=0;i<oldArray.length;i++) ec[i+1]=oldArray[i]
		return ec
	}

	function removeFromArray(oldArray,removeValue){
		var ec=new Array()
		for (var i=0;i<oldArray.length;i++) if (oldArray[i]!=removeValue) ec[ec.length]=oldArray[i]
		return ec
	}

		
	function addMouseDownEvent(fnc){this.mdE=this.addToArray(this.mdE,fnc)}
	function addMouseUpEvent(fnc){this.muE=this.addToArray(this.muE,fnc)}
	function addMouseMoveEvent(fnc){this.mmE=this.addToArray(this.mmE,fnc)}

	function removeMouseDownEvent(fnc){this.mdE=this.removeFromArray(this.mdE,fnc)}
	function removeMouseUpEvent(fnc){this.muE=this.removeFromArray(this.muE,fnc)}
	function removeMouseMoveEvent(fnc){this.mmE=this.removeFromArray(this.mmE,fnc)}

	

	function mouseDown(e){
		browser.dragging=true
		if (browser.mdE.length>0)for (var i=0;i<browser.mdE.length;i++) if (eval(browser.mdE[i]+"(e)")) break
		//if (browser.isNav4) return true
		return true
		
	}

	function mouseUp(e){
		browser.dragging=false
		if (browser.muE.length>0)for (var i=0;i<browser.muE.length;i++) if (eval(browser.muE[i]+"(e)")) break
		//if (browser.isNav4) return true
		return true

	}
	function mouseMove(e){
		var OX=browser.mouseX
		var OY=browser.mouseY
		browser.mouseX=browser.isIE?(event.clientX+document.body.scrollLeft):browser.isNav4?(e.pageX+pageXOffset):browser.isW3C?(parseInt(e.clientX)+pageXOffset):0
		browser.mouseY=browser.isIE?(event.clientY+document.body.scrollTop):browser.isNav4?(e.pageY+pageYOffset):browser.isW3C?(parseInt(e.clientY)+pageYOffset):0
		if (browser.mmE.length>0) 
		for (var i=0;i<browser.mmE.length;i++) 	if (eval(browser.mmE[i]+"(e)")) break
		if (browser.isIE||browser.isW3C) return false
		if (browser.dragging)  return false
		else return true
		
	}
	
	function init(){
		if( this.isNav4 || this.isW3C )	document.captureEvents(Event.MOUSEDOWN)
		if( this.isNav4 || this.isW3C ) document.captureEvents(Event.MOUSEUP)
		if( this.isNav4 || this.isW3C ) document.captureEvents(Event.MOUSEMOVE)
		document.onmousedown = this.mouseDown
		document.onmouseup = this.mouseUp
		document.onmousemove = this.mouseMove
	}
	
	this.init()
}


	browser=new BrowserObject()
	
	

