<!--
// $AUTOFTP:1 $

// ClientSnifferJr Object Constructor
// Mike Foster, 7/25/01
// cross-browser.com

function ClientSnifferJr()
{
  	this.ua = navigator.userAgent.toLowerCase();
  	this.major = parseInt(navigator.appVersion);
  	this.minor = parseFloat(navigator.appVersion);

  	// Opera
  	this.opera = this.ua.indexOf('opera') != -1;
  	if (this.opera) {
	//	alert ("opera ?" + this.ua);		
    	this.opera5 = (this.ua.indexOf("opera 5") != -1 || this.ua.indexOf("opera/5") != -1);
    	return;
  	}  
  	// MSIE
  	this.ie = this.ua.indexOf('msie') != -1;
  	if (this.ie) {
    	this.ie3 = this.major < 4;
    	this.ie4 = (this.major == 4 && this.ua.indexOf('msie 5') == -1 && this.ua.indexOf('msie 6') == -1);
    	this.ie4up = this.major >= 4;
    	this.ie5 = (this.major == 4 && this.ua.indexOf('msie 5.0') != -1);
    	this.ie5up = !this.ie3 && !this.ie4;
    	this.ie6 = (this.major == 4 && this.ua.indexOf('msie 6.0') != -1);
    	this.ie6up = (!this.ie3 && !this.ie4 && !this.ie5 && this.ua.indexOf("msie 5.5") == -1);
    	this.ie7 = (this.major == 4 && this.ua.indexOf('msie 7.0') != -1);
    	this.ie7up = (!this.ie3 && !this.ie4 && !this.ie5 && !this.ie6 && this.ua.indexOf("msie 6.0") == -1);
    	return;
  	}
  	
  	// Misc.
  	this.hotjava = this.ua.indexOf('hotjava') != -1; 
  	this.webtv = this.ua.indexOf('webtv') != -1;
  	this.aol = this.ua.indexOf('aol') != -1; 
  	if (this.hotjava || this.webtv || this.aol) return;
  	
  	// Gecko, NN4+, and NS6
  	this.gecko = this.ua.indexOf('gecko') != -1;
  	this.nav = (this.ua.indexOf('mozilla') != -1 && this.ua.indexOf('spoofer') == -1 && this.ua.indexOf('compatible') == -1);
  	if (this.nav) {
    	this.nav4  = this.major == 4;
    	this.nav4up= this.major >= 4;
    	this.nav5up= this.major >= 5;
    	this.nav6  = (this.major == 5);
    	this.nav6up= this.nav5up;
  	}
}

is = new ClientSnifferJr();

