
function checkBrowser(){
	this.ua = navigator.userAgent.toUpperCase();
	this.ver = navigator.appVersion;
	this.dom = document.getElementById;
	
	this.win = (this.ua.indexOf("WIN") != -1) ? true : false;
	this.mac = (this.ua.indexOf("MAC") != -1) ? true : false;
	this.unix = (this.ua.indexOf("X11") != -1) ? true : false;

    this.opera = (this.ua.indexOf("OPERA") != -1) ? true : false;
    this.firefox = (this.ua.indexOf("FIREFOX") != -1) ? true : false;
    this.nn4 = (document.layers && !document.getElementById) ? true : false;
    this.nn6 = (!this.firefox && document.getElementById && !document.all) ? true : false;
    this.ie4 = (!this.opera && document.all && !document.getElementById) ? true : false;
    this.ie5 = (!this.opera && document.all && document.getElementById) ? true : false;
 
    return this;
}
cb = new checkBrowser();
   
function scrollAreaObject(areaName, contentsName){
    this.areaElement = document.getElementById(areaName);
    this.areaCss = document.getElementById(areaName).style;
    this.element = document.getElementById(contentsName);
    this.css = document.getElementById(contentsName).style;
    this.contentsHeight = this.element.offsetHeight;
    this.areaHeight = this.areaElement.offsetHeight;
    this.up = scrollContentsUp;
	this.down = scrollContentsDown;
    this.scrollContents = scrollContents;
	this.x;
	this.y;
    this.obj = contentsName + "Object";
    eval(this.obj + "=this");
    return this;
}

function scrollContents(x, y){
    this.x = x;
	this.y = y;
    this.css.left = this.x + "px";
    this.css.top = this.y + "px";
}
 
function scrollContentsDown(val){
	if(this.y > -this.contentsHeight + this.areaHeight) {
		this.scrollContents(0, this.y - val);
	}
}

function scrollContentsUp(val){
	if(this.y < 0) {
		this.scrollContents(0, this.y - val);
	}
}
	 
function scrollTopics(val){
	if(initialised) {
		if(val > 0) objScrollArea.down(val)
		else objScrollArea.up(val)
	}
}

var initialised;
function initScrollArea(){
    objScrollArea = new scrollAreaObject('topicArea', 'topicContents', 'infodataArea', 'informationContents');
    objScrollArea.scrollContents(0, 0);
	objScrollArea.areaCss.visibility = "visible";
    initialised = true;
} 

function scrollByWheel(val){
	var swt = event.wheelDelta;
	if (swt <= -120) {
		scrollTopics(val);
	}else {
		scrollTopics(-val);
	}if (event.preventDefault) {
                event.preventDefault();
        }
        event.returnValue = false;
}