// ---

	function Date2Year (date) {
		if(is.nav)
			return 1900 + date.getYear ();
		return date.getYear ();
	}

	function GetEventObj (e) {
		if(is.nav) {
			if(e)
				return e.target ;
			return null ;	
		}
		return window.event.srcElement ;
	}
	function GetKeyCode (e) {
		if(is.nav) {
			return e.which ;
		}
		return window.event.keyCode ;
	}
	function SetKeyCode (e, code) {
		if(is.nav) {
			e.which = code;
		}
		window.event.keyCode = code;
	}
	
	function GetShift (e) {
		if(is.ie) {
			if(window.event)
				return window.event.shiftKey ;
		}		
		return 0 ;			
	}
	function GetCtrl (e) {
		if(is.ie) {
			if(window.event)
				return window.event.ctrlKey ;
		}		
		return 0 ;			
	}
	function GetAlt (e) {
		if(is.ie) {
			if(window.event)
				return window.event.altKey ;
		}		
		return 0 ;			
	}
	
	function CancelBubble () {
		if(is.ie) {
			window.event.keyCode = 0 ;
			window.event.cancelBubble = true ;
		}
	}
	function GetMouseX (ev) {
		if(is.ie)
			return window.event.clientX	 ;
		else if(is.nav) {
			return 	ev.pageX ;
		}	
		return window.event.clientX	 ;
			
	}		
	function GetMouseY (ev) {
		if(is.ie)
			return window.event.clientY	 ;
		else if(is.nav) {
			return 	ev.pageY ;
		}	
	}		
	function ReadInnerHTML (obj, str) {
		if(is.ie || is.nav5up){
			return obj.innerHTML ;
		} 
		if(is.opera) {
			return obj.firstChild.nodeValue ;
		}	
		return obj.firstChild.nodeValue ;
	}
	function innerHTML (obj, str) {
		if(is.ie || is.nav5up){
			obj.innerHTML = str ; return 1;
		} 
		if(is.opera) {
			obj.firstChild.nodeValue = str ;
			return 1;
		}	
		if(obj.firstChild)
			obj.firstChild.nodeValue = str ;
		return 0 ;
	}
	function ConcatInnerHTML (obj, str) {
		if(is.ie || is.nav5up){
			obj.innerHTML += str ; 
			return 1;
		} 
		if(is.opera) {
			obj.firstChild.nodeValue += str ;
			return 1;
		}	
		obj.firstChild.nodeValue += str ;
		return 0 ;
	}
	
	function GetObjectByName (name) {
		if(is.nav) {
            var elm = 0;
            
            if(document.getElementById) {
            	elm = document.getElementById (name);
            }	
            if(! elm) {
            	if(document.getElementByName)
                	elm = document.getElementByName (name);
                else if(document.layers){
                	elm = document.layers[name] ;
                }	
            }    
			return elm;
		}
		if(document.all) {
			return document.all[name] ;
		}		
		alert ("kein document.all");
		return null ;
	}
	// ---	
	function SetObjZIndex (obj, nIx) {
		if(is.ie) {
			obj.style.zIndex = nIx ;
			return 1 ;
		}
		return 0 ;	
	}
	function SetObjClip (obj, strClip) {
		if(is.ie) {
			obj.style.clip = strClip ;
			return 1 ;	
		}
		else if(is.nav5up) {
			obj.style.clip = strClip ;
		}
		return 0 ;	
	}
	function SetObjPos (obj, left, top) {
		if((is.ie) || (is.opera)) {
			obj.style.pixelLeft = left ;
			obj.style.pixelTop = top ;
		}			
		else if(is.nav5up || is.opera) {
			obj.style.left = left ;
			obj.style.top = top ;
		} else {
			alert ("Browser ?");
		}
	}
	function SetObjYPos (obj, top) {
		if(is.ie) {
			obj.style.pixelTop = top ;
			return 1 ;			
		}
		else if(is.nav5up || is.opera) {
			obj.style.top = top ;
		}		
		return 0 ;
	}
	function GetObjYPos (obj) {
		if(is.ie) {
			return obj.style.pixelTop ;
			return 1 ;			
		}
		else if(is.nav5up || is.opera) {
			return obj.style.top ;
		}		
		return 0 ;
	}
	function GetObjXPos (obj) {
		if(is.ie) {
			return obj.style.pixelLeft ;
			return 1 ;			
		}
		else if(is.nav5up || is.opera) {
			return obj.style.left ;
		}		
		return 0 ;
	}
	
	function SetObjXPos (obj, left) {
		if(is.ie) {
			obj.style.pixelLeft = left ;
			return 1 ;			
		}
		else if(is.nav5up || is.opera) {
			obj.style.left = left ;
		}		
		return 0 ;
	}
	function SetObjVisibility (obj, vis) {
		if(vis == 1) {
			if(is.ie)
				obj.style.visibility = "visible" ;
			else if(is.nav6)
				obj.style.visibility = "visible" ;
			else
				obj.style.visibility = "show" ;
		}
		else {
			if(is.ie)
				obj.style.visibility	= "hidden" ;
			else if(is.nav6)
				obj.style.visibility	= "hidden" ;
			else				
				obj.style.visibility	= "hide" ;
		}	
	}
    function GetObjVisibility (obj) {
        if(obj) {
            switch(obj.style.visibility) {
                case "show" :
                case "visible" :
                    return 1 ;
                default :
                    return 0 ;
            }
        } return 0 ;    
    }    
	function hideObj (obj) {
		SetObjVisibility(obj, 0);
	}
	function showObj (obj) {
		SetObjVisibility(obj, 1);
	}

	function SetWindowHeight (height) {
		var x = GetWindowWidth ();
		
		if(is.ie)
			window.resizeTo(x, height); 
	}	
	
	function GetWindowHeight () {
		if(is.ie)
			return document.body.clientHeight;
		else if(is.nav) {
			return window.innerHeight ;	
		}
		// @todo window Height			
		return 300 ;
	}		
	function GetWindowWidth () {
		if(is.ie)
			return document.body.clientWidth;
		else if(is.nav)
			return window.innerWidth ;	
		return 800 ;
	}		

	function GetPageXOffset () {
		if(is.ie)
			return document.body.scrollLeft ;
		else if(is.nav)
			return 	 window.pageXOffset ;
		else return 0 ;	
	}
	
	function GetPageYOffset () {
		if(is.ie)
			return document.body.scrollTop ;
		else if(is.nav)
			return 	 window.pageYOffset ;
		else return 0 ;	
	}

	// Functions for IE to get position of an object
	function getOffsetLeft (el) {
		var ol = el.offsetLeft;
		while ((el = el.offsetParent) != null) { 
			ol += el.offsetLeft; 
		}
		return ol;
	}
	function getOffsetTop (el) {
		var ol = el.offsetTop;
		while ((el = el.offsetParent) != null) { 
			ol += el.offsetTop; 
		}
		return ol;
	}

	function FindWindow (name) {
		var win = self;
		
		while(win != self.top) {
			win = win.parent ;
			if(win.name == name)
				return win ;
			if(win.frames[name])
				return win.frames[name] ;	
		} 
		if(self.window.name == name)
			return self ;	
		return 0 ;	
	}
	
//-->
